3#include <xrpl/basics/Number.h>
4#include <xrpl/protocol/AMMCore.h>
5#include <xrpl/protocol/Quality.h>
39 template <
typename TIn,
typename TOut>
69template <
typename TIn,
typename TOut>
75 if (amounts.
in <= beast::kZero || amounts.
out <= beast::kZero)
78 m_ = -cfee / amounts.
in;
79 b_ = amounts.
out * cfee / amounts.
in;
Number is a floating point type that can represent a wide range of values.
std::optional< Quality > const & quality() const
QualityFunction(Quality const &quality, CLOBLikeTag)
void combine(QualityFunction const &qf)
Combines QF with the next step QF.
std::optional< Quality > quality_
std::optional< Number > outFromAvgQ(Quality const &quality)
Find output to produce the requested average quality.
bool isConst() const
Return true if the quality function is constant.
Represents the logical ratio of output currency to input currency.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Number feeMult(std::uint16_t tfee)
Get fee multiplier (1 - tfee) @tfee trading fee in basis points.
XRPL_NO_SANITIZE_ADDRESS void Throw(Args &&... args)
Represents a pair of input and output currencies.