LogoLogo
SwapKit's websiteRegister for an API Key
  • 🏡Getting started
    • SwapKit's trade offerings
  • 💰Monetization
  • 🤝Partnership
  • SwapKit API
    • Introduction
    • /providers - Request supported chains by a swap provider
    • /tokens - Request supported tokens by a swap provider
    • /quote - Request a trade quote
    • /quote - Understanding the response
    • /chainflip/broker/channel - Opening a Chainflip deposit channel
    • /track - Request the status of a swap
    • /screen - Check AML compliance
    • /price - Lookup token prices
Powered by GitBook
On this page
  • Endpoint
  • Request parameters
  • Example request
  1. SwapKit API

/quote - Request a trade quote

Endpoint

Method: POST URL: https://api.swapkit.dev/quote


Request parameters

{
  "sellAsset": "string",
  "buyAsset": "string",
  "sellAmount": "string",
  "providers": [
    "string"
  ],
  "sourceAddress": "string",
  "destinationAddress": "string",
  "slippage": 100,
  "affiliate": "string",
  "affiliateFee": 1000,
  "allowSmartContractSender": true,
  "allowSmartContractReceiver": true,
  "disableSecurityChecks": true,
  "includeTx": true,
  "cfBoost": true
}

Here's a detailed description of the different parameters:

Parameter
Type
Required
Description

sellAsset

string

✅ Yes

The asset being sold (e.g. "ETH.ETH").

buyAsset

string

✅ Yes

The asset being bought (e.g. "BTC.BTC").

sellAmount

string

✅ Yes

Amount in basic units (decimals separated with a dot).

providers

array

❌ No

Limits the possible liquidity providers.

sourceAddress

string

✅ Yes

Address of the sender.

destinationAddress

string

✅ Yes

Address of the recipient.

slippage

number

❌ No

Max slippage in percentage (5 = 5%).

affiliate

string

❌ No

Affiliate address for revenue sharing.

affiliateFee

number

❌ No

Fee percentage in basis points (50= 0.5%).

allowSmartContractSender

boolean

❌ No

Allow smart contract as sender.

allowSmartContractReceiver

boolean

❌ No

Allow smart contract as receiver.

disableSecurityChecks

boolean

❌ No

Bypass security checks.

includeTx

boolean

❌ No

Include transaction details in the response.

cfBoost

boolean

❌ No

Enables Chainflip boost for better rates.

Note: Asset names for sellAsset and buyAsset should follow the following nomenclature:

  • Chain.Asset (e.g., "BTC.BTC" or "ARB.ETH")

  • Chain.Asset-ContractAddress (e.g., "ETH.USDC-0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48")

When you test your integration, use an address with enough sellAsset balance to cover the trade. This will ensure you receive complete responses.


Example request

A simple request to trade ETH.ETHto BTC.BTCmay omit the providerslist if you can manage them in the response, but should include the amount, the involved addresses and slippage settings.

The expiration time returned by the endpoint is an estimation. We recommend requesting a new quote at least every minute if the trade has not been executed yet.

curl -X POST "https://api.swapkit.dev/quote" \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_VARIABLE_HERE" \
  -d '{
    "sellAsset": "ETH.ETH",
    "buyAsset": "BTC.BTC",
    "sellAmount": "0.1",
    "sourceAddress": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045",
    "destinationAddress": "357a3So9CbsNfBBgFYACGvxxS6tMaDoa1P",
    "slippage": 10,
    "includeTx": true
  }'
Previous/tokens - Request supported tokens by a swap providerNext/quote - Understanding the response

Last updated 1 month ago

This is the identifieras provided in the endpoint.

Using the header x-api-keyin your /quoterequest automatically applies your affiliate addresses and fee values set up through our in the response parameters.

/tokens
partners dashboard