Skip to main content
Glama

Perp Carry

perp_carry
Read-onlyIdempotent

Carry screener for perpetual futures: pairs of venues for one symbol, long one leg and short the other (perp x perp, or spot bought and a perp shorted), scored by what the price gap captures plus the funding the pair earns over horizon_h hours, before costs (gross_apr) and after them (net_apr). The defaults are the list on vike.io/perp/carry: both kinds of pair (legs), legs chosen by funding (direction: long the lower funding rate, short the higher; convergence longs the cheaper price instead), no minimum gap. APRs are fractions of the capital on both legs (0.25 = 25 % a year); fees_usd, net_usd and the other USD fields are for $1,000 on each leg. breakeven_h is the hours of funding needed to pay the costs the gap does not cover (0: the gap covers them; null: funding does not pay). costs: none (net equals gross), fees (each venue's taker fee, entry and exit on both legs, or fee_bps for every venue) or fees_slippage (default: fees plus slippage_bps on each of the four fills). Only legs with $1M or more of 24-hour volume and a gap between min_spread_pct and 25 % are listed, and a pair whose perp leg has no current funding rate is left out. A spot leg's funding fields are null. Each perp leg carries long_/short_market_status and _delist_ts, as in perp_funding: a leg the venue is delisting may close before the hold ends. Same answer as GET /v1/marketdata/perp/carry.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "perp_carry"
  }
}

Input Schema

NameRequiredDescriptionDefault
legsNoperp_perp (a perp on each of two venues), perp_spot (spot bought, a perp shorted) or all (default).
sortNoRank by net_apr (default) or gross_apr, highest first.
costsNoWhich costs `net_apr` subtracts. Default fees_slippage.
limitNoRows, 1 to 500. Default 50.
fee_bpsNoTaker fee in basis points for every venue, per fill (0 to 100). Omit for each venue's own fee. Not with costs=none.
directionNofunding (default: long the lower funding rate, short the higher) or convergence (long the cheaper price, short the dearer).
horizon_hNoHours the pair is held, over which funding accrues and the APR is annualised (1 to 720). Default 48.
slippage_bpsNoSlippage in basis points per fill, four fills (0 to 100). Default 2. Only with costs=fees_slippage.
min_spread_pctNoSmallest price gap between the legs, in percent, either sign (0 to 25). Default 0.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • addedInput schema / properties / direction
      Added value: +{
      +  "description": "funding (default: long the lower funding rate, short the higher) or convergence (long the cheaper price, short the dearer).",
      +  "enum": [
      +    "funding",
      +    "convergence"
      +  ],
      +  "type": "string"
      +}
    • addedInput schema / properties / legs
      Added value: +{
      +  "description": "perp_perp (a perp on each of two venues), perp_spot (spot bought, a perp shorted) or all (default).",
      +  "enum": [
      +    "all",
      +    "perp_perp",
      +    "perp_spot"
      +  ],
      +  "type": "string"
      +}
    • changedInput schema / properties / min_spread_pct / description
      Previous value: -"Smallest price gap between the legs, in percent (0 to 25). Default 2."New value: +"Smallest price gap between the legs, in percent, either sign (0 to 25). Default 0."
  2. Added

TDQS

A4.4/5.0
Behavior5/5

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

The annotations already declare read-only, non-destructive, idempotent, and closed-world behavior. The description adds substantial context beyond that: scoring mechanics, APR and USD field conventions, breakeven semantics, cost modes, liquidity filters, exclusion of perp legs without funding, and delisting warnings.

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?

The description is front-loaded with purpose and then proceeds through defaults, units, costs, and filters in a logical order. It is dense and somewhat long, but most sentences carry useful information and there is little outright waste.

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?

This is a complex screening tool with many optional parameters and no output schema, and the description explains the important output fields, scoring units, filters, and edge cases. It is complete enough for an agent to understand and call the tool correctly.

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?

With 100% schema description coverage, the schema already documents every parameter, so the baseline is 3. The description adds useful meaning for direction, costs, fee_bps, slippage_bps, horizon_h, and min_spread_pct, though it does not materially elaborate sort or limit beyond the schema.

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 description states a specific verb and resource: a carry screener for perpetual futures that pairs venues and scores the price gap plus funding over a horizon. It clearly distinguishes the tool's output as gross_apr and net_apr, and its use of both perp-perp and spot-perp pairs.

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

Usage Guidelines3/5

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

Usage is implied by calling it a carry screener and describing defaults, but there is no explicit when-to-use or when-not-to-use guidance. It references perp_funding only for leg status fields, not as an alternative tool to choose between.

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.