sealValuationSnapshot function
MoveCallBuilder
sealValuationSnapshot({})
Close the snapshot stage once every expected market has a frozen pricer, and freeze the vault-side figures — idle, the profit basis, the pending protocol cut — completing the snapshot.
Consuming SnapshotStage is the simultaneity proof: the potato dies here, so no
later transaction can add oracle state to this flush, and every market is marked
at the instant the snapshot transaction executed. The vault capture is
consistent with the per-market stamps because rebalance_expiry_cash refuses to
run while the stage is open (ESnapshotStageOpen), so no idle↔market move can
land between a stamp and this capture. Valuation may then resume across as many
transactions as it needs.
Implementation
MoveCallBuilder sealValuationSnapshot(
{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::seal_valuation_snapshot',
arguments: normalizeMoveArguments(
tx,
withConfigDefaults(arguments, config,
const {'vault': 'poolVault', 'config': 'protocolConfig'}),
[null, null, null],
['vault', 'stage', 'config']),
);
}