Skip to main content
Glama
Derive MCP Server

Derive MCP Server

by yashhsm

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
DERIVE_API_KEYNoOptional API key for authenticated private requests that do not require local EIP-712 signing.
DERIVE_API_URLNoOptional override for the base API URL.
DERIVE_TESTNETNoSet to "true" to use https://api-demo.lyra.finance.
LYRA_SUBACCOUNT_IDNoLegacy alias for DERIVE_SUBACCOUNT_ID.
LYRA_WALLET_ADDRESSNoLegacy alias for DERIVE_WALLET_ADDRESS.
DERIVE_SUBACCOUNT_IDNoDefault subaccount used by signed trading flows and as the fallback for tools that accept subaccount_id. Required for signed trading mode.
DERIVE_WALLET_ADDRESSNoWallet address associated with the Derive session key. Required for signed trading mode.
LYRA_SESSION_PRIVATE_KEYNoLegacy alias for DERIVE_SESSION_PRIVATE_KEY.
DERIVE_SESSION_PRIVATE_KEYNoSession key private key used for EIP-712 order signing. Required for signed trading mode.

Instructions

Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.

This server publishes no instructions, or was last inspected before Glama recorded them.

Capabilities

Features and capabilities supported by this server

Protocol revision2025-11-25

CapabilityDetails
tools
{
  "listChanged": true
}

Tools

Functions exposed to the LLM to take actions

NameDescription
get_instrumentsA

Get active instruments for a currency and type. For options, this can return hundreds of instruments — use strike_min/strike_max and/or expiry_date to filter, and compact=true for minimal output. Without filters, the response can be very large (200KB+).

get_all_instrumentsA

Paginated list of all instruments across currencies. Returns {instruments, pagination}.

get_tickerA

Get detailed instrument data: mark price, index, Greeks, funding, open interest, fees, tick size, minimum_amount, amount_step. WARNING FOR OPTIONS: bid/ask here are CLOB resting orders only — options trade primarily via MM streaming quotes, so CLOB bid/ask is often $0 or wildly off-market. For option pricing/execution, ALWAYS use get_tickers instead. For PERPS: bid/ask from get_ticker is fine — perps have active CLOB liquidity. Use this tool for: perp pricing, instrument metadata (tick_size, minimum_amount, amount_step), and funding rates.

get_tickersA

Batch pricing for all instruments of a type. Returns MM streaming quotes (bid/ask/mark/greeks). This is the PRIMARY pricing tool — shows real market maker quotes unlike get_ticker which only shows CLOB resting orders. For options: currency AND expiry_date (YYYYMMDD) are required. Use only_liquid=true to filter out dead strikes with no quotes (recommended — reduces response by ~60%). Use min_delta/max_delta to focus on specific moneyness ranges. Response: {tickers: {instrument_name: {bid, ask, bid_size, ask_size, mark, delta, iv, ...}}}

get_options_chainA

Get a structured options chain for a currency — strikes as rows, calls and puts as columns, with bid/ask/mark/IV/greeks/OI. This is the RECOMMENDED tool for analyzing options. Returns a compact, pre-filtered chain instead of raw ticker data. Defaults to only_liquid=true and ±30% from spot. Bid/ask here are from MM streaming quotes (real executable prices). NOTE: Does NOT include minimum_amount or amount_step. Call get_instruments(compact=true) alongside if you need lot sizes for order placement. Response: {index_price, expiries: [{expiry, dte, chain: [{strike, call: {bid,ask,mark,iv,delta,...}, put: {...}}]}]}

get_trade_history_publicC

Get public trade history. Filter by currency, instrument, type, or time range.

get_funding_rate_historyA

Get funding rate history for a perp instrument. Max 30 days lookback.

get_liquidation_historyC

Get liquidation auction history.

get_interest_rate_historyC

Get USDC borrow/supply APY history.

get_transactionA

Look up transaction status: requested, pending, settled, reverted, ignored, or timed_out.

get_index_chart_dataC

Get spot/index OHLC candle data for a currency.

get_tradingview_chart_dataB

Get OHLCV candle data for a specific instrument (trades-based).

get_accountB

Get account details: fee tiers, rate limits, subaccount IDs, cancel-on-disconnect status.

get_subaccountsB

List all subaccount IDs for a wallet.

get_subaccountA

Full subaccount snapshot: collaterals, open orders, positions, margin, portfolio value. IMPORTANT: Check margin_type field (SM = Standard Margin, PM/PM2 = Portfolio Margin). SM: short options require full naked margin, spreads NOT netted. Only long options and perps practical. PM/PM2: spreads are netted, credit spreads work, lower margin for hedged positions. Always check margin_type BEFORE planning any strategy involving short options.

set_cancel_on_disconnectB

Enable/disable auto-cancel all orders on WebSocket disconnect.

get_notificationsC

Get account notifications.

get_positionsB

Get all active positions with Greeks, PnL, margin, and liquidation prices.

get_collateralsB

Get all collateral holdings with mark values, interest, and PnL.

get_marginA

Get current margin. Optionally simulate position/collateral changes before trading. Validates simulated amounts against instrument minimum_amount and amount_step — if amounts violate constraints, returns is_valid_trade=false with violations (the real order would reject). CRITICAL: Simulation evaluates all positions ATOMICALLY as a portfolio — but orders execute LEG BY LEG. A multi-leg spread may show is_valid_trade=true in simulation but FAIL on execution because each leg is margined independently. For multi-leg strategies: simulate EACH sell/short leg INDIVIDUALLY against current positions to verify it passes margin alone. Standard Margin (SM) does NOT net spreads — short options require full naked margin. Portfolio Margin (PM/PM2) does net spreads. Always check margin_type from get_subaccount before placing short option orders.

get_portfolio_summaryA

Get a complete portfolio overview in a single call: USDC balance, all positions with greeks, and aggregate totals. Returns {balance, positions: [...], totals: {value, unrealized_pnl, delta, gamma, vega, theta}}. Use this INSTEAD of calling get_collaterals + get_positions separately — saves a tool call and does the aggregation for you. IMPORTANT: totals.delta is summed across ALL currencies (BTC + ETH + SOL + HYPE). For hedging a specific currency, filter positions by currency prefix (e.g., instrument.startsWith('ETH')) and sum their deltas. NOTE: positions include mark_price but NOT bid/ask. To close options, use get_tickers(expiry) for real MM quotes. Theta values are in USD/day for the full position size (already scaled by amount).

place_orderA

Place an order. Handles EIP-712 signing automatically. Returns order_id and order status. IMPORTANT: For IOC/FOK orders, the order may already be filled or cancelled by the time you read the response. Use get_order(order_id) after placing to confirm fill status, filled_amount, and average_price. MARGIN RULES: Selling/shorting options requires margin. On Standard Margin (SM), short options are treated as NAKED — the full margin is required even if you hold a protective long leg. SM does NOT recognize spreads. Credit spreads (bull put, bear call) ONLY work on Portfolio Margin (PM/PM2). Before selling options: 1) check margin_type via get_subaccount, 2) simulate the sell leg ALONE via get_margin, 3) if SM, only sell options if you have enough margin for naked exposure. Buying options only requires the premium — no additional margin needed. INSTRUMENT CONSTRAINTS: Check minimum_amount and amount_step via get_instruments before placing. Common minimums: ETH options 0.1, BTC options 0.01, SOL options 0.1, HYPE options 1.

replace_orderA

Atomically cancel an existing order and create a new one. If cancel fails, the new order is not placed.

cancel_orderC

Cancel a single order by order ID.

cancel_by_instrumentC

Cancel all orders for a specific instrument.

cancel_by_labelC

Cancel all orders with a specific label.

cancel_all_ordersC

Cancel ALL open orders for a subaccount. Use with caution.

get_open_ordersB

Get all open orders for a subaccount.

get_orderA

Get a single order's current state: status, filled_amount, average_price, fees. Use this after place_order to confirm fills — especially for IOC orders which vanish from get_open_orders immediately. Returns: order_id, status (open/filled/cancelled/expired), filled_amount, average_price, limit_price, direction, label, creation_timestamp.

get_order_historyC

Get historical orders for a subaccount or wallet.

get_trade_history_privateC

Get private trade history (fills) with PnL, fees, tx status.

send_rfqC

Send a Request for Quote (multi-leg) to market makers.

get_rfqsC

Get RFQs for a subaccount. Filter by status or time.

cancel_rfqC

Cancel an open RFQ.

get_quotesC

Get quotes for a subaccount. Filter by RFQ, quote ID, or status.

execute_quoteA

Accept and execute an RFQ quote. Completes the RFQ flow: send_rfq → get_quotes → execute_quote. Each leg needs EIP-712 signing, which is handled automatically. The quote_id ties the execution to the MM's quote, ensuring you get the quoted price.

get_deposit_historyC

Get deposit history for a subaccount.

get_withdrawal_historyC

Get withdrawal history for a subaccount.

get_erc20_transfer_historyC

Get ERC20 transfer history between subaccounts.

get_mmp_configC

Get MMP (Market Maker Protection) configuration.

set_mmp_configC

Configure MMP. Set interval=0 to disable, frozen_time=0 for manual-only reset.

reset_mmpC

Manually reset/unfreeze MMP.

get_session_keysC

List all session keys for a wallet.

auth_statusB

Check what authentication is configured and what capabilities are available.

place_and_verifyA

Place an order with automatic fill verification, error classification, and audit logging. Returns a LifecycleResult — never throws for expected failures (zero liquidity, insufficient funds). Submission states: 'accepted' (order on exchange), 'rejected' (exchange rejected), 'unknown' (transport error). For IOC/FOK that can't match, returns rejected with ZERO_LIQUIDITY — no phantom order created. For GTC that crosses the spread, returns filled with trades inline. All events are appended to the audit log.

verify_orderA

Check current state of any order and return normalized OrderReceipt. If the order's status changed since last check (e.g., OPEN → FILLED), emits a correction event to the audit log. Use after place_and_verify to check if a GTC order has been filled, or to get settlement details. With include_settlement=true, fetches tx_hash from trade history for filled orders.

create_rfqA

Send an RFQ (Request for Quote) to market makers and return immediately. Does NOT poll for quotes or auto-execute — use await_rfq_quotes and accept_rfq_quote for that. RFQs remain open until valid_until (~30 min) or explicit cancel. For multi-leg options strategies, this is the preferred path for atomic execution.

await_rfq_quotesA

Poll for quotes on an open RFQ. Returns all received quotes without executing any. Does NOT cancel the RFQ on timeout — it remains open until valid_until or explicit cancel. If quotes are found, status is 'QUOTED'. If timeout with no quotes, status remains 'OPEN'. Use accept_rfq_quote to execute a specific quote.

accept_rfq_quoteA

Execute a specific quote from an RFQ. Fetches the quote details automatically — you only need rfq_id and quote_id (no need to replay legs). Optional max_total_cost safety bound prevents execution if quote cost exceeds limit. Returns LifecycleResult with trade details on success.

check_multi_leg_marginA

Pre-flight margin check for multi-leg strategies. Simulates BOTH as an atomic portfolio AND sequentially (leg-by-leg in execution order). CRITICAL for Standard Margin (SM) which does NOT net spreads — short options require full naked margin even with protective long legs. Returns warnings when portfolio simulation passes but sequential execution would fail. Execution order: buy legs first (lowest premium), then sell legs (highest margin). For atomic multi-leg execution, use RFQ instead of CLOB.

order_audit_logA

Query the local audit trail of orders placed through lifecycle tools. Returns filtered order history with a summary including fill rate, total fees, and volume. Note: only orders placed via place_and_verify or rfq tools are tracked. Use reconcile to backfill orders placed via raw place_order.

reconcileA

Compare local audit log against Derive's actual order state. Detects: orders on Derive not in local log (placed via raw tools), local orders marked as open that Derive shows as filled/cancelled. With auto_fix=true, appends correction events to bring local log in sync.

Prompts

Interactive templates invoked by user choice

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

C2.9/5.0

Scored across 52 tools

Disambiguation3/5

Descriptions work hard to differentiate closely related tools (get_ticker vs get_tickers vs get_options_chain, get_portfolio_summary vs get_collaterals+get_positions), but there are genuine duplicate pairs with overlapping purpose: send_rfq vs create_rfq, execute_quote vs accept_rfq_quote, place_order vs place_and_verify, get_order vs verify_order, and get_quotes vs await_rfq_quotes. An agent must read long descriptions to know which of two near-identical RFQ tools is 'the preferred path', and pricing has at least four overlapping entry points.

Naming Consistency4/5

Nearly everything follows a snake_case verb_noun convention (get_*, cancel_*, set_*, place_*, create_*). Minor deviations exist: auth_status and order_audit_log are noun-style, reconcile is a bare verb, and singular/plural pairs (get_ticker/get_tickers, get_rfq vs get_rfqs) rely on tiny spelling differences to mean different things.

Tool Count2/5

52 tools is well past the heavy threshold and includes a visible second layer bolted on top of the first (RFQ v1 vs v2, raw place_order vs place_and_verify, plus an audit/reconcile subsystem). While a full derivatives exchange is broad, the count is inflated by redundant legacy/new parallel surfaces rather than by distinct capabilities.

Completeness4/5

Coverage is genuinely deep: instrument discovery, pricing, order lifecycle with replace/cancel variants, RFQ flow, margin simulation, MMP, session keys, histories, and audit reconciliation. Main gaps are funding/withdrawal actions (only history is exposed, no initiate transfer/withdraw) and no order-amend beyond replace_order.

Maintenance

ActivityInactive
ResponsivenessNo recent community issues