Skip to main content

CCXT / CCXT Pro tools for Strands/DevDuck

Project description

ccxt-tool-strands

CCXT + (optional) CCXT Pro tools for Strands/DevDuck.

This repo ships Strands @tool wrappers that let your agent call any CCXT exchange method (fetch_*, create_order, etc.) via a single tool entrypoint.

What’s inside

  • tools/ccxt_generic.py
    • ccxt_generic(...) — call any ccxt exchange method (sync)
    • ccxt_multi_exchange_orderbook(...) — compare best bid/ask across exchanges
    • ccxt_pro_watch(...) — call ccxt.pro watch_* methods (optional)

Install

Base (CCXT)

pip install ccxt-tool-strands

This installs:

  • ccxt
  • strands-agents (provides the strands Python module)

Optional: CCXT Pro (WebSocket / watch_*)

CCXT Pro (real-time WebSocket watch_*) is shipped as a separate distribution by CCXT and is not reliably installable from public PyPI.

This tool will try to import ccxt.pro (recommended). If you have CCXT Pro installed in your environment, ccxt_pro_watch(...) works. Otherwise it returns a clear ImportError message.

See CCXT Pro docs: https://github.com/ccxt/ccxt/wiki/ccxt.pro.manual

Using with DevDuck / Strands

Assuming your agent loads tools from ./tools (DevDuck default when DEVDUCK_LOAD_TOOLS_FROM_DIR=true).

Public calls

ccxt_generic(action="call", exchange="bybit", method="fetch_ticker", args='["BTC/USDT"]')
ccxt_generic(action="call", exchange="bybit", method="fetch_ohlcv", args='["BTC/USDT","1m",null,200]')
ccxt_generic(action="list_methods", exchange="bybit")

Authenticated calls (server-side env)

Set environment variables:

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:

ccxt_generic(action="call", method="fetch_balance")

CCXT Pro watch example

ccxt_pro_watch(
  exchange="bybit",
  method="watch_ticker",
  args='["BTC/USDT"]',
  max_messages=3,
  max_seconds=15,
)

Notes

  • Outputs redact common secret fields.
  • enableRateLimit=True by default.
  • Browser-side API keys are unsafe; keep keys server-side.

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.0.tar.gz (38.4 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.0-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ccxt_tool_strands-0.1.0.tar.gz
  • Upload date:
  • Size: 38.4 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.0.tar.gz
Algorithm Hash digest
SHA256 6d8cd744e517944d6985fac837476ac140e9d5fa49e8ad594fb26a3d1e21e246
MD5 47bc3f75ec5af3bb08de233b840f3ccd
BLAKE2b-256 c9bdfa4f23543f321c1ce7a41b8b04d0222136ecd95a62558a20dc403a7ed636

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ccxt_tool_strands-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3ed4344f48e18b4e17fe8056a5f74cca5b3859f2d7238745488736c7ead174ec
MD5 e75e0226271fe39f2ed8048085478c4f
BLAKE2b-256 2cc980bfeb4d5011149f26491b7b699d7bfb2e64b21709c82e6a150fc4ca28b5

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