TradingCalc MCP — Crypto Futures Math
Server Details
Crypto futures math: PnL, liquidation, position sizing, carry trade. 19 tools. Not AI estimates.
- Status
- Healthy
- Last Tested
- Transport
- Streamable HTTP
- URL
- Repository
- SKalinin909/tradingcalc-mcp
- GitHub Stars
- 1
- Server Listing
- TradingCalc MCP Server
Glama MCP Gateway
Connect through Glama MCP Gateway for full control over tool access and complete visibility into every call.
Full call logging
Every tool call is logged with complete inputs and outputs, so you can debug issues and audit what your agents are doing.
Tool access control
Enable or disable individual tools per connector, so you decide what your agents can and cannot do.
Managed credentials
Glama handles OAuth flows, token storage, and automatic rotation, so credentials never expire on your clients.
Usage analytics
See which tools your agents call, how often, and when, so you can understand usage patterns and catch anomalies.
Tool Definition Quality
Average 4/5 across 23 of 23 tools scored.
Some tools have overlapping purposes, e.g., primitive.average_entry and workflow.run_dca_entry both compute average entry, and workflow.run_breakeven_planning overlaps with workflow.run_funding_breakeven in different contexts. However, descriptions and naming help distinguish them, so ambiguity is moderate.
All tools follow a consistent pattern: primitive.<action>, system.<action>, workflow.run_<action>. They use lowercase with underscores and a clear verb_noun structure (e.g., hedge_ratio, run_risk_reward). No mixing of conventions.
23 tools is on the higher end but still reasonable for a crypto futures math server covering many calculations, funding analysis, market profile, and workflow orchestrators. It's slightly heavy but each tool has a distinct role.
The tool set covers most core futures math operations: average entry, hedging, breakeven, liquidation, position sizing, risk-reward, funding cost/arbitrage, and market profile analysis. Minor gaps exist (e.g., no explicit tool for index price or option math), but overall coverage is solid.
Available Tools
23 toolsprimitive.average_entryInspect
Calculate the weighted average entry price from multiple buy/sell fills (DCA). Use when user has filled at multiple prices and asks "what's my average entry?" Returns: averagePrice, totalSize, totalCost.
| Name | Required | Description | Default |
|---|---|---|---|
| input | Yes | ||
| symbol | Yes | Trading pair symbol, e.g. BTCUSDT | |
| exchangeCode | No | Exchange identifier (optional) |
primitive.hedge_ratioInspect
Calculate the short perpetual futures position size needed to hedge a spot holding. Use when user asks "how much should I short to hedge my BTC?" or "what margin do I need for a 100% hedge?". Returns: hedgeNotional, requiredMargin, estimatedFundingCost.
| Name | Required | Description | Default |
|---|---|---|---|
| leverage | No | Leverage on the perp short. Default 1. | |
| spotSize | Yes | Spot position value in USDT | |
| hedgeRatio | No | Percentage of spot to hedge, e.g. 100 for full hedge, 50 for half. Default 100. | |
| fundingRatePct | No | Current 8h funding rate as percentage, e.g. 0.01. Used for cost estimate. |
system.verifyInspect
Run the full regression suite — 22 canonical test vectors across all 12 calculators — and return a pass/fail report with counts and timestamp. Call this before using results in production workflows to confirm the computation layer is operating correctly.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
workflow.run_breakeven_planningInspect
Calculate the break-even exit price that covers all trading fees. Use when user asks "what price do I need to just break even?" Returns: breakevenPrice, totalFees.
| Name | Required | Description | Default |
|---|---|---|---|
| side | Yes | ||
| sizeBase | Yes | Position size in base asset | |
| entryPrice | Yes | Entry price (positive) | |
| feeOpenPct | No | Opening fee fraction, default 0.0002 | |
| feeClosePct | No | Closing fee fraction, default 0.0005 |
workflow.run_breakout_acceptanceInspect
Market Profile breakout acceptance — did price accept (hold) beyond the value area / range, or reject back inside (fakeout)? Optional buy/sell delta. Use for "did the break above VAH get accepted?".
| Name | Required | Description | Default |
|---|---|---|---|
| venue | Yes | Exchange to fetch candles from when candles[] not supplied | |
| candles | No | Optional OHLCV for the session — omit to fetch from venue (reproducible + 0 COGS when supplied) | |
| timeframe | No | Candle timeframe (default 15m) | |
| instrument | Yes | Symbol, e.g. BTCUSDT | |
| prev_candles | No | Optional OHLCV for the previous session | |
| session_date | Yes | Session date YYYY-MM-DD (UTC) | |
| include_delta | No | Include buy/sell delta analysis (default true) | |
| value_area_rule | No | Value-area fraction 0.5–0.9 (default 0.70) |
workflow.run_carry_tradeInspect
Delta-neutral carry trade (funding arbitrage) analysis. Use when user asks "is this carry trade worth it?" — long on exchange A, short on exchange B, collect the funding rate spread. Returns: netYieldPct, grossProfit, netProfit, breakevenDays, verdict (profitable/marginal/loss).
| Name | Required | Description | Default |
|---|---|---|---|
| notional | Yes | Position notional in USDT | |
| hold_days | Yes | Hold duration in days | |
| interval_hours | No | Funding interval: 1 or 8 hours (default 8) | |
| transfer_fee_pct | No | One-way transfer fee % (default 0.1) | |
| funding_rate_long | Yes | Funding rate on long exchange per interval (decimal) | |
| funding_rate_short | Yes | Funding rate on short exchange per interval (decimal) |
workflow.run_compound_fundingInspect
Project capital growth from reinvesting perpetual futures funding income (compounding carry). Use when user asks "how much will I make compounding 0.01% funding for 90 days?" or "what's my APY on this carry position?". Returns: finalCapital, totalEarned, apy, growthTable.
| Name | Required | Description | Default |
|---|---|---|---|
| reinvestPct | No | Percentage of earnings reinvested each interval. 100 = full compounding, 0 = no reinvestment. Default 100. | |
| durationDays | Yes | Number of days to project | |
| intervalHours | No | Funding interval: 8 (standard) or 1 (Hyperliquid) | |
| fundingRatePct | Yes | Funding rate per interval as percentage, e.g. 0.01 for 0.01% | |
| initialCapital | Yes | Starting capital in USDT |
workflow.run_dca_entryInspect
DCA entry planner: weighted average entry price, breakeven, and per-level contribution from multiple fill prices and sizes. Use when user bought at several prices and asks "what's my average entry?" or "where is my DCA breakeven?". Returns: averageEntry, breakeven, per-level summary.
| Name | Required | Description | Default |
|---|---|---|---|
| side | Yes | ||
| entries | Yes | ||
| fee_open_pct | No | Open fee rate (default 0.0002) | |
| fee_close_pct | No | Close fee rate (default 0.0005) |
workflow.run_exit_targetInspect
Calculate the exact exit price needed to hit a target PnL or ROE percentage. Use when user asks "at what price do I take profit to make $500?" or "where should I set TP for 20% ROE?". Returns: targetExitPrice.
| Name | Required | Description | Default |
|---|---|---|---|
| side | Yes | ||
| leverage | Yes | Leverage multiplier | |
| sizeBase | Yes | Position size in base asset | |
| entryPrice | Yes | Entry price | |
| feeOpenPct | No | Opening fee fraction, default 0.0002 | |
| targetMode | Yes | "pnl" = target in USDT, "roe" = target in % | |
| feeClosePct | No | Closing fee fraction, default 0.0005 | |
| targetValue | Yes | Target value (USDT or %) |
workflow.run_funding_arbitrageInspect
Calculate funding rate arbitrage profit: annualized yield, net profit, and breakeven days for a long/short basis trade across two exchanges. Use when user asks "is this funding arb worth it?" or "how many days to break even on transfer fees?". Returns: netProfitUsdt, annualizedYieldPct, breakevenDays.
| Name | Required | Description | Default |
|---|---|---|---|
| durationDays | Yes | Holding period in days | |
| positionSize | Yes | Position size in USDT | |
| intervalHours | No | Funding interval: 8 (standard) or 1 (Hyperliquid) | |
| transferFeePct | No | One-time transfer/setup fee as percentage, e.g. 0.1 for 0.1% | |
| longFundingRate | Yes | Funding rate on long side (% per interval, positive = you pay) | |
| shortFundingRate | Yes | Funding rate on short side (% per interval, positive = you receive) |
workflow.run_funding_breakevenInspect
Price move needed to cover funding cost + fees over a holding period. Use when user asks "how much does BTC need to move for me to profit after funding?" or "is funding killing my edge on this trade?". Returns: breakevenWithFunding, breakevenWithoutFunding, requiredMovePct.
| Name | Required | Description | Default |
|---|---|---|---|
| side | Yes | ||
| size | Yes | Position size in base currency | |
| hold_hours | Yes | Hold duration in hours | |
| entry_price | Yes | Entry price | |
| fee_open_pct | No | Open fee rate (default 0.0002) | |
| funding_rate | Yes | Funding rate per 8h period (decimal, e.g. 0.0001) | |
| fee_close_pct | No | Close fee rate (default 0.0005) |
workflow.run_funding_costInspect
Calculate the total funding cost (or income) for holding a perpetual futures position. Use when user asks "how much funding will I pay holding X days?" or "is funding eating my profit?". Returns: totalFundingUsdt (negative = you pay, positive = you receive), perIntervalUsdt.
| Name | Required | Description | Default |
|---|---|---|---|
| days | Yes | Number of days to hold | |
| side | Yes | ||
| sizeBase | Yes | Position size in base asset | |
| entryPrice | Yes | Entry price | |
| fundingRate | Yes | Funding rate per 8h period as fraction, e.g. 0.0001 |
workflow.run_liquidation_safetyInspect
Calculate the liquidation price for an isolated-margin futures position. Use when user asks "where will I get liquidated?" or "how close is my liq price?". Returns: liquidationPrice, distancePct (how far from entry).
| Name | Required | Description | Default |
|---|---|---|---|
| mmr | No | Maintenance margin rate, default 0.005 (0.5%) | |
| side | Yes | ||
| leverage | Yes | Leverage multiplier, e.g. 10 for 10x | |
| entryPrice | Yes | Entry price (positive) |
workflow.run_max_leverageInspect
Calculate the maximum safe leverage based on account size, max acceptable drawdown, and asset daily volatility. Use when user asks "what's the max leverage I should use on BTC?" or "how much leverage is safe given 3% daily volatility?". Returns: maxLeverage, marginAtRisk.
| Name | Required | Description | Default |
|---|---|---|---|
| mmr | No | Maintenance margin rate, default 0.005 (0.5%) | |
| accountSize | Yes | Total account size in USDT | |
| volatilityPct | Yes | Expected daily price volatility as percentage, e.g. 3 for 3% | |
| maxDrawdownPct | Yes | Maximum acceptable drawdown as percentage, e.g. 10 for 10% |
workflow.run_open_analysisInspect
Market Profile open analysis — where and how price opened vs the prior session value area. Returns open location, open type (OD/OTD/ORR/OAIR), key levels (VAH/VAL/VPOC/IB), and bullish/bearish/neutral scenario framing. Use for "how did BTC open today?" / "what does the open imply for the session?".
| Name | Required | Description | Default |
|---|---|---|---|
| venue | Yes | Exchange to fetch candles from when candles[] not supplied | |
| candles | No | Optional OHLCV for the session — omit to fetch from venue (reproducible + 0 COGS when supplied) | |
| timeframe | No | Candle timeframe (default 15m) | |
| instrument | Yes | Symbol, e.g. BTCUSDT | |
| prev_candles | No | Optional OHLCV for the previous session | |
| session_date | Yes | Session date YYYY-MM-DD (UTC) | |
| value_area_rule | No | Value-area fraction 0.5–0.9 (default 0.70) |
workflow.run_pnl_planningInspect
Calculate net PnL, ROE, fees and gross profit/loss for a futures trade. Use when user asks "what's my profit/loss on this trade?" Returns: grossPnl, fees, netPnl, netPnlUsdt, roe (%).
| Name | Required | Description | Default |
|---|---|---|---|
| side | Yes | Trade direction | |
| size | Yes | Position size in base asset | |
| exitPrice | Yes | Exit price (positive) | |
| entryPrice | Yes | Entry price (positive) | |
| feeOpenPct | No | Opening fee as fraction, e.g. 0.0002 = 0.02% | |
| feeClosePct | No | Closing fee as fraction |
workflow.run_position_sizingInspect
Calculate the correct position size given a maximum risk in USDT and a stop-loss price. Use when user asks "how many coins should I buy?" or "size my position so I risk exactly $X". Returns: positionSize (base), positionUsdt, marginRequired.
| Name | Required | Description | Default |
|---|---|---|---|
| side | Yes | ||
| leverage | No | Leverage, default 1 | |
| riskUsdt | Yes | Maximum acceptable loss in USDT | |
| stopLoss | Yes | Stop-loss price | |
| entryPrice | Yes | Entry price | |
| feeOpenPct | No | Opening fee fraction, default 0.0002 | |
| feeClosePct | No | Closing fee fraction, default 0.0005 |
workflow.run_pre_trade_checkInspect
Full pre-trade decision card: orchestrates position sizing, breakeven, liquidation, and funding cost in one call. Use when user describes a full trade setup and asks "should I take this trade?" or "run the numbers on this setup". Provide exchange+symbol to fetch live funding rate automatically. Returns: positionSize, breakeven, liquidationPrice, fundingCost, overnightBreakevenShift, verdict.
| Name | Required | Description | Default |
|---|---|---|---|
| mmr | No | Maintenance margin rate, default 0.005 | |
| side | Yes | ||
| symbol | No | Perpetual symbol, e.g. "BTCUSDT". | |
| exchange | No | Exchange code, e.g. "binance" or "bybit". Used to fetch live funding rate if funding_rate is omitted. | |
| leverage | Yes | Leverage multiplier | |
| risk_pct | Yes | Risk as % of balance, e.g. 1.0 = 1% | |
| stop_loss | Yes | Stop-loss price (positive) | |
| hold_hours | No | Expected hold time in hours for overnight shift calc. Default 8. | |
| entry_price | Yes | Entry price (positive) | |
| fee_open_pct | No | Opening fee fraction, default 0.0002 | |
| funding_rate | No | Funding rate per 8h as decimal, e.g. 0.0001. If omitted, fetched live from exchange. | |
| fee_close_pct | No | Closing fee fraction, default 0.0005 | |
| account_balance | Yes | Total account balance in USDT |
workflow.run_risk_rewardInspect
Full risk:reward analysis — the single best tool when user describes a trade with entry, stop, and target. Calculates R:R ratio, position size, liquidation price, breakeven, and P&L at both stop and target. Returns a verdict: strong (3:1+) / good (2:1+) / marginal / poor. Use when user asks "is this trade worth taking?" or "what's my risk reward on this setup?".
| Name | Required | Description | Default |
|---|---|---|---|
| mmr | No | Maintenance margin rate (default 0.005) | |
| side | Yes | ||
| leverage | Yes | Leverage multiplier | |
| risk_pct | Yes | Max risk as % of account | |
| stop_loss | Yes | Stop-loss price | |
| entry_price | Yes | Entry price | |
| take_profit | Yes | Take-profit price | |
| fee_open_pct | No | Open fee rate (default 0.0002) | |
| fee_close_pct | No | Close fee rate (default 0.0005) | |
| account_balance | Yes | Account balance in USDT |
workflow.run_scale_outInspect
Scale-out planner: P&L, ROI, and cumulative P&L for each partial exit level. Use when user wants to take profit at multiple targets — "close 30% at $90k, 30% at $95k, 40% at $100k — what's my total P&L?". Returns: per-level pnl, weightedAvgExitPrice, totalRoi.
| Name | Required | Description | Default |
|---|---|---|---|
| side | Yes | ||
| exits | Yes | ||
| total_size | Yes | Total position size in base currency | |
| entry_price | Yes | Entry price | |
| fee_open_pct | No | Open fee rate (default 0.0002) | |
| fee_close_pct | No | Close fee rate (default 0.0005) |
workflow.run_scenario_planningInspect
Run a scenario analysis: compute PnL for multiple price-change percentages at once. Use when user asks "show me my P&L if BTC moves -10%, -5%, +5%, +10%". Returns: array of { deltaPct, exitPrice, netPnl, roe }.
| Name | Required | Description | Default |
|---|---|---|---|
| side | Yes | ||
| size | Yes | Position size in base asset | |
| deltasPct | Yes | List of price change percentages, e.g. [-10, -5, 0, 5, 10] | |
| entryPrice | Yes | Entry price | |
| feeOpenPct | No | Opening fee fraction | |
| feeClosePct | No | Closing fee fraction |
workflow.run_session_structureInspect
Market Profile day-type classifier — trend / balance / neutral_trend / normal / normal_var, from TPO, initial balance, range extension and value migration. Use for "is this a trend day or a balance day?".
| Name | Required | Description | Default |
|---|---|---|---|
| venue | Yes | Exchange to fetch candles from when candles[] not supplied | |
| candles | No | Optional OHLCV for the session — omit to fetch from venue (reproducible + 0 COGS when supplied) | |
| timeframe | No | Candle timeframe (default 15m) | |
| instrument | Yes | Symbol, e.g. BTCUSDT | |
| prev_candles | No | Optional OHLCV for the previous session | |
| session_date | Yes | Session date YYYY-MM-DD (UTC) | |
| value_area_rule | No | Value-area fraction 0.5–0.9 (default 0.70) |
workflow.run_value_migrationInspect
Market Profile value-area migration across sessions — is value migrating up, down, or overlapping (directional conviction vs balance)? Use for "is value moving higher day over day?".
| Name | Required | Description | Default |
|---|---|---|---|
| venue | Yes | Exchange to fetch candles from when candles[] not supplied | |
| candles | No | Optional OHLCV for the session — omit to fetch from venue (reproducible + 0 COGS when supplied) | |
| timeframe | No | Candle timeframe (default 15m) | |
| instrument | Yes | Symbol, e.g. BTCUSDT | |
| prev_candles | No | Optional OHLCV for the previous session | |
| session_date | Yes | Session date YYYY-MM-DD (UTC) | |
| value_area_rule | No | Value-area fraction 0.5–0.9 (default 0.70) | |
| lookback_sessions | No | Sessions to compare, 1–5 (default 1) |
Claim this connector by publishing a /.well-known/glama.json file on your server's domain with the following structure:
{
"$schema": "https://glama.ai/mcp/schemas/connector.json",
"maintainers": [{ "email": "your-email@example.com" }]
}The email address must match the email associated with your Glama account. Once published, Glama will automatically detect and verify the file within a few minutes.
Control your server's listing on Glama, including description and metadata
Access analytics and receive server usage reports
Get monitoring and health status updates for your server
Feature your server to boost visibility and reach more users
For users:
Full audit trail – every tool call is logged with inputs and outputs for compliance and debugging
Granular tool control – enable or disable individual tools per connector to limit what your AI agents can do
Centralized credential management – store and rotate API keys and OAuth tokens in one place
Change alerts – get notified when a connector changes its schema, adds or removes tools, or updates tool definitions, so nothing breaks silently
For server owners:
Proven adoption – public usage metrics on your listing show real-world traction and build trust with prospective users
Tool-level analytics – see which tools are being used most, helping you prioritize development and documentation
Direct user feedback – users can report issues and suggest improvements through the listing, giving you a channel you would not have otherwise
The connector status is unhealthy when Glama is unable to successfully connect to the server. This can happen for several reasons:
The server is experiencing an outage
The URL of the server is wrong
Credentials required to access the server are missing or invalid
If you are the owner of this MCP connector and would like to make modifications to the listing, including providing test credentials for accessing the server, please contact support@glama.ai.
Discussions
No comments yet. Be the first to start the discussion!
Your Connectors
Sign in to create a connector for this server.