|
| static bool | checkExtraFeatures (PreflightContext const &ctx) |
| static NotTEC | preflight (PreflightContext const &ctx) |
| static TER | preclaim (PreclaimContext const &ctx) |
| static NotTEC | checkSeqProxy (ReadView const &view, STTx const &tx, beast::Journal j) |
| static NotTEC | checkPriorTxAndLastLedger (PreclaimContext const &ctx) |
| static TER | checkFee (PreclaimContext const &ctx, XRPAmount baseFee) |
| static NotTEC | checkSign (PreclaimContext const &ctx) |
| static NotTEC | checkBatchSign (PreclaimContext const &ctx) |
| static XRPAmount | calculateBaseFee (ReadView const &view, STTx const &tx) |
| static XRPAmount | calculateBaseFee (ReadView const &view, STTx const &tx, std::uint32_t extraBaseFeeMultiplier) |
| template<class T> |
| static NotTEC | invokePreflight (PreflightContext const &ctx) |
| template<> |
| NotTEC | invokePreflight (PreflightContext const &ctx) |
| template<> |
| NotTEC | invokePreflight (PreflightContext const &ctx) |
| static NotTEC | checkGranularSemantics (ReadView const &view, STTx const &tx, std::unordered_set< GranularPermissionType > const &heldGranularPermissions) |
| | This function can be overridden to introduce additional semantic constraints beyond the granular template validation for granular permissions.
|
| template<class T> |
| static NotTEC | invokeCheckPermission (ReadView const &view, STTx const &tx) |
| | Checks whether the transaction is authorized to be executed by the delegated account.
|
| static TER | ticketDelete (ApplyView &view, AccountID const &account, uint256 const &ticketIndex, beast::Journal j) |
|
| static NotTEC | checkSign (ReadView const &view, ApplyFlags flags, std::optional< uint256 const > const &parentBatchId, AccountID const &idAccount, STObject const &sigObject, beast::Journal const j) |
| static XRPAmount | minimumFee (ServiceRegistry ®istry, XRPAmount baseFee, Fees const &fees, ApplyFlags flags) |
| | Compute the minimum fee required to process a transaction with a given baseFee based on the current server load.
|
| static XRPAmount | calculateOwnerReserveFee (ReadView const &view, STTx const &tx) |
| static std::uint32_t | getFlagsMask (PreflightContext const &ctx) |
| static NotTEC | preflightSigValidated (PreflightContext const &ctx) |
| static bool | validDataLength (std::optional< Slice > const &slice, std::size_t maxLength) |
| template<class T> |
| static bool | validNumericRange (std::optional< T > value, T max, T min=T{}) |
| template<class T, class Unit> |
| static bool | validNumericRange (std::optional< T > value, unit::ValueUnit< Unit, T > max, unit::ValueUnit< Unit, T > min=unit::ValueUnit< Unit, T >{}) |
| template<class T> |
| static bool | validNumericMinimum (std::optional< T > value, T min=T{}) |
| | Minimum will usually be zero.
|
| template<class T, class Unit> |
| static bool | validNumericMinimum (std::optional< T > value, unit::ValueUnit< Unit, T > min=unit::ValueUnit< Unit, T >{}) |
| | Minimum will usually be zero.
|
AMMBid implements AMM bid Transactor.
This is a mechanism for an AMM instance to auction-off the trading advantages to users (arbitrageurs) at a discounted TradingFee for a 24 hour slot. Any account that owns corresponding LPTokens can bid for the auction slot of that AMM instance. Part of the proceeds from the auction, i.e. LPTokens are refunded to the current slot-holder computed on a pro rata basis. Remaining part of the proceeds - in the units of LPTokens- is burnt, thus effectively increasing the LPs shares. Total slot time of 24 hours is divided into 20 equal intervals. The auction slot can be in any of the following states at any time:
- Empty - no account currently holds the slot.
- Occupied - an account owns the slot with at least 5% of the remaining slot time (in one of 1-19 intervals).
- Tailing - an account owns the slot with less than 5% of the remaining time. The slot-holder owns the slot privileges when in state Occupied or Tailing. If x is the fraction of used slot time for the current slot holder and X is the price at which the slot can be bought specified in LPTokens then: The minimum bid price for the slot in first interval is f(x) = X * 1.05 + min_slot_price The bid price of slot any time is f(x) = X * 1.05 * (1 - x^60) + min_slot_price, where min_slot_price is a constant fraction of the total LPTokens. The revenue from a successful bid is split between the current slot-holder and the pool. The current slot holder is always refunded the remaining slot value f(x) = (1 - x) * X. The remaining LPTokens are burnt. The auction information is maintained in AuctionSlot of ltAMM object. AuctionSlot contains: Account - account id, which owns the slot. Expiration - slot expiration time DiscountedFee - trading fee charged to the account, default is 0. Price - price paid for the slot in LPTokens. AuthAccounts - up to four accounts authorized to trade at the discounted fee.
- See also
- XLS30d:Continuous Auction Mechanism
Definition at line 45 of file tx/transactors/dex/AMMBid.h.
Inspect a single ledger entry modified by this transaction.
Called once for every SLE created, modified, or deleted by the transaction, before finalizeInvariants. Implementations should accumulate whatever state they need to verify transaction-specific post-conditions.
- Parameters
-
| isDelete | true if the entry was erased from the ledger. |
| before | the entry's state before the transaction (nullptr for newly created entries). |
| after | the entry's state as supplied by the apply logic for this transaction. For deletions, this is the SLE being erased and is not guaranteed to be null; callers must use isDelete rather than after == nullptr to detect deletions. |
Implements xrpl::Transactor.
Definition at line 381 of file AMMBid.cpp.
Check transaction-specific post-conditions after all entries have been visited.
Called once after every modified ledger entry has been passed to visitInvariantEntry. Returns true if all transaction-specific invariants hold, or false to fail the transaction with tecINVARIANT_FAILED.
- Parameters
-
| tx | the transaction being applied. |
| result | the tentative TER result so far. |
| fee | the fee consumed by the transaction. |
| view | read-only view of the ledger after the transaction. |
| j | journal for logging invariant failures. |
- Returns
- true if all invariants pass; false otherwise.
Implements xrpl::Transactor.
Definition at line 387 of file AMMBid.cpp.
Checks whether the transaction is authorized to be executed by the delegated account.
This function enforces the strict permission check hierarchy. It is explicitly designed NOT to be overridden. Derived transactors must instead implement checkGranularSemantics to add custom validation logic for granular permissions.
The evaluation proceeds as follows:
- If transaction-level permission is granted, the function immediately returns tesSUCCESS.
- If transaction-level permission is not granted, the function checks whether the transaction matches the granular permission template defined in permissions.macro. If it does, it then calls checkGranularSemantics to perform any additional, fine-grained validation.
Definition at line 261 of file Transactor.h.