5. Agent Architecture
In this section we'll link DeFi applications to the agent architecture.
5.1 Cognitive Architecture: Model, Tools, and Orchestration
Model (LLM-based):
Possibly fine-tuned on historical crypto or macro data.
Gains problem-solving methods like ReAct, Chain-of-Thought, or Tree-of-Thoughts for enhanced planning.
Tools:
Extensions: Direct agent-side integration to external APIs, e.g., Polymarket bet placements or on-chain derivatives.
Functions: Let the agent propose an action with arguments (e.g., “short ETH at price X”), with final execution controlled by the user or another system.
Data Stores: Vector databases containing historical outcomes—helping the agent recall complex scenarios or adapt to new data quickly.
Orchestration:
The cyclical process of taking user input (market conditions, user queries), reasoning, and selecting a next action.
In a DeFi context, could repeat every block or every price update.
5.2 Example Use Case: AI Agent in Polymarket
The agent sees a new Polymarket pool on an upcoming election.
Through chain-of-thought, it checks real-time sentiment on Twitter, recent polling, and the current odds.
If it identifies a discrepancy, it calls a “function” to place a bet on Polymarket—specifically a long position if the odds are undervalued.
Over time, the agent periodically re-checks the sentiment feed. If the odds shift dramatically, it rebalances or closes out the bet.
By chaining multiple Tools (sentiment analysis, Polymarket extension, news aggregator), the agent executes a data-driven speculation strategy more efficiently than a single script or manual approach.
Last updated