DEX spot swaps

Route Uniswap V3 (Ethereum, Arbitrum) and Jupiter Swap V2 (Solana) through trade-worker signals. Setup, secrets, pair syntax, and test-flag limits.

This page

Spot DEX venues use the same webhook vocabulary as CEX (LONG / SHORT / CLOSE_*) but execute as ExactIn swaps in web3-wallet-worker. Signing never leaves that isolate. Perpetual DEX venues are not supported.


Venues

exchangeChainRouterPair syntaxtest: true
uniswap-ethereumEthereumUniswap V3 (SwapRouter02)BASE/QUOTE (e.g. ETH/USDC)Rejected
uniswap-arbitrumArbitrumUniswap V3 (SwapRouter02)BASE/QUOTERejected
jupiter-solanaSolanaJupiter Swap V2 (/order + /execute)BASE/QUOTE (e.g. SOL/USDC)Rejected

KV toggles (dashboard Exchanges section, or CLI):

bash
hoox config kv set exchange:uniswap-ethereum:enabled true
hoox config kv set exchange:uniswap-arbitrum:enabled true
hoox config kv set exchange:jupiter-solana:enabled true

Unset means enabled. "false" skips the venue.


What hoox setup fills

Secret / varAutomatic?
WALLET_EXECUTE_KEY_BINDINGYes — mesh key, same value as INTERNAL_KEY_BINDING
SOLANA_PRIVATE_KEYYes if missing — 32-byte base58 seed. Existing Phantom exports are kept
RPC_URL_ARBITRUM / RPC_URL_SOLANAYes if empty — public RPCs
WEB3_WALLET_SERVICE binding on trade-workerYes — wrangler materialize
JUPITER_API_KEYNo — Jupiter portal
WALLET_PK_SECRET / WALLET_MNEMONIC_SECRETNo — EVM signing material
bash
hoox setup
hoox secrets set web3-wallet-worker JUPITER_API_KEY   # Solana DEX only

Replace the generated Solana seed with a Phantom export (base58 32-byte seed or 64-byte secret) if you want an existing wallet.


Signal shape

DEX venues require BASE/QUOTE (slash). Compact CEX tickers like ETHUSDC are rejected.

json
{
  "apiKey": "your-hoox-webhook-passkey",
  "exchange": "uniswap-ethereum",
  "action": "LONG",
  "symbol": "ETH/USDC",
  "quantity": 100
}
ActionSwap
LONG / CLOSE_SHORTSpend QUOTE to buy BASE (ExactIn)
SHORT / CLOSE_LONGSell BASE for QUOTE

quantity is in quote units on buy (LONG of ETH/USDC with 100 spends 100 USDC) and base units on sell. Curated symbols: ETH, WETH, USDC, USDT, DAI, WBTC, SOL.

Uniswap venues send dexVersion: "v3". Native ETH is wrapped to WETH for the pool; native-out unwraps via unwrapWETH9. Solana SOL uses the wrapped mint So111…11112.

Do not set "test": true — DEX venues are mainnet-only (TEST_TRADING_UNSUPPORTED).


Auth path

  1. Gateway (hoox) authenticates the webhook as usual.
  2. trade-worker ExchangeRouter resolves the DEX venue and builds a thin IExchangeClient.
  3. The client POSTs /swap on WEB3_WALLET_SERVICE with X-Internal-Auth-Key (WALLET_EXECUTE_KEY_BINDING or INTERNAL_KEY_BINDING) and an Idempotency-Key.
  4. The wallet worker quotes, enforces USD caps, signs, and returns { txHash, id }.

Credential source is wallet-binding — CEX API keys are not used.

The hoox gateway also exposes an operator /wallet/* proxy (Bearer OPERATOR_API_KEY) that forwards allowlisted paths (/status, /config, /balance, /quote, /swap, /transfer, /approve, /transactions) to web3-wallet-worker. Mesh auth is injected by the gateway. See API endpoints.


Related