quote

API reference to fetch a quote for a swap.

Enzyme

To execute swap with your Enzyme vault note the following:

  • taker: Address of your Enzyme vault

  • txOrigin: Address of the authorized "Manager" or "Asset Manager"

  • encodingType: Set to "enzyme-vault"

Get quote for a swap

get
Query parameters
sellTokenstringRequired

Address of the sell token

Example: 0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48
buyTokenstringRequired

Address of the buy token

Example: 0x2260fac5e5542a773aa44fbcfedf7c193bc2c599
sellAmountstringRequired

Sell amount in token base units (e.g. Wei for ETH)

Example: 1000000000000
takerstringRequired

Address which holds the sellToken. (Allowance has to be set before execution)

Example: 0xab5801a7d398351b8be11c439e05c5b3259aec9b
txOriginstringOptional

Address of the external account that executed the tx. (Only needed if taker is a contract)

Example: 0xab5801a7d398351b8be11c439e05c5b3259aec9b
typesarrayOptional

(WIP) Liquidity sources types

sourcesanyOptional

Configuration allows three strategies: empty, include or exclude.

  • Empty: all sources are enabled.
  • Include (Whitelisting): only the given sources are enabled.
  • Exclude (Blacklisting): all sources except the given ones are enabled.
maxSlippageBpsnumber · max: 10000Optional

Maximum allowed slippage for the swap. (in basis points)

Default: 50
maxPriceImpactBpsnumber · max: 10000Optional

Max price impact for the swap. (in basis points)

Default: 10000
priceImpactExceedsErrorbooleanOptional

If true an error is returned if the price impact is exceeded. Otherwise an issue (warning) is added to the response. Defaults to false.

Default: false
minExpirySecnumber · min: 10 · max: 120Optional

Min quote expiry. (in seconds) RFQ/OTC quotes from market makers have hard expiries between 40-90 seconds. If minExpiry is set higher then MM expiries these MMs are excluded. (Keep in mind that MM pricing might be better than DEX pricing, especially if quantity is high)

Default: 35
skipSimulationbooleanOptional

Skip Tenderly simulation

Default: false
skipChecksbooleanOptional

Skip balance and allowance checks

Default: false
encodingTypestring · enumOptional

Encoding type for the returned raw transaction.

Default: basicPossible values:
Header parameters
x-api-keystringOptional

31Third API key (Request via [email protected])

chain-idstringOptional

Chain ID as hex string. (e.g.: 0x1 for Ethereum mainnet)

Responses
200Success
application/json
get
GET /0.1/swap/quote?sellToken=text&buyToken=text&sellAmount=text&taker=text HTTP/1.1
Host: 
Accept: */*
200Success
{
  "id": "0096124c-19df-4459-8cbb-7615fdc7c157",
  "sellToken": "0xdac17f958d2ee523a2206206994597c13d831ec7",
  "buyToken": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
  "sellAmount": "100000000",
  "buyAmount": "99500000",
  "price": 0.999955,
  "priceImpactBps": 31,
  "minBuyAmount": "99500000",
  "guaranteedPrice": 0.999955,
  "maxPriceImpactBps": 42,
  "expiresAt": "2025-06-25T15:01:03.155Z",
  "transaction": {
    "to": "0xd20c024560cca40288c05bab650ac087ae9b0f6e",
    "data": "0x9396f4590000000000...0000000000",
    "value": "1000000000000000000",
    "gasLimit": "21000",
    "gasPrice": "50000000000"
  },
  "issues": {
    "balance": {
      "token": {
        "address": "0x95ad61b0a150d79219dcf64e1e6cc01f0b64c4ce",
        "name": "Shiba Inu",
        "symbol": "SHIB",
        "imageUrl": "https://assets.31third.com/images/tokens/SHIB.svg",
        "decimals": 18,
        "sliderColor": "#C47438",
        "chain": {
          "name": "Ethereum",
          "identifier": "0x1",
          "enabled": true,
          "batchTradeSupported": true,
          "batchTradeAddress": "0x1ee8b39f09c5299526db65428ab2a8a23ebf08a7",
          "blockExplorerLink": "https://etherscan.io",
          "nativeTokenAddress": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
          "wrappedNativeTokenAddress": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
          "tokenHelperAddress": "0x6af90502f49E3B4151018F7aE82d10079c29Bc97",
          "portfolioEnabled": true
        },
        "tags": [
          "text"
        ],
        "deflationary": true
      },
      "actual": "0",
      "required": "1000000000000"
    },
    "allowance": {
      "token": {
        "address": "0x95ad61b0a150d79219dcf64e1e6cc01f0b64c4ce",
        "name": "Shiba Inu",
        "symbol": "SHIB",
        "imageUrl": "https://assets.31third.com/images/tokens/SHIB.svg",
        "decimals": 18,
        "sliderColor": "#C47438",
        "chain": {
          "name": "Ethereum",
          "identifier": "0x1",
          "enabled": true,
          "batchTradeSupported": true,
          "batchTradeAddress": "0x1ee8b39f09c5299526db65428ab2a8a23ebf08a7",
          "blockExplorerLink": "https://etherscan.io",
          "nativeTokenAddress": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
          "wrappedNativeTokenAddress": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
          "tokenHelperAddress": "0x6af90502f49E3B4151018F7aE82d10079c29Bc97",
          "portfolioEnabled": true
        },
        "tags": [
          "text"
        ],
        "deflationary": true
      },
      "spender": "0xab5801a7d398351b8be11c439e05c5b3259aec9b",
      "actual": "0",
      "required": "1000000000000"
    },
    "priceImpact": {
      "sellToken": {
        "address": "0x95ad61b0a150d79219dcf64e1e6cc01f0b64c4ce",
        "name": "Shiba Inu",
        "symbol": "SHIB",
        "imageUrl": "https://assets.31third.com/images/tokens/SHIB.svg",
        "decimals": 18,
        "sliderColor": "#C47438",
        "chain": {
          "name": "Ethereum",
          "identifier": "0x1",
          "enabled": true,
          "batchTradeSupported": true,
          "batchTradeAddress": "0x1ee8b39f09c5299526db65428ab2a8a23ebf08a7",
          "blockExplorerLink": "https://etherscan.io",
          "nativeTokenAddress": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
          "wrappedNativeTokenAddress": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
          "tokenHelperAddress": "0x6af90502f49E3B4151018F7aE82d10079c29Bc97",
          "portfolioEnabled": true
        },
        "tags": [
          "text"
        ],
        "deflationary": true
      },
      "buyToken": {
        "address": "0x95ad61b0a150d79219dcf64e1e6cc01f0b64c4ce",
        "name": "Shiba Inu",
        "symbol": "SHIB",
        "imageUrl": "https://assets.31third.com/images/tokens/SHIB.svg",
        "decimals": 18,
        "sliderColor": "#C47438",
        "chain": {
          "name": "Ethereum",
          "identifier": "0x1",
          "enabled": true,
          "batchTradeSupported": true,
          "batchTradeAddress": "0x1ee8b39f09c5299526db65428ab2a8a23ebf08a7",
          "blockExplorerLink": "https://etherscan.io",
          "nativeTokenAddress": "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",
          "wrappedNativeTokenAddress": "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2",
          "tokenHelperAddress": "0x6af90502f49E3B4151018F7aE82d10079c29Bc97",
          "portfolioEnabled": true
        },
        "tags": [
          "text"
        ],
        "deflationary": true
      },
      "actual": "130",
      "max": 100
    }
  },
  "tenderlySimulation": {
    "status": true,
    "errorMessage": "text",
    "blockNumber": 313313,
    "gas": "313313",
    "gasUsed": "310313"
  }
}

Last updated