|
rippled
|
Represents synthetic AMM offer in BookStep. More...
#include <AMMOffer.h>
Public Member Functions | |
| AMMOffer (AMMLiquidity< TIn, TOut > const &ammLiquidity, TAmounts< TIn, TOut > const &amounts, TAmounts< TIn, TOut > const &balances, Quality const &quality) | |
| Quality | quality () const noexcept |
| Issue const & | issueIn () const |
| AccountID const & | owner () const |
| std::optional< uint256 > | key () const |
| TAmounts< TIn, TOut > const & | amount () const |
| void | consume (ApplyView &view, TAmounts< TIn, TOut > const &consumed) |
| bool | fully_consumed () const |
| TAmounts< TIn, TOut > | limitOut (TAmounts< TIn, TOut > const &offrAmt, TOut const &limit, bool roundUp) const |
| Limit out of the provided offer. | |
| TAmounts< TIn, TOut > | limitIn (TAmounts< TIn, TOut > const &offrAmt, TIn const &limit, bool roundUp) const |
| Limit in of the provided offer. | |
| QualityFunction | getQualityFunc () const |
| bool | isFunded () const |
| 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 some threshold. | |
Static Public Member Functions | |
| template<typename... Args> | |
| static TER | send (Args &&... args) |
| Send funds without incurring the transfer fee. | |
| static std::pair< std::uint32_t, std::uint32_t > | adjustRates (std::uint32_t ofrInRate, std::uint32_t ofrOutRate) |
Private Attributes | |
| AMMLiquidity< TIn, TOut > const & | ammLiquidity_ |
| TAmounts< TIn, TOut > const | amounts_ |
| TAmounts< TIn, TOut > const | balances_ |
| Quality const | quality_ |
| bool | consumed_ |
Represents synthetic AMM offer in BookStep.
AMMOffer mirrors TOffer methods for use in generic BookStep methods. AMMOffer amounts are changed indirectly in BookStep limiting steps.
Definition at line 20 of file AMMOffer.h.
| ripple::AMMOffer< TIn, TOut >::AMMOffer | ( | AMMLiquidity< TIn, TOut > const & | ammLiquidity, |
| TAmounts< TIn, TOut > const & | amounts, | ||
| TAmounts< TIn, TOut > const & | balances, | ||
| Quality const & | quality | ||
| ) |
Definition at line 9 of file AMMOffer.cpp.
|
noexcept |
Definition at line 50 of file AMMOffer.h.
| Issue const & ripple::AMMOffer< TIn, TOut >::issueIn | ( | ) | const |
Definition at line 24 of file AMMOffer.cpp.
| AccountID const & ripple::AMMOffer< TIn, TOut >::owner | ( | ) | const |
Definition at line 31 of file AMMOffer.cpp.
| std::optional< uint256 > ripple::AMMOffer< TIn, TOut >::key | ( | ) | const |
Definition at line 62 of file AMMOffer.h.
| TAmounts< TIn, TOut > const & ripple::AMMOffer< TIn, TOut >::amount | ( | ) | const |
Definition at line 38 of file AMMOffer.cpp.
| void ripple::AMMOffer< TIn, TOut >::consume | ( | ApplyView & | view, |
| TAmounts< TIn, TOut > const & | consumed | ||
| ) |
Definition at line 45 of file AMMOffer.cpp.
| bool ripple::AMMOffer< TIn, TOut >::fully_consumed | ( | ) | const |
Definition at line 74 of file AMMOffer.h.
| TAmounts< TIn, TOut > ripple::AMMOffer< TIn, TOut >::limitOut | ( | TAmounts< TIn, TOut > const & | offrAmt, |
| TOut const & | limit, | ||
| bool | roundUp | ||
| ) | const |
Limit out of the provided offer.
If one-path then swapOut using current balances. If multi-path then ceil_out using current quality.
Definition at line 63 of file AMMOffer.cpp.
| TAmounts< TIn, TOut > ripple::AMMOffer< TIn, TOut >::limitIn | ( | TAmounts< TIn, TOut > const & | offrAmt, |
| TIn const & | limit, | ||
| bool | roundUp | ||
| ) | const |
Limit in of the provided offer.
If one-path then swapIn using current balances. If multi-path then ceil_in using current quality.
Definition at line 88 of file AMMOffer.cpp.
| QualityFunction ripple::AMMOffer< TIn, TOut >::getQualityFunc | ( | ) | const |
Definition at line 107 of file AMMOffer.cpp.
|
static |
Send funds without incurring the transfer fee.
Definition at line 104 of file AMMOffer.h.
| bool ripple::AMMOffer< TIn, TOut >::isFunded | ( | ) | const |
Definition at line 110 of file AMMOffer.h.
|
static |
Definition at line 117 of file AMMOffer.h.
| bool ripple::AMMOffer< TIn, TOut >::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 some threshold.
Definition at line 117 of file AMMOffer.cpp.
|
private |
Definition at line 23 of file AMMOffer.h.
|
private |
Definition at line 33 of file AMMOffer.h.
|
private |
Definition at line 35 of file AMMOffer.h.
|
private |
Definition at line 38 of file AMMOffer.h.
|
private |
Definition at line 40 of file AMMOffer.h.