Swap Quotes

Swap Details Endpoint

  • Endpoint: /swap/details

  • Description: This endpoint allows you to obtain the best exchange rate between two tokens and identify the best pool to perform the swap.

  • Response Includes:

    • Best pool for performing the swap.

    • amountIn and amountOut values.

    • Network fees and liquidity provider fees.

    • Price impact of the swap.

Important Notes:

  • Swap from Rune to BTC:

    • The amountOut provided by the /swap/details endpoint does not account for the network fees.

    • You need to subtract the network fees from the amountOut to get the correct amount to send to the endpoint.

Get Swap Details

get

Retrieves detailed information about a potential swap, including expected amounts and fees.

Query parameters
feeRateinteger · min: 1Required

The fee rate for the transaction (in sats per byte).

token0stringRequired

The identifier of the first token. Format: 0:0

token1stringRequired

The identifier of the second token. Usually '0:0: (Bitcoin)

zeroToOnebooleanRequired

A boolean indicating whether to swap from token0 to token1.

exactInbooleanRequired

A boolean indicating whether the swap is exact in.

amountstringRequiredPattern: ^[1-9][0-9]*$
Responses
200
An object containing detailed swap information such as expected amounts, price, price impact, fees, and pool ID.
application/json
get
GET /v0/pool/swap/details HTTP/1.1
Host: api-dev.saturnbtc.io
Accept: */*
{
  "amountIn": "text",
  "amountOut": "text",
  "price": "text",
  "priceImpact": "text",
  "fees": {
    "makers": "text",
    "network": "text"
  },
  "poolId": "text"
}

Last updated