Skip to main content
Glama

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

Compound Funding

workflow.run_compound_funding
Read-only

Project capital growth from reinvesting perpetual futures funding income (compounding carry). Edge cases: initialCapital above zero; fundingRatePct in percent per interval (0.01 is 0.01%), either sign; intervalHours a whole number that divides 24 (1, 2, 3, 4, 6, 8, 12 or 24, default 8); durationDays above zero and at most 3650; reinvestPct 0 to 100 (default 100); a result too large to represent is an error. Assumes the rate stays constant. Not covered: a changing rate, fees, taxes, and the capital limits a venue may set. 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?". Funding received is split by reinvestPct (the rest is withdrawn and still counts as earned); funding paid comes out of capital in full, and the capital never goes below 0. Returns: finalCapital, totalWithdrawn, endValue, totalEarned, totalEarnedPct, annualizedAPY, dailyEarnings, snapshots.

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": {
      "initialCapital": "<initialCapital>",
      "fundingRatePct": "<fundingRatePct>",
      "durationDays": "<durationDays>"
    },
    "name": "workflow.run_compound_funding"
  }
}

Input Schema

NameRequiredDescriptionDefault
reinvestPctNoPercentage of funding received that is reinvested each interval, 0-100 (the rest is withdrawn and counts as earned; funding paid always comes out of capital). 100 = full compounding. Default 100.
durationDaysYesNumber of days to project, up to 3650
intervalHoursNoHours between funding payments, the period fundingRatePct covers, a whole number of hours that divides 24. Default 8; 1 on Hyperliquid, dYdX, Kraken and Backpack (per-hour rates); 4 or 2 on some symbols.
fundingRatePctYesFunding rate per interval in PERCENT: 0.01 means 0.01%, so a quoted 0.0125% is 0.0125, never 0.000125
initialCapitalYesStarting capital in USDT

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / fundingRatePct / description
      Previous value: -"Funding rate per interval as percentage, e.g. 0.01 for 0.01%"New value: +"Funding rate per interval in PERCENT: 0.01 means 0.01%, so a quoted 0.0125% is 0.0125, never 0.000125"
  2. Changed2 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, the period fundingRatePct covers, a whole number of hours that divides 24. Default 8; 1 on Hyperliquid, dYdX, Kraken and Backpack (per-hour rates); 4 or 2 on some symbols."
    • changedInput schema / properties / intervalHours / enum
      Previous value: -[
      -  8,
      -  1
      -]New value: +[
      +  1,
      +  2,
      +  3,
      +  4,
      +  6,
      +  8,
      +  12,
      +  24
      +]
  3. 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)"
  4. Changed7 schema fields changed
    • changedInput schema / properties / durationDays / description
      Previous value: -"Number of days to project"New value: +"Number of days to project, up to 3650"
    • addedInput schema / properties / durationDays / exclusiveMinimum
      Added value: +0
    • addedInput schema / properties / durationDays / maximum
      Added value: +3650
    • addedInput schema / properties / initialCapital / exclusiveMinimum
      Added value: +0
    • changedInput schema / properties / reinvestPct / description
      Previous value: -"Percentage of earnings reinvested each interval. 100 = full compounding, 0 = no reinvestment. Default 100."New value: +"Percentage of funding received that is reinvested each interval, 0-100 (the rest is withdrawn and counts as earned; funding paid always comes out of capital). 100 = full compounding. Default 100."
    • addedInput schema / properties / reinvestPct / maximum
      Added value: +100
    • addedInput schema / properties / reinvestPct / minimum
      Added value: +0
  5. Added

TDQS

A4.2/5.0
Behavior5/5

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

Annotations already declare a safe read-only, closed-world operation, and the description still adds substantial behavior: the constant-rate assumption, what is explicitly out of scope (fees, taxes, venue capital limits), the overflow-is-an-error rule, and the mechanic that funding paid drains capital but capital never goes below zero. That is the kind of disclosure an agent needs to trust and caveat the result.

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

Conciseness3/5

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

The purpose and the two example questions are front-loaded and earn their place, but the 'Edge cases' block restates constraint data already present in the schema (enum values, min/max bounds, defaults) rather than adding meaning. The dense parenthetical packing makes it harder to scan than necessary.

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 no output schema, the description compensates by enumerating the returned fields (finalCapital, totalWithdrawn, endValue, totalEarned, totalEarnedPct, annualizedAPY, dailyEarnings, snapshots). Combined with the stated assumptions and failure condition, an agent has everything needed to call it and to describe the result.

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

Parameters4/5

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

Schema coverage is 100%, so the schema already carries the parameter definitions and the description's repetition of the intervalHours enum, the 3650-day cap and the 0-100 reinvest range adds little. What it does add beyond the schema is the payout semantics: funding received is split by reinvestPct with the remainder withdrawn yet still counted as earned, which is non-obvious and affects interpretation.

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

Purpose4/5

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

The first sentence names a specific verb and resource: project capital growth from reinvesting perpetual futures funding income, with the parenthetical '(compounding carry)' pinning down the domain. It is clearly distinct from cost/breakeven/arbitrage siblings by implication, though no sibling is named explicitly.

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

Usage Guidelines4/5

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

Two concrete example user questions ('how much will I make compounding 0.01% funding for 90 days?', 'what's my APY on this carry position?') give an agent a reliable trigger pattern. It lacks an explicit exclusion or a named alternative for the non-compounding case, which keeps it from a 5.

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.