Skip to main content
Glama

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.

MCP client
Glama
MCP server

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.

100% free. Your data is private.
Tool DescriptionsA

Average 4/5 across 23 of 23 tools scored.

Server CoherenceA
Disambiguation3/5

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.

Naming Consistency5/5

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.

Tool Count4/5

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.

Completeness4/5

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 tools
primitive.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.

ParametersJSON Schema
NameRequiredDescriptionDefault
inputYes
symbolYesTrading pair symbol, e.g. BTCUSDT
exchangeCodeNoExchange 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.

ParametersJSON Schema
NameRequiredDescriptionDefault
leverageNoLeverage on the perp short. Default 1.
spotSizeYesSpot position value in USDT
hedgeRatioNoPercentage of spot to hedge, e.g. 100 for full hedge, 50 for half. Default 100.
fundingRatePctNoCurrent 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.

ParametersJSON Schema
NameRequiredDescriptionDefault

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
sideYes
sizeBaseYesPosition size in base asset
entryPriceYesEntry price (positive)
feeOpenPctNoOpening fee fraction, default 0.0002
feeClosePctNoClosing 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?".

ParametersJSON Schema
NameRequiredDescriptionDefault
venueYesExchange to fetch candles from when candles[] not supplied
candlesNoOptional OHLCV for the session — omit to fetch from venue (reproducible + 0 COGS when supplied)
timeframeNoCandle timeframe (default 15m)
instrumentYesSymbol, e.g. BTCUSDT
prev_candlesNoOptional OHLCV for the previous session
session_dateYesSession date YYYY-MM-DD (UTC)
include_deltaNoInclude buy/sell delta analysis (default true)
value_area_ruleNoValue-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).

ParametersJSON Schema
NameRequiredDescriptionDefault
notionalYesPosition notional in USDT
hold_daysYesHold duration in days
interval_hoursNoFunding interval: 1 or 8 hours (default 8)
transfer_fee_pctNoOne-way transfer fee % (default 0.1)
funding_rate_longYesFunding rate on long exchange per interval (decimal)
funding_rate_shortYesFunding 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.

ParametersJSON Schema
NameRequiredDescriptionDefault
reinvestPctNoPercentage of earnings reinvested each interval. 100 = full compounding, 0 = no reinvestment. Default 100.
durationDaysYesNumber of days to project
intervalHoursNoFunding interval: 8 (standard) or 1 (Hyperliquid)
fundingRatePctYesFunding rate per interval as percentage, e.g. 0.01 for 0.01%
initialCapitalYesStarting 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.

ParametersJSON Schema
NameRequiredDescriptionDefault
sideYes
entriesYes
fee_open_pctNoOpen fee rate (default 0.0002)
fee_close_pctNoClose 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.

ParametersJSON Schema
NameRequiredDescriptionDefault
sideYes
leverageYesLeverage multiplier
sizeBaseYesPosition size in base asset
entryPriceYesEntry price
feeOpenPctNoOpening fee fraction, default 0.0002
targetModeYes"pnl" = target in USDT, "roe" = target in %
feeClosePctNoClosing fee fraction, default 0.0005
targetValueYesTarget 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.

ParametersJSON Schema
NameRequiredDescriptionDefault
durationDaysYesHolding period in days
positionSizeYesPosition size in USDT
intervalHoursNoFunding interval: 8 (standard) or 1 (Hyperliquid)
transferFeePctNoOne-time transfer/setup fee as percentage, e.g. 0.1 for 0.1%
longFundingRateYesFunding rate on long side (% per interval, positive = you pay)
shortFundingRateYesFunding 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.

ParametersJSON Schema
NameRequiredDescriptionDefault
sideYes
sizeYesPosition size in base currency
hold_hoursYesHold duration in hours
entry_priceYesEntry price
fee_open_pctNoOpen fee rate (default 0.0002)
funding_rateYesFunding rate per 8h period (decimal, e.g. 0.0001)
fee_close_pctNoClose 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.

ParametersJSON Schema
NameRequiredDescriptionDefault
daysYesNumber of days to hold
sideYes
sizeBaseYesPosition size in base asset
entryPriceYesEntry price
fundingRateYesFunding 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).

ParametersJSON Schema
NameRequiredDescriptionDefault
mmrNoMaintenance margin rate, default 0.005 (0.5%)
sideYes
leverageYesLeverage multiplier, e.g. 10 for 10x
entryPriceYesEntry 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.

ParametersJSON Schema
NameRequiredDescriptionDefault
mmrNoMaintenance margin rate, default 0.005 (0.5%)
accountSizeYesTotal account size in USDT
volatilityPctYesExpected daily price volatility as percentage, e.g. 3 for 3%
maxDrawdownPctYesMaximum 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?".

ParametersJSON Schema
NameRequiredDescriptionDefault
venueYesExchange to fetch candles from when candles[] not supplied
candlesNoOptional OHLCV for the session — omit to fetch from venue (reproducible + 0 COGS when supplied)
timeframeNoCandle timeframe (default 15m)
instrumentYesSymbol, e.g. BTCUSDT
prev_candlesNoOptional OHLCV for the previous session
session_dateYesSession date YYYY-MM-DD (UTC)
value_area_ruleNoValue-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 (%).

ParametersJSON Schema
NameRequiredDescriptionDefault
sideYesTrade direction
sizeYesPosition size in base asset
exitPriceYesExit price (positive)
entryPriceYesEntry price (positive)
feeOpenPctNoOpening fee as fraction, e.g. 0.0002 = 0.02%
feeClosePctNoClosing 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.

ParametersJSON Schema
NameRequiredDescriptionDefault
sideYes
leverageNoLeverage, default 1
riskUsdtYesMaximum acceptable loss in USDT
stopLossYesStop-loss price
entryPriceYesEntry price
feeOpenPctNoOpening fee fraction, default 0.0002
feeClosePctNoClosing 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.

ParametersJSON Schema
NameRequiredDescriptionDefault
mmrNoMaintenance margin rate, default 0.005
sideYes
symbolNoPerpetual symbol, e.g. "BTCUSDT".
exchangeNoExchange code, e.g. "binance" or "bybit". Used to fetch live funding rate if funding_rate is omitted.
leverageYesLeverage multiplier
risk_pctYesRisk as % of balance, e.g. 1.0 = 1%
stop_lossYesStop-loss price (positive)
hold_hoursNoExpected hold time in hours for overnight shift calc. Default 8.
entry_priceYesEntry price (positive)
fee_open_pctNoOpening fee fraction, default 0.0002
funding_rateNoFunding rate per 8h as decimal, e.g. 0.0001. If omitted, fetched live from exchange.
fee_close_pctNoClosing fee fraction, default 0.0005
account_balanceYesTotal 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?".

ParametersJSON Schema
NameRequiredDescriptionDefault
mmrNoMaintenance margin rate (default 0.005)
sideYes
leverageYesLeverage multiplier
risk_pctYesMax risk as % of account
stop_lossYesStop-loss price
entry_priceYesEntry price
take_profitYesTake-profit price
fee_open_pctNoOpen fee rate (default 0.0002)
fee_close_pctNoClose fee rate (default 0.0005)
account_balanceYesAccount 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.

ParametersJSON Schema
NameRequiredDescriptionDefault
sideYes
exitsYes
total_sizeYesTotal position size in base currency
entry_priceYesEntry price
fee_open_pctNoOpen fee rate (default 0.0002)
fee_close_pctNoClose 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 }.

ParametersJSON Schema
NameRequiredDescriptionDefault
sideYes
sizeYesPosition size in base asset
deltasPctYesList of price change percentages, e.g. [-10, -5, 0, 5, 10]
entryPriceYesEntry price
feeOpenPctNoOpening fee fraction
feeClosePctNoClosing 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?".

ParametersJSON Schema
NameRequiredDescriptionDefault
venueYesExchange to fetch candles from when candles[] not supplied
candlesNoOptional OHLCV for the session — omit to fetch from venue (reproducible + 0 COGS when supplied)
timeframeNoCandle timeframe (default 15m)
instrumentYesSymbol, e.g. BTCUSDT
prev_candlesNoOptional OHLCV for the previous session
session_dateYesSession date YYYY-MM-DD (UTC)
value_area_ruleNoValue-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?".

ParametersJSON Schema
NameRequiredDescriptionDefault
venueYesExchange to fetch candles from when candles[] not supplied
candlesNoOptional OHLCV for the session — omit to fetch from venue (reproducible + 0 COGS when supplied)
timeframeNoCandle timeframe (default 15m)
instrumentYesSymbol, e.g. BTCUSDT
prev_candlesNoOptional OHLCV for the previous session
session_dateYesSession date YYYY-MM-DD (UTC)
value_area_ruleNoValue-area fraction 0.5–0.9 (default 0.70)
lookback_sessionsNoSessions to compare, 1–5 (default 1)

Discussions

No comments yet. Be the first to start the discussion!

Try in Browser

Your Connectors

Sign in to create a connector for this server.