AgentContext is passed to your run and unwind functions. It has session data and all SDK methods.
Session Data
sessionId(number): Unique session identifiersessionWalletAddress(string): Wallet address for this sessionportfolio(object): What the session holds at the start of execution —portfolio.balances(cash/spot/staking inventory + Polymarket pUSD cash) andportfolio.positions(open Hyperliquid perps + Polymarket outcome-token positions)executionMode(string):"auto"or"manual"settings(object): Resolved settings (defaults merged with session overrides)
SDK Methods
- Python
- TypeScript
log(): Send messages to users and log locallymemory: Key-value storage (shared=Truefor shared scope, omit for session)platforms: Platform integrations (Polymarket, Hyperliquid)swap: Cross-chain swap operationssign_and_send(): Sign and broadcast transactionssign_message(): Sign messages (EVM only)transactions(): Get transaction historyclear_suggested_transactions(): Clear pending suggestions (manual mode)
Basic Usage
Portfolio
agent.portfolio is captured at execution start. It is a field — no await, no success/data wrapper. See Positions for full details.
See Also
- SDK Quick Reference — All SDK methods at a glance
- Execution Model — How sessions and the run loop work
- Positions — Full portfolio reference