FBYT for developers · API · MCP · Webhooks

Crypto trading API and MCP server for AI trading agents

FBYT has a public REST API, an MCP server and signed webhooks. Money managers use them to run their vaults from their own code or an AI agent such as Claude, Codex or Cursor: spot swaps, conditional orders, strategy bots, lending, perps and reporting. A key can trade a vault’s funds but cannot send them to an outside wallet.

For money managers on FBYT. One API key, created in the app, works for all three.

  • REST API

    https://api.fbyt.io

    106 endpoints, key in X-API-Key

  • MCP server

    https://mcp.fbyt.io/mcp

    64 tools for your AI agent

  • Webhooks

    POST /api/bot/webhooks

    57 events, HMAC-SHA256 signed

REST API

Try the FBYT API with a real request

Pick a route and send it. The answer comes from the live API, the same one your code calls. These routes need no key; every other route takes the API key you create in the app.

The platform halt: while it is on, trades, lends and perps writes get 503. Public, no key.

GEThttps://api.fbyt.io/api/bot-trading/halt
Response
Press Send to call the live API.
Base URL
https://api.fbyt.io
Authentication
X-API-Key: fbyt_… on every request. Scopes read, trade, lend and perps. How keys work
Rate limits
60 requests a minute, 20,000 a day and 1,000 writes a day per key. Webhooks do not count.
Amounts
Raw base units as strings, so large values stay exact. A token field takes its symbol or its mint. Units

With your API key: quote, then trade

A quote shows the expected output and the trading fee and trades nothing. The trade carries an idempotency key, so a retry after a timeout never trades twice. Spot trading guide

The vaults this key can act on (read scope)
curl https://api.fbyt.io/api/bot/vaults \
  -H "X-API-Key: fbyt_your-secret-here"
Quote: sell 0.5 SOL for USDC, trades nothing (read scope)
curl "https://api.fbyt.io/api/bot/vaults/YOUR_VAULT/quote?inputMint=SOL&outputMint=USDC&amount=500000000&slippageBps=50" \
  -H "X-API-Key: fbyt_your-secret-here"
Trade it, safe to retry with the same key (trade scope)
curl -X POST https://api.fbyt.io/api/bot/vaults/YOUR_VAULT/trade \
  -H "X-API-Key: fbyt_your-secret-here" \
  -H "Content-Type: application/json" \
  -d '{
    "inputMint": "SOL",
    "outputMint": "USDC",
    "amount": "500000000",
    "slippageBps": 50,
    "idempotencyKey": "rebal-2026-12-04-sol-usdc"
  }'

MCP server

Run an AI trading agent with the FBYT MCP server

Add the FBYT MCP server to Claude, Codex, Cursor or any MCP client, and your agent can read vault state, trade, manage orders and bots, lend, trade perps and report: 64 tools, one API key.

In a terminal. Runs the server on your machine.

claude mcp add --transport stdio fbyt --env FBYT_API_KEY=fbyt_xxx -- npx -y @fbyt/mcp-server

Guardrails for an AI trading agent

How much an AI agent can do on FBYT depends on the API key you give it. A FBYT key can trade a vault’s funds but cannot send them to an outside wallet. Five controls narrow it further:

  1. Start read-only. A key with only the read scope lets the agent report and analyse, but not trade.

  2. Approve each write. Set your MCP client to ask before every tool that changes something.

  3. Check before sending. Swaps take a quote and perps orders a dry run, so the agent can show you the result first.

  4. Limit what a key can reach. Give the key only the vaults it should trade. Every key is capped at 1,000 writes a day.

  5. Watch with webhooks. Fills, failures, margin warnings and low gas reach your endpoint within seconds.

  • Locally the server runs with npx and reads the key from FBYT_API_KEY. The hosted server at mcp.fbyt.io takes it as a Bearer token on each request and does not store it.
  • A key that requires signed requests works only with the local server, so the signing key never leaves your machine.
  • Every tool, its scope and example prompts are in the MCP guide.
AI assistant· FBYT MCP connected

Is my Momentum vault ready for the bot? Check gas too.

Usedfbyt_list_vaultsfbyt_get_vault

Momentum is Active, the execution wallet is set as its trading delegate, and the platform halt is off. The execution wallet holds 0.042 SOL, enough for about 20 trades at recent costs. Top it up before you start a grid bot.

Quote selling 0.5 SOL for USDC. Trade only if the fee is under $0.50.

Usedfbyt_get_quote

The quote returns 71.2 USDC with a trading fee of $0.28, under your limit. Send the swap?

Yes, send it.

Usedfbyt_execute_trade

Sent with the idempotency key rebal-sol-usdc-1, so a retry cannot trade twice. It confirmed: 0.5 SOL out, 71.19 USDC in.

Example conversation. The vault and the figures are illustrative, not live data.

What your agent can do

64 tools in 8 groups. Tools that change something are marked: set your MCP client to ask you before each of them.

Changes something

Vault state and quotes

7 tools
  • fbyt_whoamiThe key: owner, scopes, vault limit, rate limits
  • fbyt_list_tokensTradable tokens with current prices
  • fbyt_list_vaultsThe vaults this key can act on
  • fbyt_get_vaultHoldings, execution wallet and readiness
  • fbyt_list_tradesExecuted trades
  • fbyt_get_quoteExpected output and the trading fee
  • fbyt_get_halt_statusIs trading halted platform-wide?

Spot trading and lending

6 tools
  • fbyt_execute_trade (changes something)Swap now, with an idempotency key
  • fbyt_list_lending_reservesLending pools and their rates
  • fbyt_get_lending_reserve_ratesOne pool’s rate history
  • fbyt_get_lending_positionsA vault’s lending positions
  • fbyt_lend (changes something)Lend a vault token now
  • fbyt_take_back (changes something)Take a loan back now

Conditional orders

5 tools
  • fbyt_list_ordersStanding orders
  • fbyt_list_order_executionsOrder executions
  • fbyt_create_order (changes something)Limit, stop-loss, take-profit or recurring
  • fbyt_update_order (changes something)Pause, resume or re-tune
  • fbyt_cancel_order (changes something)Cancel an order

Strategy bots

11 tools
  • fbyt_list_botsA vault’s bots
  • fbyt_get_botOne bot, its runs, levels or profit
  • fbyt_get_pair_priceLive pair price for a grid
  • fbyt_get_bot_network_feeAverage network fee of bot trades
  • fbyt_create_dca_bot (changes something)Create a DCA bot
  • fbyt_create_grid_bot (changes something)Create a grid bot
  • fbyt_create_rebalance_bot (changes something)Create a rebalancing bot
  • fbyt_update_dca_bot (changes something)Start, stop or change a DCA bot
  • fbyt_update_grid_bot (changes something)Start, stop or change a grid bot
  • fbyt_update_rebalance_bot (changes something)Start, stop or change a rebalancing bot
  • fbyt_delete_bot (changes something)Delete a stopped bot

Perps on Phoenix

17 tools
  • fbyt_get_perps_accountPositions, margin, totals, server orders
  • fbyt_list_perps_historyFills and funding payments
  • fbyt_get_perps_requestA write by its idempotency key
  • fbyt_get_perps_marketMarkets, order book, candles, funding
  • fbyt_perps_market_order (changes something)Market order, optional TP/SL
  • fbyt_perps_limit_order (changes something)Limit order, post-only or reduce-only
  • fbyt_perps_scale_order (changes something)A ladder of 2 to 64 limits
  • fbyt_perps_twap_order (changes something)TWAP order
  • fbyt_perps_isolated_order (changes something)Isolated-margin order
  • fbyt_perps_trigger_order (changes something)Stop or entry, held by the server
  • fbyt_perps_pegged_order (changes something)Limit chaser, repriced by the server
  • fbyt_perps_cancel (changes something)Cancel orders, TWAP, TP/SL
  • fbyt_perps_set_tpsl (changes something)Set or replace a position’s TP/SL
  • fbyt_perps_set_stop (changes something)One side of a TP/SL
  • fbyt_perps_close_position (changes something)Close a position
  • fbyt_perps_isolated_margin (changes something)Add or remove isolated margin
  • fbyt_perps_collateral (changes something)Move collateral to or from the vault

Stats and reporting

4 tools
  • fbyt_get_vault_statsReturns, risk, PnL, volume, entry prices
  • fbyt_list_vault_activityFees, investors, deposits, withdrawals
  • fbyt_get_manager_statsYour vaults in one summary, fees earned
  • fbyt_get_platform_statsPlatform-wide totals

Execution wallet

4 tools
  • fbyt_get_execution_walletStatus, SOL balance and history
  • fbyt_create_execution_wallet (changes something)Create the vault’s execution wallet
  • fbyt_report_execution_wallet_top_up (changes something)Record a SOL top-up
  • fbyt_withdraw_execution_wallet (changes something)Send its SOL back to the manager

Webhooks

10 tools
  • fbyt_list_webhook_event_typesEvent types
  • fbyt_list_webhooksYour endpoints
  • fbyt_get_webhookOne endpoint
  • fbyt_list_webhook_deliveriesDelivery log
  • fbyt_create_webhook (changes something)Create an endpoint
  • fbyt_update_webhook (changes something)Change or switch on an endpoint
  • fbyt_delete_webhook (changes something)Delete an endpoint
  • fbyt_rotate_webhook_secret (changes something)Rotate the signing secret
  • fbyt_send_webhook_test (changes something)Send a test event
  • fbyt_redeliver_webhook (changes something)Send a delivery again

Webhooks

Signed webhooks instead of polling

Register an HTTPS endpoint and FBYT sends each event to it as a signed JSON POST within seconds: 57 event types, from a filled order to a margin warning. Up to 10 endpoints per key, each limited to the vaults you choose.

Orders and trades

8 events
  • order.created
  • order.updated
  • order.paused
  • order.resumed
  • order.cancelled
  • order.executed
  • order.failed
  • trade.executed

Strategy bots

8 events
  • bot.created
  • bot.updated
  • bot.started
  • bot.stopped
  • bot.deleted
  • bot.executed
  • bot.waiting
  • bot.failed

Perps

20 events
  • perps.order.placed
  • perps.order.filled
  • perps.order.cancelled
  • perps.order.failed
  • perps.trigger.fired
  • perps.trigger.failed
  • perps.pegged.repriced
  • perps.pegged.filled
  • perps.tpsl.triggered
  • perps.twap.completed
  • perps.twap.cancelled
  • perps.position.opened
  • perps.position.closed
  • perps.position.liquidated
  • perps.margin.warning
  • perps.funding.paid
  • perps.collateral.deposited
  • perps.collateral.withdrawn
  • perps.exit.requested
  • perps.market.delisted

Lending

3 events
  • lending.supplied
  • lending.redeemed
  • lending.rate.changed

Vault

6 events
  • vault.deposit
  • vault.withdrawal
  • vault.daily_snapshot
  • vault.fees.charged
  • vault.fees.claimable
  • vault.stray_tokens.received

Wallet and access

7 events
  • execution_wallet.low_balance
  • execution_wallet.topped_up
  • execution_wallet.withdrawn
  • trading_delegate.revoked
  • api_key.created
  • api_key.revoked
  • api_key.rejected

Platform and webhooks

5 events
  • platform.trading_halted
  • platform.trading_resumed
  • webhook.test
  • webhook.disabled
  • webhook.endpoint_updated
An event, as your endpoint receives it
POST /fbyt HTTP/1.1
Content-Type: application/json
FBYT-Signature: t=1764756000,v1=5f2b…c9a1
FBYT-Event-Id: 6b1e0c4a-8f2d-4e7b-9c3a-1d5f7e9b2a4c
FBYT-Event-Type: order.executed

{
  "id": "6b1e0c4a-8f2d-4e7b-9c3a-1d5f7e9b2a4c",
  "type": "order.executed",
  "createdAt": "2026-12-03T10:00:00.000Z",
  "apiVersion": "2026-12-03",
  "vault": "YOUR_VAULT_ADDRESS",
  "data": {
    "order": { "orderType": "stop_loss", "status": "filled", "…": "…" },
    "signature": "3pQx…",
    "priceUsd": "131.20",
    "amountIn": "1500000000",
    "amountOut": "196800000",
    "final": true
  }
}
Verify the signature (Node.js)
import crypto from "node:crypto";

// HMAC-SHA256 over "<t>.<raw body>", keyed with the whole whsec_ secret.
function verify(header, rawBody, secret) {
  const parts = header.split(",").map((p) => p.trim().split("="));
  const t = Number(parts.find(([k]) => k === "t")?.[1]);
  if (!Number.isInteger(t) || Math.abs(Date.now() / 1000 - t) > 300) return false;
  const expected = crypto.createHmac("sha256", secret).update(`${t}.`).update(rawBody).digest();
  return parts
    .filter(([k, v]) => k === "v1" && /^[0-9a-f]{64}$/.test(v ?? ""))
    .some(([, v]) => crypto.timingSafeEqual(Buffer.from(v, "hex"), expected));
}

Refuse a timestamp more than 300 seconds from your clock and compare in constant time. Python, the full event catalogue and every field are in the webhooks guide.

At least once

The event id stays the same on every retry. Drop an id you have already handled.

Retries for 24 hours

A failed delivery is sent again with a growing delay, up to an hour apart, for a day.

Public HTTPS only

Endpoints must resolve to public addresses, checked again at each delivery. Redirects are not followed.

Switched off when dead

An endpoint that fails 20 times in a row over 6 hours is switched off. Switch it on again once it is fixed.

Safety

How the API protects investor funds

A key, a bot or an agent can trade a vault’s funds but cannot send them to an outside wallet. It can still lose value through trades, slippage or a liquidated perps position, so give each key only the scopes and vaults it needs.

Funds stay in the vault

On FBYT, trades, lends and perps orders only move funds between the vault and positions it holds. No route sends vault tokens or SOL to an outside address. The execution wallet’s gas SOL can only go back to the manager.

Scopes and vault limits

Each key carries only the scopes you tick: read, trade, lend, perps. A key can be limited to some of your vaults, and every vault route checks that you manage the vault.

Signed requests and an IP allowlist

Optionally, a key can require an Ed25519 signature on every request, over the method, path, body, time and a one-time nonce, and accept calls only from the IPs you list.

Idempotency and dry runs

Writes take an idempotency key, so a retry never trades twice. One action runs per vault at a time. Perps orders take a dry run, and swaps a quote.

Fixed limits and an audit log

Rate limits are the same for every key and cannot be changed through the API. Every request, accepted or refused, goes into the key’s audit log, which you read in the app.

Revoke a key, halt the platform

Revoke a key in the app and its next request is refused. That does not stop the bots and orders it created: stop them in the app as well. While the platform halt is on, new trades, lends and perps orders are refused. Its state is public at /api/bot-trading/halt.

What stays in the app

Anything that needs a wallet signature. Do these once in the app, then the API does the rest.

  • Register as a manager, create or close a vault
  • Accept the Automated Trading terms
  • Create, list and revoke API keys
  • Authorize the trading delegate
  • Enable or disable perps
  • Claim management and performance fees
  • Investor deposits and withdrawals

Use of the API, the MCP server and any bot or AI agent you connect is governed by the Automated Trading, Conditional Orders and API Terms. You are responsible for what your code and your agents do with your key. The vault program was audited by IronNode Security in November 2026 (see Security); report a vulnerability to [email protected]. Page last reviewed .

FAQ

Questions about the FBYT API, MCP and webhooks

Can an AI agent trade crypto on FBYT?

Yes. An AI agent can trade crypto when it has access to a trading API, often through an MCP server. On FBYT, a money manager can connect an AI trading agent such as Claude, Codex or Cursor to their vault through the FBYT MCP server and an API key. The agent can read the vault, quote and execute swaps, manage orders and strategy bots, lend and trade perps. It cannot send the vault’s funds to an outside wallet. Start with a read-only key, and set the MCP client to ask you before each trade.

Who can use the FBYT API?

The FBYT API is for money managers on FBYT. It acts on the vaults that the key’s owner manages. Register as a manager and create a vault in the app, accept the Automated Trading terms, then create an API key there. Investors do not need the API: they deposit and withdraw in the app.

Can an API key or an AI agent withdraw investor funds?

No. On FBYT, trades, lends and perps orders only move funds between the vault and positions it holds. No route sends vault tokens or SOL to an outside address. The one withdrawal in the API returns the execution wallet’s SOL, which pays for gas, to the vault’s manager. Investor deposits and withdrawals happen only in the app, signed by the investor’s wallet.

Does FBYT have an MCP server?

Yes. The FBYT MCP server (@fbyt/mcp-server on npm) gives an AI agent 64 tools over the API, and works with any MCP client. Claude Code, Codex CLI, Cursor and Claude Desktop run the server locally with npx and read the key from the environment. Clients with remote MCP support can use the hosted server at mcp.fbyt.io/mcp and send the key as a Bearer token. Keys that require signed requests work only with the local server, so the signing key never leaves your machine.

Is it safe to let an AI agent trade crypto?

An AI agent can make bad trades quickly, so limit what it can do. On FBYT, an agent’s API key can trade a vault’s funds but never send them to an outside wallet. Start with a read-only key, set your MCP client to ask before every trade, check swaps with a quote and perps orders with a dry run, and limit the key to one small vault. Every key is capped at 1,000 writes a day, and webhooks report each fill and failure.

Can I test without risking funds?

FBYT runs on Solana mainnet, and there is no separate test network. A swap quote and a perps dry run check an action and its cost without sending it. Start with a read-only key, then a key limited to one small vault.

What can the API not do?

The FBYT API cannot do anything that needs a wallet signature. These stay in the app: registering as a manager, creating or closing a vault, accepting the terms, creating and revoking API keys, authorizing the trading delegate, enabling perps, claiming fees, and investor deposits and withdrawals.

What are the rate limits?

Each FBYT API key can make 60 requests a minute, 20,000 a day and 1,000 writes a day. The limits are the same for every key and cannot be changed through the API. Webhook deliveries do not count against them. Apart from these request limits, the platform sets no limit on trade size.

How do I check that a webhook came from FBYT?

Each FBYT webhook delivery carries an FBYT-Signature header with a timestamp and an HMAC-SHA256 signature of the timestamp and the raw body, keyed with your endpoint’s secret. Refuse a timestamp more than 300 seconds from your clock, then compare the signatures in constant time.

What does a trade through the API cost?

The vault’s execution wallet pays each transaction’s network fee and, for a spot swap, the protocol trading fee in SOL: a flat fee plus a tiered percentage of the trade’s value. The quote route shows the trading fee before you trade, and the execution wallet’s history lists every cost.

Get started

Start with one key

Create a vault, accept the terms and create an API key in the app. Then point your code or your agent at it.

Questions about the API? Ask the team on Discord or Telegram.