Skip to content

arthur-orderly/arthur-crewai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

arthur-crewai

CrewAI tools for trading perpetuals on Arthur DEX — give your crew access to perps trading.

Install

pip install arthur-crewai

Quick Start

from 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.

Configuration

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.

Available Tools

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

Example: Trading Crew

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.

Links

License

MIT

About

CrewAI tools for trading perpetual futures on Arthur DEX (Orderly Network)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages