Skip to main content
The Avantis Python SDK is an API-first client for Avantis v2 on Base. The model is simple: you hold an API key (a delegate key registered to your wallet with one signature; generate one with the Avantis API Key Generator), the SDK signs orders locally, and the Avantis relayer puts them on-chain. No gas, no node, no wallet popups.

Quickstart

From zero to a filled trade in five minutes.

Trading

The full order surface: market, limit, TP/SL, margin, TWAP.

Positions & portfolio

Open positions, PnL, history, and analytics.

Core concepts

Units, keys, execution routes, receipts. Read this once.

Market-maker fast path

Build and sign orders locally, with the fewest possible round-trips.

Runnable examples

18 scripts, one per flow, from reading prices to the MM fast path.

Why v2

  • All information the Avantis app has, through one client: pairs, funding, spreads, OI caps, positions with liquidation prices, PnL breakdowns, portfolio analytics, referral stats, vault APY.
  • Correct by construction. Every signed intent is digest-verified against the API, and the signer is tested against vectors computed by the on-chain hashing library itself.
  • Built for every user type. One-liner market orders for agents and scripts; TWAP, coin-sized orders, direct broadcasting, and local signing for institutions.