Skip to main content

CCXT / CCXT Pro tools for Strands Agents

Project description

CCXT Tools (for Strands Agents)

A community tool package that exposes CCXT (and optional CCXT Pro) to Strands Agents via @tool wrappers.

  • Generic method calling: fetch_*, create_order, cancel_order, etc.
  • Optional real-time WebSocket streaming via ccxt.pro (watch_*).

Install

pip install ccxt-tool-strands

Optional: CCXT Pro

CCXT Pro is distributed separately by CCXT.

If you have it available in your environment, ccxt_pro_watch(...) will work. If not, the tool returns a clear ImportError message.

Tools

  • ccxt_generic(...)
    • Call any CCXT exchange method.
  • ccxt_multi_exchange_orderbook(...)
    • Compare best bid/ask across multiple exchanges.
  • ccxt_pro_watch(...)
    • Call ccxt.pro watch_* methods (bounded snapshots).

Usage in a Strands Agent

from strands import Agent

# import tools from the installed package
from ccxt_tool_strands.ccxt_generic import ccxt_generic, ccxt_multi_exchange_orderbook
from ccxt_tool_strands.ccxt_pro import ccxt_pro_watch

agent = Agent(
    model="...",
    tools=[ccxt_generic, ccxt_multi_exchange_orderbook, ccxt_pro_watch],
)

# public market data
agent.tool.ccxt_generic(action="call", exchange="bybit", method="fetch_ticker", args='["BTC/USDT"]')
agent.tool.ccxt_generic(action="call", exchange="bybit", method="fetch_ohlcv", args='["BTC/USDT","1m",null,200]')

# multi-exchange best bid/ask
agent.tool.ccxt_multi_exchange_orderbook(exchanges='["binance","bybit","okx"]', symbol="BTC/USDT")

Authentication (recommended: server-side)

Set environment variables in the agent runtime:

export CCXT_EXCHANGE=bybit
export CCXT_API_KEY=...
export CCXT_SECRET=...
# optional
export CCXT_PASSWORD=...
export CCXT_UID=...
export CCXT_TOKEN=...
export CCXT_DEFAULT_TYPE=swap   # or spot
export CCXT_SANDBOX=true        # optional

Then you can omit exchange= and call authenticated methods:

agent.tool.ccxt_generic(action="call", method="fetch_balance")

Notes

  • Secrets: do not put API keys in client-side apps; keep them in the agent/server environment.
  • Rate limits: CCXT enableRateLimit=True is enabled by default in the tool.

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ccxt_tool_strands-0.1.6.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ccxt_tool_strands-0.1.6-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file ccxt_tool_strands-0.1.6.tar.gz.

File metadata

  • Download URL: ccxt_tool_strands-0.1.6.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for ccxt_tool_strands-0.1.6.tar.gz
Algorithm Hash digest
SHA256 b8e50eb90f6d89744578f21bc300e9690e03cc3b826eb8469b2bbc2d0624fee8
MD5 88df0b55930c5c3a933e79f099ffc92b
BLAKE2b-256 ac3b9e912e859fa219191cfc7a92859837c358d939f9bbe52a046ff5e9f2bbb0

See more details on using hashes here.

File details

Details for the file ccxt_tool_strands-0.1.6-py3-none-any.whl.

File metadata

File hashes

Hashes for ccxt_tool_strands-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 7bdc5551011e5555229e12bc789dc426285ee1a8134c98c836ec3e0ecd0d7b2d
MD5 4a3a15e1b6203b8abad868d6003d50c6
BLAKE2b-256 9e26abf7babe9a3d886adac8afdf3f55cb43388cbaacc9cec0e1a3288e19f20e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page