{
  "tool_id": "art-654-perp-funding-implied-yield",
  "note": "offshore-8h-twap unclamped long, offshore-8h-twap clamped short (high funding), kalshi-periodic long, kalshi-periodic short (negative funding), offshore-8h-twap chained-to-prior-print, and three domain-error refusal paths (invalid mechanism, invalid mark_price, malformed prev_funding_hash).",
  "vectors": [
    {
      "name": "offshore_8h_twap_long_unclamped",
      "policy_parameters": {
        "funding_mechanism": "offshore-8h-twap",
        "venue": "hyperliquid",
        "mark_price": 65200,
        "index_price": 65000,
        "interval_hours": 8,
        "position_notional": 100000,
        "position_side": "long",
        "premium_index_pct": 0.02,
        "interest_rate_pct": 0.01,
        "clamp_pct": 0.05
      },
      "output_payload": {
        "funding_mechanism": "offshore-8h-twap",
        "venue": "hyperliquid",
        "mark_price": 65200,
        "index_price": 65000,
        "interval_hours": 8,
        "position_side": "long",
        "position_notional": 100000,
        "premium_index_pct": 0.02,
        "interest_rate_pct": 0.01,
        "clamp_pct": 0.05,
        "funding_rate_pct": 0.01,
        "funding_payment": 10,
        "funding_payment_direction": "position_pays",
        "periods_per_year": 1095,
        "implied_annual_funding_yield_pct": 10.95,
        "prev_funding_hash": null,
        "chained": false,
        "domain_errors": [],
        "mechanism_note": "offshore-8h-twap: funding_rate = premium_index + clamp(interest_rate - premium_index, -clamp_pct, +clamp_pct), applied to a TWAP-sampled premium index over the declared interval -- the continuous funding formula shape observed on offshore perpetual venues (e.g. Binance/Hyperliquid-class). The TWAP sampling and clamp bound are venue conventions this node lets the caller declare; the cited policy statement (see this node's cited_clause_digest) describes the funding-rate concept in general terms and does not itself prescribe this or any specific formula.",
        "sign_convention_note": "Per the cited policy statement (see this node's cited_clause_digest): when the perpetual contract trades above the underlying spot/index price, long positions make payments while short positions receive them, and vice versa. funding_rate_pct > 0 with position_side=\"long\" therefore yields a positive (paying) funding_payment; the reverse holds for a short position or a negative rate.",
        "scope_note": "Recomputes a caller-declared funding-rate formula and its simple-annualized implied yield from caller-declared inputs. Never fetches a live market price or a venue's actual current funding print, never asserts that any venue's own published print matches this recompute, and the mechanism formulas themselves are declared modeling conventions (see mechanism_note), not requirements drawn from the cited policy statement.",
        "disclaimer": "Not financial advice. Verify actual funding mechanics, interval length, and historical prints with your venue before trading. For informational purposes only."
      },
      "golden_hash": "8bd149da386744f390511ea8a51d86404bdbd1329299d679ede62c2731a96d78"
    },
    {
      "name": "offshore_8h_twap_short_clamped_high_funding",
      "policy_parameters": {
        "funding_mechanism": "offshore-8h-twap",
        "venue": "binance",
        "mark_price": 51000,
        "index_price": 50000,
        "interval_hours": 8,
        "position_notional": 50000,
        "position_side": "short",
        "premium_index_pct": 0.8,
        "interest_rate_pct": 0.01,
        "clamp_pct": 0.05
      },
      "output_payload": {
        "funding_mechanism": "offshore-8h-twap",
        "venue": "binance",
        "mark_price": 51000,
        "index_price": 50000,
        "interval_hours": 8,
        "position_side": "short",
        "position_notional": 50000,
        "premium_index_pct": 0.8,
        "interest_rate_pct": 0.01,
        "clamp_pct": 0.05,
        "funding_rate_pct": 0.75,
        "funding_payment": -375,
        "funding_payment_direction": "position_receives",
        "periods_per_year": 1095,
        "implied_annual_funding_yield_pct": 821.25,
        "prev_funding_hash": null,
        "chained": false,
        "domain_errors": [],
        "mechanism_note": "offshore-8h-twap: funding_rate = premium_index + clamp(interest_rate - premium_index, -clamp_pct, +clamp_pct), applied to a TWAP-sampled premium index over the declared interval -- the continuous funding formula shape observed on offshore perpetual venues (e.g. Binance/Hyperliquid-class). The TWAP sampling and clamp bound are venue conventions this node lets the caller declare; the cited policy statement (see this node's cited_clause_digest) describes the funding-rate concept in general terms and does not itself prescribe this or any specific formula.",
        "sign_convention_note": "Per the cited policy statement (see this node's cited_clause_digest): when the perpetual contract trades above the underlying spot/index price, long positions make payments while short positions receive them, and vice versa. funding_rate_pct > 0 with position_side=\"long\" therefore yields a positive (paying) funding_payment; the reverse holds for a short position or a negative rate.",
        "scope_note": "Recomputes a caller-declared funding-rate formula and its simple-annualized implied yield from caller-declared inputs. Never fetches a live market price or a venue's actual current funding print, never asserts that any venue's own published print matches this recompute, and the mechanism formulas themselves are declared modeling conventions (see mechanism_note), not requirements drawn from the cited policy statement.",
        "disclaimer": "Not financial advice. Verify actual funding mechanics, interval length, and historical prints with your venue before trading. For informational purposes only."
      },
      "golden_hash": "ab0fa32e9b199c3d77dd7bfd965403d44c3b8c5612f20b8948a1b043ed6f5b4e"
    },
    {
      "name": "kalshi_periodic_long",
      "policy_parameters": {
        "funding_mechanism": "kalshi-periodic",
        "venue": "kalshi",
        "mark_price": 100250,
        "index_price": 100000,
        "interval_hours": 1,
        "position_notional": 20000,
        "position_side": "long",
        "premium_index_pct": 0.05,
        "interest_rate_pct": 0
      },
      "output_payload": {
        "funding_mechanism": "kalshi-periodic",
        "venue": "kalshi",
        "mark_price": 100250,
        "index_price": 100000,
        "interval_hours": 1,
        "position_side": "long",
        "position_notional": 20000,
        "premium_index_pct": 0.05,
        "interest_rate_pct": 0,
        "clamp_pct": null,
        "funding_rate_pct": 0.05,
        "funding_payment": 10,
        "funding_payment_direction": "position_pays",
        "periods_per_year": 8760,
        "implied_annual_funding_yield_pct": 438,
        "prev_funding_hash": null,
        "chained": false,
        "domain_errors": [],
        "mechanism_note": "kalshi-periodic: funding_rate = premium_index, a single point-in-time price-differential reset at the declared interval, with no interest-rate offset term and no clamp -- modeled as the simpler, more directly observable mechanism shape a CFTC-regulated, manipulation-resistant DCM listing would plausibly use in place of a continuously-sampled offshore-style TWAP+clamp formula (see this node's cited_clause_digest for the reliability-at-every-funding-interval discussion this models against). The cited policy statement does not itself prescribe this or any specific formula -- this is a declared modeling choice (standards_basis: cites_informative), not a conformance claim against any venue's actual, unpublished-to-this-node computation.",
        "sign_convention_note": "Per the cited policy statement (see this node's cited_clause_digest): when the perpetual contract trades above the underlying spot/index price, long positions make payments while short positions receive them, and vice versa. funding_rate_pct > 0 with position_side=\"long\" therefore yields a positive (paying) funding_payment; the reverse holds for a short position or a negative rate.",
        "scope_note": "Recomputes a caller-declared funding-rate formula and its simple-annualized implied yield from caller-declared inputs. Never fetches a live market price or a venue's actual current funding print, never asserts that any venue's own published print matches this recompute, and the mechanism formulas themselves are declared modeling conventions (see mechanism_note), not requirements drawn from the cited policy statement.",
        "disclaimer": "Not financial advice. Verify actual funding mechanics, interval length, and historical prints with your venue before trading. For informational purposes only."
      },
      "golden_hash": "c095f48c0e4310b2db6123aeef4d56367317266f66fc50011b73a3124989d102"
    },
    {
      "name": "kalshi_periodic_short_negative_funding",
      "policy_parameters": {
        "funding_mechanism": "kalshi-periodic",
        "venue": "kalshi",
        "mark_price": 99800,
        "index_price": 100000,
        "interval_hours": 4,
        "position_notional": 15000,
        "position_side": "short",
        "premium_index_pct": -0.02
      },
      "output_payload": {
        "funding_mechanism": "kalshi-periodic",
        "venue": "kalshi",
        "mark_price": 99800,
        "index_price": 100000,
        "interval_hours": 4,
        "position_side": "short",
        "position_notional": 15000,
        "premium_index_pct": -0.02,
        "interest_rate_pct": 0,
        "clamp_pct": null,
        "funding_rate_pct": -0.02,
        "funding_payment": 3,
        "funding_payment_direction": "position_pays",
        "periods_per_year": 2190,
        "implied_annual_funding_yield_pct": -43.8,
        "prev_funding_hash": null,
        "chained": false,
        "domain_errors": [],
        "mechanism_note": "kalshi-periodic: funding_rate = premium_index, a single point-in-time price-differential reset at the declared interval, with no interest-rate offset term and no clamp -- modeled as the simpler, more directly observable mechanism shape a CFTC-regulated, manipulation-resistant DCM listing would plausibly use in place of a continuously-sampled offshore-style TWAP+clamp formula (see this node's cited_clause_digest for the reliability-at-every-funding-interval discussion this models against). The cited policy statement does not itself prescribe this or any specific formula -- this is a declared modeling choice (standards_basis: cites_informative), not a conformance claim against any venue's actual, unpublished-to-this-node computation.",
        "sign_convention_note": "Per the cited policy statement (see this node's cited_clause_digest): when the perpetual contract trades above the underlying spot/index price, long positions make payments while short positions receive them, and vice versa. funding_rate_pct > 0 with position_side=\"long\" therefore yields a positive (paying) funding_payment; the reverse holds for a short position or a negative rate.",
        "scope_note": "Recomputes a caller-declared funding-rate formula and its simple-annualized implied yield from caller-declared inputs. Never fetches a live market price or a venue's actual current funding print, never asserts that any venue's own published print matches this recompute, and the mechanism formulas themselves are declared modeling conventions (see mechanism_note), not requirements drawn from the cited policy statement.",
        "disclaimer": "Not financial advice. Verify actual funding mechanics, interval length, and historical prints with your venue before trading. For informational purposes only."
      },
      "golden_hash": "eaee4bfd352221daef968e42c4b7a0ccfcb3007a85bf8ba8e80a593492f8ad79"
    },
    {
      "name": "offshore_8h_twap_chained_to_prior_print",
      "policy_parameters": {
        "funding_mechanism": "offshore-8h-twap",
        "venue": "hyperliquid",
        "mark_price": 65100,
        "index_price": 65000,
        "interval_hours": 8,
        "position_notional": 100000,
        "position_side": "long",
        "premium_index_pct": 0.01,
        "interest_rate_pct": 0.01,
        "clamp_pct": 0.05,
        "prev_funding_hash": "sha256:a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1"
      },
      "output_payload": {
        "funding_mechanism": "offshore-8h-twap",
        "venue": "hyperliquid",
        "mark_price": 65100,
        "index_price": 65000,
        "interval_hours": 8,
        "position_side": "long",
        "position_notional": 100000,
        "premium_index_pct": 0.01,
        "interest_rate_pct": 0.01,
        "clamp_pct": 0.05,
        "funding_rate_pct": 0.01,
        "funding_payment": 10,
        "funding_payment_direction": "position_pays",
        "periods_per_year": 1095,
        "implied_annual_funding_yield_pct": 10.95,
        "prev_funding_hash": "sha256:a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a1",
        "chained": true,
        "domain_errors": [],
        "mechanism_note": "offshore-8h-twap: funding_rate = premium_index + clamp(interest_rate - premium_index, -clamp_pct, +clamp_pct), applied to a TWAP-sampled premium index over the declared interval -- the continuous funding formula shape observed on offshore perpetual venues (e.g. Binance/Hyperliquid-class). The TWAP sampling and clamp bound are venue conventions this node lets the caller declare; the cited policy statement (see this node's cited_clause_digest) describes the funding-rate concept in general terms and does not itself prescribe this or any specific formula.",
        "sign_convention_note": "Per the cited policy statement (see this node's cited_clause_digest): when the perpetual contract trades above the underlying spot/index price, long positions make payments while short positions receive them, and vice versa. funding_rate_pct > 0 with position_side=\"long\" therefore yields a positive (paying) funding_payment; the reverse holds for a short position or a negative rate.",
        "scope_note": "Recomputes a caller-declared funding-rate formula and its simple-annualized implied yield from caller-declared inputs. Never fetches a live market price or a venue's actual current funding print, never asserts that any venue's own published print matches this recompute, and the mechanism formulas themselves are declared modeling conventions (see mechanism_note), not requirements drawn from the cited policy statement.",
        "disclaimer": "Not financial advice. Verify actual funding mechanics, interval length, and historical prints with your venue before trading. For informational purposes only."
      },
      "golden_hash": "29c58dbf2537438422b3915214693bd9885b0eb0f0e058d7069281adfbfa4cd4"
    },
    {
      "name": "domain_error_invalid_mechanism",
      "policy_parameters": {
        "funding_mechanism": "bogus-mechanism",
        "venue": "x",
        "mark_price": 100,
        "index_price": 100,
        "interval_hours": 8,
        "position_notional": 1000,
        "position_side": "long",
        "premium_index_pct": 0.1
      },
      "output_payload": {
        "funding_mechanism": null,
        "venue": "x",
        "interval_hours": 8,
        "position_side": "long",
        "funding_rate_pct": null,
        "funding_payment": null,
        "funding_payment_direction": null,
        "periods_per_year": null,
        "implied_annual_funding_yield_pct": null,
        "prev_funding_hash": null,
        "chained": false,
        "domain_errors": [
          "INVALID_FUNDING_MECHANISM"
        ],
        "scope_note": "One or more declared inputs failed domain validation; no funding-rate or implied-yield figure is computed. Inputs are never silently clamped or coerced to a default — correct every field named in domain_errors and resubmit."
      },
      "golden_hash": "9323dfa2e57ea76ca120a10d51ce908f41deb0943ef2ea0376fdd7ed69526f30"
    },
    {
      "name": "domain_error_negative_mark_price",
      "policy_parameters": {
        "funding_mechanism": "offshore-8h-twap",
        "mark_price": -5,
        "index_price": 100,
        "interval_hours": 8,
        "position_notional": 1000,
        "position_side": "long",
        "premium_index_pct": 0.1,
        "clamp_pct": 0.05
      },
      "output_payload": {
        "funding_mechanism": "offshore-8h-twap",
        "venue": null,
        "interval_hours": 8,
        "position_side": "long",
        "funding_rate_pct": null,
        "funding_payment": null,
        "funding_payment_direction": null,
        "periods_per_year": null,
        "implied_annual_funding_yield_pct": null,
        "prev_funding_hash": null,
        "chained": false,
        "domain_errors": [
          "INVALID_MARK_PRICE"
        ],
        "scope_note": "One or more declared inputs failed domain validation; no funding-rate or implied-yield figure is computed. Inputs are never silently clamped or coerced to a default — correct every field named in domain_errors and resubmit."
      },
      "golden_hash": "e63ce34735061bed012f737598ebd5d925bd434aa54b2e6c52804151f6cf6c7e"
    },
    {
      "name": "domain_error_malformed_prev_hash",
      "policy_parameters": {
        "funding_mechanism": "kalshi-periodic",
        "mark_price": 100,
        "index_price": 100,
        "interval_hours": 1,
        "position_notional": 1000,
        "position_side": "short",
        "premium_index_pct": 0.1,
        "prev_funding_hash": "not-a-real-hash"
      },
      "output_payload": {
        "funding_mechanism": "kalshi-periodic",
        "venue": null,
        "interval_hours": 1,
        "position_side": "short",
        "funding_rate_pct": null,
        "funding_payment": null,
        "funding_payment_direction": null,
        "periods_per_year": null,
        "implied_annual_funding_yield_pct": null,
        "prev_funding_hash": null,
        "chained": false,
        "domain_errors": [
          "INVALID_PREV_FUNDING_HASH"
        ],
        "scope_note": "One or more declared inputs failed domain validation; no funding-rate or implied-yield figure is computed. Inputs are never silently clamped or coerced to a default — correct every field named in domain_errors and resubmit."
      },
      "golden_hash": "98d90f9dbf2952f245cb697dff1ce925884e676f8ff7d2a249808d9038bba5af"
    }
  ]
}
