20 #ifndef RIPPLE_APP_TX_AMMLIQUIDITY_H_INCLUDED
21 #define RIPPLE_APP_TX_AMMLIQUIDITY_H_INCLUDED
23 #include "ripple/app/misc/AMMHelpers.h"
24 #include "ripple/app/misc/AMMUtils.h"
25 #include "ripple/app/paths/AMMContext.h"
26 #include "ripple/basics/Log.h"
27 #include "ripple/ledger/ReadView.h"
28 #include "ripple/ledger/View.h"
29 #include "ripple/protocol/Quality.h"
30 #include "ripple/protocol/STLedgerEntry.h"
34 template <
typename TIn,
typename TOut>
51 template <
typename TIn,
typename TOut>
143 maxOffer(TAmounts<TIn, TOut>
const& balances)
const;
148 #endif // RIPPLE_APP_TX_AMMLIQUIDITY_H_INCLUDED
AMMOffer< TIn, TOut > maxOffer(TAmounts< TIn, TOut > const &balances) const
Generate max offer.
A currency issued by an account.
const std::uint32_t tradingFee_
TAmounts< TIn, TOut > fetchBalances(ReadView const &view) const
Fetches current AMM balances.
std::optional< AMMOffer< TIn, TOut > > getOffer(ReadView const &view, std::optional< Quality > const &clobQuality) const
Generate AMM offer.
AMMLiquidity(ReadView const &view, AccountID const &ammAccountID, std::uint32_t tradingFee, Issue const &in, Issue const &out, AMMContext &ammContext, beast::Journal j)
Issue const & issueOut() const
AccountID ammAccountID(std::uint16_t prefix, uint256 const &parentHash, uint256 const &ammID)
Calculate AMM account ID.
TAmounts< TIn, TOut > generateFibSeqOffer(TAmounts< TIn, TOut > const &balances) const
Generate AMM offers with the offer size based on Fibonacci sequence.
Issue const & issueIn() const
std::uint32_t tradingFee() const
static const Number InitialFibSeqPct
Maintains AMM info per overall payment engine execution and individual iteration.
AMMContext & context() const
Represents synthetic AMM offer in BookStep.
A generic endpoint for log messages.
AccountID const & ammAccount() const
AMMLiquidity & operator=(AMMLiquidity const &)=delete
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
const AccountID ammAccountID_
const TAmounts< TIn, TOut > initialBalances_
AMMLiquidity class provides AMM offers to BookStep class.