1#ifndef XRPL_PROTOCOL_AMMCORE_H_INCLUDED
2#define XRPL_PROTOCOL_AMMCORE_H_INCLUDED
4#include <xrpl/basics/Number.h>
5#include <xrpl/protocol/AccountID.h>
6#include <xrpl/protocol/Issue.h>
7#include <xrpl/protocol/TER.h>
8#include <xrpl/protocol/UintTypes.h>
54 bool validZero =
false);
102 return 1 -
getFee(tfee) / 2;
A currency issued by an account.
Rules controlling protocol behavior.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
NotTEC invalidAMMAmount(STAmount const &amount, std::optional< std::pair< Issue, Issue > > const &pair=std::nullopt, bool validZero=false)
Validate the amount.
std::uint32_t constexpr TOTAL_TIME_SLOT_SECS
std::uint16_t constexpr AUCTION_SLOT_TIME_INTERVALS
std::optional< std::uint8_t > ammAuctionTimeSlot(std::uint64_t current, STObject const &auctionSlot)
Get time slot of the auction slot.
NotTEC invalidAMMAsset(Issue const &issue, std::optional< std::pair< Issue, Issue > > const &pair=std::nullopt)
Currency ammLPTCurrency(Currency const &cur1, Currency const &cur2)
Calculate Liquidity Provider Token (LPT) Currency.
bool ammEnabled(Rules const &)
Return true if required AMM amendments are enabled.
Issue ammLPTIssue(Currency const &cur1, Currency const &cur2, AccountID const &ammAccountID)
Calculate LPT Issue from AMM asset pair.
@ current
This was a new validation and was added.
std::uint32_t constexpr AUCTION_SLOT_MIN_FEE_FRACTION
Number feeMult(std::uint16_t tfee)
Get fee multiplier (1 - tfee) @tfee trading fee in basis points.
std::uint32_t constexpr AUCTION_SLOT_FEE_SCALE_FACTOR
Number getFee(std::uint16_t tfee)
Convert to the fee from the basis points.
std::uint32_t constexpr VOTE_WEIGHT_SCALE_FACTOR
NotTEC invalidAMMAssetPair(Issue const &issue1, Issue const &issue2, std::optional< std::pair< Issue, Issue > > const &pair=std::nullopt)
std::uint32_t constexpr AUCTION_SLOT_INTERVAL_DURATION
Number feeMultHalf(std::uint16_t tfee)
Get fee multiplier (1 - tfee / 2) @tfee trading fee in basis points.
std::uint16_t constexpr VOTE_MAX_SLOTS
std::uint16_t constexpr TRADING_FEE_THRESHOLD
std::uint16_t constexpr AUCTION_SLOT_MAX_AUTH_ACCOUNTS
std::uint32_t constexpr AUCTION_SLOT_DISCOUNTED_FEE_FRACTION