Class AmmPool
An AMM pool's state as amm_info reports it: the two assets, the balances the AMM
account holds, the LP token balance and the trading fee.
Inheritance
Namespace: Xrpl.Sugar
Assembly: Xrpl.dll
Syntax
public sealed class AmmPool
Properties
| Edit this page View SourceAsset
The first asset (amount).
Declaration
public Common.IssuedCurrency Asset { get; init; }
Property Value
| Type | Description |
|---|---|
| Common.IssuedCurrency |
Asset2
The second asset (amount2).
Declaration
public Common.IssuedCurrency Asset2 { get; init; }
Property Value
| Type | Description |
|---|---|
| Common.IssuedCurrency |
Balance
The pool's balance of Asset, in its own unit (drops for XRP).
Declaration
public XrplNumber Balance { get; init; }
Property Value
| Type | Description |
|---|---|
| XrplNumber |
Balance2
The pool's balance of Asset2, in its own unit (drops for XRP).
Declaration
public XrplNumber Balance2 { get; init; }
Property Value
| Type | Description |
|---|---|
| XrplNumber |
LpTokenBalance
The LP tokens outstanding (lp_token).
Declaration
public XrplNumber LpTokenBalance { get; init; }
Property Value
| Type | Description |
|---|---|
| XrplNumber |
TradingFee
The trading fee the node applies to this account, in 1/100,000: the pool's
trading_fee, or the auction slot's discounted fee for the slot holder
(DiscountedTradingFee(uint)).
Declaration
public ushort TradingFee { get; init; }
Property Value
| Type | Description |
|---|---|
| ushort |
Methods
| Edit this page View SourceFromAmmInfo(AMMInfo, string, DateTime?)
The pool from an amm_info result, at the trading fee the node applies to
account (getTradingFee): the auction slot's discounted fee
while the slot has not expired and the account holds it or is one of its authorized
accounts, and the pool's trading fee otherwise.
Declaration
public static AmmPool FromAmmInfo(AMMInfo amm, string account = null, DateTime? parentCloseTime = null)
Parameters
| Type | Name | Description |
|---|---|---|
| AMMInfo | amm | The |
| string | account | The account that deposits or withdraws; null takes the pool's fee. |
| Nullable | parentCloseTime | The close time of the ledger before the one the transaction lands in, against which the slot's expiration is checked; null takes the current time. |
Returns
| Type | Description |
|---|---|
| AmmPool |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | The result carries no pool. |