Get Quote

Fetch a real-time quote for swapping a specified token amount from one chain to another. Check out the getQuote API template script for implementation details.

POST
/vpc/v1/get-quote

Authorization

x-authorization-secret<token>

Trade Service Secret (set this to the value of TRADE_SERVICE_SECRET from .env)

In: header

Request Body

application/jsonRequired
fromTokenRequiredstring
fromChainRequiredstring
toTokenRequiredstring
toChainRequiredstring
sameChainFeestring
sameChainFeeCollectorstring
crossChainFeestring
crossChainFeeCollectorstring
fromAmountRequiredstring
slippagestring
fromUserWalletAddressstring
toUserWalletAddressstring
curl -X POST "https://okto-trade-service.oktostage.com//vpc/v1/get-quote" \
  -H "x-authorization-secret: <token>" \
  -H "Content-Type: application/json" \
  -d '{
    "fromToken": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
    "fromChain": "eip155:8453",
    "toToken": "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
    "toChain": "eip155:42161",
    "sameChainFee": "10",
    "sameChainFeeCollector": "0xfde4C96c8593536E31F229EA8f37b2ADa2699bb2",
    "crossChainFee": "10",
    "crossChainFeeCollector": "0xfde4C96c8593536E31F229EA8f37b2ADa2699bb2",
    "fromAmount": "1000",
    "slippage": "3.0",
    "fromUserWalletAddress": "0x2c2505D0E21f32F38bCEBeca1C331ab4069bBCb9",
    "toUserWalletAddress": "0x2c2505D0E21f32F38bCEBeca1C331ab4069bBCb9"
  }'

Fetched

{
  "outputAmount": "979",
  "routeMetadata": {
    "protocol": "Okto_ULL",
    "aggregatorName": "Okto_ULL",
    "type": "Bridge"
  },
  "permitData": {}
}