redeemLive function

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

Redeem a live order you hold account authority over.

A live order is priced and closed (partial or full). Settled orders must use redeem_settled. Returns a replacement order ID only when a partial close leaves quantity open.

Two close-side slippage floors, the mirror of mint's max_probability / max_cost pair; pass 0 to disable either. min_probability floors the quoted per-contract range probability (same units as mint's max_probability). min_proceeds floors the all-in net USDC credited to the account (redeem_amount minus trading fee, builder fee, and EWMA penalty), the mirror of mint's all-in max_cost.

Implementation

MoveCallBuilder redeemLive(
    {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::redeem_live',
        arguments: normalizeMoveArguments(
            tx,
            withConfigDefaults(
                arguments, config, const {'config': 'protocolConfig'}),
            [
              null,
              null,
              null,
              null,
              null,
              'u256',
              'u64',
              'u64',
              'u64',
              '0x2::accumulator::AccumulatorRoot',
              '0x2::clock::Clock'
            ],
            [
              'market',
              'wrapper',
              'auth',
              'config',
              'pricer',
              'orderId',
              'closeQuantity',
              'minProbability',
              'minProceeds'
            ]),
      );
}