20 #ifndef RIPPLE_APP_AMMOFFER_H_INCLUDED
21 #define RIPPLE_APP_AMMOFFER_H_INCLUDED
23 #include <ripple/ledger/ApplyView.h>
24 #include <ripple/ledger/View.h>
25 #include <ripple/protocol/Quality.h>
26 #include <ripple/protocol/TER.h>
30 template <
typename TIn,
typename TOut>
32 class QualityFunction;
38 template <
typename TIn,
typename TOut>
65 TAmounts<TIn, TOut>
const& amounts,
90 TAmounts<TIn, TOut>
const&
108 TAmounts<TIn, TOut>
const& offrAmt,
110 bool fixReducedOffers,
118 limitIn(TAmounts<TIn, TOut>
const& offrAmt, TIn
const& limit)
const;
125 template <
typename... Args>
143 return {ofrInRate, QUALITY_ONE};
149 #endif // RIPPLE_APP_AMMOFFER_H_INCLUDED
TAmounts< TIn, TOut > const & amount() const
TAmounts< TIn, TOut > limitOut(TAmounts< TIn, TOut > const &offrAmt, TOut const &limit, bool fixReducedOffers, bool roundUp) const
Limit out of the provided offer.
AMMLiquidity< TIn, TOut > const & ammLiquidity_
A currency issued by an account.
TER accountSend(ApplyView &view, AccountID const &uSenderID, AccountID const &uReceiverID, STAmount const &saAmount, beast::Journal j, WaiveTransferFee waiveFee)
QualityFunction getQualityFunc() const
Issue const & issueIn() const
TAmounts< TIn, TOut > limitIn(TAmounts< TIn, TOut > const &offrAmt, TIn const &limit) const
Limit in of the provided offer.
Writeable view to a ledger, for applying a transaction.
const TAmounts< TIn, TOut > amounts_
Integers of any length that is a multiple of 32-bits.
void consume(ApplyView &view, TAmounts< TIn, TOut > const &consumed)
static std::pair< std::uint32_t, std::uint32_t > adjustRates(std::uint32_t ofrInRate, std::uint32_t ofrOutRate)
AMMOffer(AMMLiquidity< TIn, TOut > const &ammLiquidity, TAmounts< TIn, TOut > const &amounts, std::optional< TAmounts< TIn, TOut >> const &balances, Quality const &quality)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Quality quality() const noexcept
AMMLiquidity class provides AMM offers to BookStep class.
bool fully_consumed() const
Average quality of a path as a function of out: q(out) = m * out + b, where m = -1 / poolGets,...
Issue const & issueOut() const
static TER send(Args &&... args)
Send funds without incurring the transfer fee.
std::optional< uint256 > key() const
AccountID const & owner() const
const std::optional< TAmounts< TIn, TOut > > balances_