Saturn Documentation
Launch App
  • Saturn
  • Traders
    • Trading in Saturn
    • How to Swap
    • How Saturn Protects Your Trades from MEV Risks
  • Liquidity Providers
    • Open a position in a Liquidity Pool
    • Managing your Portfolio on Saturn
  • Token Creators
    • How to Create a Pool on Saturn
  • Builders
    • Saturn API
      • Pool API
        • Initialize pool
        • Add Shards
        • Open position
        • Increase Liquidity
        • Remove Liquidity
        • Swap
        • Swap Quotes
        • Boost Transaction
        • Wallet
      • Indexer API
        • Collections
        • Pools
        • Prices
        • Positions
        • Transactions
        • Charts
        • Stats
    • Liquidity Pool SDK
  • Saturn V1
    • Overview
    • How-To-Links
      • Setting up Trading Account
        • Withdrawing from Trading account
      • Swap
      • Orderbook
        • Your Profile
          • Trade History
        • How to place a sell order
        • How to place a buy order
        • Positions
      • Collect
      • Charts
      • Tutorial videos
        • Setting up a Trading Account (v3) and preparing for Rings Airdrops
        • Trading on Saturn
    • FAQs
      • What are Satoshi's, Rare SATs, and Rings?
        • More on Rare SATs
      • What is a UTXO
      • What is a PSBT
      • Why are there batch sizes?
      • Compatible Wallets
      • Why is my Available balance different than my Total balance?
Powered by GitBook
On this page
  1. Builders
  2. Saturn API
  3. Pool API

Swap Quotes

PreviousSwapNextBoost Transaction

Last updated 1 month ago

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
400
Pool error
application/json
500
Internal Server Error
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"
}
  • Swap Details Endpoint
  • GETGet Swap Details