Skip to main content
A delegate (API key) is a separate key registered to your wallet. It signs orders on your behalf; the wallet keeps the funds. This is the recommended setup for bots and agents. The SDK enters delegate mode automatically when AVANTIS_PRIVATE_KEY’s address differs from AVANTIS_TRADER_ADDRESS.

Easiest path: the API Key Generator

Generate an API key on the Avantis API Key Generator; one wallet signature registers it. Then set the two env vars and trade. See Quickstart.

DIY registration

Register any key programmatically. The trader key signs one DelegateReq intent (used transiently, never stored); submission is gasless:
expiry_seconds is an absolute unix timestamp in seconds (not a duration, not milliseconds). The API rejects anything that isn’t a future timestamp.
Registration is gasless and needs no RPC: it rides the fresh delegate key’s EIP-7702 smart account. Relayer mode only needs an rpc_url when you run the SDK with your wallet key as the signer; see Execution modes.

Check and verify

Call verify_delegation() at startup for a fail-fast bot: it is a no-op when the signer is the trader itself.

Revoke

Revoking kills any in-flight intents signed by that delegate. You can also revoke from the UI.