Skip to main content
Glama
trustxai

amazing-binance-mcp

by trustxai

binance_place_twap_order

Place a spot TWAP algo order on Binance to split a large trade into smaller sub-orders over a set duration, reducing price impact versus one market order.

Instructions

Place a REAL spot TWAP algo order on Binance. This spends real money.

Calls POST /sapi/v1/algo/spot/newOrderTwap (SIGNED, UID weight 3000 of a 180,000/min budget — call it sparingly). Binance splits quantity into sub-orders and works them over duration seconds, aiming at the time-weighted average price instead of taking the book in one hit.

Kill-switch. This call is refused with Error: … trading is disabled … unless the server runs with BINANCE_ALLOW_TRADING=1. The gate lives in the HTTP client, so no tool can bypass it. If you see that error, the operator has deliberately put the server in read-only mode — report it, do not try to work around it.

Binance's own constraints, all rejected server-side if broken:

  • duration 300-86400 seconds (5 minutes to 24 hours) — checked locally too.

  • Minimum notional ≈ 1,000 USDT equivalent per algo order (the docs also quote a per-symbol maximum of 200k / 2mm / 10mm; let the API arbitrate the ceiling).

  • At most 20 open algo orders at a time — check with binance_get_open_algo_orders before adding another.

  • client_algo_id, when supplied, must be exactly 32 characters.

success: true means ACCEPTED, NOT EXECUTED. The response carries no fill information at all; it only says Binance took the order. What actually traded is visible through binance_get_open_algo_orders, binance_get_algo_order_history and binance_get_algo_sub_orders.

When to Use:

  • Working a position that is large relative to the book, where a single MARKET order would move the price against you.

  • Spreading an entry or exit over minutes or hours on purpose.

When NOT to Use:

  • For an ordinary immediate or resting order — use binance_place_order (spot_orders.py); it is weight 1, not 3000, and has no notional floor.

  • Below ~1,000 USDT of notional — the API rejects it; place a normal order instead.

  • For USDⓈ-M / COIN-M futures TWAP or VP — that is a different product on a different wallet and this server does not implement it.

Returns: A confirmation echoing exactly the four fields Binance returned — clientAlgoId, success, code, msg — plus an explicit note that the order is accepted and not executed, and which tool to poll. A success: false body (Binance answers those with HTTP 200) is rendered as Error: <msg> (code <code>), never as a confirmation.

Examples: params = {"symbol": "BTCUSDT", "side": "BUY", "quantity": "0.5", "duration": 3600} params = {"symbol": "BTCUSDT", "side": "SELL", "quantity": "1.25", "duration": 7200, "limit_price": "65000.00", "client_algo_id": "abcdefghijklmnopqrstuvwxyz012345"}

Error Handling:

  • Error: … trading is disabled … → the kill-switch is off; nothing was sent.

  • A duration outside 300-86400 or a 31-character client_algo_id fails locally, before anything is signed.

  • -2010 / -1013 point at balance, the notional floor or a symbol filter; -2015 means the key lacks Spot & Margin Trading permission or this IP is not allowlisted.

  • A 5xx or a timeout means the execution status is UNKNOWN — the algo order may well be live. Check binance_get_open_algo_orders (and binance_get_algo_order_history) before doing anything else. NEVER resend blindly: a duplicate TWAP is a second position, and each one eats one of the 20 slots.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A5/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description goes far beyond the annotations by disclosing the signed endpoint and UID weight 3000 rate limit, the BINANCE_ALLOW_TRADING=1 kill-switch and its non-bypassable gate, and the crucial fact that success:true means ACCEPTED, NOT EXECUTED. It also covers ambiguous outcomes on 5xx/timeout, duplicate-order risk, and what tools to poll for actual fills.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Although long, the description is exceptionally well-structured with clear headings (kill-switch, constraints, success semantics, when to use, returns, examples, error handling) and front-loads the most critical warning ('spends real money'). Every section earns its place by providing operational guidance a model needs to call this high-stakes tool safely.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a real-money trading tool with no idempotency and ambiguous failure modes, the description is comprehensive: it covers constraints, rate limits, safety gates, response semantics, polling paths, error codes, and timeout behavior. An agent has everything needed to avoid blind resends and to route to the correct polling tools.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Even though the schema has some property descriptions, the description adds material runtime meaning: duration is checked locally, quantity is sent verbatim with a ~1,000 USDT notional floor, limit_price changes sub-orders to LIMIT vs market, and client_algo_id enables traceable retries and must be exactly 32 characters. These behavioral details are not present in the schema alone.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with 'Place a REAL spot TWAP algo order on Binance. This spends real money,' naming a specific verb, resource, and order type. It further distinguishes from siblings by explicitly saying when NOT to use it (use binance_place_order for ordinary orders, and futures TWAP is a different product).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Includes dedicated 'When to Use' and 'When NOT to Use' sections with explicit conditions: large orders relative to the book, intentional spreading over time, notional below ~1,000 USDT, and futures products. It also names the alternative tool (binance_place_order) and tells the agent to check binance_get_open_algo_orders before exceeding the 20-open-algo-order limit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools