Skip to main content

GTX DEX API Reference

The GTX DEX API provides comprehensive access to market data, trading information, and user account details. Built on a high-performance indexer, our API delivers real-time and historical data for all trading pairs and user activities.

Base URL

https://api.gtxdex.xyz
All API endpoints are RESTful and return JSON responses. The API supports both HTTP and HTTPS protocols.

API Features

Rate Limits

Endpoint TypeRate LimitWindow
Market Data1200 req/min1 minute
User Data600 req/min1 minute
Kline Data300 req/min1 minute

Response Format

All API responses follow a consistent JSON structure:

Successful Response

{
  "symbol": "ETHUSDC",
  "price": "2500.50",
  "timestamp": 1640995200000
}

Error Response

{
  "error": "Pool not found"
}

Data Types

Price Precision

  • All prices are returned as strings to maintain precision
  • Prices are denominated in the quote currency of the trading pair
  • Use appropriate decimal handling in your application

Timestamps

  • Unix timestamps in milliseconds for API responses
  • Unix timestamps in seconds for internal processing
  • All timestamps are in UTC

Order Status

StatusDescription
NEWOrder placed but not yet processed
OPENOrder active in the order book
PARTIALLY_FILLEDOrder partially executed
FILLEDOrder completely executed
CANCELLEDOrder cancelled by user
REJECTEDOrder rejected by system

Order Types

TypeDescription
LIMITLimit order with specified price
MARKETMarket order for immediate execution

Order Sides

SideDescription
BuyBuy order (bid)
SellSell order (ask)

Error Codes

HTTP StatusError TypeDescription
400Bad RequestInvalid parameters or missing required fields
404Not FoundRequested resource not found
408TimeoutQuery took too long to process
500Internal ErrorServer error or database issue

API Integration

WebSocket API

For real-time data streams, GTX DEX also provides WebSocket connections:
const ws = new WebSocket('wss://ws.gtxdex.xyz');
ws.onmessage = (event) => {
  const data = JSON.parse(event.data);
  console.log('Market update:', data);
};
WebSocket documentation is available in the Developer Tools section.

Ready to start building with GTX DEX? Check out our quickstart guide or dive into the endpoint documentation.