Multi-Venue Trading
The agent's code can route trades to more than one venue: Hyperliquid and Uniswap.
- Hyperliquid: perpetual futures on the native DEX and, on testnet, equity perpetuals on HIP-3 builder DEXes.
- Uniswap: spot DEX swaps.
:::info What actually runs today Owlpha trades on Hyperliquid testnet only. The Uniswap venue is in the code but off by default: it switches on only when a Uniswap API key is configured. Nothing on this page involves mainnet funds. See How Testnet Works. :::
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 |
Equity perpetual (e.g. xyz:TSLA) | Hyperliquid HIP-3 DEX xyz | Stock exposure as a USDC-collateralised perp, same account as crypto |
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
Hyperliquid HIP-3 Builder DEXes (Stocks)
Hyperliquid lets builders deploy their own perpetual markets ("HIP-3 builder DEXes"). 7N7D uses this to trade equity perpetuals on the xyz DEX — Tesla (xyz:TSLA) and SpaceX (xyz:SPCX) on mainnet, Tesla on testnet (SpaceX is listed on mainnet only).
- One account, one pool of USDC. Crypto and stock positions share the same Hyperliquid account, the same vault capital, the same risk limits and the same executor. Nothing is re-deposited or moved to a second vault when a stock trade happens.
- Exact identities. A stock market is identified by its coin (
xyz:TSLA), its DEX (xyz) and the network (hl-testnet:xyz:TSLA,hl-mainnet:xyz:SPCX). The display name ("Tesla perpetual", "SpaceX perpetual") is never used to place an order. - Discovered, not hard-coded. The agent reads the DEX's metadata at startup and refuses to trade a market whose identity it cannot verify.
- Session-aware. New stock entries are only placed while the underlying stock market is in its regular session; exits and protective orders keep running around the clock.
- Shared approval, separate agent gates. API activation is shared by market symbol across networks. Each agent separately requires its rollback flag (
HIP3_EQUITY_ENTRIES_ENABLED) and operator symbol list (TRADING_SYMBOLS) to allow entries. The mainnet stock agent is a separate process from the testnet crypto agent, and a market the venue does not list on a network is simply ignored there. A mainnet agent will not start without an explicit symbol list.
See Markets & Asset Classes for how this shows up in the dashboard.
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 |
If the Uniswap venue is switched on, the chain ID setting defaults to 1 (Ethereum) unless an environment variable overrides it. The venue is off by default.
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 only apply to Hyperliquid — Uniswap swaps are always 1x. The agent's effective ceiling is 5x for crypto and 2x for equity perpetuals, regardless of the venue's own maximum
- 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 │
│ (LLM: DeepSeek) │
└──────────┬──────────┘
│
┌──────▼──────┐
│ 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.