{"version":3,"file":"pricing.mjs","names":["i64.I64"],"sources":["../../../../../src/contracts/deepbook_predict_orders/deps/deepbook_predict/pricing.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\n\n/**\n * Pricing for Predict markets.\n *\n * This module reads canonical Propbook Pyth and Block Scholes feeds and computes\n * SVI-adjusted digital probabilities. Live reads require fresh, pricing-safe Block\n * Scholes spot, forward, and SVI observations. The latest forward is paired with\n * an exact source-timestamp spot from Propbook's bounded recent history. The live\n * forward comes from one of two admin-selected sources\n * (`PricingConfig.use_pyth_spot_for_forward`): a fresh positive Pyth spot carrying\n * the Block Scholes basis, or the Block Scholes forward directly. A load falls\n * back to the Block Scholes forward when the selected Pyth spot is stale or\n * unavailable; valuation prices on that fallback, while every live trade (mints,\n * mint quotes, and live redeems) refuses it through `assert_pyth_spot_fresh`.\n * Exact-history reads do not apply live freshness policy.\n *\n * Delayed execution splits that read in two. `load_vol` validates the same live\n * inputs when an order is admitted and returns the raw Block Scholes basis and SVI\n * its receipt stores; `pricer_at` later rebuilds a `Pricer` from them at the\n * order's committed Pyth tick. The `try_*` reads price exactly as `up_price` and\n * `range_price` do, and return `none` where those abort, so an order-flow fill\n * never aborts on a surface.\n *\n * A Propbook SVI store signs its parameters at the decimals the admin set on it,\n * `9` or `18`. Every load prices `a` and `b` at 1e18 either way, exactly when the\n * store is at 18. A receipt's snapshot keeps them at 1e9, so an admission at 18\n * also records the full-precision tuple in its market's SVI cache, a dynamic field\n * this module keeps on the market's UID (`SviKey`), and the fill prices from that\n * entry when it still holds it.\n */\n\nimport { MoveStruct } from '../../../utils/index.js';\nimport { bcs } from '@mysten/sui/bcs';\nimport { U64 } from '../../../../bcs/integers.js';\nimport * as i64 from '../fixed_math/i64.js';\nconst $moduleName = 'deepbook_predict::pricing';\nexport const VolSnapshot = new MoveStruct({\n\tname: `${$moduleName}::VolSnapshot`,\n\tfields: {\n\t\t/**\n\t\t * Canonical Propbook Pyth source for the market's underlying; commit finds this\n\t\t * feed in each Lazer update.\n\t\t */\n\t\tpyth_source_id: bcs.u32(),\n\t\t/** The matched Block Scholes spot and forward, narrowed to Predict's width. */\n\t\tbs_spot: U64,\n\t\tbs_forward: U64,\n\t\t/** Raw SVI parameters before roll-down, at 1e9. */\n\t\tsvi_a: i64.I64,\n\t\tsvi_b: U64,\n\t\tsvi_rho: i64.I64,\n\t\tsvi_m: i64.I64,\n\t\tsvi_sigma: U64,\n\t\t/**\n\t\t * Provider source timestamps of the three reads. The SVI one is also the roll-down\n\t\t * anchor.\n\t\t */\n\t\tbs_spot_source_timestamp_ms: U64,\n\t\tbs_forward_source_timestamp_ms: U64,\n\t\tsvi_source_timestamp_ms: U64,\n\t},\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsCA,MAAM,cAAc;AACpB,MAAa,cAAc,IAAI,WAAW;CACzC,MAAM,GAAG,YAAY;CACrB,QAAQ;EAKP,gBAAgB,IAAI,KAAK;EAEzB,SAAS;EACT,YAAY;EAEZ,OAAOA;EACP,OAAO;EACP,SAASA;EACT,OAAOA;EACP,WAAW;EAKX,6BAA6B;EAC7B,gCAAgC;EAChC,yBAAyB;EACzB;CACD,CAAC"}