AVANTIS_EXECUTION or AsyncAvantis(execution=...). Method calls are identical in both modes.
Relayer-mode actions that ride your EIP-7702 smart account (limit orders,
margin, approvals, delegate registration, …) sign an authorization over your
EOA’s account nonce. A delegate/API key is a fresh EOA, so the SDK needs no
RPC at all; that is the normal setup. Signing with your wallet key directly
requires
rpc_url / AVANTIS_RPC_URL (any Base endpoint, e.g.
https://mainnet.base.org) to read that nonce; the SDK raises a clear
ConfigError if it’s missing.Relayer mode
Sub-routes, chosen automatically per action:- Batched market: market opens/closes and increases submit a signed EIP-712 intent — plus, from the high-level methods, an optional pre-signed EIP-7702 transaction (the server picks which mechanism executes) — to the batched-market service, which executes with a fresh price per attempt and streams the order lifecycle back (accepted → initiated → executed/canceled). Receipt
routeisbatched-market, withtracking_id(lifecycle replay handle) andorder_id(on-chain id) filled in. A protocol-declined fill (MarketOrderCanceled, e.g. slippage) raisesRelayError. Intent-only submission (no EIP-7702 leg) is the market-maker fast path. - Price triggers: full-position TP/SL updates are signed as EIP-712 intents and submitted to the core API price-triggers endpoint, which executes the operator entry point itself. Receipt
routeisprice-triggers. This same path is used in direct mode (there is no public contract entry point). - Passthrough: limit orders, margin, approvals, claims, LP, and referral are built as transactions and relayed through your EIP-7702 smart account. Receipt
routeisrelayer-passthrough. - TWAP API: TWAP open/close/cancel are signed intents submitted to the TWAP service, which sends the registration transaction itself. Receipt
routeistwap-api.
Direct mode
The SDK fetches calldata from the tx-builder API, signs an EIP-1559 transaction, and broadcasts through yourrpc_url. Receipt route is rpc, and tx_hash is available immediately.
update_tp_sl is the one exception: v2 has no public contract entry point for it, so it always routes through the relayer even in direct mode.Choosing
- Relayer for almost everyone: no ETH, no nonce management, and no RPC when using a delegate/API key.
- Direct if you must control broadcasting: your own RPC/builder, custom gas strategy, or no dependency on Avantis infrastructure for submission.