API Reference
This page provides a brief overview of all available endpoints in the STON.fi DEX API v1.160.0.
Base URL: https://api.ston.fi
DEX Operations
Swap Simulation
POST /v1/swap/simulate
- Simulate a token swap before execution. Calculates expected output, fees, and gas costs.
Reverse Swap Simulation
POST /v1/reverse_swap/simulate
- Calculate required input amount to receive a specific output amount.
Liquidity Provision Simulation
POST /v1/liquidity_provision/simulate
- Preview liquidity addition with support for Initial, Balanced, and Arbitrary provision types.
Swap Status
GET /v1/swap/status
- Check the status of a swap operation using router address, owner address, and query ID.
Routers
GET /v1/routers
- List all available routersGET /v1/routers/{address}
- Get specific router details
Markets
GET /v1/markets
- Get all available trading pairs
Assets
Asset Operations
GET /v1/assets
- List all available assetsGET /v1/assets/{address}
- Get specific asset detailsPOST /v1/assets/query
- Query assets with conditionsPOST /v1/assets/search
- Search assets by name, symbol, or address
Jetton Operations
GET /v1/jetton/{address}/address
- Get jetton wallet address for a specific owner
Pools
Pool Operations
GET /v1/pools
- List all liquidity poolsGET /v1/pools/{address}
- Get specific pool detailsGET /v1/pools/by_market/{asset0}/{asset1}
- Get pools for a token pairPOST /v1/pool/query
- Query pools with conditions
Farms
Farm Operations
GET /v1/farms
- List all farmsGET /v1/farms/{address}
- Get specific farm detailsGET /v1/farms/by_pool/{pool_address}
- Get farms by pool
Wallets
Wallet-Specific Data
GET /v1/wallets/{address}/assets
- Get wallet's assetsGET /v1/wallets/{address}/assets/{asset}
- Get specific asset in walletGET /v1/wallets/{address}/pools
- Get wallet's liquidity positionsGET /v1/wallets/{address}/pools/{pool}
- Get specific pool positionGET /v1/wallets/{address}/farms
- Get wallet's farm positionsGET /v1/wallets/{address}/farms/{farm}
- Get specific farm positionGET /v1/wallets/{address}/operations
- Get wallet's transaction historyGET /v1/wallets/{address}/fee_vaults
- Get referral fee vaults
Statistics
Protocol Statistics
GET /v1/stats/dex
- Overall DEX statistics (TVL, volume, users, trades)GET /v1/stats/pool
- Pool statistics for time periodGET /v1/stats/operations
- Trading operation statistics
Fee Statistics
GET /v1/stats/fees
- Referral fee statisticsGET /v1/stats/fee_accruals
- Detailed fee accrual historyGET /v1/stats/fee_withdrawals
- Fee withdrawal history
Export
Third-Party Integrations
GET /export/cmc/v1
- Export data in CoinMarketCap formatGET /export/dexscreener/v1/latest-block
- Latest indexed blockGET /export/dexscreener/v1/asset/{address}
- Asset info for DexScreenerGET /export/dexscreener/v1/pair/{address}
- Pool info for DexScreenerGET /export/dexscreener/v1/events
- Event stream for block range
Common Parameters
Query Parameters
Time ranges: Use format
YYYY-MM-DDTHH:MM:SS
Addresses: TON blockchain addresses (e.g.,
EQBynBO23ywHy_CgarY9NK9FTz0yDsG82PtcbSTQgGoXwiuA
)Amounts: String values in smallest units (1 TON = "1000000000")
Slippage: Decimal values (0.001 = 0.1%)
Filters
dex_v2
: Boolean to filter V2 pools/routers (default: true)only_active
: Show only active farmsop_type
: Filter operations by type (swap, provide_liquidity, etc.)
Rate Limits
Currently, there are no rate limits for the DEX API.
SDK
For easier integration, use our TypeScript SDK:
npm install @ston-fi/api
import { DEX } from '@ston-fi/api';
const dex = new DEX();
const assets = await dex.getAssets();
Support
For the most up-to-date information about parameters, response formats, and new endpoints, always refer to our Swagger documentation.
Last updated