Web3
On-chain trading: which exchange object to use.
| Need | Exchange object | Notes |
|---|---|---|
| Swap tokens on DEXs of EVM chains | Uniswap (Uniswap, PancakeSwap, Aerodrome), KyberSwap, OneInch (1inch) | Trade with the spot trading functions; see EVM On-chain Swaps (Uniswap, KyberSwap, 1inch) |
| Swap tokens on Solana | Jupiter | See Solana Swaps (Jupiter) |
| Swap on several chains through the OKX DEX aggregator | OKX_DEX | Mnemonic phrase; pairs are {chainIndex}:{token}_USD (case-sensitive token names); see OKX_DEX |
| Read on-chain data, call smart contracts, send custom transactions | Web3 | Supports Ethereum and other EVM-compatible chains (see Ethereum (EVM)) and TRON (see TRON) |
On-chain exchanges such as Hyperliquid, Lighter, EdgeX, Aster and Polymarket are used with the standard trading functions just like centralized exchanges; for their configuration see the exchange pages under Decentralized Exchanges and Prediction Markets in the syntax manual.
In this sectionRead the whole section
| Name | Description |
| EVM On-chain Swaps (Uniswap, KyberSwap, 1inch) | The Uniswap exchange object (exchange.GetName() returns Uniswap) connects to the pools of Uniswap, PancakeSwap or Aerodrome on one EVM chain and maps on-chain s… |
| Solana Swaps (Jupiter) | The Jupiter exchange object (exchange.GetName() returns Jupiter) connects to the Jupiter aggregator on Solana and maps swaps to the spot trading functions. |
| Ethereum (EVM) | With ChainType set to ETH, the Web3 exchange object connects to nodes of Ethereum and every EVM-compatible chain (BSC, Base, Arbitrum, Optimism, Polygon and so… |
| TRON | With ChainType set to TRON, the Web3 exchange object connects to a TRON node. |