Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.circuit.org/llms.txt

Use this file to discover all available pages before exploring further.

AgentContext is passed to your run and unwind functions. It has session data and all SDK methods.

Session Data

  • sessionId (number): Unique session identifier
  • sessionWalletAddress (string): Wallet address for this session
  • currentPositions (array): Assets allocated to the agent at the start of execution
  • executionMode (string): "auto" or "manual"
  • settings (object): Resolved settings (defaults merged with session overrides)

SDK Methods

  • log(): Send messages to users and log locally
  • memory: Key-value storage (shared=True for shared scope, omit for session)
  • platforms: Platform integrations (Polymarket, Hyperliquid)
  • swap: Cross-chain swap operations
  • sign_and_send(): Sign and broadcast transactions
  • sign_message(): Sign messages (EVM only)
  • transactions(): Get transaction history
  • get_current_positions(): Get live positions
  • clear_suggested_transactions(): Clear pending suggestions (manual mode)

Basic Usage

def run(agent: AgentContext) -> None:
    agent.log(f"Session: {agent.sessionId}")
    agent.log(f"Wallet: {agent.sessionWalletAddress}")
    agent.log(f"Positions: {len(agent.currentPositions)}")

Current Positions

currentPositions is a snapshot taken at execution start. After transactions, use getCurrentPositions() for updated balances. See Positions for full details.
positions = agent.get_current_positions()
if positions.success and positions.data:
    if positions.data.hasPendingTxs:
        agent.log("Pending transactions detected")
    # Use positions.data.positions

See Also