Documentation
    Preparing search index...
    • Map a queue record to its display state. nowMs drives the refund flags. A record is sellable while it is Open, holds a position, and nowMs is before the cutoff (opts.cutoffMs, or the record's own placement cutoff when omitted). Unknown status or kind codes map to unknown. opts.lotSize is the config's position lot (default 10,000, Predict's), which decodes a held position's quantity.

      Parameters

      • record: {
            account_id: string;
            escrow: {
                budget: bigint;
                cash_need: bigint;
                order_fee: bigint;
                subsidy_bound: bigint;
                subsidy_reserved: bigint;
            };
            funds: bigint;
            kind: number;
            position: { opened_at_ms: bigint; order_id: bigint; root_id: bigint };
            price: { generation_us: bigint; spot: bigint; tick_ms: bigint };
            receipt_stage: number;
            receive_address: string;
            request: {
                higher_tick: bigint;
                lower_tick: bigint;
                max_cost: bigint;
                max_premium: bigint;
                max_probability: bigint;
                min_probability: bigint;
                min_proceeds: bigint;
                min_quantity: bigint;
                quantity: bigint;
            };
            result: {
                amount: bigint;
                finished_at_ms: bigint;
                quantity: bigint;
                reason: number;
            };
            status: number;
            timing: {
                cutoff_ms: bigint;
                deadline_ms: bigint;
                earliest_price_ms: bigint;
                placed_at_ms: bigint;
                pyth_channel: number;
                tau_ms: bigint;
            };
        }
        • account_id: string
        • escrow: {
              budget: bigint;
              cash_need: bigint;
              order_fee: bigint;
              subsidy_bound: bigint;
              subsidy_reserved: bigint;
          }
          • budget: bigint

            USDC locked for the premium and fees, and the fill's all-in cost cap. Sells lock none.

          • cash_need: bigint

            Worst-case market cash the fill can consume, counted in Predict's waiting cash need while the order waits.

          • order_fee: bigint

            Flat fee charged at placement.

          • subsidy_bound: bigint

            The admission dry run's pre-subsidy trading fee, capped at the budget. Bounds the subsidy commit reserves.

          • subsidy_reserved: bigint

            The incentives commit reserved for the order, held with its escrow.

        • funds: bigint

          USDC the record holds now: escrow while unfinished, parked funds after.

        • kind: number
        • position: { opened_at_ms: bigint; order_id: bigint; root_id: bigint }
        • price: { generation_us: bigint; spot: bigint; tick_ms: bigint }
          • generation_us: bigint

            The feed's own update time, in µs.

          • spot: bigint

            Pyth price normalized to 1e9.

          • tick_ms: bigint

            The update's envelope in ms: τ, or a later backup tick. The fill prices at it.

        • receipt_stage: number

          The receipt's Predict stage (constants::receipt_stage_*), 0 when the record holds none.

        • receive_address: string
        • request: {
              higher_tick: bigint;
              lower_tick: bigint;
              max_cost: bigint;
              max_premium: bigint;
              max_probability: bigint;
              min_probability: bigint;
              min_proceeds: bigint;
              min_quantity: bigint;
              quantity: bigint;
          }
        • result: { amount: bigint; finished_at_ms: bigint; quantity: bigint; reason: number }
          • amount: bigint

            Cost paid (mint) or proceeds (sell). Zero on a refund.

          • finished_at_ms: bigint

            Sui clock of the finishing transaction.

          • quantity: bigint

            Filled quantity (mint) or closed quantity (sell).

          • reason: number

            0 for a fill, or a REASON_* code.

        • status: number
        • timing: {
              cutoff_ms: bigint;
              deadline_ms: bigint;
              earliest_price_ms: bigint;
              placed_at_ms: bigint;
              pyth_channel: number;
              tau_ms: bigint;
          }
          • cutoff_ms: bigint

            expiry - max(no_trade_window_ms, stall_timeout_ms + 5_000); placement requires τ below it.

          • deadline_ms: bigint

            At or past it the order is refunded, never filled.

          • earliest_price_ms: bigint

            τ itself: a price generated before it never commits the order.

          • placed_at_ms: bigint

            t₀, the Sui clock of the placement transaction.

          • pyth_channel: number

            The policy channel at placement. Commit accepts only updates on it.

          • tau_ms: bigint

            The channel tick the order is priced on.

      • nowMs: bigint
      • opts: { cutoffMs?: bigint; lotSize?: bigint } = {}

      Returns queue.OrderView