19 #ifndef RIPPLE_APP_MISC_AMMUTILS_H_INLCUDED
20 #define RIPPLE_APP_MISC_AMMUTILS_H_INLCUDED
22 #include <ripple/basics/Expected.h>
23 #include <ripple/beast/utility/Journal.h>
24 #include <ripple/ledger/View.h>
25 #include <ripple/protocol/STAmount.h>
26 #include <ripple/protocol/STLedgerEntry.h>
27 #include <ripple/protocol/TER.h>
51 Expected<std::tuple<STAmount, STAmount, STAmount>,
TER>
113 Issue
const& lptIssue,
118 #endif // RIPPLE_APP_MISC_AMMUTILS_H_INLCUDED
void initializeFeeAuctionVote(ApplyView &view, std::shared_ptr< SLE > &ammSle, AccountID const &account, Issue const &lptIssue, std::uint16_t tfee)
Initialize Auction and Voting slots and set the trading/discounted fee.
Expected< std::tuple< STAmount, STAmount, STAmount >, TER > ammHolds(ReadView const &view, SLE const &ammSle, std::optional< Issue > const &optIssue1, std::optional< Issue > const &optIssue2, FreezeHandling freezeHandling, beast::Journal const j)
Get AMM pool and LP token balances.
FreezeHandling
Controls the treatment of frozen account balances.
AccountID ammAccountID(std::uint16_t prefix, uint256 const &parentHash, uint256 const &ammID)
Calculate AMM account ID.
std::pair< STAmount, STAmount > ammPoolHolds(ReadView const &view, AccountID const &ammAccountID, Issue const &issue1, Issue const &issue2, FreezeHandling freezeHandling, beast::Journal const j)
Get AMM pool balances.
std::uint16_t getTradingFee(ReadView const &view, SLE const &ammSle, AccountID const &account)
Get AMM trading fee for the given account.
TERSubset< CanCvtToTER > TER
A generic endpoint for log messages.
base_uint< 160, detail::CurrencyTag > Currency
Currency is a hash representing a specific currency.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
TER deleteAMMAccount(Sandbox &view, Issue const &asset, Issue const &asset2, beast::Journal j)
Delete trustlines to AMM.
STAmount ammLPHolds(ReadView const &view, Currency const &cur1, Currency const &cur2, AccountID const &ammAccount, AccountID const &lpAccount, beast::Journal const j)
Get the balance of LP tokens.
STAmount ammAccountHolds(ReadView const &view, AccountID const &ammAccountID, Issue const &issue)
Returns total amount held by AMM for the given token.
base_uint< 160, detail::AccountIDTag > AccountID
A 160-bit unsigned that uniquely identifies an account.