Dengis Swap API
Build powerful trading applications with our comprehensive REST and WebSocket APIs. Access real-time pricing, execute swaps, and manage wallets programmatically.
Introduction
The Dengis Exchange API provides developers with direct access to our decentralized exchange infrastructure. Our API is built on top of Solana blockchain and Jupiter aggregator, offering the best rates and lowest slippage for token swaps.
Base URL: https://api.dengis.xyz/v1
Features
- Real-time token pricing and market data
- Optimal swap routing through Jupiter aggregator
- WebSocket support for live price feeds
- Portfolio tracking and analytics
- Low latency infrastructure
Authentication
Most endpoints are public and don't require authentication. However, for rate-limited access and premium features, you'll need an API key.
curl -H "Authorization: Bearer YOUR_API_KEY" \
https://api.dengis.xyz/v1/tokens
You can obtain an API key from your dashboard after connecting your wallet.
Rate Limits
API rate limits are applied per IP address:
| Tier | Requests per minute | Requirements |
|---|---|---|
| Free | 60 | No authentication |
| Pro | 600 | API key required |
| Enterprise | Unlimited | Contact sales |
Get Quote
Get the best swap quote for a token pair with optimal routing.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
inputMint required |
string | Input token mint address |
outputMint required |
string | Output token mint address |
amount required |
number | Amount in smallest unit (lamports) |
slippageBps optional |
number | Slippage tolerance in basis points (default: 50) |
{
"success": true,
"quote": {
"inputMint": "So11111111111111111111111111111111111111112",
"outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"inAmount": "1000000000",
"outAmount": "156040000",
"priceImpactPct": 0.12,
"marketInfos": [
{
"id": "whirlpool",
"label": "Whirlpool",
"inputMint": "So11111111111111111111111111111111111111112",
"outputMint": "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v",
"inAmount": "1000000000",
"outAmount": "156040000",
"fee": {
"amount": "25000",
"mint": "So11111111111111111111111111111111111111112",
"pct": 0.0025
}
}
]
}
}
Execute Swap
Execute a swap transaction based on a quote.
Request Body
{
"quoteResponse": { ... },
"userPublicKey": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
"wrapAndUnwrapSol": true
}
{
"success": true,
"swapTransaction": "4hXTCkRzt9WyecN...",
"lastValidBlockHeight": 150000000
}
Swap History
Retrieve swap transaction history for a wallet address.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
wallet required |
string | Solana wallet address |
Query Parameters
| Parameter | Type | Description |
|---|---|---|
limit optional |
number | Number of results (default: 50, max: 100) |
offset optional |
number | Pagination offset (default: 0) |
List Tokens
Get a list of all supported tokens with metadata.
{
"success": true,
"tokens": [
{
"mint": "So11111111111111111111111111111111111111112",
"symbol": "SOL",
"name": "Solana",
"decimals": 9,
"logoURI": "https://...",
"verified": true,
"volume24h": 15000000,
"price": 156.04
}
],
"count": 150
}
Token Info
Get detailed information about a specific token.
Token Price
Get real-time prices for one or multiple tokens.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
ids required |
string | Comma-separated list of token mints |
Trending Tokens
Get trending tokens based on volume and price action.
Wallet Balance
Get total portfolio balance in USD for a wallet.
Wallet Tokens
List all tokens held by a wallet with balances and values.
{
"success": true,
"wallet": "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
"tokens": [
{
"mint": "So11111111111111111111111111111111111111112",
"symbol": "SOL",
"balance": 5.23,
"decimals": 9,
"usdValue": 816.23
}
],
"totalValue": 1250.45
}
Wallet Activity
Get recent transaction activity for a wallet.
WebSocket Connection
Connect to our WebSocket server for real-time updates:
WebSocket URL: wss://ws.dengis.xyz
const ws = new WebSocket('wss://ws.dengis.xyz');
ws.onopen = () => {
console.log('Connected to Dengis Swap');
// Subscribe to price feed
ws.send(JSON.stringify({
type: 'subscribe',
channel: 'prices',
tokens: ['SOL', 'USDC']
}));
};
ws.onmessage = (event) => {
const data = JSON.parse(event.data);
console.log('Price update:', data);
};
Price Feed
Subscribe to real-time price updates for tokens.
{
"type": "subscribe",
"channel": "prices",
"tokens": ["SOL", "USDC", "BONK"]
}
{
"type": "price_update",
"data": {
"token": "SOL",
"price": 156.04,
"change24h": 2.5,
"volume24h": 15000000,
"timestamp": 1699564800000
}
}
Orderbook Stream
Subscribe to orderbook updates for a trading pair.
{
"type": "subscribe",
"channel": "orderbook",
"pair": "SOL/USDC"
}