redeemLive method

TransactionResult Function(Transaction) redeemLive({
  1. required String expiryMarketId,
  2. required String wrapperId,
  3. required String protocolConfig,
  4. required dynamic pricer,
  5. required BigInt orderId,
  6. required Object closeQuantity,
  7. Object? minProbability,
  8. Object? minProceeds,
})

Close part or all of a live position at the pricer's mark, as session. minProbability / minProceeds are close-side slippage floors; 0 disables either, and OMITTING them is 0 — unlike the mint caps, which are required. On a delegated key this is the direction that closes a position at any price, so pass real floors unless you mean to accept whatever the mark gives you.

Returns Option<u256> — the replacement order id when a partial close leaves quantity open.

Implementation

TransactionResult Function(Transaction) redeemLive({
  required String expiryMarketId,
  required String wrapperId,
  required String protocolConfig,
  required dynamic pricer,
  required BigInt orderId,
  required Object closeQuantity,
  Object? minProbability,
  Object? minProceeds,
}) =>
    (tx) => sessions.redeemLive(
          config: _generatedConfig,
          arguments: {
            'market': expiryMarketId,
            'accountRegistry': _config.accountRegistry,
            'wrapper': wrapperId,
            'config': protocolConfig,
            'pricer': pricer,
            'orderId': orderId,
            'closeQuantity': closeQuantity,
            'minProbability': minProbability ?? 0,
            'minProceeds': minProceeds ?? 0,
          },
        )(tx);