API Specification
Required API endpoints for DEX integration with DexPal.
DexPal requires partner DEXs to provide two API endpoints for integration. These endpoints enable real-time market data display and aggregate statistics on the DexPal platform.
All endpoints must return JSON responses over HTTPS with data updated at least every 2 minutes. All monetary values should be pre-calculated in USD.
General Requirements
| Requirement | Description |
|---|---|
| Protocol | HTTPS only |
| Format | JSON response |
| Values | Pre-calculated in USD |
| Update Frequency | ≤2 minutes |
Endpoint 1: Markets
GET /dexpal/v1/markets
Real-time market data for all trading pairs.
Required Fields
| Field | Type | Description | Example |
|---|---|---|---|
base_assets | array[object] | Base assets (single-item array for standard pairs). Each object contains symbol (string, required) and optionally asset_type (string: crypto, equity, index, commodity, forex) | [{"symbol": "BTC", "asset_type": "crypto"}] |
quote_assets | array[object] | Quote assets (single-item array for standard pairs). Each object contains symbol (string, required) and optionally asset_type (string: crypto, equity, index, commodity, forex) | [{"symbol": "USD", "asset_type": "forex"}] |
trade_url | string | Direct URL to trade this market on your platform | "https://app.example.com/trade/BTC-USD" |
price | number | Current mark/last price in quote currency | 67543.21 |
volume_24h | number | 24-hour trading volume in USD (pre-calculated) | 1234567890.5 |
open_interest | number | Open interest in USD (pre-calculated) | 98765432.1 |
funding_rate | number | Current funding rate as percentage (0.01 = 0.01%) | 0.0125 |
Optional Fields
| Field | Type | Description | Example |
|---|---|---|---|
index_price | number | Oracle/index price | 67540.0 |
change_24h | number | 24-hour price change percentage | 2.34 |
high_24h | number | 24-hour high price | 68000.0 |
low_24h | number | 24-hour low price | 66500.0 |
max_leverage | integer | Maximum leverage available for this market | 100 |
funding_interval | integer | Funding interval in hours (default: 8) | 8 |
next_funding | ISO8601 | Timestamp of next funding payment | "2026-01-20T22:00:00Z" |
min_order_size | number | Minimum order size in base currency | 0.001 |
maker_or_open_fee | number | BASE maker/open position fee as percentage (0.01 = 0.01%) | 0.02 |
taker_or_close_fee | number | BASE taker/close position fee as percentage (0.01 = 0.01%) | 0.05 |
Example Response
{
"markets": [
{
"base_assets": [
{
"symbol": "BTC",
"asset_type": "crypto"
}
],
"quote_assets": [
{
"symbol": "USD"
}
],
"trade_url": "https://app.example.com/trade/BTC-USD",
"price": 67543.21,
"volume_24h": 1234567890.5,
"open_interest": 98765432.1,
"funding_rate": 0.0125,
"index_price": 67540.0,
"change_24h": 2.34,
"max_leverage": 100,
"funding_interval": 8,
"maker_or_open_fee": 0.02,
"taker_or_close_fee": 0.05
},
{
"base_assets": [
{
"symbol": "ETH",
"asset_type": "crypto"
}
],
"quote_assets": [
{
"symbol": "USD"
}
],
"trade_url": "https://app.example.com/trade/ETH-USD",
"price": 3456.78,
"volume_24h": 567890123.45,
"open_interest": 45678901.23,
"funding_rate": 0.008,
"index_price": 3455.5,
"change_24h": 1.56,
"max_leverage": 50,
"funding_interval": 8
}
],
"timestamp": "2026-01-20T21:00:00Z"
}Endpoint 2: Metrics
GET /dexpal/v1/metrics
Aggregate DEX volume, fees, and statistics.
Required Fields
| Field | Type | Description | Example |
|---|---|---|---|
volume_24h | number | 24-hour total trading volume in USD | 1234567890.5 |
open_interest_24h | number | 24-hour open interest in USD | 98765432.1 |
fees_24h | number | 24-hour fees collected in USD | 12345.0 |
Optional Fields
| Field | Type | Description | Example |
|---|---|---|---|
volume_7d | number | 7-day total trading volume in USD | 8765432100.0 |
volume_all_time | number | All-time total trading volume in USD | 999999999999.0 |
volume_change_1d | number | 24-hour volume change percentage | 5.25 |
volume_change_7d | number | 7-day volume change percentage | -2.1 |
volume_change_24h | number | 24-hour volume change percentage | 15.3 |
open_interest_7d | number | 7-day open interest in USD | 105000000.0 |
open_interest_30d | number | 30-day open interest in USD | 120000000.0 |
open_interest_all_time | number | All-time open interest in USD | 150000000.0 |
fees_7d | number | 7-day fees collected in USD | 123456.0 |
fees_30d | number | 30-day fees collected in USD | 456789.0 |
revenue_24h | number | 24-hour revenue in USD | 12345.0 |
revenue_7d | number | 7-day revenue in USD | 67890.0 |
tvl | number | Total value locked in USD | 500000000.0 |
traders_24h | integer | Number of unique traders in 24 hours | 12500 |
markets_count | integer | Total number of active markets | 150 |
token_staked_pct | number | Percentage of platform token staked (0-100) | 45.5 |
token_staking_apy | number | Token staking APY as percentage | 12.5 |
Example Response
{
"volume_24h": 1234567890.5,
"volume_7d": 8765432100.0,
"volume_all_time": 999999999999.0,
"volume_change_1d": 5.25,
"volume_change_7d": -2.1,
"volume_change_24h": 15.3,
"open_interest_24h": 98765432.1,
"open_interest_7d": 105000000.0,
"open_interest_30d": 120000000.0,
"open_interest_all_time": 150000000.0,
"fees_24h": 12345.0,
"fees_7d": 123456.0,
"fees_30d": 456789.0,
"tvl": 500000000.0,
"traders_24h": 12500,
"markets_count": 150,
"token_staked_pct": 45.5,
"token_staking_apy": 12.5,
"timestamp": "2026-01-20T21:00:00Z"
}Integration Process
Implement Endpoints
Build the /dexpal/v1/markets and /dexpal/v1/metrics endpoints on your infrastructure.
Validate Response Format
Ensure your endpoints return valid JSON with all required fields and correct data types.
Test with DexPal
Share your base URL with your DexPal account manager. We'll validate the integration within 24 hours.
Go Live
Once validated, your DEX will appear on the DexPal platform with live data.
Need Help?
For technical integration support:
- Email: info@dexpal.io
- Discord: Join our community