Skip to main content
The Decibel MCP server exposes 36 tools for perpetuals, spot, and account queries. Each tool accepts a JSON input validated with Zod schemas and returns JSON results. The original market and order tools operate on perpetuals. Use get_spot_markets and the *_spot_* tools for spot; each product has its own market lookup. Spot symbols are case-insensitive and must be available on the selected network. All tools use the same server credentials and account configuration.

Trading tools

place_limit_order

Place a limit order on Decibel DEX. Returns order ID and transaction hash on success.

place_market_order

Place a market order. Executes immediately at current price with slippage tolerance.

place_stop_limit_order

Place a stop limit order. Triggers when the market reaches the stop price, then posts as a limit order at the specified price.

place_stop_market_order

Place a stop market order. Triggers when the market reaches the stop price, then executes immediately with slippage tolerance.

place_twap_order

Place a TWAP (Time-Weighted Average Price) order. Splits execution across a duration at regular intervals.

Order management tools

close_position

Close an open position. Places a reduce-only market order in the opposite direction. Supports partial closes.

cancel_order

Cancel an open order by order ID.

cancel_all_orders

Cancel all open orders. Optionally filter by market.

cancel_twap_order

Cancel an active TWAP order by order ID.

place_tp_sl

Set take-profit and/or stop-loss for an existing position. Omit size fields to apply to the full position.

cancel_tp_sl

Cancel a TP/SL order for a position.

Account query tools

get_positions

Get all open positions for the account. No parameters required.

get_orders

Get all open orders for the account. No parameters required.

get_balances

Get account balances including wallet USDC, trading account value, and margin info. No parameters required.

get_active_twaps

Get all active TWAP orders for the account. No parameters required.

get_trade_history

Get recent trade fill history.

get_order_history

Get order history for the account (all states including filled, cancelled, etc.).

get_twap_history

Get TWAP order history (completed and cancelled TWAPs).

get_funding_history

Get funding rate payment history.

get_tp_sl

Get all TP/SL orders for a market position, including position-level and fixed-size TP/SL orders.

Market data tools

get_markets

List all available perpetual markets on Decibel DEX with their configurations. No parameters required. Use get_spot_markets for spot. Returns { markets }. Each market includes name, address, maxLeverage, mode, sizeDecimals, and priceDecimals. tickSize is normalized to price units; minSize and lotSize are normalized to base-asset units, matching order inputs. rawTickSize, rawMinSize, and rawLotSize are on-chain integers and must not be used directly as order sizes or prices.

get_price

Get current price, funding rate, and open interest for a market.

get_orderbook

Get the order book (bids and asks) for a market.

Configuration tools

set_leverage

Set leverage for a market.

set_margin_type

Switch margin type for a market between cross and isolated. Preserves current leverage.

Spot order behavior

Spot tools accept buy and sell, not long or short. Sizes are in base-asset units and prices in quote-asset units per base unit. Spot has no leverage, margin settings, position closing, reduce-only, stop, TP/SL, TWAP, or client order ID parameters. Use the normalized tickSize, minSize, and lotSize from get_spot_markets to check order inputs.

Tick alignment and IOC execution

Both spot placement tools align prices to the market tick down for buys and up for sells. This never crosses the requested limit or slippage bound. A price that rounds to zero is rejected before submission. Conservative rounding can leave an IOC order unfilled, especially at zero slippage or with a coarse tick; a successful transaction is not proof of a fill. Spot market orders are IOC limit orders, not a separate on-chain market order type. They fill immediately, partially fill and cancel the remainder, or cancel without filling. They never rest in get_spot_orders. Use get_spot_trade_history for fills and get_spot_order_history for the final state.

Queued placement

Both placement tools can return pendingCbs: true: the transaction succeeded, but funding is queued behind a rate-limited collateral withdrawal and the order is queued, not placed. Do not report it as filled or resting, and do not submit a duplicate order just because it is absent from open orders.
Track the returned orderId with get_spot_order_history for its final state and get_spot_trade_history for fills. GTC/post-only orders can also appear in get_spot_orders once they rest. An empty open-orders list cannot distinguish a queued IOC order from one that has already filled or cancelled. Queued orders are absent from the open-orders feed and cannot be found by cancel_all_spot_orders. They may execute when the withdrawal completes. Use cancel_spot_order with the returned order ID to cancel one explicitly.

Spot trading tools

place_spot_limit_order

Place a spot limit order. Returns placement status, order ID, and transaction hash; handle pendingCbs as described in queued placement. Example input to buy 10 APT at a limit of 5.20 USDC per APT:

place_spot_market_order

Place an IOC limit order at a slippage-adjusted price. The reference price is the midpoint of a two-sided order book, falling back to the asset-context midpoint and then the last trade. A one-sided book is ignored as a reference; the tool fails rather than guessing if no positive reference price is available. Use place_spot_limit_order with an explicit price in that case. The buy cap is referencePrice * (1 + slippage / 100) and the sell floor is referencePrice * (1 - slippage / 100), followed by side-safe tick alignment. Sell slippage must be at least zero and below 100%, since 100% gives an invalid zero price. Returns the placement result plus referencePrice and the actual tick-aligned limitPrice, both in quote-asset units. A buy reserves size * limitPrice of the quote asset; do not size against the reference price alone. As with limit orders, pendingCbs: true means queued rather than placed.

cancel_spot_order

Cancel a spot order by ID, including one queued behind a collateral withdrawal. Returns { success, transactionHash } on success.

cancel_all_spot_orders

Cancel open spot orders in repeated passes so orders beyond one pagination window can come into view. Optionally filter by spot market. Perpetual orders are not touched, and orders already cancelled during the run are not resubmitted. Returns { cancelled, failed, total }, counting distinct attempted orders. Check failed before reporting success. Cancellation errors can occur after partial progress:
  • Incomplete: The sweep could not finish or confirm the remaining orders, for example because the indexed open-orders feed still shows cancelled orders. Report the confirmed cancellation count from the error and re-run to continue; do not report full completion.
  • Unreachable: The symbol filter is applied client-side. If other markets’ orders fill the pagination window, remaining matching orders cannot be reached. Report the cancellation count from the error and cancel remaining orders individually by ID. Re-running with the same filter reads the same window. Do not silently remove symbol, which would cancel the user’s orders on other spot markets.
This tool cannot find pendingCbs orders because they are absent from the open-orders feed. A successful sweep does not mean the account has no live orders or holdings. Cancel queued orders explicitly with cancel_spot_order.

Spot account query tools

These tools need a configured subaccount address but no signing key. They return only spot account data.

get_spot_orders

Get resting spot orders, following pagination. No parameters required. Returns { orders, truncated }. When truncated is true, the API pagination window limits the listing; do not report it as the complete set. Queued orders and IOC orders are absent, so an empty list is not evidence that there are no live orders or that an IOC filled.

get_spot_balances

Get spot holdings, open-order reservations, and lifetime activity. No parameters required. Each position’s entryNotionalUsd is the recorded total cost basis, not a per-unit average cost. Lifetime metrics can remain available when there are no current holdings. Missing spot enrichment returns empty holdings/reservations rather than an error.

get_spot_trade_history

Get recent spot trade fills, including fills from IOC orders. Returns { trades }.

get_spot_order_history

Get spot order history across all order states, including filled and cancelled orders. Use this to track the final state of queued and IOC orders. Returns { orders }.

Spot market data tools

These tools only require a Node API key, not an account or signing key.

get_spot_markets

List available spot markets. No parameters required. Returns { markets }; each market contains: Use the normalized constraints to check order inputs. Do not pass raw chain integers as order sizes or prices. Spot markets have no leverage.

get_spot_price

Get last/mid price and 24-hour statistics for a spot market. Returns symbol, marketAddress, lastPrice, midPrice, prevDayPrice, change24hPct, high24h, low24h, volume24hBase, volume24hQuote, baseAssetAddress, and quoteAssetAddress. midPrice is null unless both book sides have resting liquidity. lastPrice, high24h, and low24h are null without a trade in the last 24 hours. change24hPct is in percentage units (5 means +5%) and is null without a last price or usable previous-day baseline. Preserve these nulls rather than presenting them as zero. Spot has no funding rate, open interest, mark price, or oracle price.

get_spot_orderbook

Fetch a spot orderbook snapshot via WebSocket. Returns symbol, bids, asks, bestBid, bestAsk, spread, and spreadPercent. A missing book side has a null best price, and spread values are null unless both sides are available. The tool fails if no snapshot arrives within 10 seconds.