setMaxLpPoolValue function

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

Set the ceiling on LP-attributable pool value that queued supplies may raise the pool to. A supply that would carry the pool past it is filled up to the cap at the flush and its remainder stays queued; withdrawals and already-issued PLP are unaffected, so lowering this below current pool value closes the pool to new capital rather than forcing anyone out.

Implementation

MoveCallBuilder setMaxLpPoolValue(
    {dynamic arguments, String? package, Map<String, dynamic>? config}) {
  final packageAddress = package ??
      (config?['predictPackageId'] as String?) ??
      '@local-pkg/deepbook_predict';
  return (tx) => tx.moveCall(
        '$packageAddress::protocol_config::set_max_lp_pool_value',
        arguments: normalizeMoveArguments(
            tx,
            withConfigDefaults(
                arguments, config, const {'config': 'protocolConfig'}),
            [null, null, 'u64'],
            ['config', 'AdminCap', 'maxPoolValue']),
      );
}