The finance developer workbenchSearch the reference Development · 0.1.4 · unpublished

crypto / wire operation

Futures basis / cash-and-carry

totalfinance.crypto.futures_basis

Annualized basis of a dated future over spot — the cash-and-carry yield. Reports raw and percentage basis, simple and continuously-compounded annualization, contango/backwardation, and flags an arbitrage-sized basis.

Pack / profilescrypto / default, full
Default discoveryIncluded
Required capabilitiesNone
Effects / authorizationnone / none
Cost / cancellationsmall / Do not assume inline interruption
Handle-eligible inputsNone
Idempotencynot-applicable
Input schema
{
  "type": "object",
  "properties": {
    "spot": {
      "type": "number",
      "exclusiveMinimum": 0,
      "description": "Spot price (quote currency)"
    },
    "future": {
      "type": "number",
      "exclusiveMinimum": 0,
      "description": "Dated-futures price (quote currency)"
    },
    "timeToExpiryYears": {
      "type": "number",
      "exclusiveMinimum": 0,
      "description": "Time to futures expiry in YEARS"
    },
    "financingRate": {
      "type": "number",
      "description": "Quote financing rate (annualized decimal) — supply to get fairFuture/richness/carryArbitrage and the cash-and-carry arbitrage flag"
    },
    "coinYield": {
      "type": "number",
      "description": "Base-coin yield (annualized decimal, e.g. staking; default 0)"
    },
    "arbitrageThreshold": {
      "type": "number",
      "description": "|carryArbitrage| above which cash-and-carry is flagged (decimal, default 0.05)"
    }
  },
  "additionalProperties": false,
  "required": [
    "spot",
    "future",
    "timeToExpiryYears"
  ]
}
Output schema
{
  "type": "object",
  "properties": {
    "value": {
      "description": "The computed result"
    },
    "assumptions": {
      "type": "object",
      "description": "Every applied convention, echoed"
    },
    "diagnostics": {
      "type": "object",
      "description": "Engine/method/warnings (+ convergence where iterative)"
    }
  },
  "required": [
    "value",
    "assumptions",
    "diagnostics"
  ]
}

All operations · Setup, handles, jobs & permissions