Price Oracle (XLS-47d): (#4789) (#4789)

Implement native support for Price Oracles.

 A Price Oracle is used to bring real-world data, such as market prices,
 onto the blockchain, enabling dApps to access and utilize information
 that resides outside the blockchain.

 Add Price Oracle functionality:
 - OracleSet: create or update the Oracle object
 - OracleDelete: delete the Oracle object

 To support this functionality add:
 - New RPC method, `get_aggregate_price`, to calculate aggregate price for a token pair of the specified oracles
 - `ltOracle` object

 The `ltOracle` object maintains:
 - Oracle Owner's account
 - Oracle's metadata
 - Up to ten token pairs with the scaled price
 - The last update time the token pairs were updated

 Add Oracle unit-tests
This commit is contained in:
Gregory Tsipenyuk
2024-02-26 06:28:26 -05:00
committed by GitHub
parent d7d15a922a
commit e718378bdb
40 changed files with 2865 additions and 7 deletions

View File

@@ -29,6 +29,7 @@
#include <ripple/protocol/SOTemplate.h>
#include <ripple/protocol/STAmount.h>
#include <ripple/protocol/STBase.h>
#include <ripple/protocol/STCurrency.h>
#include <ripple/protocol/STIssue.h>
#include <ripple/protocol/STPathSet.h>
#include <ripple/protocol/STVector256.h>
@@ -241,6 +242,8 @@ public:
getFieldV256(SField const& field) const;
const STArray&
getFieldArray(SField const& field) const;
const STCurrency&
getFieldCurrency(SField const& field) const;
/** Get the value of a field.
@param A TypedField built from an SField value representing the desired
@@ -370,6 +373,8 @@ public:
void
setFieldIssue(SField const& field, STIssue const&);
void
setFieldCurrency(SField const& field, STCurrency const&);
void
setFieldPathSet(SField const& field, STPathSet const&);
void
setFieldV256(SField const& field, STVector256 const& v);