Liquidity API
Use the Dispatcher’s liquidity selectors when exchanging reserves and the selected pool’s LP Token. All Amount fields below are token addresses and integer token base units.
Provide
quoteProvideLiquidity(pool, payReserveAssets, claimToken)
provideLiquidity(pool, payReserveAssets, minClaimToken)
payReserveAssets is Amount[]. Each amount is the quantity to add. The ratio of each pay amount to its opening reserve must be identical across participating assets.
claimToken is the selected pool’s target LP Token address. The quote returns pay QuoteItem[], the LP receive QuoteItem, and priceOfUSD.
Execution takes minClaimToken as an Amount: the LP address and minimum LP quantity to receive. Approve external reserve tokens to the Dispatcher and attach the exact native pay value when needed.
Remove
quoteRemoveLiquidity(pool, payClaimToken, receiveReserveAssets)
removeLiquidity(pool, payClaimToken, receiveReserveAssets)
payClaimToken is an Amount specifying the LP quantity to redeem. It must be positive and smaller than total LP supply. receiveReserveAssets is Amount[] selecting the receive addresses; each amount specifies the minimum quantity of that token to receive.
The engine derives proportional withdrawals across the selected reserves. The quote returns the LP pay quote, reserve receive quotes, fee placeholders, derived receive allocations, and priceOfUSD.
Execution views
quoteProvideLiquidityForExecution and quoteRemoveLiquidityForExecution omit the USD lookup and additionally return LiquidityStateChange, including the exact scale changes consumed by execution.
Both operations use the PTE value-flow rule for the participating reserves and LP Token. The common scale accumulator accounts for the complement. Full participation is detected from the validated participating count against registered reserves; ledger base-scale totals remain exact.
Validation
Use valid pool roles, positive reserves/backing, unique participating tokens, exact proportional provide ratios, and token-unit minima. Submit LP liquidity through the dedicated liquidity selectors. The engine derives proportional receive amounts for the selected reserves.
See Provide and Remove Liquidity for the user-facing model.