DragonSwap

Supported Chains

Available on Kaia Mainnet.

Available Endpoints:

Click on the endpoint to jump to the section with full details

  • /getprice GET - Returns the swap quotation for a given token pair on Klayswap V3.

  • /getuserliquidity GET - Returns the balance of a particular token pair of accounts.

  • /getpoolliquidity GET - Returns the total liquidity for a specified pool.

  • /gettokenliquidity GET - Returns the individual token liquidity within the specified liquidity pool.

  • /swap POST - Initiate a swap transaction on a specified DEX.

  • /addliquidity POST - Add liquidity to a specified pool in a specified DEX.

  • /removeliquidity POST - Remove liquidity from a specified pool in a specified DEX.

DEX IDs

Many endpoints have a parameter where you can provide a DEX ID.

Below is a list of DEX IDs related to DragonSwap V3. For a complete list and more information, please see the DEX ID page.

DEX Name
Chain
DEX ID

DragonSwap V3

Kaia Mainnet

3700

Endpoint Details

/getprice

Returns the swap quotation for the given token pair.

GET https://api.expand.network/dex/getprice

Query Parameters

Name
Type
Description

rpc

String

Remote procedural call URL.

dexId

String

Refer to the DEX ID page for details.

path*

String

Comma separated values of token addresses whose price is to be fetched.

amountIn*

String

Amount of token.

poolFees

String

Different pool based on the fees. By default, it is selected as 10000.

https://api.expand.network/dex/getprice?path=0x0BA2bA407E80bcb8a314649d9bC12efEECC81519,0xd077A400968890Eacc75cdc901F0356c943e4fDb&amountIn=1000000000000000000&vsCurrencies=inr&dexId=3700&poolFees=2000

Returns the total liquidity for a specified pool.

GET https://api.expand.network/dex/getpoolliquidity

Query Parameters

Name
Type
Description

rpc

String

Remote procedural call URL.

poolAddress*

String

Pool address whose liquidity is to be fetched.

dexId

String

Refer to DEX ID page for details.

https://api.expand.network/dex/getpoolliquidity?dexId=3700&poolAddress=0xe6FAcE64967c6CDd53651d6ac97a04Bc9ef305d6

/gettokenliquidity

Returns the individual token liquidity within the specified liquidity pool.

GET https://api.expand.network/dex/gettokenliquidity

Query Parameters

Name
Type
Description

rpc

String

Remote procedural call URL.

poolAddress*

String

The pool address.

dexId*

String

Refer to DEX ID page for details.

https://api.expand.network/dex/gettokenliquidity?poolAddress=0xe6FAcE64967c6CDd53651d6ac97a04Bc9ef305d6&vsCurrencies=inr&dexId=3700

/getpoolliquidity

Returns the total liquidity for a specified pool.

GET https://api.expand.network/dex/getpoolliquidity

Query Parameters

Name
Type
Description

rpc

String

Remote procedural call URL.

poolAddress*

String

Pool address whose liquidity is to be fetched.

dexId*

String

Refer to DEX ID page for details.

https://api.expand.network/dex/getpoolliquidity?dexId=3700&poolAddress=0xe6FAcE64967c6CDd53651d6ac97a04Bc9ef305d6

back to top

/getindividualposition

Returns the liquidity position for a specified user address across all the pools for the DEX.

GET https://api.expand.network/dex/getindividualposition

Query Parameters

Name
Type
Description

rpc

String

Remote procedural call URL.

address*

String

The public address of the liquidity holder.

dexId

String

Refer to DEX ID page for details.

poolAddresses

String

The pool Addresses whose liquidity is to be fetched. (Comma-separated vaules)

https://api.expand.network/dex/getindividualposition?address=0x0ebc19619e8aa912d393ca321c0b6b4f7d98697d&dexId=3700

/getpool

Returns poolAddress, tickSpacing, poolFees, tokensLiquidity and liquidity data based on tokenA and tokenB

GET https://api.expand.network/dex/getpool

Query Parameters

https://api.expand.network/dex/getpool?dexId=3700&tokenA=0x0BA2bA407E80bcb8a314649d9bC12efEECC81519&tokenB=0xd077A400968890Eacc75cdc901F0356c943e4fDb

/swap

Initiate a swap transaction on a specified DEX.

POST https://api.expand.network/dex/swap

Request Body

Name
Type
Description

dexId*

String

Refer to the DEX ID page for details.

path*

Array

Comma-separated values of token addresses, inside an array, to swap.

amountIn*

String

Amount of token to be swapped.

amountOutmin*

String

Minimum amount accepted as the result of swap.

to*

String

Address of the recipient of the token.

deadline*

String

Deadline for the transaction to be executed (UNIX Timestamp).

from*

String

Address of the sender of the token.

gas*

String

Maximum gas limit provided by the sender, for the transaction.

poolFees

String

Different pool based on the fees. By default, it is selected as 10000.

gasPriority

String

low, medium, or high.

slippage

String

Percentage of total swap value. By default, 1.

0 <= slippage value <= 100

{
    "path": [
        "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee","0xd077A400968890Eacc75cdc901F0356c943e4fDb"
    ],
    "amountIn": "1000000000000000000",
    "deadline": "1799212923",
    "to": "0x0eBc19619e8aA912d393Ca321c0B6b4f7d98697D",
    "from": "0x0eBc19619e8aA912d393Ca321c0B6b4f7d98697D",
    "gas": "1000000",
    "poolFees": "1000",
    "slippage": "10",
    "dexId": "3700"
}

With gasPriority:

{
    "path": [
        "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee","0xd077A400968890Eacc75cdc901F0356c943e4fDb"
    ],
    "amountIn": "1000000000000000000",
    "deadline": "1799212923",
    "to": "0x0eBc19619e8aA912d393Ca321c0B6b4f7d98697D",
    "from": "0x0eBc19619e8aA912d393Ca321c0B6b4f7d98697D",
    "gas": "1000000",
    "poolFees": "1000",
    "gasPriority": "high",
    "slippage": "10",
    "dexId": "3700"
}

With Slippage:

{
    "path": [
        "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee","0xd077A400968890Eacc75cdc901F0356c943e4fDb"
    ],
    "amountIn": "1000000000000000000",
    "deadline": "1799212923",
    "to": "0x0eBc19619e8aA912d393Ca321c0B6b4f7d98697D",
    "from": "0x0eBc19619e8aA912d393Ca321c0B6b4f7d98697D",
    "gas": "1000000",
    "poolFees": "1000",
    "gasPriority": "high",
    "slippage": "10",
    "dexId": "3700"
}

Last updated