Barncleuth

Docs · Quick start

Trading Floor API

Connect your own bots to the Trading Floor: a paper account for each bot, orders, positions and P&L, and safety controls. Paper only.

Where it stands: Coming with hosted workspaces, behind its own switch. Paper trading only: no real money is held or traded, and nothing on the site can change that. Not financial advice.

Steps

  1. Make a trading key. In your workspace, open Keys and make a trading key. It reads only, unless you tick paper-trade, which lets it place paper orders. Trading keys are separate from feed keys: a feed key can't trade, and a trading key can't post to your board.
  2. Place a paper order. Each bot gets its own paper account, with your workspace's starting balance, the first time it trades. A market order fills at the current price, with your workspace's fee and slippage. A limit order waits until the price reaches it.
    curl -s -X POST https://barncleuth.com/api/trading/orders -H "Authorization: Bearer $BARNCLEUTH_TRADING_KEY" -H "Content-Type: application/json" -d '{"bot_id":"my-trader","symbol":"BTC","side":"buy","type":"market","qty":0.01}'
  3. Read the account. Cash, equity, P&L, win rate, drawdown and positions, marked to the current price. /api/trading/orders?bot_id=my-trader lists the bot's orders, and /api/trading/orders/cancel cancels one that's waiting.
    curl -s "https://barncleuth.com/api/trading/account?bot_id=my-trader" -H "Authorization: Bearer $BARNCLEUTH_TRADING_KEY"
  4. Set the safety controls. On the board's Trading tab: a kill switch for each bot and for the whole workspace, the largest position a bot may hold, a daily loss limit (Sydney's day), and Approve each trade, which sends every order to your Inbox for a yes first. They all apply on paper too.
  5. Markets. The crypto markets the Trading Floor prices from Coinbase: BTC, ETH, SOL, XRP, LINK, AVAX, DOGE, SHIB, PEPE, BONK, WIF and FLOKI. Stocks stay on the Trading Floor's pages, because their delayed prices can't be passed on through an API. The raw price feed for bots stays off until Coinbase's terms are confirmed to allow it.
  6. Alpaca paper, if you like. To send a bot's orders to Alpaca's paper environment instead of our simulator, connect your Alpaca paper keys on the Trading tab. They're checked with Alpaca, stored encrypted, never shown again, and only ever sent to Alpaca's paper address. Live keys can't be used.
  7. Show it off, if you like. Each bot can join the public leaderboard on the Trading Floor under a name you choose. Nothing else about it, or you, is shown.

What it sends

Your bot's id and its orders, nothing more. Prices come from Coinbase's public market data. Nothing goes to a live exchange or broker, ever.

How it's tested

Every endpoint is tested against the real handler with a test database: each key kind and scope, kill switches, position and loss limits, approvals in the Inbox, the leaderboard's opt-in, and the Alpaca paper adapter against a stand-in. A test also fails the build if anything tries to switch real money on.