{"version":3,"file":"queue.mjs","names":["OrderViewBcs","expiryMarket.expiry","expiryMarket.mintPaused","expiryMarket.cashBalance","expiryMarket.requiredCash","expiryMarket.backingBufferLambda","expiryMarket.orderFlowState","queue.queueStuck","queue.waitingCohorts","queue.queueHeads","queue.pendingCounts","queue.payoutProgress","desk.policy","desk.versionWatermark","protocolConfig.noTradeWindowMs","protocolConfig.feeIncentiveSubsidyRate","protocolConfig.tradingPaused","protocolConfig.frozen","protocolConfig.versionWatermark","protocolConfig.isOrderFlow","queue.waitingOrders","account.loadAccount","account.balance","queue.order","cashBalance","requiredCash","DelayedExecutionPolicyBcs","balance","quoteRedeemOpenCall","expiryMarket.quoteMintExactCostForAccount","expiryMarket.quoteMintForAccount","expiryMarket.quoteMint"],"sources":["../../../src/predict/reads/queue.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n// Delayed execution (DBU-885): chain reads for the order queue. A market's queue is a\n// `MarketQueue` in the order-flow companion (`deepbook_predict_orders`), at an ID derived from the\n// companion's `OrderDesk` and the market, so these reads take `OrdersGeneratedConfig` and the\n// facade gates them on the config recording the companion. The market's cash figures stay\n// Predict reads. A market whose queue doesn't exist yet can't be read: the facade checks that\n// first.\nimport type { ClientWithCoreApi } from '@mysten/sui/client';\nimport { bcs } from '@mysten/sui/bcs';\nimport { Transaction, type TransactionResult } from '@mysten/sui/transactions';\nimport { normalizeSuiAddress } from '@mysten/sui/utils';\nimport type { GeneratedConfig, OrdersGeneratedConfig } from '../config/generated.js';\nimport {\n\tDELAYED_EXECUTION_VERSION,\n\tPREDICT_PACKAGE_VERSION,\n\tpolicyFromBcs,\n\ttype DelayedExecutionPolicy,\n\ttype QueueHeads,\n\ttype QueuedOrder,\n} from '../queue.js';\nimport { deriveAccountIdFrom, deriveAccountWrapperIdFrom } from '../tx/common.js';\nimport { queueIdOf, type QueueTarget } from '../tx/queue.js';\nimport { loadLivePricer, type MarketFeeds } from '../tx/trade.js';\nimport { accountMoveCalls as account } from '../../account.js';\nimport * as expiryMarket from '../../contracts/deepbook_predict/expiry_market.js';\nimport * as protocolConfig from '../../contracts/deepbook_predict/protocol_config.js';\nimport { DelayedExecutionPolicy as DelayedExecutionPolicyBcs } from '../../contracts/deepbook_predict_orders/delayed_execution_config.js';\nimport * as desk from '../../contracts/deepbook_predict_orders/desk.js';\nimport { OrderView as OrderViewBcs } from '../../contracts/deepbook_predict_orders/order_queue.js';\nimport * as queue from '../../contracts/deepbook_predict_orders/queue.js';\nimport { quoteRedeemOpen as quoteRedeemOpenCall } from '../bindings/queue.js';\nimport { inspectReturns, type ReadClient } from './inspect.js';\nimport { parseOptionalU64, parseU64LE } from './parse.js';\n\nconst parseBool = (bytes: Uint8Array): boolean => (bytes[0] ?? 0) !== 0;\nconst OptionalOrderView = bcs.option(OrderViewBcs);\n\n/** The companion's `order_flow::OrderFlow` witness type, which Predict's allowlist names. */\nexport function orderFlowWitnessType(\n\tconfig: Pick<OrdersGeneratedConfig, 'predictOrdersPackageIdV1'>,\n) {\n\treturn `${config.predictOrdersPackageIdV1}::order_flow::OrderFlow`;\n}\n\n/** Everything the queued-order preflight and the app's queue view read, from one simulate. */\nexport interface MarketQueueState {\n\tmarketId: string;\n\t/** The market's `MarketQueue`. */\n\tqueueId: string;\n\texpiryMs: bigint;\n\tmintPaused: boolean;\n\tcashBalance: bigint;\n\trequiredCash: bigint;\n\t/**\n\t * Cash above required cash, 0 when below: the largest cash need a new queued mint may have\n\t * now (Predict's admission refuses a larger one).\n\t */\n\tspareCash: bigint;\n\t/** Summed cash need of the admitted orders; `rebalance_expiry_cash` funds it. */\n\twaitingCashNeed: bigint;\n\t/** 1e9-scaled. The mint cash-need formulas take it. */\n\tminEntryProbability: bigint;\n\t/** 1e9-scaled λ. The sell cash-need formula takes it. */\n\tbackingBufferLambda: bigint;\n\t/** Sizes a filler's resolve batch. */\n\tpayoutTreeNodeCount: bigint;\n\t/** `queue_stuck`: enqueue would refuse as stuck right now (\"pricing delayed\"). */\n\tstuck: boolean;\n\tcohorts: {\n\t\tcount: bigint;\n\t\toldestUncommittedTauMs: bigint | null;\n\t\t/** The cohort the stuck gate's first rule watches. */\n\t\toldestUncommittedTauAboveCommittedMs: bigint | null;\n\t};\n\theads: QueueHeads;\n\t/** Unfinished mints and sells, against the policy capacities. */\n\tpending: { mints: bigint; sells: bigint };\n\t/**\n\t * The settlement payout walk (`settle_step`): it resumes at `cursor`, and `completed` is set\n\t * by the call that emits `MarketPayoutsCompleted`.\n\t */\n\tpayout: { cursor: bigint; nextId: bigint; completed: boolean };\n\t/** The companion's `OrderDesk`: the policy every queue runs under, and its version floor. */\n\tdesk: {\n\t\tid: string;\n\t\tpolicy: DelayedExecutionPolicy;\n\t\tversionWatermark: bigint;\n\t};\n\tprotocol: {\n\t\tnoTradeWindowMs: bigint;\n\t\t/** The admin-set mint fee subsidy rate, 1e9-scaled (20% when unset). */\n\t\tfeeIncentiveSubsidyRate: bigint;\n\t\ttradingPaused: boolean;\n\t\tfrozen: boolean;\n\t\t/** Predict's version floor. Enqueue needs it at `DELAYED_EXECUTION_VERSION`. */\n\t\tversionWatermark: bigint;\n\t\t/**\n\t\t * Whether Predict allowlists this companion's `OrderFlow` witness\n\t\t * (`protocol_config::set_order_flow`). Predict's admission, commit and fill refuse it until\n\t\t * then (`EOrderFlowNotAllowed`).\n\t\t */\n\t\torderFlowEnabled: boolean;\n\t};\n\t/** Present when an owner was given. */\n\taccount: {\n\t\taccountId: string;\n\t\t/**\n\t\t * Unfinished orders the account holds in this market, against `per_account_cap`. Stale\n\t\t * after expiry: the settlement drain refunds without lowering it.\n\t\t */\n\t\twaitingOrders: bigint;\n\t\t/** `account::balance<USDC>`, unsettled accumulator funds included. */\n\t\tavailableRaw: bigint;\n\t} | null;\n\t/** One entry per requested record ID: the record, or `null` when missing or deleted. */\n\trecords: (QueuedOrder | null)[];\n}\n\n/**\n * Read a market's queue state in one simulate: Predict's cash figures and gates, the queue's\n * stuck gate, cohorts, heads and counters, and the desk's policy. With `owner`, also the\n * account's waiting-order count and USDC balance (the owner must have an account: loading a\n * missing wrapper aborts the read). With `recordIds`, also those records. The queue must exist.\n */\nexport async function marketQueueState(\n\tclient: ReadClient,\n\tconfig: OrdersGeneratedConfig,\n\tmarketId: string,\n\topts: {\n\t\towner?: string;\n\t\tquoteCoinType?: string;\n\t\trecordIds?: readonly bigint[];\n\t\tqueueId?: string;\n\t} = {},\n): Promise<MarketQueueState> {\n\tconst queueId = queueIdOf(config, { expiryMarketId: marketId, queueId: opts.queueId });\n\tconst tx = new Transaction();\n\tlet next = 0;\n\tconst results: TransactionResult[] = [];\n\tconst add = (command: (tx: Transaction) => TransactionResult): number => {\n\t\tresults.push(tx.add(command));\n\t\treturn next++;\n\t};\n\tconst market = { market: marketId };\n\tconst onQueue = { queue: queueId };\n\tconst i = {\n\t\texpiry: add(expiryMarket.expiry({ config, arguments: market })),\n\t\tmintPaused: add(expiryMarket.mintPaused({ config, arguments: market })),\n\t\tcashBalance: add(expiryMarket.cashBalance({ config, arguments: market })),\n\t\trequiredCash: add(expiryMarket.requiredCash({ config, arguments: market })),\n\t\tbackingBufferLambda: add(expiryMarket.backingBufferLambda({ config, arguments: market })),\n\t\torderFlow: add(expiryMarket.orderFlowState({ config, arguments: market })),\n\t\tstuck: add(queue.queueStuck({ config, arguments: onQueue })),\n\t\tcohorts: add(queue.waitingCohorts({ config, arguments: onQueue })),\n\t\theads: add(queue.queueHeads({ config, arguments: onQueue })),\n\t\tpending: add(queue.pendingCounts({ config, arguments: onQueue })),\n\t\tpayout: add(queue.payoutProgress({ config, arguments: onQueue })),\n\t\tpolicy: add(desk.policy({ config })),\n\t\tdeskWatermark: add(desk.versionWatermark({ config })),\n\t\tnoTradeWindowMs: add(protocolConfig.noTradeWindowMs({ config })),\n\t\tsubsidyRate: add(protocolConfig.feeIncentiveSubsidyRate({ config })),\n\t\ttradingPaused: add(protocolConfig.tradingPaused({ config })),\n\t\tfrozen: add(protocolConfig.frozen({ config })),\n\t\twatermark: add(protocolConfig.versionWatermark({ config })),\n\t\torderFlowEnabled: add(\n\t\t\tprotocolConfig.isOrderFlow({ config, typeArguments: [orderFlowWitnessType(config)] }),\n\t\t),\n\t};\n\tlet accountIdx: { waiting: number; balance: number; accountId: string } | null = null;\n\tif (opts.owner) {\n\t\tif (!opts.quoteCoinType) throw new Error('marketQueueState: owner reads need quoteCoinType');\n\t\tconst accountId = deriveAccountIdFrom(config, opts.owner);\n\t\tconst waiting = add(queue.waitingOrders({ config, arguments: { ...onQueue, accountId } }));\n\t\tconst loaded = add(\n\t\t\taccount.loadAccount({\n\t\t\t\tconfig,\n\t\t\t\targuments: { self: deriveAccountWrapperIdFrom(config, opts.owner) },\n\t\t\t}),\n\t\t);\n\t\tconst balance = add(\n\t\t\taccount.balance({\n\t\t\t\tconfig,\n\t\t\t\ttypeArguments: [opts.quoteCoinType],\n\t\t\t\targuments: { self: results[loaded] },\n\t\t\t}),\n\t\t);\n\t\taccountIdx = { waiting, balance, accountId };\n\t}\n\tconst recordIdx = (opts.recordIds ?? []).map((recordId) =>\n\t\tadd(queue.order({ config, arguments: { ...onQueue, recordId } })),\n\t);\n\n\tconst cmds = await inspectReturns(client, tx);\n\tconst u64 = (idx: number, value = 0) => parseU64LE(cmds[idx][value]);\n\tconst cashBalance = u64(i.cashBalance);\n\tconst requiredCash = u64(i.requiredCash);\n\treturn {\n\t\tmarketId: normalizeSuiAddress(marketId),\n\t\tqueueId: normalizeSuiAddress(queueId),\n\t\texpiryMs: u64(i.expiry),\n\t\tmintPaused: parseBool(cmds[i.mintPaused][0]),\n\t\tcashBalance,\n\t\trequiredCash,\n\t\tspareCash: cashBalance > requiredCash ? cashBalance - requiredCash : 0n,\n\t\twaitingCashNeed: u64(i.orderFlow, 0),\n\t\tpayoutTreeNodeCount: u64(i.orderFlow, 1),\n\t\tminEntryProbability: u64(i.orderFlow, 2),\n\t\tbackingBufferLambda: u64(i.backingBufferLambda),\n\t\tstuck: parseBool(cmds[i.stuck][0]),\n\t\tcohorts: {\n\t\t\tcount: u64(i.cohorts, 0),\n\t\t\toldestUncommittedTauMs: parseOptionalU64(cmds[i.cohorts][1]),\n\t\t\toldestUncommittedTauAboveCommittedMs: parseOptionalU64(cmds[i.cohorts][2]),\n\t\t},\n\t\theads: {\n\t\t\tresolveHead: u64(i.heads, 0),\n\t\t\tnextId: u64(i.heads, 1),\n\t\t\tlastTauMs: u64(i.heads, 2),\n\t\t\tlastCommittedTauMs: u64(i.heads, 3),\n\t\t},\n\t\tpending: { mints: u64(i.pending, 0), sells: u64(i.pending, 1) },\n\t\tpayout: {\n\t\t\tcursor: u64(i.payout, 0),\n\t\t\tnextId: u64(i.payout, 1),\n\t\t\tcompleted: parseBool(cmds[i.payout][2]),\n\t\t},\n\t\tdesk: {\n\t\t\tid: normalizeSuiAddress(config.orderDesk),\n\t\t\tpolicy: policyFromBcs(DelayedExecutionPolicyBcs.parse(cmds[i.policy][0])),\n\t\t\tversionWatermark: u64(i.deskWatermark),\n\t\t},\n\t\tprotocol: {\n\t\t\tnoTradeWindowMs: u64(i.noTradeWindowMs),\n\t\t\tfeeIncentiveSubsidyRate: u64(i.subsidyRate),\n\t\t\ttradingPaused: parseBool(cmds[i.tradingPaused][0]),\n\t\t\tfrozen: parseBool(cmds[i.frozen][0]),\n\t\t\tversionWatermark: u64(i.watermark),\n\t\t\torderFlowEnabled: parseBool(cmds[i.orderFlowEnabled][0]),\n\t\t},\n\t\taccount: accountIdx\n\t\t\t? {\n\t\t\t\t\taccountId: accountIdx.accountId,\n\t\t\t\t\twaitingOrders: u64(accountIdx.waiting),\n\t\t\t\t\tavailableRaw: u64(accountIdx.balance),\n\t\t\t\t}\n\t\t\t: null,\n\t\trecords: recordIdx.map((idx) => OptionalOrderView.parse(cmds[idx][0]) ?? null),\n\t};\n}\n\n/** Queue records by record ID (`queue::order`), `null` for a missing or cleaned-up one. One simulate. */\nexport async function queuedOrders(\n\tclient: ReadClient,\n\tconfig: OrdersGeneratedConfig,\n\ttarget: QueueTarget,\n\trecordIds: readonly bigint[],\n): Promise<(QueuedOrder | null)[]> {\n\tif (recordIds.length === 0) return [];\n\tconst queueId = queueIdOf(config, target);\n\tconst tx = new Transaction();\n\tfor (const recordId of recordIds) {\n\t\ttx.add(queue.order({ config, arguments: { queue: queueId, recordId } }));\n\t}\n\tconst cmds = await inspectReturns(client, tx);\n\treturn cmds.map((rv) => OptionalOrderView.parse(rv[0]) ?? null);\n}\n\n/**\n * `ProtocolConfig.version_watermark`, read from the object's own BCS rather than a getter, so it\n * works against any package version: the getter only exists from the delayed-execution package\n * on, while the struct layout is frozen since v1.\n */\nexport async function versionWatermark(\n\tclient: ClientWithCoreApi,\n\tprotocolConfigId: string,\n): Promise<bigint> {\n\tconst { object } = await client.core.getObject({\n\t\tobjectId: protocolConfigId,\n\t\tinclude: { content: true },\n\t});\n\tif (!object.content) throw new Error(`ProtocolConfig ${protocolConfigId} returned no content`);\n\treturn protocolConfig.ProtocolConfig.parse(object.content).version_watermark;\n}\n\n/**\n * Which trade path a network is on:\n * - `'immediate'`: the watermark isn't raised and this SDK has no delayed-execution record, so\n *   its call target is a pre-v4 Predict package. Use the immediate `mint*` / `redeem` builders.\n * - `'awaiting-cutover'`: the config records delayed execution but the watermark isn't raised.\n *   Nothing trades: enqueue aborts `ECutoverNotReached`, and the immediate builders abort in the\n *   v4 package the config calls (`EDelayedExecutionRequired`). Trading stays paused through the\n *   cutover.\n * - `'delayed'`: the watermark is raised. Use the `enqueue*` builders; the immediate ones abort\n *   `EDelayedExecutionRequired`.\n * - `'unsupported'`: the watermark is raised but this SDK's config has no delayed-execution\n *   record for the network. Upgrade the SDK, or pass a config that records it.\n * - `'retired'`: the watermark is above the Predict code version the config calls\n *   (`packages.predictCurrentVersion`, else `PREDICT_PACKAGE_VERSION`), so every version-gated\n *   call aborts `EPackageVersionDisabled`.\n *   Upgrade the SDK.\n */\nexport type ExecutionMode =\n\t'immediate' | 'awaiting-cutover' | 'delayed' | 'unsupported' | 'retired';\n\n/**\n * The {@link ExecutionMode} for a watermark and what the config records.\n * `recordsDelayedExecution`: the Predict upgrade, the order-flow companion and its desk, which\n * queued orders need. `recordsPredictUpgrade`: the Predict upgrade alone\n * (`packages.predictDelayedExecution`), which makes the config's Predict call target the package\n * that retired the immediate trades. It defaults to `recordsDelayedExecution`.\n */\nexport function executionModeFor(\n\twatermark: bigint,\n\trecordsDelayedExecution: boolean,\n\trecordsPredictUpgrade: boolean = recordsDelayedExecution,\n\tpredictCurrentVersion: bigint = PREDICT_PACKAGE_VERSION,\n): ExecutionMode {\n\tif (watermark >= DELAYED_EXECUTION_VERSION) {\n\t\tif (!recordsDelayedExecution) return 'unsupported';\n\t\treturn watermark > predictCurrentVersion ? 'retired' : 'delayed';\n\t}\n\treturn recordsDelayedExecution || recordsPredictUpgrade ? 'awaiting-cutover' : 'immediate';\n}\n\n/**\n * USDC sent to an account's wrapper address with `send_funds` that the account hasn't settled\n * yet: refunds, sell proceeds and settled payouts land here. `account::balance` already counts\n * them, so this is for display (\"pending funds\"), not for sizing.\n */\nexport async function pendingFunds(\n\tclient: ClientWithCoreApi,\n\twrapperId: string,\n\tcoinType: string,\n): Promise<bigint> {\n\tconst { balance } = await client.core.getBalance({ owner: wrapperId, coinType });\n\treturn BigInt(balance.addressBalance);\n}\n\n// The prefix of `pyth_lazer::state::State` up to the upgrade cap, identical in the testnet and\n// mainnet vendored sources. Parsing a prefix ignores the trailing `governance` field.\nconst LazerStatePrefix = bcs.struct('State', {\n\tid: bcs.Address,\n\ttrusted_signers: bcs.vector(\n\t\tbcs.struct('TrustedSignerInfo', { public_key: bcs.vector(bcs.u8()), expires_at: bcs.u64() }),\n\t),\n\tupgrade_cap: bcs.struct('UpgradeCap', {\n\t\tid: bcs.Address,\n\t\tpackage: bcs.Address,\n\t\tversion: bcs.u64(),\n\t\tpolicy: bcs.u8(),\n\t}),\n});\n\n/**\n * The current Pyth Lazer package (from `State.upgrade_cap.package`) and the original ID that\n * types `update::Update` (from the State's own type). Read it per filler batch and never cache\n * it: a Lazer upgrade retires the old package at once.\n */\nexport async function lazerPackages(\n\tclient: ClientWithCoreApi,\n\tstateId: string,\n): Promise<{ stateId: string; packageId: string; originalId: string }> {\n\tconst { object } = await client.core.getObject({ objectId: stateId, include: { content: true } });\n\tif (!object.content) throw new Error(`Lazer State ${stateId} returned no content`);\n\tconst [originalId, module, name] = object.type.split('::');\n\tif (module !== 'state' || name !== 'State') {\n\t\tthrow new Error(`${stateId} is a ${object.type}, not a Pyth Lazer State`);\n\t}\n\treturn {\n\t\tstateId: normalizeSuiAddress(stateId),\n\t\tpackageId: normalizeSuiAddress(LazerStatePrefix.parse(object.content).upgrade_cap.package),\n\t\toriginalId: normalizeSuiAddress(originalId),\n\t};\n}\n\n/** `expiry_market::RedeemQuote` with camelCase keys. `proceeds` is before the order fee. */\nexport interface RedeemOpenQuoteRaw {\n\tcloseQuantity: bigint;\n\tprobability: bigint;\n\tproceeds: bigint;\n\ttradingFee: bigint;\n\tbuilderFee: bigint;\n\tinventoryImpactRebate: bigint;\n}\n\n/**\n * Quote an early sell of an Open record at a fresh live pricer (`load_live_pricer`, then the\n * queue's `quote_redeem_open`, which prices through Predict's `quote_close`), and read the desk's\n * policy for the order fee. `proceeds` is before the order fee, with no congestion penalty.\n * Aborts `ERecordNotOpen` when the record isn't Open. It doesn't check that the wrapper's account\n * owns the record: the wrapper only supplies the builder code.\n */\nexport async function quoteRedeemOpen(\n\tclient: ReadClient,\n\tconfig: OrdersGeneratedConfig,\n\targs: QueueTarget & {\n\t\twrapperId: string;\n\t\trecordId: bigint;\n\t\tcloseQuantityRaw: bigint;\n\t} & MarketFeeds,\n): Promise<{ quote: RedeemOpenQuoteRaw; policy: DelayedExecutionPolicy }> {\n\tconst tx = new Transaction();\n\tconst pricer = tx.add(loadLivePricer(config, args));\n\ttx.add(\n\t\tquoteRedeemOpenCall({\n\t\t\tconfig,\n\t\t\targuments: {\n\t\t\t\tqueue: queueIdOf(config, args),\n\t\t\t\tmarket: args.expiryMarketId,\n\t\t\t\twrapper: args.wrapperId,\n\t\t\t\tpricer,\n\t\t\t\trecordId: args.recordId,\n\t\t\t\tcloseQuantity: args.closeQuantityRaw,\n\t\t\t},\n\t\t}),\n\t);\n\ttx.add(desk.policy({ config }));\n\tconst cmds = await inspectReturns(client, tx);\n\tconst q = expiryMarket.RedeemQuote.parse(cmds[1][0]);\n\treturn {\n\t\tquote: {\n\t\t\tcloseQuantity: q.close_quantity,\n\t\t\tprobability: q.probability,\n\t\t\tproceeds: q.proceeds,\n\t\t\ttradingFee: q.trading_fee,\n\t\t\tbuilderFee: q.builder_fee,\n\t\t\tinventoryImpactRebate: q.inventory_impact_rebate,\n\t\t},\n\t\tpolicy: policyFromBcs(DelayedExecutionPolicyBcs.parse(cmds[2][0])),\n\t};\n}\n\n/**\n * `expiry_market::MintQuote` with camelCase keys. `allInCost` includes `penaltyFee`, which the\n * delayed-execution package always quotes as 0: its quotes price like a queued fill.\n */\nexport interface MintQuoteRaw {\n\tquantity: bigint;\n\tentryProbability: bigint;\n\tpremium: bigint;\n\ttradingFee: bigint;\n\tfeeIncentiveSubsidy: bigint;\n\tbuilderFee: bigint;\n\tpenaltyFee: bigint;\n\tinventoryImpactCharge: bigint;\n\tallInCost: bigint;\n}\n\n/** What to quote: an exact quantity, a premium budget, or an all-in budget. */\nexport type MintQuoteRequest =\n\t| { shape: 'exact-quantity'; quantityRaw: bigint }\n\t| { shape: 'exact-amount'; maxPremiumRaw: bigint; minQuantityRaw: bigint }\n\t| { shape: 'exact-cost'; maxCostRaw: bigint; minQuantityRaw: bigint };\n\n/**\n * Quote a mint for one account without placing it: Predict's `quote_mint_for_account` (exact\n * quantity and premium budget) or `quote_mint_exact_cost_for_account` (all-in budget), at a fresh\n * live pricer. Both read the account's builder code and cap a budget at its balance. From the\n * delayed-execution package on they price like a queued fill at the clock: no congestion penalty,\n * and no trade-window or Pyth-staleness abort. They abort `EOrderFailsLimits` when the mint would\n * be refused at the clock. With `ordersConfig`, also reads the order desk's policy.\n */\nexport async function quoteMintForAccount(\n\tclient: ReadClient,\n\tconfig: GeneratedConfig,\n\targs: {\n\t\texpiryMarketId: string;\n\t\twrapperId: string;\n\t\tlowerTick: bigint;\n\t\thigherTick: bigint;\n\t\trequest: MintQuoteRequest;\n\t\t/** Also read the order desk's policy, in the same simulate. */\n\t\tordersConfig?: OrdersGeneratedConfig;\n\t} & MarketFeeds,\n): Promise<{ quote: MintQuoteRaw; policy: DelayedExecutionPolicy | null }> {\n\tconst tx = new Transaction();\n\tconst pricer = tx.add(loadLivePricer(config, args));\n\tconst base = {\n\t\tmarket: args.expiryMarketId,\n\t\twrapper: args.wrapperId,\n\t\tpricer,\n\t\tlowerTick: args.lowerTick,\n\t\thigherTick: args.higherTick,\n\t};\n\tconst r = args.request;\n\tif (r.shape === 'exact-cost') {\n\t\ttx.add(\n\t\t\texpiryMarket.quoteMintExactCostForAccount({\n\t\t\t\tconfig,\n\t\t\t\targuments: { ...base, maxCost: r.maxCostRaw, minQuantity: r.minQuantityRaw },\n\t\t\t}),\n\t\t);\n\t} else {\n\t\ttx.add(\n\t\t\texpiryMarket.quoteMintForAccount({\n\t\t\t\tconfig,\n\t\t\t\targuments:\n\t\t\t\t\tr.shape === 'exact-quantity'\n\t\t\t\t\t\t? { ...base, maxPremium: 0n, minQuantity: r.quantityRaw, exactQuantity: true }\n\t\t\t\t\t\t: {\n\t\t\t\t\t\t\t\t...base,\n\t\t\t\t\t\t\t\tmaxPremium: r.maxPremiumRaw,\n\t\t\t\t\t\t\t\tminQuantity: r.minQuantityRaw,\n\t\t\t\t\t\t\t\texactQuantity: false,\n\t\t\t\t\t\t\t},\n\t\t\t}),\n\t\t);\n\t}\n\tif (args.ordersConfig) tx.add(desk.policy({ config: args.ordersConfig }));\n\tconst cmds = await inspectReturns(client, tx);\n\tconst q = expiryMarket.MintQuote.parse(cmds[1][0]);\n\tconst quote: MintQuoteRaw = {\n\t\tquantity: q.quantity,\n\t\tentryProbability: q.entry_probability,\n\t\tpremium: q.premium,\n\t\ttradingFee: q.trading_fee,\n\t\tfeeIncentiveSubsidy: q.fee_incentive_subsidy,\n\t\tbuilderFee: q.builder_fee,\n\t\tpenaltyFee: q.penalty_fee,\n\t\tinventoryImpactCharge: q.inventory_impact_charge,\n\t\tallInCost: q.all_in_cost,\n\t};\n\tconst policy = args.ordersConfig\n\t\t? policyFromBcs(DelayedExecutionPolicyBcs.parse(cmds[2][0]))\n\t\t: null;\n\treturn { quote, policy };\n}\n\n/** What `quote_mint` quotes: an exact quantity, or the largest quantity a premium budget buys. */\nexport type AnonymousMintQuoteRequest = Exclude<MintQuoteRequest, { shape: 'exact-cost' }>;\n\n/**\n * Quote a mint for no particular account: Predict's `quote_mint`, at a fresh live pricer. It\n * prices like a queued fill at the clock with no builder fee, so it previews a mint for a visitor\n * without an account or a funded balance. It has no all-in budget mode. It aborts\n * `EOrderFailsLimits` when the mint would be refused at the clock, for example below the 1 USDC\n * minimum premium. With `ordersConfig`, also reads the order desk's policy.\n */\nexport async function quoteMintAnonymous(\n\tclient: ReadClient,\n\tconfig: GeneratedConfig,\n\targs: {\n\t\texpiryMarketId: string;\n\t\tlowerTick: bigint;\n\t\thigherTick: bigint;\n\t\trequest: AnonymousMintQuoteRequest;\n\t\tordersConfig?: OrdersGeneratedConfig;\n\t} & MarketFeeds,\n): Promise<{ quote: MintQuoteRaw; policy: DelayedExecutionPolicy | null }> {\n\tconst tx = new Transaction();\n\tconst pricer = tx.add(loadLivePricer(config, args));\n\tconst r = args.request;\n\ttx.add(\n\t\texpiryMarket.quoteMint({\n\t\t\tconfig,\n\t\t\targuments: {\n\t\t\t\tmarket: args.expiryMarketId,\n\t\t\t\tpricer,\n\t\t\t\tlowerTick: args.lowerTick,\n\t\t\t\thigherTick: args.higherTick,\n\t\t\t\t...(r.shape === 'exact-quantity'\n\t\t\t\t\t? { maxPremium: 0n, minQuantity: r.quantityRaw, exactQuantity: true }\n\t\t\t\t\t: { maxPremium: r.maxPremiumRaw, minQuantity: r.minQuantityRaw, exactQuantity: false }),\n\t\t\t},\n\t\t}),\n\t);\n\tif (args.ordersConfig) tx.add(desk.policy({ config: args.ordersConfig }));\n\tconst cmds = await inspectReturns(client, tx);\n\tconst q = expiryMarket.MintQuote.parse(cmds[1][0]);\n\treturn {\n\t\tquote: {\n\t\t\tquantity: q.quantity,\n\t\t\tentryProbability: q.entry_probability,\n\t\t\tpremium: q.premium,\n\t\t\ttradingFee: q.trading_fee,\n\t\t\tfeeIncentiveSubsidy: q.fee_incentive_subsidy,\n\t\t\tbuilderFee: q.builder_fee,\n\t\t\tpenaltyFee: q.penalty_fee,\n\t\t\tinventoryImpactCharge: q.inventory_impact_charge,\n\t\t\tallInCost: q.all_in_cost,\n\t\t},\n\t\tpolicy: args.ordersConfig ? policyFromBcs(DelayedExecutionPolicyBcs.parse(cmds[2][0])) : null,\n\t};\n}\n\n/**\n * The order desk's policy and an owner's USDC balance, in one simulate. The queued exact-cost\n * quote needs both: enqueue escrows `min(max_cost, available − fee)`, while the chain quote caps\n * at the whole balance.\n */\nexport async function orderFeeAndBalance(\n\tclient: ReadClient,\n\tconfig: OrdersGeneratedConfig,\n\towner: string,\n\tcoinType: string,\n): Promise<{ policy: DelayedExecutionPolicy; availableRaw: bigint }> {\n\tconst tx = new Transaction();\n\ttx.add(desk.policy({ config }));\n\tconst loaded = tx.add(\n\t\taccount.loadAccount({ config, arguments: { self: deriveAccountWrapperIdFrom(config, owner) } }),\n\t);\n\ttx.add(account.balance({ config, typeArguments: [coinType], arguments: { self: loaded } }));\n\tconst cmds = await inspectReturns(client, tx);\n\treturn {\n\t\tpolicy: policyFromBcs(DelayedExecutionPolicyBcs.parse(cmds[0][0])),\n\t\tavailableRaw: parseU64LE(cmds[2][0]),\n\t};\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAmCA,MAAM,aAAa,WAAgC,MAAM,MAAM,OAAO;AACtE,MAAM,oBAAoB,IAAI,OAAOA,UAAa;;AAGlD,S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