API Reference

This page provides a brief overview of all available endpoints in the STON.fi DEX API v1.160.0.

For detailed parameters, request/response schemas, and examples, please refer to our Swagger documentation.

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 routers

  • GET /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 assets

  • GET /v1/assets/{address} - Get specific asset details

  • POST /v1/assets/query - Query assets with conditions

  • POST /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 pools

  • GET /v1/pools/{address} - Get specific pool details

  • GET /v1/pools/by_market/{asset0}/{asset1} - Get pools for a token pair

  • POST /v1/pool/query - Query pools with conditions

Farms

Farm Operations

  • GET /v1/farms - List all farms

  • GET /v1/farms/{address} - Get specific farm details

  • GET /v1/farms/by_pool/{pool_address} - Get farms by pool

Wallets

Wallet-Specific Data

  • GET /v1/wallets/{address}/assets - Get wallet's assets

  • GET /v1/wallets/{address}/assets/{asset} - Get specific asset in wallet

  • GET /v1/wallets/{address}/pools - Get wallet's liquidity positions

  • GET /v1/wallets/{address}/pools/{pool} - Get specific pool position

  • GET /v1/wallets/{address}/farms - Get wallet's farm positions

  • GET /v1/wallets/{address}/farms/{farm} - Get specific farm position

  • GET /v1/wallets/{address}/operations - Get wallet's transaction history

  • GET /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 period

  • GET /v1/stats/operations - Trading operation statistics

Fee Statistics

  • GET /v1/stats/fees - Referral fee statistics

  • GET /v1/stats/fee_accruals - Detailed fee accrual history

  • GET /v1/stats/fee_withdrawals - Fee withdrawal history

Export

Third-Party Integrations

  • GET /export/cmc/v1 - Export data in CoinMarketCap format

  • GET /export/dexscreener/v1/latest-block - Latest indexed block

  • GET /export/dexscreener/v1/asset/{address} - Asset info for DexScreener

  • GET /export/dexscreener/v1/pair/{address} - Pool info for DexScreener

  • GET /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 farms

  • op_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