{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/coinrithm-com/json-schema/coinrithm-com-futures-quote-response-schema.json",
  "title": "FuturesQuoteResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/coinrithm-com-futures-api-openapi.yml#/components/schemas/FuturesQuoteResponse",
  "type": "object",
  "properties": {
    "eligible": {
      "type": "boolean"
    },
    "blockReasons": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "coin": {
      "type": "object",
      "properties": {
        "ucid": {
          "type": "string"
        },
        "symbol": {
          "type": "string"
        },
        "name": {
          "type": "string"
        }
      }
    },
    "side": {
      "type": [
        "string",
        "null"
      ]
    },
    "leverage": {
      "type": [
        "number",
        "null"
      ]
    },
    "marginMusd": {
      "type": [
        "number",
        "null"
      ]
    },
    "minMargin": {
      "type": "number"
    },
    "maxLeverage": {
      "type": "number"
    },
    "referenceMark": {
      "type": [
        "number",
        "null"
      ],
      "description": "Mark price the quote was priced from; executable entryPrice may include the fill model."
    },
    "entryPrice": {
      "type": [
        "number",
        "null"
      ]
    },
    "notionalMusd": {
      "type": [
        "number",
        "null"
      ]
    },
    "sizeCoin": {
      "type": [
        "number",
        "null"
      ]
    },
    "liquidationPrice": {
      "type": [
        "number",
        "null"
      ]
    },
    "maintenanceMarginRate": {
      "type": [
        "number",
        "null"
      ]
    },
    "executionModel": {
      "$ref": "#/$defs/ExecutionModel"
    },
    "fill": {
      "type": [
        "object",
        "null"
      ],
      "description": "Estimated executable fill; null when the futures fill model is disabled.",
      "properties": {
        "model": {
          "type": "string"
        },
        "referenceMark": {
          "type": "number"
        },
        "execPrice": {
          "type": "number"
        },
        "sizeCoin": {
          "type": "number"
        },
        "adverseBps": {
          "type": "number"
        },
        "adverseCostMusd": {
          "type": "number"
        },
        "impactBps": {
          "type": "number"
        },
        "impactBasis": {
          "type": "string",
          "enum": [
            "volume",
            "cap_fallback"
          ]
        },
        "volumeCoverage": {
          "type": "string",
          "enum": [
            "complete",
            "partial",
            "unknown"
          ]
        },
        "unavailable": {
          "type": [
            "string",
            "null"
          ]
        }
      }
    },
    "funding": {
      "description": "Latest venue funding quote; null when no funding rate is available for this coin.",
      "oneOf": [
        {
          "$ref": "#/$defs/FuturesFundingQuote"
        },
        {
          "type": "null"
        }
      ]
    },
    "perpetual": {
      "description": "Current perpetual contract reference used by the entry gate and funding source; this is not historical funding provenance.",
      "oneOf": [
        {
          "$ref": "#/$defs/FuturesPerpetualReference"
        },
        {
          "type": "null"
        }
      ]
    },
    "freshness": {
      "$ref": "#/$defs/Freshness"
    },
    "observation": {
      "$ref": "#/$defs/AgentObservation"
    }
  },
  "$defs": {
    "AgentObservation": {
      "type": "object",
      "description": "Compact provenance block for an agent-facing market observation. It is\nalso stored in the private ledger responseSummary when the request uses\nagentTrace/run headers, giving run exports a verifiable snapshot of what\nthe agent observed without creating a full market archive.\n",
      "properties": {
        "schema": {
          "type": "string"
        },
        "endpoint": {
          "type": "string"
        },
        "source": {
          "type": "string"
        },
        "observedAt": {
          "type": "string",
          "format": "date-time"
        },
        "sourceAsOf": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "freshness": {
          "anyOf": [
            {
              "$ref": "#/$defs/Freshness"
            },
            {
              "type": "null"
            }
          ]
        },
        "inputs": {
          "type": "object",
          "additionalProperties": true
        },
        "dataset": {
          "type": "object",
          "additionalProperties": true
        },
        "rowCount": {
          "type": [
            "integer",
            "null"
          ]
        },
        "hash": {
          "type": "string",
          "description": "Short SHA-256 digest of the observed payload metadata."
        }
      }
    },
    "ExecutionModel": {
      "type": "object",
      "description": "Paper Execution Realism v1 cost disclosure. Paper fills apply a\ndeterministic, fully-disclosed cost so simulated PnL reflects real\ntrading friction (a flat round-trip is a small loss, not a free\nbreakeven). This is a rehearsal cost model, NOT an exchange fill\nguarantee. Per venue:\n    - spot: a taker fee (`feeBps`) on notional, with market orders also\n      filling at an adverse price (half-spread + slippage). Futures use\n      the default-off legacy mark fill unless `futures_fill_v1` is\n      pinned; that model applies deterministic half-spread, slippage,\n      and square-root size-scaled impact, with adverse cost embedded in\n      the executed price.\n  - PM: fills at the ask (mid + half the ingested bid-ask spread) with\n    size/liquidity-based slippage and a Polymarket-shaped taker fee\n    (~1.8% near 50%, ~0 at the extremes), folded into `sharesMusd`.\n    `feeBps`/`spreadBps` are positive and `slippageBps` scales with\n    order size; `entryProbability` stays the mid for calibration.\nFutures quote funding is estimated from the latest venue rate when\navailable and may change before settlement. Covered futures charges are\napplied from recorded settled venue history; `fundingMode` is a\nvenue-specific mode such as `binance_perp_rate_v1`,\n`bybit_perp_rate_v1`, or `gateio_perp_rate_v1`, and is\n`not_modeled` when no latest rate is available. Funding does not apply\nto spot or PM. Futures liquidation forfeits margin without adverse fill\ncost, and fixed-price SL/TP triggers fill at their set price. Order-book\ndepth, latency, and partial fills are not modeled.\n",
      "properties": {
        "version": {
          "type": "string"
        },
        "feeBps": {
          "type": "number",
          "description": "taker fee, basis points of notional"
        },
        "spreadBps": {
          "type": "number",
          "description": "modeled bid/ask spread (bps)"
        },
        "slippageBps": {
          "type": "number",
          "description": "modeled slippage (bps)"
        },
        "fillModel": {
          "type": [
            "string",
            "null"
          ],
          "description": "Futures fill model pinned for this execution, or null for legacy mark fills."
        },
        "estimatedFeeMusd": {
          "type": "number",
          "description": "estimated fee for this trade (mUSD)"
        },
        "estimatedSlippageMusd": {
          "type": "number",
          "description": "estimated slippage cost for this trade (mUSD)"
        },
        "fundingMode": {
          "type": "string",
          "description": "Venue-specific current funding reference mode, or not_modeled when no latest rate is available."
        },
        "assumptions": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "human-readable list of what is and isn't modeled"
        }
      }
    },
    "Freshness": {
      "type": "object",
      "description": "Data-freshness descriptor. Futures + spot use ageSeconds; PM uses\nageMinutes. `status` is a freshness label; `basis` (PM only) names which\ntimestamp the age was measured against.\n",
      "properties": {
        "asOf": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time"
        },
        "ageSeconds": {
          "type": [
            "number",
            "null"
          ],
          "description": "futures / spot"
        },
        "ageMinutes": {
          "type": [
            "number",
            "null"
          ],
          "description": "PM"
        },
        "status": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "fresh",
            "lagging",
            "stale",
            "unknown",
            null
          ],
          "description": "fresh | lagging (PM only) | stale | unknown. PM lagging>=45m &\nstale>=2h; spot/futures stale>120s.\n"
        },
        "basis": {
          "type": [
            "string",
            "null"
          ],
          "enum": [
            "latest_snapshot",
            "source_update",
            "processed",
            "event_update",
            "unknown"
          ],
          "description": "PM only — which timestamp the age was measured against.\n"
        }
      }
    },
    "FuturesFundingQuote": {
      "type": "object",
      "required": [
        "venue",
        "symbol",
        "rate",
        "intervalHours",
        "nextFundingTime",
        "asOf",
        "estimatedPerIntervalMusd",
        "annualizedRate"
      ],
      "description": "Latest funding rate used by the futures quote. The rate is signed as\nprovided by the venue: for a long, a positive rate produces a positive\nestimated payment; a negative rate produces a receipt. The estimate is\nfor the quoted position at the next settlement and is signed the same\nway (positive = paid, negative = received). `estimatedPerIntervalMusd`\nis null when the quote cannot price a position; zero remains a real\nestimate.\n",
      "properties": {
        "venue": {
          "type": "string",
          "description": "Funding-rate venue identifier."
        },
        "symbol": {
          "type": "string",
          "description": "Venue perpetual symbol."
        },
        "rate": {
          "type": "number",
          "description": "Signed venue funding rate for the next settlement."
        },
        "intervalHours": {
          "type": "integer",
          "description": "Funding settlement interval in hours."
        },
        "nextFundingTime": {
          "type": "string",
          "format": "date-time",
          "description": "Next expected funding settlement."
        },
        "asOf": {
          "type": "string",
          "format": "date-time",
          "description": "When this venue rate was fetched."
        },
        "estimatedPerIntervalMusd": {
          "type": [
            "number",
            "null"
          ],
          "description": "Signed estimated payment for the quoted position in mUSD (positive = paid, negative = received); null when unavailable. Zero is meaningful."
        },
        "annualizedRate": {
          "type": "number",
          "description": "Signed simple annualized rate (rate multiplied by intervals per year; not compounded)."
        },
        "stale": {
          "type": "boolean",
          "description": "Whether this latest venue rate exceeds the freshness policy."
        }
      }
    },
    "FuturesPerpetualReference": {
      "type": "object",
      "required": [
        "listed",
        "venue",
        "symbol",
        "fundingIntervalHours",
        "fetchedAt",
        "stale"
      ],
      "description": "Current venue/contract reference for a coin. Historical funding charges remain on funding ledger events.",
      "properties": {
        "listed": {
          "type": "boolean",
          "description": "Whether a covered venue reference is currently known."
        },
        "venue": {
          "type": [
            "string",
            "null"
          ],
          "description": "Current funding venue identifier, such as binance, bybit, or gateio."
        },
        "symbol": {
          "type": [
            "string",
            "null"
          ],
          "description": "Current venue perpetual symbol."
        },
        "fundingIntervalHours": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Current venue funding interval in hours."
        },
        "fetchedAt": {
          "type": [
            "string",
            "null"
          ],
          "format": "date-time",
          "description": "When the current venue reference was fetched; null when unavailable."
        },
        "stale": {
          "type": "boolean",
          "description": "Whether the current venue reference exceeds the freshness policy."
        }
      }
    }
  }
}