Documentation Index
Fetch the complete documentation index at: https://docs.orca.so/llms.txt
Use this file to discover all available pages before exploring further.
AI Agents on Orca
Orca’s Whirlpools SDK is designed for programmatic use — making it well-suited for autonomous agents that manage LP positions, execute swaps, or monitor pool conditions without human intervention. This page covers the key patterns for building an agent on top of Orca.Why Orca for Agents
- MCP server — native tool-use access to all Orca docs at
https://docs.orca.so/mcp - Full SDK coverage — open, monitor, harvest, and close positions in a single SDK call each
- REST API — read pool and token data without a wallet or on-chain connection
- Deterministic quoting — get exact expected output amounts before submitting any transaction
- Multi-network — works on Solana Mainnet and Solana Devnet
Using the Orca MCP Server
Orca exposes a live MCP server that any agent framework can connect to for real-time documentation search. The server provides aSearchOrcaDocumentation tool — useful for grounding agent decisions with protocol knowledge at runtime.
MCP server URL: https://docs.orca.so/mcp
Add it to Claude Desktop (claude_desktop_config.json) or Cursor (.cursor/mcp.json):
The Minimal Agent Loop
A minimal autonomous LP management agent:| Operation | SDK function | When to use |
|---|---|---|
| Read pool state | fetchWhirlpool(rpc, poolAddress) | Every loop iteration |
| Read positions | fetchPositionsForOwner(rpc, ownerAddress) | Every loop iteration |
| Harvest fees | harvestPosition(rpc, positionMint, wallet) | When fees exceed threshold |
| Rebalance | closePosition → openPosition | When position goes out of range |
TypeScript Example (Kit SDK)
Python (REST API + whirlpool-essentials)
For Python-based agent frameworks (LangChain, CrewAI, custom loops):Agent Framework Integrations
Orca SDK functions are straightforward to wrap as tools in any agent framework:LangChain / LangGraph
Wrap
fetchWhirlpool and swap as @tool functions. Use the REST API for read-only tools that don’t require a wallet.CrewAI
Define a
WhirlpoolMonitorTool and SwapExecutorTool as CrewAI tools. Assign them to specialist agents in your crew.Eliza (ai16z)
Register Orca SDK calls as Eliza actions. The REST API
/pools/search endpoint works well for on-demand pool lookups.Vercel AI SDK
Use
tool() to define Orca operations as typed tools. Pair with streamText or generateText for natural language LP management.Key SDK Pages
- Monitor Positions — fetch all positions, check in-range status and fees owed
- Execute a Swap — swap tokens programmatically
- Open Position — open a new CLMM or Splash Pool position
- Harvest Fees — collect accumulated fees without closing
- Close Position — collect fees, remove liquidity, burn NFT
- Monitor Pools — fetch pool state including current price
- Python Integration — Python patterns for agents and ML pipelines
Security Considerations
Additional recommendations:- Simulate before submitting — use quote functions (
swap,openPosition,closePosition) to verify expected outcomes before callingsendTx() - Set slippage limits — always pass a
slippageBpsvalue;100(1%) is a reasonable default for most LP operations - Use devnet first — the devnet test pool (SOL/devUSDC, tick spacing 8) is safe for end-to-end agent testing
- Handle errors gracefully — catch
InvalidTickIndex(0x177a) andNotRentExempt(0x0); see the error reference
