Skip to main content
Glama

TradingCalc MCP: Options, Forex, Risk Stats, Prediction Markets, On-Chain & Crypto Futures

Funding Arbitrage

workflow.run_funding_arbitrage
Read-only

Calculate funding rate arbitrage profit: annualized yield, net profit, and breakeven days for a long/short basis trade across two exchanges: the bare numbers only, no plain-English verdict. For the same math plus a profitable/marginal/loss verdict, use workflow.run_carry_trade instead. Edge cases: positionSize and durationDays above zero; longFundingRate and shortFundingRate in percent per interval (0.01 is 0.01%), either sign; transferFeePct 0 or more (default 0.1); intervalHours 0.25 to 24 (default 8). Not covered: price divergence between the venues, liquidation of either leg, margin on both venues, a rate that changes during the hold, and trading fees. Use when user asks "is this funding arb worth it?" or "how many days to break even on transfer fees?". Returns: netProfitUsdt, annualizedYieldPct, breakevenDays.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "positionSize": "<positionSize>",
      "longFundingRate": "<longFundingRate>",
      "shortFundingRate": "<shortFundingRate>",
      "durationDays": "<durationDays>"
    },
    "name": "workflow.run_funding_arbitrage"
  }
}

Input Schema

NameRequiredDescriptionDefault
durationDaysYesHolding period in days
positionSizeYesPosition size in USDT
intervalHoursNoHours between funding payments, one interval for both legs. Default 8; 1 on Hyperliquid, dYdX, Kraken and Backpack (per-hour rates); 4 or 2 on some symbols. A leg paid on another interval is entered as its rate times (this interval / its own interval).
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)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 schema fields changed
    • changedInput schema / properties / intervalHours / description
      Previous value: -"Funding interval: 8 (standard) or 1 (Hyperliquid, dYdX, Kraken: per-hour rates)"New value: +"Hours between funding payments, one interval for both legs. Default 8; 1 on Hyperliquid, dYdX, Kraken and Backpack (per-hour rates); 4 or 2 on some symbols. A leg paid on another interval is entered as its rate times (this interval / its own interval)."
    • removedInput schema / properties / intervalHours / enum
      Removed value: -[
      -  8,
      -  1
      -]
    • addedInput schema / properties / intervalHours / maximum
      Added value: +24
    • addedInput schema / properties / intervalHours / minimum
      Added value: +0.25
  2. Changed1 schema field changed
    • changedInput schema / properties / intervalHours / description
      Previous value: -"Funding interval: 8 (standard) or 1 (Hyperliquid)"New value: +"Funding interval: 8 (standard) or 1 (Hyperliquid, dYdX, Kraken: per-hour rates)"
  3. Added

TDQS

A4.9/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true and destructiveHint=false, but the description adds real value beyond them: it discloses what the tool deliberately omits (no verdict), enumerates model limitations (price divergence, liquidation of either leg, margin on both venues, rate drift during the hold, trading fees), and states the return fields. That scope-of-model disclosure is exactly the behavioral context an agent needs before trusting the output.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

It is front-loaded with purpose and the sibling disambiguation before edge cases and exclusions, and every clause carries information. It is dense to the point of being a single unbroken block, which makes scanning slightly harder, and the unit conventions partially repeat the schema, but nothing is filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With six parameters, no output schema, and a multi-leg financial model, the description covers purpose, exclusions, edge cases, defaults, and the exact returned fields. An agent has everything needed to call it correctly and to know when the answer is out of scope.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline would be 3, but the description goes further by restating unit conventions with an explicit example ('0.01 is 0.01%'), sign semantics for both rate legs ('either sign'), the transferFeePct default of 0.1 not given in the schema, the intervalHours 0.25–24 range and default, and the positivity constraint on positionSize and durationDays.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The first sentence names a specific verb (Calculate) and resource (funding rate arbitrage profit) plus the three outputs (annualized yield, net profit, breakeven days) and the trade structure (long/short basis trade across two exchanges). It then explicitly distinguishes itself from the closest sibling, workflow.run_carry_trade, by saying it returns 'the bare numbers only, no plain-English verdict.'

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives an explicit alternative and the condition that selects it: 'For the same math plus a profitable/marginal/loss verdict, use workflow.run_carry_trade instead.' It also supplies trigger phrasings ('is this funding arb worth it?', 'how many days to break even on transfer fees?') that route the agent to this tool rather than run_funding_breakeven or run_funding_cost.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.