GTX DEX Smart Contracts
GTX DEX is built on a sophisticated smart contract architecture that enables efficient CLOB trading while maintaining decentralization and security. This guide covers all contract addresses, ABIs, and integration patterns.Contract Architecture
The GTX DEX system consists of four main smart contracts working together:GTXRouter
Main entry point for all user interactions and trade routing
PoolManager
Manages trading pairs and pool deployments
OrderBook
Handles order placement and matching using Red-Black Tree
BalanceManager
Manages token deposits, withdrawals, and locks
Deployed Contract Addresses
GTX DEX is deployed across multiple testnet environments for comprehensive testing and development:GTX Devnet Contracts
Core Contracts
Core Contracts
GTXRouter ContractPoolManager ContractOrderBook ContractBalanceManager Contract
Test Tokens
Test Tokens
Mock USDCMock WETHMock WBTCMock ChainlinkMock PEPE
Base Sepolia Testnet Contracts
Core Contracts
Core Contracts
GTXRouter ContractPoolManager ContractOrderBook ContractBalanceManager Contract
Test Tokens
Test Tokens
Mock USDCMock WETHMock WBTCMock Chainlink
Network Information
| Network | Chain ID | RPC URL | Explorer |
|---|---|---|---|
| GTX Devnet | 1802 | https://testnet-rpc.gtxdex.xyz | https://testnet-explorer.gtxdex.xyz |
| Base Sepolia | 84532 | https://sepolia.base.org | https://sepolia.basescan.org |
Contract Interfaces
GTXRouter Interface
The main entry point for all trading operations:OrderBook Interface
Handles order matching and execution:Integration Examples
Basic Trading Integration
Advanced Integration Patterns
Batch Operations
Real-time Price Monitoring
Gas Optimization
Efficient Order Management
Security Considerations
Best Practices
Input Validation
Input Validation
Error Handling
Error Handling
Access Control
Access Control
Testing & Development
Local Development Setup
Contract ABIs
The contract ABIs are available in the contracts repository under/deployments/ or can be fetched from the block explorer.
Download ABIs
Get the latest contract ABIs from GitHub
API Integration
Use the REST API for easier integration
Ready to build on GTX DEX? The smart contract architecture provides a robust foundation for creating yield-generating trading applications.
