From MazeLedger Bots
Use when building or operating spot/futures trading bots on the MazeLedger Bot Trading API (ZebPay execution). Covers onboarding, API keys, registering end-users with their own keys, placing/closing spot & futures orders, reading balances/positions, history & stats, the bundled MCP tools, and sandbox-vs-live. Examples: "build a bot that DCAs into BTC", "place a futures order for a user", "how do I onboard to MazeLedger", "use the trading MCP", "close a position".
How this skill is triggered — by the user, by Claude, or both
Slash command
/mazeledger-bots:mazeledger-trading-apiThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Build trading bots that place **spot (INR)** and **futures (USDT-M)** orders via the MazeLedger API. You write the
Build trading bots that place spot (INR) and futures (USDT-M) orders via the MazeLedger API. You write the bot logic + UI; MazeLedger handles execution, risk caps, idempotency, audit, and a sandbox. Each end-user brings their own ZebPay API keys (BYO) — MazeLedger never custodies funds.
Base URL: https://mazeledger.ai · Auth: x-api-key header.
Don't assume defaults. Gather and confirm these before acting; if any is missing or ambiguous, ask the user — do not guess:
endUserId).notionalUsd / quantity / amountInr), and that it fits the org risk caps + exchange MIN_NOTIONAL.clientOrderId per order; how positions are tracked and closed.Always start in sandbox (ml_test_…). Never place a live order without the user's explicit go-ahead. The API independently validates hard requirements and rejects bad or over-cap orders (400 / 422 with a reason) — surface those rejections to the user as the next thing to fix. (/build-bot runs this same intake as a guided flow.)
mazeledger-bots, authed with your configured API key):
list_symbols — MIN_NOTIONAL / precision for a symbolget_account — balanceget_positions — open positionsplace_futures_order — place a futures orderclose_position — close a position (reduce-only)validate_bot — validate/derive a Strategy Spec from a description (returns spec or questions)create_bot — create a managed bot for an end-user (paper + paused; resume to start)list_bots / resume_bot / pause_bot — manage bots
Sandbox keys (ml_test_…) simulate; live keys (ml_live_…) place real orders.Managed bots (POST /api/v1/bots, or the create_bot tool): create a bot for a registered
end-user from a natural-language strategy. Created paper + paused — resume to evaluate
(simulated). Call validate_bot first; it returns the spec or asks for missing details. Autonomous
live execution is gated separately — see docs/v4/MANAGED-BOTS.md.
POST /api/v1/onboarding/organizations { "name": "Acme", "country": "IN" }
-> first sandbox key (ml_test_…)
POST /api/v1/organizations/{id}/exchange-connections { "apiKey": "...", "apiSecret": "..." } # or per end-user
POST /api/v1/organizations/{id}/risk-acknowledgment { "acknowledge": true } # activates live
POST /api/v1/organizations/{id}/api-keys { "mode": "live" } # mint a live key
Put the key in the plugin config (api_key). Start with a sandbox key — no money, no credentials.
POST /api/v1/users { "externalUserId": "user-123", "apiKey": "...", "apiSecret": "...", "label": "Jane" }
GET /api/v1/users # list + count
GET/DELETE /api/v1/users/{externalUserId}
Then pass endUserId on any trading call to route to that user's credentials.
POST /api/v1/futures/orders
{ "endUserId": "user-123", "symbol": "DOGEUSDT", "side": "BUY", "type": "MARKET",
"notionalUsd": 6, "leverage": 5, "clientOrderId": "idem-key" } # or "quantity"
GET /api/v1/futures/orders/{id}
GET /api/v1/futures/positions?endUserId=
POST /api/v1/futures/positions/{id}/close?endUserId=
GET /api/v1/futures/account?endUserId=
GET /api/v1/exchange/symbols?symbol=DOGEUSDT
POST /api/v1/spot/orders
{ "endUserId": "user-123", "symbol": "BTC", "side": "buy", "amountInr": 500 } # market buy
{ "symbol": "BTC", "side": "sell", "quantity": 0.001 } # market sell
{ "symbol": "BTC", "side": "buy", "type": "LIMIT", "quantity": 0.001, "priceInr": 5000000 }
GET /api/v1/spot/orders/{id} ; GET /api/v1/spot/account
GET /api/v1/orders?externalUserId=&status=&limit= # org-wide history
GET /api/v1/users/{externalUserId}/orders # per-user history
GET /api/v1/stats # users, orders total/today, by status, by market
A "bot" is your logic calling these primitives on a schedule/signal. Typical loop:
list_symbols / get_account to size the order.place_futures_order / POST /spot/orders with a stable clientOrderId (idempotent).get_positions / GET /orders / /stats; close_position on exit.Example bot ideas: DCA (recurring small buys), grid (laddered limits), TP/SL manager (watch positions, close on target), copy-trading (mirror a signal across users).
ml_test_… with zero risk, then a live key.max_order_usd, max_daily_notional_usd, max_leverage, max_open_positions,
plus exchange minimums. A breach returns 422 RISK_CAP_REJECTED with a reason.clientOrderId. Ambiguous failures are recorded unknown, never lost —
re-query status/positions before retrying.Full reference + OpenAPI: https://mazeledger.ai/docs and https://mazeledger.ai/api/openapi.
Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub mythyaverse/mazeledger-plugins --plugin mazeledger-bots