Saseul Gold Docs
  • Saseul Gold Docs
  • Network CLI
    • Using Saseulgold Network CLI
    • Wallet Interface
      • Representative Wallet Settings
      • Check your wallet balance
      • Remittance
    • Dex Interface
      • Get Token Detail
      • Mint Token
      • Transfer Token
      • Swap
      • ProvideLiquidity
    • Swap Process
      • Example
  • Dex API
    • Using Dex API
    • Token Info API
    • Token Mint API
    • Token Pair Info API
    • Provide Liquidity API
    • Faucet API
    • Swap
    • Liquidity Withdraw
    • Balance Of
    • Transfer
  • Backend API
    • Using Backend API
    • Token Detail API
    • Token List API
    • Pair List API
    • Pair Detail API
    • Pair Transaction Candle API
    • Block List API
Powered by GitBook
On this page
  1. Dex API

Swap

Inter-token exchange must have a liquidity pool for that token pair, and the reserve value for token token_address_in must be at least amount.

If all conditions are met and the contract is performed, the number of tokens in token_in_address from the user's wallet will be transferred to the liquidity pool by amount_in, and tokens for token_address_out will be paid.

Setting minimum_amount_out prevents swaps when set below the corresponding quantity.

{
    "transaction": {
        "type": "Swap",
        "token_address_in": "dc2d6ab6d6a6000fb82931cc6ea3989629d051612701158df1214",
        "token_address_out": "450a8c9a1a72c285d919ef86c673542b5396ee79dffb6b58fc8",
        "amount_in": "100000000000000000000",
        "minimum_amount_out": "50000000000000000000",
        "timestamp": 1735694190022786,
        "from": "f43808a3998233c4336d873880fe4a22fdd7eafdd90e"
    },
    "public_key": "391e87c9ceedb34ecd7f74d4536a33851ce54dbb0c2dfbf1a529816f8ed7",
    "signature": "de081b535e1ef03432dcef296639b44238adf56d41c2cbfd699c5e1478b25"
}
PreviousFaucet APINextLiquidity Withdraw

Last updated 3 months ago