Skip to main content
POST
/
v1
/
swaps
/
quote
Create a new Swap Quote
curl --request POST \
  --url https://sandbox-api.borderless.xyz/v1/swaps/quote \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "fromAccountId": "cm2c4x3cc000019stwv7um4zl",
  "fromAmount": "100.50",
  "fromAsset": "POL",
  "toAsset": "POL",
  "toAddress": "0xE79a68B87544ed42Cc5aA805bb056201e7942D3A"
}
'
{
  "id": "<string>",
  "expiredAt": "2023-11-07T05:31:56Z",
  "fromAmountUSD": "<string>",
  "toAmountUSD": "<string>",
  "estimatedCostsUSD": "<string>",
  "steps": [
    {
      "executionDuration": 123,
      "source": {
        "currency": "<string>",
        "chainId": 123,
        "amount": "<string>",
        "amountUSD": "<string>",
        "minAmount": "<string>"
      },
      "destination": {
        "currency": "<string>",
        "chainId": 123,
        "amount": "<string>",
        "amountUSD": "<string>",
        "minAmount": "<string>"
      },
      "estimate": {
        "feeCosts": [
          {
            "amount": "<string>",
            "amountUSD": "<string>",
            "token": "<string>",
            "included": true
          }
        ],
        "gasCosts": [
          {
            "amount": "<string>",
            "amountUSD": "<string>",
            "token": "<string>",
            "included": true
          }
        ]
      }
    }
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
fromAccountId
string
required

The id of the account initiating the swap.

Required string length: 25
Example:

"cm2c4x3cc000019stwv7um4zl"

fromAmount
string
required

The amount authorized for the swap transaction.

Example:

"100.50"

fromAsset
enum<string>
required

The source asset to be swapped.

Available options:
POL,
USDT_POLYGON,
USDC_POLYGON,
USDM_POLYGON,
ETH,
USDT_ETHEREUM,
USDC_ETHEREUM,
USDM_ETHEREUM,
TRX,
USDT_TRON,
ETH_BASE,
USDC_BASE,
USDM_BASE,
ETH_OPTIMISM,
USDT_OPTIMISM,
USDC_OPTIMISM,
USDM_OPTIMISM,
BTC,
CELO,
CUSD_CELO,
USDC_CELO,
SOL,
USDC_SOLANA,
USDT_SOLANA
toAsset
enum<string>
required

The target asset to receive from the swap.

Available options:
POL,
USDT_POLYGON,
USDC_POLYGON,
USDM_POLYGON,
ETH,
USDT_ETHEREUM,
USDC_ETHEREUM,
USDM_ETHEREUM,
TRX,
USDT_TRON,
ETH_BASE,
USDC_BASE,
USDM_BASE,
ETH_OPTIMISM,
USDT_OPTIMISM,
USDC_OPTIMISM,
USDM_OPTIMISM,
BTC,
CELO,
CUSD_CELO,
USDC_CELO,
SOL,
USDC_SOLANA,
USDT_SOLANA
toAddress
string

The wallet address where the swapped funds will be credited. If not provided, the funds will be credited to the account that executed the swap.

Example:

"0xE79a68B87544ed42Cc5aA805bb056201e7942D3A"

Response

Successfully created Swap Quote data.

id
string
required

Temporary quote ID for execution via /swaps/quote/execution.

expiredAt
string<date-time>
required

Quote expiration date.

fromAmountUSD
string
required

Amount in USD for the source asset.

toAmountUSD
string
required

Amount in USD for the destination asset.

estimatedCostsUSD
string
required

Estimated costs in USD.

steps
object[]
required

Steps for the swap.