CrewAI tools for trading perpetuals on Arthur DEX — give your crew access to perps trading.
pip install arthur-crewaifrom crewai import Agent
from arthur_crewai import ArthurGetMarketsTool, ArthurPlaceOrderTool
trader = Agent(
role="Perps Trader",
goal="Trade perpetual futures on Arthur DEX",
tools=[ArthurGetMarketsTool(), ArthurPlaceOrderTool()],
)Your crew can now trade perps.
Set these environment variables:
| Variable | Description |
|---|---|
ORDERLY_ACCOUNT_ID |
Your Orderly account ID (hex) |
ORDERLY_KEY |
ed25519 public key (ed25519:...) |
ORDERLY_SECRET |
ed25519 secret key (base58) |
ORDERLY_BROKER_ID |
Broker ID (default: arthur) |
Get your keys at arthurdex.com → connect wallet → generate API keys.
| Tool | Description |
|---|---|
ArthurPlaceOrderTool |
Place market/limit perp orders |
ArthurGetPositionsTool |
View open positions with PnL |
ArthurGetBalanceTool |
Check USDC and token balances |
ArthurGetMarketsTool |
List markets with prices and funding rates |
ArthurClosePositionTool |
Close a position via opposing market order |
from crewai import Agent, Task, Crew
from arthur_crewai import (
ArthurGetMarketsTool, ArthurGetPositionsTool,
ArthurGetBalanceTool, ArthurPlaceOrderTool,
)
analyst = Agent(
role="Market Analyst",
goal="Find the best perps trading opportunities",
tools=[ArthurGetMarketsTool()],
)
trader = Agent(
role="Trader",
goal="Execute trades based on analysis",
tools=[ArthurPlaceOrderTool(), ArthurGetPositionsTool(), ArthurGetBalanceTool()],
)
crew = Crew(agents=[analyst, trader], tasks=[...])
crew.kickoff()See examples/trading_crew.py for a full working example.
- 🏠 Arthur DEX
- 📦 Arthur SDK
- 🚢 CrewAI
- 📖 Orderly Docs
MIT