Quote

Get a quote from native units.

Deprecated: use getNativeQuotes, which also returns DCA quotes. This endpoint returns only the regular quote.

get/quote-native

Request

  • Base URL: https://chainflip-broker.io
  • URL: https://chainflip-broker.io/quote-native
  • Auth: one of:
    • API key in query parameter apiKey
    • API key in header X-API-Key

Query parameters

apiKeystring

Your partner API key. A key is required through this parameter OR the X-API-Key header; when both are present, this query parameter wins, even when it is empty, which fails validation rather than falling back to the header.

sourceAssetstring required

The asset to swap from.

destinationAssetstring required

The asset to swap to.

amountstring required

The amount to swap in native units.

commissionBpsinteger

An optional override to the charged commission bps.

Response

A quote for the given assets and amount.

type'regular' | 'dca' required

regular: swapped at once. dca: split into numberOfChunks chunks swapped chunkIntervalBlocks apart, usually at a better price for large amounts.

ingressAssetstring required

The asset you send.

ingressAmountnumber double required

The amount you send, in whole units of ingressAsset.

ingressAmountNativestring required

ingressAmount in the asset's smallest unit.

intermediateAssetstring nullable

The asset the swap passes through (USDC), when neither asset is USDC.

intermediateAmountnumber double nullable

The amount of the intermediate asset, in whole units.

intermediateAmountNativestring nullable

intermediateAmount in the asset's smallest unit.

egressAssetstring required

The asset you receive.

egressAmountnumber double required

The amount you receive, in whole units of egressAsset, after every fee in includedFees. An estimate: the final amount depends on the price when the swap executes.

egressAmountNativestring required

egressAmount in the asset's smallest unit.

recommendedSlippageTolerancePercentnumber double required

Recommended slippage percentage to use when calculating minimum price.

recommendedRetryDurationInBlocksinteger nullable

Recommended retryDurationInBlocks for /swap: Chainflip's recommended retry window (30 minutes when BTC is on either side, otherwise 5 minutes) in 6-second state-chain blocks.

recommendedLivePriceSlippageTolerancePercentnumber double nullable

Recommended livePriceSlippageTolerancePercent for /swap: how far, in percent, the execution price may fall below Chainflip's oracle price. Absent when Chainflip has no oracle-based protection to recommend for the pair; /swap rejects the parameter when either asset has no oracle price.

lowLiquidityWarningboolean required

A warning in case liquidity is low and there is a risk of high slippage.

estimatedDurationSecondsnumber double required

The estimated time the swap will take.

estimatedPricenumber double required

The estimated price in the destination asset for 1 unit of the source asset. Used for slippage calculations.

chunkIntervalBlocksinteger nullable

The delay between the "sub-swaps" of a DCA swap in number of blocks.

numberOfChunksinteger nullable

The number of "sub-swaps" to perform for a DCA swap.

platformstring

The provider that produced this quote. Pass it as platform to startSwap to open the swap with the same provider.

Example response

{
  "type": "regular",
  "ingressAsset": "btc.btc",
  "ingressAmount": 0.5,
  "ingressAmountNative": "50000000",
  "intermediateAsset": "usdc.eth",
  "intermediateAmount": 40643.039585,
  "intermediateAmountNative": "40643039585",
  "egressAsset": "usdt.hub",
  "egressAmount": 40638.953831,
  "egressAmountNative": "40638953831",
  "includedFees": [
    {
      "type": "network",
      "asset": "usdc.eth",
      "amount": 40.683723,
      "amountNative": "40683723"
    }
  ],
  "recommendedSlippageTolerancePercent": 2.5,
  "recommendedRetryDurationInBlocks": 300,
  "recommendedLivePriceSlippageTolerancePercent": 0.75,
  "poolInfo": [
    {
      "baseAsset": "usdt.hub",
      "quoteAsset": "usdc.eth",
      "fee": {
        "asset": "usdc.eth",
        "amountNative": "0"
      }
    }
  ],
  "estimatedDurationSeconds": 1009.5,
  "estimatedDurationsSeconds": {
    "deposit": 906,
    "swap": 12,
    "egress": 91.5
  },
  "estimatedPrice": 81278.32200114832,
  "chunkIntervalBlocks": 1,
  "numberOfChunks": 5,
  "boostQuote": {
    "ingressAsset": "btc.btc",
    "ingressAmount": 0.5,
    "ingressAmountNative": "50000000",
    "intermediateAsset": "usdc.eth",
    "intermediateAmount": 40622.717973,
    "intermediateAmountNative": "40622717973",
    "egressAsset": "usdt.hub",
    "egressAmount": 40618.634251,
    "egressAmountNative": "40618634251",
    "includedFees": [
      {
        "type": "network",
        "asset": "usdc.eth",
        "amount": 40.683723,
        "amountNative": "40683723"
      }
    ],
    "recommendedSlippageTolerancePercent": 2.5,
    "recommendedRetryDurationInBlocks": 300,
    "recommendedLivePriceSlippageTolerancePercent": 0.75,
    "poolInfo": [
      {
        "baseAsset": "usdt.hub",
        "quoteAsset": "usdc.eth",
        "fee": {
          "asset": "usdc.eth",
          "amountNative": "0"
        }
      }
    ],
    "estimatedDurationSeconds": 409.5,
    "estimatedDurationsSeconds": {
      "deposit": 906,
      "swap": 12,
      "egress": 91.5
    },
    "estimatedBoostFeeBps": 5,
    "maxBoostFeeBps": 5,
    "estimatedPrice": 81278.3220021494,
    "chunkIntervalBlocks": 1,
    "numberOfChunks": 5
  },
  "platform": "chainflip"
}

Changes

No recorded changes to this operation across all 1 revision of this API.