Interface AmmObject

All Superinterfaces:
LedgerObject
All Known Implementing Classes:
ImmutableAmmObject

@Immutable @Beta public interface AmmObject extends LedgerObject
Represents an AMM ledger object, which describes a single Automated Market Maker instance.

This class will be marked Beta until the AMM amendment is enabled on mainnet. Its API is subject to change.

  • Method Details

    • builder

      static ImmutableAmmObject.Builder builder()
      Construct a AmmObject builder.
      Returns:
      An ImmutableAmmObject.Builder.
    • ledgerEntryType

      @Derived default LedgerObject.LedgerEntryType ledgerEntryType()
      The type of ledger object, which will always be "AMM" in this case.
      Returns:
      Always returns LedgerObject.LedgerEntryType.AMM.
    • flags

      @Derived default Flags flags()
      A bit-map of boolean flags. No flags are defined for AmmObject, so this value is always 0.
      Returns:
      Always Flags.UNSET.
    • asset

      Issue asset()
      The definition for one of the two assets this AMM holds.
      Returns:
      An Issue.
    • asset2

      Issue asset2()
      The definition for the other asset this AMM holds.
      Returns:
      An Issue.
    • account

      Address account()
      The address of the special account that holds this AMM's assets.
      Returns:
      An Address.
    • auctionSlot

      Optional<AuctionSlot> auctionSlot()
      Details of the current owner of the auction slot.
      Returns:
      An AuctionSlot.
    • lpTokenBalance

      IssuedCurrencyAmount lpTokenBalance()
      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.
      Returns:
      An IssuedCurrencyAmount.
    • tradingFee

      TradingFee tradingFee()
      The percentage fee to be charged for trades against this AMM instance, in units of 1/10,000. The maximum value is 1000, for a 1% fee.
      Returns:
      A TradingFee.
    • voteSlots

      List<VoteEntryWrapper> voteSlots()
      A list of vote objects, representing votes on the pool's trading fee.
      Returns:
      A List of VoteEntryWrappers.
    • ownerNode

      String ownerNode()
      A hint indicating which page of the sender's owner directory links to this object, in case the directory consists of multiple pages.

      Note: The object does not contain a direct link to the owner directory containing it, since that value can be derived from the Account.

      Returns:
      A String containing the owner node hint.
    • voteSlotsUnwrapped

      @Derived default List<VoteEntry> voteSlotsUnwrapped()
      Unwraps the VoteEntryWrappers in voteSlots() for easier access to VoteEntrys.
      Returns:
      A List of VoteEntry.
    • index

      Hash256 index()
      The unique ID of the AmmObject.
      Returns:
      A Hash256.