GTX is a decentralized finance (DeFi) protocol designed to enable permissionless spot trading,
GTX is a decentralized finance (DeFi) protocol designed to enable permissionless spot trading, with plans to expand into perpetual markets in the future. Addressing inefficiencies in Automated Market Makers (AMMs) and centralized exchanges, GTX provides an order book-based, permissionless trading experience that is fair, efficient, and scalable.
π Inefficient Capital Utilization β AMMs require deep liquidity to minimize slippage, leading to inefficient capital allocation.
π° High Impermanent Loss β Liquidity providers often suffer from impermanent loss due to volatile price movements.
π Price Manipulation β AMMs are vulnerable to front-running and sandwich attacks, harming traders.
π§ Restricted Market Listings β Centralized exchanges limit listings, making it difficult for emerging assets to gain liquidity.
GTX introduces a Central Limit Order Book (CLOB)-based DEX with:
π Decentralized Market Creation β Anyone can list a spot trading pair without permission.
π Efficient Order Book Trading β CLOB enables traders to set limit orders and achieve fair price execution.
π€ AMM-Free Model β Eliminates impermanent loss risks by relying on direct peer-to-peer trading.
π‘ Oracle-Free Spot Trading β Uses an order book mechanism to ensure transparent and decentralized price discovery.
π± Spot Trading β Fully decentralized CLOB-based exchange.
π Permissionless Market Creation β No gatekeepersβanyone can list a new market.
π Fair and Transparent Pricing β No reliance on external oracles for spot trades.
π Optimized Liquidity Utilization β Capital-efficient trading mechanism compared to AMMs.
β‘ High-Frequency Trading Ready β Supports traders placing orders with minimal delay.
π No Liquidity Providers (LPs) Needed β Orders are matched peer-to-peer, removing LP dependency.
π Cross-chain Swaps - Liquidity can be accessed from other chains (swap only for now)
πΉ Permissionless Market Making β Everyon can participate to be market maker to earn incentives from trading (Coming Soon)
The CLOB DEX system consists of four main components:
GTXRouter: Entry point for all user interactions
PoolManager: Manages trading pairs and pool deployments
OrderBook: Handles order placement and matching using RB-Tree
BalanceManager: Manages token deposits, withdrawals, and locks
Multichains - All chains supported to connect with our apps
Solver - Using Open Intents Framework (OIF) and Hyperlane intergrations for connecting other chains to GTX
GTX - Source of liquidity, on-chain trading deployed on Pharos
1. Initiating an Open Intent (User Action)
The user creates an open intent to swap WETH for WBTC on the parent chain, such as Ethereum.
This intent is signed and transmitted through the Open Intents Framework (OIF).
2. Transmitting Intent to Pharos
Hyperlane facilitates the relay of the signed swap intent from the parent chain to Pharos.
Upon arrival, the OIF Router on Pharos authenticates the intent and initiates processing.
3. Matching Orders & Executing Trades
Pharos examines its CLOB order book for a direct WETH/WBTC market order.
If a direct market order is available, the trade is executed immediately.
In the absence of a direct match, Pharos employs routing strategies:
Initially, WETH is sold for USDC (Market Order 1).
Subsequently, the obtained USDC is used to purchase WBTC (Market Order 2).
These orders are executed sequentially by Pharos using its CLOB liquidity to ensure optimal execution.
4. Bridging Assets Back to the Parent Chain
Once the trade is completed, the acquired WBTC is transferred to the user via the Hyperlane Bridge.
The user receives WBTC on the parent chain, such as Ethereum.
We use Goldsky for indexing, which allows the frontend to easily query key data such as candlestick charts, pool balances, and listed markets. Goldsky is chosen due to its simple setup, customizability, and compatibility with EVM chains. It is also self-hostable, ensuring greater control over the infrastructure.
π¨βπ» Traders place buy/sell orders on the decentralized order book.
π Order Matching occurs through a fair and efficient matching engine.
π° Protocol earns trading fees when orders are matched in the order book.
π Settlement happens directly on-chain, ensuring security and transparency.
π Limit Orders β Set precise pricing for trades.
β‘ Market Orders β Instant execution at the best available price.
π― Smart Order Routing β Optimized execution for best trade outcomes.
πββοΈ O(log n) Matching Algorithm β Efficient trade matching.
π Price-Time Priority Execution β Ensures fair order processing.
π Real-Time Order Book Updates β Continuous visibility into market movements.
π Atomic Settlements β Ensures consistency and security in trades.
O(log n) Operations β Efficient price level insertions and removals.
Quick Best Bid/Ask Access β Fast retrieval of top market prices.
Ordered Iteration β Enables seamless market data traversal.
Double-Linked List Structure β Efficiently manages orders at each price level.
FIFO Execution β Ensures fair trade processing within the same price level.
Efficient Order Updates β Minimizes processing overhead.
Packed struct layouts reduce storage operations
Minimized SSTOREs through strategic updates
Efficient order data retrieval patterns
Retrieve best bid/ask prices.
Check order queue status at any price level.
View userβs active orders.
Fetch next best price levels with trading volumes.
Balance Protection
Order amount locking before placement
Atomicity in balance operations
Authorization checks for operators
Order Integrity
Order ownership validation
Expiration handling
Time-in-force constraints enforcement
Access Control
Router authorization for order operations
Owner-only configuration changes
Operator-limited permissions
The contract addresses are stored in JSON files under the deployments/<chain_id>.json
(Source). Example folder:
π Local Development: deployments/31337.json
(Anvil network)
π GTX Dev Network: deployments/31338.json
(GTX Development)
π Rise Network: deployments/11155931.json
(Rise Sepolia)
π Pharos Network: deployments/50002.json
(Pharos Devnet)
To access contract addresses for a specific network:
Locate the appropriate JSON file for your target network
Parse the JSON to find the contract you need (e.g., GTXRouter
, PoolManager
)
Use the address in your frontend or for contract interactions
The contract ABIs are stored in the deployed-contracts/deployedContracts.ts
(Source) file.
Note: This file is automatically generated using the generate-abi
target in the Makefile
. Ensure you run the appropriate Makefile command to update or regenerate the ABIs when needed.
100
5th Place Winner, Build & Brew, Espresso Global Hackathon (2025)