Multi-Venue Trading
7N7D's AI agent trades across multiple venues to access the best execution for each trade type. Currently supported: Hyperliquid (perpetual futures) and Uniswap (spot DEX swaps).
How Venue Routing Works
Every trade goes through the Venue Router, which decides where to execute based on the trade's characteristics:
Trade Signal ──► Venue Router ──► Hyperliquid (perps)
│
└──────────► Uniswap (spot swaps)
Decision Rules
| Condition | Venue | Reason |
|---|---|---|
| Leveraged position (>1x) | Hyperliquid | Only perp venues support leverage |
| Perpetual contract | Hyperliquid | Native perp trading |
| Token not on Hyperliquid | Uniswap | Broader token coverage |
| Explicit spot swap | Uniswap | On-chain DEX execution |
| Default (everything else) | Hyperliquid | Primary venue, lowest fees |
Uniswap-Only Tokens
Some tokens are always routed to Uniswap because they aren't available on Hyperliquid:
- 7N7D — the project's own token
- UNI, AAVE, COMP, MKR — governance tokens
Supported Chains
Uniswap swaps are supported on multiple chains:
| Chain | Chain ID | Key Tokens |
|---|---|---|
| Ethereum | 1 | ETH, USDC, USDT, DAI, WBTC |
| Arbitrum | 42161 | ETH, USDC, USDT, ARB |
| Base | 8453 | ETH, USDC |
The agent defaults to Ethereum mainnet but can be configured to prefer other chains via environment variables.
Uniswap Trading API
Spot swaps use the Uniswap Trading API, which provides:
- Best-price routing across Uniswap V2 and V3 pools
- Gas estimation and urgency levels (normal, fast, urgent)
- Slippage protection — default 0.5%, configurable per trade
- 25+ supported chains
Swap Flow
- Quote — Agent requests a price quote from the Uniswap API
- Approve — Token approval transaction (if needed)
- Execute — Signed swap transaction submitted on-chain
- Confirm — Wait for transaction confirmation
Risk Controls
Multi-venue trading inherits the same risk management framework:
- Position sizing applies across all venues
- Daily loss limits are tracked globally, not per-venue
- Leverage caps (max 20x) only apply to Hyperliquid — Uniswap swaps are always 1x
- Slippage protection on Uniswap prevents execution at unfavorable prices
Configuration
Multi-venue trading is controlled by environment variables:
| Variable | Default | Description |
|---|---|---|
UNISWAP_API_KEY | (none) | API key for Uniswap Trading API (required to enable) |
UNISWAP_DEFAULT_CHAIN_ID | 1 | Default chain for swaps |
UNISWAP_SLIPPAGE_BPS | 50 | Slippage tolerance in basis points (50 = 0.5%) |
UNISWAP_GAS_URGENCY | urgent | Gas price urgency: normal, fast, urgent |
Uniswap venue is disabled by default. It activates automatically when UNISWAP_API_KEY is set.
Architecture
┌─────────────────────┐
│ AI Decision Engine │
│ (DeepSeek / Claude) │
└──────────┬──────────┘
│
┌──────▼──────┐
│ Venue Router │
└──┬───────┬──┘
│ │
┌────▼──┐ ┌──▼──────────┐
│ Hyper- │ │ Uniswap │
│ liquid │ │ Spot Adapter │
│ (Perps)│ │ (DEX Swaps) │
└───┬────┘ └──────┬──────┘
│ │
Perp Markets On-Chain DEXs
Next: Learn about Transparency to see how all trades are verified on-chain.