Skip to main content

AMMFields

Trait AMMFields 

Source
pub trait AMMFields: LedgerObjectCommonFields {
    // Provided methods
    fn account(&self) -> Result<AccountID> { ... }
    fn trading_fee(&self) -> Result<Option<u16>> { ... }
    fn lp_token_balance(&self) -> Result<Amount> { ... }
    fn asset(&self) -> Result<Issue> { ... }
    fn asset2(&self) -> Result<Issue> { ... }
    fn owner_node(&self) -> Result<u64> { ... }
    fn previous_txn_id(&self) -> Result<Option<Hash256>> { ... }
    fn previous_txn_lgr_seq(&self) -> Result<Option<u32>> { ... }
}
Expand description

Trait providing access to fields specific to AMM objects in any ledger.

Provided Methods§

Source

fn account(&self) -> Result<AccountID>

The address of the special account that holds this AMM’s assets.

Source

fn trading_fee(&self) -> Result<Option<u16>>

The percentage fee to be charged for trades against this AMM instance, in units of 1/100,000. The maximum value is 1000, for a 1% fee.

Source

fn lp_token_balance(&self) -> Result<Amount>

The total outstanding balance of liquidity provider tokens from this AMM instance. The holders of these tokens can vote on the AMM’s trading fee in proportion to their holdings, or redeem the tokens for a share of the AMM’s assets which grows with the trading fees collected.

Source

fn asset(&self) -> Result<Issue>

The definition for one of the two assets this AMM holds. In JSON, this is an object with currency and issuer fields.

Source

fn asset2(&self) -> Result<Issue>

The definition for the other asset this AMM holds. In JSON, this is an object with currency and issuer fields.

Source

fn owner_node(&self) -> Result<u64>

The OwnerNode field (Required).

Source

fn previous_txn_id(&self) -> Result<Option<Hash256>>

The identifying hash of the transaction that most recently modified this entry.

Source

fn previous_txn_lgr_seq(&self) -> Result<Option<u32>>

The index of the ledger that contains the transaction that most recently modified this entry.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§