trySettle function

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

Settle from Propbook's exact positive Pyth spot at expiry, or from the exact Block Scholes minute-boundary spot when Pyth remains unavailable after the compiled grace period. Permissionless and idempotent; missing or unusable observations leave the market unsettled.

Implementation

MoveCallBuilder trySettle(
    {dynamic arguments, String? package, Map<String, dynamic>? config}) {
  final packageAddress = package ??
      (config?['predictPackageId'] as String?) ??
      '@local-pkg/deepbook_predict';
  return (tx) => tx.moveCall(
        '$packageAddress::expiry_market::try_settle',
        arguments: normalizeMoveArguments(
            tx,
            withConfigDefaults(arguments, config, const {
              'config': 'protocolConfig',
              'propbookRegistry': 'oracleRegistry'
            }),
            [null, null, null, null, null, '0x2::clock::Clock'],
            ['market', 'config', 'propbookRegistry', 'pyth', 'bsValues']),
      );
}