Liquidity Pool
Represents a Liquidity Pool Parameters object on the Stellar network.
Liquidity pools allow for automated market making through constant product pools. Each pool contains two assets and a fee parameter.
Usage
val assetA = AssetTypeCreditAlphaNum4("USD", issuer)
val assetB = AssetTypeCreditAlphaNum4("EUR", issuer)
val pool = LiquidityPool(assetA, assetB)Content copied to clipboard
Asset Ordering
Assets must be in the order stellar-core requires, assetA < assetB under Asset.compareTo: type, then code, then the issuer's raw public key bytes. The constructor, and therefore fromXdr, validates this ordering, and the pool id is computed over the assets in this order.