valueExpiry function

MoveCallBuilder valueExpiry({
  1. dynamic arguments,
  2. String? package,
  3. Map<String, dynamic>? config,
})

Fold one snapshotted market's SNAPSHOT-INSTANT NAV into the running total. A market frozen as settled is swept and contributes 0; one frozen with a pricer is valued via expiry_market::snapshot_nav over its captured cash and tree shadows, then has its stamp cleared (releasing the tree snapshot), so later trades and the next flush start clean.

The resumable stage: any transaction after the seal, one market per transaction (constants::max_payout_tree_nodes), reading no oracle and no clock. MEASUREMENT-ONLY for every member — settled members were swept during the snapshot stage and every frozen figure was captured there, so this call moves no cash and rebalance_expiry_cash runs at any time. A market that expired mid-window is valued at its frozen pre-expiry mark; its settlement does not wait for this call, because settlement is never blocked by a flush.

Implementation

MoveCallBuilder valueExpiry(
    {dynamic arguments, String? package, Map<String, dynamic>? config}) {
  final packageAddress = package ??
      (config?['predictPackageId'] as String?) ??
      '@local-pkg/deepbook_predict';
  return (tx) => tx.moveCall(
        '$packageAddress::plp::value_expiry',
        arguments: normalizeMoveArguments(
            tx,
            withConfigDefaults(arguments, config,
                const {'vault': 'poolVault', 'config': 'protocolConfig'}),
            [null, null, null],
            ['vault', 'market', 'config']),
      );
}