Environment variables
Centrally-routed services (core, TWAP, batched-market, relayer, data, risk-engine v2) derive from a single base URL:
https://prod-api.avantisfi.com on mainnet, https://staging-api.avantisfi.com on testnet. Override it with AVANTIS_API_BASE_URL. Per-service endpoint overrides (rarely needed) win over the derivation: AVANTIS_TX_BUILDER_URL, AVANTIS_RELAYER_URL, AVANTIS_CORE_API_URL, AVANTIS_TWAP_API_URL, AVANTIS_BATCHED_MARKET_URL, AVANTIS_DATA_API_URL, AVANTIS_RISK_V2_API_URL, AVANTIS_HISTORY_API_URL, AVANTIS_RISK_API_URL, AVANTIS_FEED_URL.
Constructor overrides
Anything the env can set, the constructor can override:timeout_s (default 30), relay_poll_timeout_s (default 60, how long wait=True polls the relayer), builder_code (optional 32-byte calldata suffix for partners).
Sync client
Avantis mirrors the async surface with blocking calls. Same namespaces, same methods:
Custom signers
By default the SDK builds aLocalSigner from private_key. Pass any BaseSigner instead, e.g. AWS KMS (install with pip install 'avantis-trader-sdk[kms]'):
Streams (Socket.IO pair data) need an extra:
pip install 'avantis-trader-sdk[streams]'.
Python 3.10+ is required.