|
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 &offerAmount, TOut const &limit, bool roundUp) const |
| Limit out of the provided offer. | |
| TAmounts< TIn, TOut > | limitIn (TAmounts< TIn, TOut > const &offerAmount, 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_ {false} |
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.
| xrpl::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 8 of file AMMOffer.cpp.
|
noexcept |
Definition at line 50 of file AMMOffer.h.
| Issue const & xrpl::AMMOffer< TIn, TOut >::issueIn | ( | ) | const |
Definition at line 20 of file AMMOffer.cpp.
| AccountID const & xrpl::AMMOffer< TIn, TOut >::owner | ( | ) | const |
Definition at line 27 of file AMMOffer.cpp.
| std::optional< uint256 > xrpl::AMMOffer< TIn, TOut >::key | ( | ) | const |
Definition at line 62 of file AMMOffer.h.
| TAmounts< TIn, TOut > const & xrpl::AMMOffer< TIn, TOut >::amount | ( | ) | const |
Definition at line 34 of file AMMOffer.cpp.
| void xrpl::AMMOffer< TIn, TOut >::consume | ( | ApplyView & | view, |
| TAmounts< TIn, TOut > const & | consumed | ||
| ) |
Definition at line 41 of file AMMOffer.cpp.
| bool xrpl::AMMOffer< TIn, TOut >::fully_consumed | ( | ) | const |
Definition at line 74 of file AMMOffer.h.
| TAmounts< TIn, TOut > xrpl::AMMOffer< TIn, TOut >::limitOut | ( | TAmounts< TIn, TOut > const & | offerAmount, |
| 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 57 of file AMMOffer.cpp.
| TAmounts< TIn, TOut > xrpl::AMMOffer< TIn, TOut >::limitIn | ( | TAmounts< TIn, TOut > const & | offerAmount, |
| 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 82 of file AMMOffer.cpp.
| QualityFunction xrpl::AMMOffer< TIn, TOut >::getQualityFunc | ( | ) | const |
Definition at line 99 of file AMMOffer.cpp.
|
static |
Send funds without incurring the transfer fee.
Definition at line 100 of file AMMOffer.h.
| bool xrpl::AMMOffer< TIn, TOut >::isFunded | ( | ) | const |
Definition at line 106 of file AMMOffer.h.
|
static |
Definition at line 113 of file AMMOffer.h.
| bool xrpl::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 108 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.