Skip to main content
This guide covers the Socket Swap V3 endpoints:
  • GET /v3/swap/quote — fetch executable transaction routes, deposit-address routes, and CEX withdraw routes
  • GET /v3/swap/status — poll the status of a submitted route
  • GET /v3/swap/supported-chains — list supported chains
  • GET /v3/swap/tokens/list — list supported tokens
  • GET /v3/swap/tokens/search — search tokens by address, name, or symbol
Use the production base URL:
The examples below use the dedicated endpoint with x-api-key and affiliate headers. For testing without credentials, use https://public-backend.socket.tech. See Get API Access for the full breakdown.

Endpoint Selection

Use /v3/swap/quote with userOps=tx for OpenRouter direct routes, which support:
  • Same-chain swaps when originChainId === destinationChainId
  • Cross-chain bridge routes when originChainId !== destinationChainId
For deposit-address flows, use userOps=deposit. See the Deposit Addresses Guide.

Common Token and Amount Rules

  • inputAmount is a string in the smallest token unit for EVM-style chains.
  • The native token address is 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE.
  • EVM addresses are normalized to lowercase by the API.
  • receiverAddress must be valid for the destination chain.
  • userAddress is required for OpenRouter transaction routes.
  • Same-chain quotes reject identical inputToken and outputToken.

Step 1: Get a Quote

Request

Required query parameters: Optional query parameters:

Same-chain DEX provider IDs

Cross-chain bridge provider IDs

Example: Same-chain swap

Example: Cross-chain bridge

Quote response

Important route fields:

Step 2: Check Approval

If the approval field is present in the route response, approve the approval.spenderAddress for approval.amount of approval.tokenAddress before submitting the transaction.
OpenRouter EVM routes usually ask the user to approve the AllowanceHolder contract, not the final bridge or DEX. The to address in txData is typically the AllowanceHolder.

Step 3: Submit the Transaction

Submit txData.object as a transaction from userAddress.
Do not rebuild calldata client-side. Always use the returned txData.object exactly as provided.

Step 4: Poll Status

Request

The v3 status endpoint looks up execution state by quoteId.

Status response

Status values:

Full Execution Flow

  1. Request quotes from /v3/swap/quote with userOps=tx.
  2. Select a route. Prefer routeTags or compare output.valueInUsd, estimatedTime, and gasFee.
  3. Check quote freshness with expiresAt — do not send expired quotes.
  4. If approval is present, approve approval.spenderAddress for approval.amount.
  5. Submit the route transaction from userAddress using txData.object.
  6. Poll status with the returned quoteId.
  7. Poll until the route reaches a terminal status.

Using contractCaller

By default, Socket’s AllowanceHolder contract requires that the wallet signing the transaction is also the entity calling AllowanceHolder.exec. If your integration routes the call through an intermediate contract (e.g. a router or bridge contract you own), the AllowanceHolder will see your contract as the caller — not the user’s wallet — and the transaction will revert with CallerNotSignedUser. Set contractCaller to your intermediate contract’s address when this applies:
contractCaller is only needed for userOps=tx (direct OpenRouter routes). It has no effect on deposit or CEX-withdraw routes. userAddress still acts as the default refund address unless you also set refundAddress.

Fees

Integrator fees are set with feeBps and feeTakerAddress. Rules:
  • feeBps and feeTakerAddress must be provided together.
  • feeBps must be greater than 0 and at most 10000.
  • For direct DEX routes, fees can be taken from input or output depending on the OpenRouter fee resolution.
  • For direct bridge no-swap routes, fees are forced to the input side.
  • The client-facing output amount is already net of applicable fees.
See the Charging Fees Guide for detailed implementation steps.

Validation and Error Notes

Common 400 errors:
  • Missing userOps for /v3/swap/quote.
  • Missing originChainId for userOps=tx.
  • Missing userAddress for userOps=tx.
  • Missing refundAddress for userOps=deposit or userOps=cex-withdraw.
  • Missing exchange for userOps=cex-withdraw.
  • Invalid slippage.
  • Invalid or unsupported chain ID.
  • destinationPayload without destinationGasLimit, or the reverse.
  • feeBps without feeTakerAddress, or the reverse.
  • Provider listed in both include and exclude filters.
Quote responses can return an empty route list when providers fail to quote, the route is unsupported, or filters exclude all providers.

Implementation Notes

  • OpenRouter EVM routes usually ask the user to approve the AllowanceHolder contract, not the final bridge or DEX.
  • Use quoteId exactly as returned — it is used for status lookup and source transaction recording.
  • Do not rebuild calldata client-side. Use the returned txData.
  • For same-chain swaps, routeDetails.dexDetails is populated when route metadata is available.
  • For cross-chain routes, routeDetails.bridgeDetails describes the bridge leg. If there is an origin swap leg, routeDetails.dexDetails may also be present.

Charging Fees

Add integrator fees to your quotes

Deposit Addresses

Accept deposits from any chain

Destination Payload

Execute calldata on the destination chain

Chain Support

See all supported networks