1#ifndef XRPL_APP_AMMOFFER_H_INCLUDED 
    2#define XRPL_APP_AMMOFFER_H_INCLUDED 
    4#include <xrpl/ledger/ApplyView.h> 
    5#include <xrpl/ledger/View.h> 
    6#include <xrpl/protocol/Quality.h> 
    7#include <xrpl/protocol/TER.h> 
   11template <
typename TIn, 
typename TOut>
 
   19template <
typename TIn, 
typename TOut>
 
   45        TAmounts<TIn, TOut> 
const& amounts,
 
   46        TAmounts<TIn, TOut> 
const& balances,
 
   67    TAmounts<TIn, TOut> 
const&
 
   85        TAmounts<TIn, TOut> 
const& offrAmt,
 
   94    limitIn(TAmounts<TIn, TOut> 
const& offrAmt, TIn 
const& limit, 
bool roundUp)
 
  102    template <
typename... Args>
 
  120        return {ofrInRate, QUALITY_ONE};
 
 
 
A generic endpoint for log messages.
 
AMMLiquidity class provides AMM offers to BookStep class.
 
Represents synthetic AMM offer in BookStep.
 
static TER send(Args &&... args)
Send funds without incurring the transfer fee.
 
AccountID const & owner() const
 
TAmounts< TIn, TOut > limitOut(TAmounts< TIn, TOut > const &offrAmt, TOut const &limit, bool roundUp) const
Limit out of the provided offer.
 
static std::pair< std::uint32_t, std::uint32_t > adjustRates(std::uint32_t ofrInRate, std::uint32_t ofrOutRate)
 
AMMLiquidity< TIn, TOut > const  & ammLiquidity_
 
Quality quality() const noexcept
 
bool checkInvariant(TAmounts< TIn, TOut > const &consumed, beast::Journal j) const
Check the new pool product is greater or equal to the old pool product or if decreases then within so...
 
void consume(ApplyView &view, TAmounts< TIn, TOut > const &consumed)
 
TAmounts< TIn, TOut > limitIn(TAmounts< TIn, TOut > const &offrAmt, TIn const &limit, bool roundUp) const
Limit in of the provided offer.
 
std::optional< uint256 > key() const
 
TAmounts< TIn, TOut > const balances_
 
TAmounts< TIn, TOut > const amounts_
 
bool fully_consumed() const
 
Issue const & issueIn() const
 
TAmounts< TIn, TOut > const & amount() const
 
QualityFunction getQualityFunc() const
 
Writeable view to a ledger, for applying a transaction.
 
A currency issued by an account.
 
Average quality of a path as a function of out: q(out) = m * out + b, where m = -1 / poolGets,...
 
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
 
TER accountSend(ApplyView &view, AccountID const &from, AccountID const &to, STAmount const &saAmount, beast::Journal j, WaiveTransferFee waiveFee=WaiveTransferFee::No)
Calls static accountSendIOU if saAmount represents Issue.