mirror of
https://github.com/Xahau/xahaud.git
synced 2026-06-04 17:26:39 +00:00
Introduce AMM support (XLS-30d): (#4294)
Add AMM functionality: - InstanceCreate - Deposit - Withdraw - Governance - Auctioning - payment engine integration To support this functionality, add: - New RPC method, `amm_info`, to fetch pool and LPT balances - AMM Root Account - trust line for each IOU AMM token - trust line to track Liquidity Provider Tokens (LPT) - `ltAMM` object The `ltAMM` object tracks: - fee votes - auction slot bids - AMM tokens pair - total outstanding tokens balance - `AMMID` to AMM `RootAccountID` mapping Add new classes to facilitate AMM integration into the payment engine. `BookStep` uses these classes to infer if AMM liquidity can be consumed. The AMM formula implementation uses the new Number class added in #4192. IOUAmount and STAmount use Number arithmetic. Add AMM unit tests for all features. AMM requires the following amendments: - featureAMM - fixUniversalNumber - featureFlowCross Notes: - Current trading fee threshold is 1% - AMM currency is generated by: 0x03 + 152 bits of sha256{cur1, cur2} - Current max AMM Offers is 30 --------- Co-authored-by: Howard Hinnant <howard.hinnant@gmail.com>
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
#include <ripple/protocol/STBitString.h>
|
||||
#include <ripple/protocol/STBlob.h>
|
||||
#include <ripple/protocol/STInteger.h>
|
||||
#include <ripple/protocol/STIssue.h>
|
||||
#include <ripple/protocol/STObject.h>
|
||||
#include <ripple/protocol/STPathSet.h>
|
||||
#include <ripple/protocol/STVector256.h>
|
||||
@@ -157,6 +158,9 @@ STVar::STVar(SerialIter& sit, SField const& name, int depth)
|
||||
case STI_ARRAY:
|
||||
construct<STArray>(sit, name, depth);
|
||||
return;
|
||||
case STI_ISSUE:
|
||||
construct<STIssue>(sit, name);
|
||||
return;
|
||||
default:
|
||||
Throw<std::runtime_error>("Unknown object type");
|
||||
}
|
||||
@@ -212,6 +216,9 @@ STVar::STVar(SerializedTypeID id, SField const& name)
|
||||
case STI_ARRAY:
|
||||
construct<STArray>(name);
|
||||
return;
|
||||
case STI_ISSUE:
|
||||
construct<STIssue>(name);
|
||||
return;
|
||||
default:
|
||||
Throw<std::runtime_error>("Unknown object type");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user