Skip to main content

DEX API

Endpoints for DEX trading, liquidity management, and pool analytics.

Swap Endpoints

Execute Swap

POST /dex/swap

Execute a token swap on a DEX protocol.

Request Body:

FieldTypeRequiredDescription
chainIdnumberYesChain ID
tokenInstringYesInput token address
tokenOutstringYesOutput token address
amountInstringYesAmount of input tokens
slippagenumberNoSlippage tolerance (default: 0.5%)
walletAddressstringYesUser wallet address

Get Swap Quote

POST /dex/quote

Get a swap quote without executing the trade.

Request Body:

FieldTypeRequiredDescription
chainIdnumberYesChain ID
tokenInstringYesInput token address
tokenOutstringYesOutput token address
amountInstringYesAmount to swap

Response:

{
"amountOut": "1500000000000000000",
"priceImpact": 0.12,
"route": "uniswap",
"gasEstimate": "150000"
}

Liquidity Endpoints

Create Liquidity Position

POST /dex/liquidity/create

Add liquidity to a DEX pool and create a new position.

Request Body:

FieldTypeRequiredDescription
chainIdnumberYesChain ID
protocolstringYesDEX protocol (uniswap, pancakeswap, sushiswap)
token0stringYesFirst token address
token1stringYesSecond token address
feenumberYesFee tier (e.g., 3000 for 0.3%)
amount0stringYesAmount of token 0
amount1stringYesAmount of token 1
tickLowernumberYesLower price tick
tickUppernumberYesUpper price tick

Increase Liquidity

POST /dex/liquidity/increase

Add more liquidity to an existing position.


Decrease Liquidity

POST /dex/liquidity/decrease

Remove liquidity from an existing position.


Collect Fees

POST /dex/liquidity/collectFees

Collect accumulated trading fees from an LP position.


Burn Position

POST /dex/liquidity/burn

Close and burn an LP position NFT.

Pool Endpoints

Get Pool Info

POST /dex/pool-info

Retrieve detailed information about a specific pool.


Get Pool List

GET /dex/getPoolList

Fetch lists of pools filtered by type.

Query Parameters:

ParameterTypeRequiredDescription
chainIdnumberYesChain ID
dexstringYesDEX protocol name
typestringNoPool list type (top, new, general)
pagenumberNoPagination page

Get Pool Graph Data

GET /dex/poolgraphdata

Retrieve price chart data for a specific pool.


Get Pool Candlestick

GET /dex/pool-candlestick

Retrieve OHLCV candlestick data for a pool.

Query Parameters:

ParameterTypeRequiredDescription
poolAddressstringYesPool contract address
chainIdnumberYesChain ID
dexstringYesDEX protocol
intervalstringNoTime interval (1h, 4h, 1d)

Get Price Range Graph

GET /dex/pricerangegraphdata

Retrieve liquidity distribution / price range data for a pool.


Simulate LP Position

POST /dex/simulate-lp

Simulate a liquidity position to estimate returns before committing.