Merge branch 'master' into amm-modular-tutorials
@@ -252,6 +252,18 @@
|
||||
[OfferCreateトランザクション]: /docs/references/protocol/transactions/types/offercreate.md
|
||||
[Offerエントリ]: /docs/references/protocol/ledger-data/ledger-entry-types/offer.md
|
||||
[Offerオブジェクト]: /docs/references/protocol/ledger-data/ledger-entry-types/offer.md
|
||||
[OracleDelete transaction]: /docs/references/protocol/transactions/types/oracledelete.md
|
||||
[OracleDeleteトランザクション]: /docs/references/protocol/transactions/types/oracledelete.md
|
||||
[OracleDelete transactions]: /docs/references/protocol/transactions/types/oracledelete.md
|
||||
[OracleDeleteトランザクション]: /docs/references/protocol/transactions/types/oracledelete.md
|
||||
[Oracle entry]: /docs/references/protocol/ledger-data/ledger-entry-types/oracle.md
|
||||
[Oracleエントリ]: /docs/references/protocol/ledger-data/ledger-entry-types/oracle.md
|
||||
[Oracle object]: /docs/references/protocol/ledger-data/ledger-entry-types/oracle.md
|
||||
[Oracleオブジェクト]: /docs/references/protocol/ledger-data/ledger-entry-types/oracle.md
|
||||
[OracleSet transaction]: /docs/references/protocol/transactions/types/oracleset.md
|
||||
[OracleSetトランザクション]: /docs/references/protocol/transactions/types/oracleset.md
|
||||
[OracleSet transactions]: /docs/references/protocol/transactions/types/oracleset.md
|
||||
[OracleSetトランザクション]: /docs/references/protocol/transactions/types/oracleset.md
|
||||
[OwnerPaysFee amendment]: /resources/known-amendments.md#ownerpaysfee
|
||||
[OwnerPaysFeeの修正]: /resources/known-amendments.md#ownerpaysfee
|
||||
[PayChan amendment]: /resources/known-amendments.md#paychan
|
||||
@@ -282,6 +294,7 @@
|
||||
[PaymentChannelFundトランザクション]: /docs/references/protocol/transactions/types/paymentchannelfund.md
|
||||
[Payment]: /docs/references/protocol/transactions/types/payment.md
|
||||
[Paymentトランザクション]: /docs/references/protocol/transactions/types/payment.md
|
||||
[PriceOracle amendment]: /resources/known-amendments.md#priceoracle
|
||||
[RFC-1751]: https://tools.ietf.org/html/rfc1751
|
||||
[Reporting Mode]: /docs/concepts/networks-and-servers/rippled-server-modes.md#reporting-mode
|
||||
[RequireFullyCanonicalSig amendment]: /resources/known-amendments.md#requirefullycanonicalsig
|
||||
@@ -498,6 +511,10 @@
|
||||
[fixTakerDryOfferRemovalの修正]: /resources/known-amendments.md#fixtakerdryofferremoval
|
||||
[fixTrustLinesToSelf amendment]: /resources/known-amendments.md#fixtrustlinestoself
|
||||
[fixTrustLinesToSelfの修正]: /resources/known-amendments.md#fixtrustlinestoself
|
||||
[get_aggregate_price command]: /docs/references/http-websocket-apis/public-api-methods/path-and-order-book-methods/get_aggregate_price.md
|
||||
[get_aggregate_priceコマンド]: /docs/references/http-websocket-apis/public-api-methods/path-and-order-book-methods/get_aggregate_price.md
|
||||
[get_aggregate_price method]: /docs/references/http-websocket-apis/public-api-methods/path-and-order-book-methods/get_aggregate_price.md
|
||||
[get_aggregate_priceメソッド]: /docs/references/http-websocket-apis/public-api-methods/path-and-order-book-methods/get_aggregate_price.md
|
||||
[gateway_balances command]: /docs/references/http-websocket-apis/public-api-methods/account-methods/gateway_balances.md
|
||||
[gateway_balances method]: /docs/references/http-websocket-apis/public-api-methods/account-methods/gateway_balances.md
|
||||
[gateway_balances メソッド]: /docs/references/http-websocket-apis/public-api-methods/account-methods/gateway_balances.md
|
||||
|
||||
@@ -38,7 +38,7 @@ An exception to the owner reserve is that you can create your first two trust li
|
||||
|
||||
Many objects in the ledger (ledger entries) are owned by a particular account. Usually, the owner is the account that created the object. Each object increases the owner's total reserve requirement by the owner reserve. When objects are removed from the ledger, they no longer count against the reserve requirement.
|
||||
|
||||
Objects that count towards their owner's reserve requirement include: [Checks](../payment-types/checks.md), [Deposit Preauthorizations](depositauth.md#preauthorization), [Escrows](../payment-types/escrow.md), [NFT Offers](../tokens/nfts/trading.md), [NFT Pages](../tokens/nfts/index.md), [Offers](../../references/protocol/ledger-data/ledger-entry-types/offer.md), [Payment Channels](../payment-types/payment-channels.md), [Signer Lists](multi-signing.md), [Tickets](tickets.md), and [Trust Lines](../tokens/fungible-tokens/index.md).
|
||||
Objects that count towards their owner's reserve requirement include: [Checks](../payment-types/checks.md), [Deposit Preauthorizations](depositauth.md#preauthorization), [Escrows](../payment-types/escrow.md), [NFT Offers](../tokens/nfts/trading.md), [NFT Pages](../tokens/nfts/index.md), [Offers](../../references/protocol/ledger-data/ledger-entry-types/offer.md), [Oracles](../xrpl-sidechains/price-oracles.md), [Payment Channels](../payment-types/payment-channels.md), [Signer Lists](multi-signing.md), [Tickets](tickets.md), and [Trust Lines](../tokens/fungible-tokens/index.md).
|
||||
|
||||
Some special cases:
|
||||
|
||||
@@ -46,6 +46,7 @@ Some special cases:
|
||||
- Trust lines (`RippleState` entries) are shared between two accounts. The owner reserve can apply to one or both of them. Most often, the token holder owes a reserve and the issuer does not. See also: [RippleState: Contributing to the Owner Reserve](../../references/protocol/ledger-data/ledger-entry-types/ripplestate.md#contributing-to-the-owner-reserve).
|
||||
- Signer lists created before the [MultiSignReserve amendment][] activated in April 2019 count as multiple objects. See also: [Signer Lists and Reserves](../../references/protocol/ledger-data/ledger-entry-types/signerlist.md#signer-lists-and-reserves).
|
||||
- An [Owner Directory](../../references/protocol/ledger-data/ledger-entry-types/directorynode.md) is a ledger entry that lists all objects related to an account, including all objects the account owns. However, the owner directory itself does not count towards the reserve.
|
||||
- Oracles count as one item for the owner reserve if they contain one to five `PriceData` objects, or two items if they contain six to ten `PriceData` objects.
|
||||
|
||||
### Looking Up Reserves
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ Validators can vote for changes to basic [transaction cost](../transactions/tran
|
||||
|
||||
Operators of [`rippled` validators](../../infrastructure/configuration/server-modes/run-rippled-as-a-validator.md) can set their preferences for the transaction cost and reserve requirements in the `[voting]` stanza of the `rippled.cfg` file.
|
||||
|
||||
**Caution:** Insufficient requirements, if adopted by a consensus of trusted validators, could expose the XRP Ledger peer-to-peer network to denial-of-service attacks.
|
||||
**Caution:** Insufficient requirements, if adopted by a consensus of trusted validators (>50%), could expose the XRP Ledger peer-to-peer network to denial-of-service attacks.
|
||||
|
||||
The parameters you can set are as follows:
|
||||
|
||||
|
||||
41
docs/concepts/xrpl-sidechains/price-oracles.md
Normal file
@@ -0,0 +1,41 @@
|
||||
# Price Oracles
|
||||
|
||||
_(Requires the [PriceOracle amendment][] {% not-enabled /%})_
|
||||
|
||||
Blockchains can't inherently interact with and "know" what's happening off the network, but many of its use cases in decentralized finance require this information.
|
||||
|
||||
Price oracles solve this problem. An oracle is a service or technology that gathers real-world information, such as market prices, exchange rates, or interest rates, and relays it to the blockchain. Like blockchains, most oracles are also decentralized and validate data through multiple nodes.
|
||||
|
||||
{% admonition type="info" name="Note" %}
|
||||
|
||||
Generally speaking, oracles aren't limited to only providing financial information. They can provide any type of info, such as what sports team won a game, or even the weather. The XRP Ledger's Price Oracle feature, however, is designed specifically for reporting the prices of assets.
|
||||
|
||||
{% /admonition %}
|
||||
|
||||
|
||||
## How Oracles Works
|
||||
|
||||
Most oracle blockchain interactions work like this:
|
||||
|
||||
1. Data is validated offchain by a decentralized oracle network.
|
||||
2. The data is sent to the blockchain.
|
||||
3. The blockchain uses that information to execute a smart contract, such as releasing funds from an escrow.
|
||||
|
||||
This process can also work in reverse, pushing transaction information to external systems.
|
||||
|
||||
|
||||
## Price Oracles on the XRP Ledger
|
||||
|
||||
XRPL price oracles are a native, on-chain oracle, enhancing the native DeFi functionality of the XRP Ledger. Off-chain price oracles send their data to XRPL oracles, which store that information on-chain. Decentralized apps can then query the XRPL oracles for price data; multiple XRPL oracles can be queried to minimize risk and inaccuracies.
|
||||
|
||||
By standardizing price feeds in this manner, all XRPL apps can access a dependable, shared data source.
|
||||
|
||||
## See Also
|
||||
|
||||
- **References:**
|
||||
- [get_aggregate_price method][]
|
||||
- [Oracle entry][]
|
||||
- [OracleDelete transaction][]
|
||||
- [OracleSet transaction][]
|
||||
|
||||
{% raw-partial file="/docs/_snippets/common-links.md" /%}
|
||||
BIN
docs/img/uc-smart-contract-insurance.png
Normal file
|
After Width: | Height: | Size: 254 KiB |
BIN
docs/img/uc-smart-contract-real-estate-supplies.png
Normal file
|
After Width: | Height: | Size: 260 KiB |
BIN
docs/img/uc-smart-contract.png
Normal file
|
After Width: | Height: | Size: 126 KiB |
|
Before Width: | Height: | Size: 228 KiB After Width: | Height: | Size: 231 KiB |
BIN
docs/img/uc-the-oracle.png
Normal file
|
After Width: | Height: | Size: 162 KiB |
BIN
docs/img/uc-yescrow-holding-lock-and-key.png
Normal file
|
After Width: | Height: | Size: 87 KiB |
@@ -21,7 +21,7 @@ For day-to-day payments, this may be preferable, since these types of wallets ar
|
||||
|
||||

|
||||
|
||||
A non-custodial wallet, such as [XUMM](https://xumm.app/), is one where you have the secret keys to your account. This means you're ultimately responsible for managing the security of your account.
|
||||
A non-custodial wallet, such as [Xaman](https://Xaman.app/), is one where you have the secret keys to your account. This means you're ultimately responsible for managing the security of your account.
|
||||
|
||||
**Caution:** If you lose your keys, you are locked out of your XRP Ledger account and there are no recovery options.
|
||||
|
||||
|
||||
@@ -45,13 +45,13 @@ The request can contain the following parameters:
|
||||
The `ledger` field is deprecated and may be removed without further notice.
|
||||
|
||||
{% admonition type="info" name="Note" %}
|
||||
The `ledger` command in Clio does not support the following fields that are supported by [ledger command in rippled](../ledger-methods/ledger.md):
|
||||
The `ledger` command in Clio does not support the following fields:
|
||||
|
||||
* `accounts`
|
||||
* `full`
|
||||
* `queue`
|
||||
|
||||
Clio will **always** forward the request to `rippled` when any of the above fields is set to `true`.
|
||||
Clio returns an error when any of the above fields is set to `true`. (It is OK to include the fields in the request as long as the provided value is `false`.) {% badge href="https://github.com/XRPLF/clio/releases/tag/2.2.2" %}Updated in: Clio 2.2.2{% /badge %}
|
||||
{% /admonition %}
|
||||
|
||||
## Response Format
|
||||
@@ -68,6 +68,10 @@ An example of a successful response:
|
||||
{% code-snippet file="/_api-examples/ledger-clio/jsonrpc-response.json" language="json" prefix="200 OK\n\n" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="JSON-RPC (with diff)" %}
|
||||
{% code-snippet file="/_api-examples/ledger-clio/jsonrpc-diff-response.json" language="json" /%}
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
The response follows the [standard format][], with a successful result containing information about the ledger, including the following fields:
|
||||
@@ -107,10 +111,6 @@ If the request specified `"diff": true`, the response has an object `diff`. The
|
||||
| `object_id` | String | The object identifier. |
|
||||
| `Hashes` | Object or Hex String | Depending on whether the request set `binary` to true or false, this field returns the contents of the object that was created, the new value of an object that was modified, or an empty string if the object was deleted. |
|
||||
|
||||
### Response When `diff` is `true`
|
||||
|
||||
|
||||
`{% code-snippet file="/_api-examples/ledger-clio/jsonrpc-diff-response.json" language="json" /%}`
|
||||
|
||||
## Possible Errors
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ This method can retrieve several different types of data. You can select which t
|
||||
| `binary` | Boolean | _(Optional)_ If `true`, return the requested ledger entry's contents as a hex string in the XRP Ledger's [binary format](../../../protocol/binary-format.md). Otherwise, return data in JSON format. The default is `false`. {% badge href="https://github.com/XRPLF/rippled/releases/tag/1.2.0" %}Updated in: rippled 1.2.0{% /badge %} |
|
||||
| `ledger_hash` | String | _(Optional)_ A 20-byte hex string for the ledger version to use. (See [Specifying Ledgers][]) |
|
||||
| `ledger_index` | String or Unsigned Integer | _(Optional)_ The [ledger index][] of the ledger to use, or a shortcut string (e.g. "validated" or "closed" or "current") to choose a ledger automatically. (See [Specifying Ledgers][]) |
|
||||
| `include_deleted` | Boolean | _(Optional, Clio servers only)_ If set to _true_ and the queried object has been deleted, return its complete data as it was prior to its deletion. If set to _false_ or not provided, and the queried object has been deleted, return `objectNotFound` (current behavior). |
|
||||
|
||||
The `generator` and `ledger` parameters are deprecated and may be removed without further notice.
|
||||
|
||||
@@ -39,6 +40,7 @@ In addition to the general fields above, you must specify *exactly 1* of the fol
|
||||
- [Get Bridge Object](#get-bridge-object)
|
||||
- [Get DirectoryNode Object](#get-directorynode-object)
|
||||
- [Get Offer Object](#get-offer-object)
|
||||
- [Get Oracle Object](#get-oracle-object)
|
||||
- [Get RippleState Object](#get-ripplestate-object)
|
||||
- [Get Check Object](#get-check-object)
|
||||
- [Get Escrow Object](#get-escrow-object)
|
||||
@@ -400,6 +402,61 @@ rippled json ledger_entry '{ "offer": { "account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJY
|
||||
[Try it! >](/resources/dev-tools/websocket-api-tool#ledger_entry-offer)
|
||||
|
||||
|
||||
### Get Oracle Object
|
||||
|
||||
_(Requires the [PriceOracle amendment][] {% not-enabled /%})_
|
||||
|
||||
Retrieve an [Oracle entry](../../../protocol/ledger-data/ledger-entry-types/oracle.md), which represents a single price oracle that can store token prices.
|
||||
|
||||
| Field | Type | Required? | Description |
|
||||
|-----------------------------|----------------------|-----------|-------------|
|
||||
| `oracle` | Object | Yes | The oracle identifier. |
|
||||
| `oracle.account` | String - [Address][] | Yes | The account that controls the `Oracle` object. |
|
||||
| `oracle.oracle_document_id` | Number | Yes | A unique identifier of the price oracle for the `Account` |
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="WebSocket" %}
|
||||
```json
|
||||
{
|
||||
"id": "example_get_oracle",
|
||||
"command": "ledger_entry",
|
||||
"oracle" : {
|
||||
"account": "rNZ9m6AP9K7z3EVg6GhPMx36V4QmZKeWds",
|
||||
"oracle_document_id": 34
|
||||
},
|
||||
"ledger_index": "validated"
|
||||
}
|
||||
```
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="JSON-RPC" %}
|
||||
```json
|
||||
{
|
||||
"method": "ledger_entry",
|
||||
"params" : [
|
||||
{
|
||||
"oracle" : {
|
||||
"account": "rNZ9m6AP9K7z3EVg6GhPMx36V4QmZKeWds",
|
||||
"oracle_document_id": 34
|
||||
},
|
||||
"ledger_index": "validated"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="Commandline" %}
|
||||
```sh
|
||||
rippled json ledger_entry '{ "oracle": { "account": "rNZ9m6AP9K7z3EVg6GhPMx36V4QmZKeWds", "oracle_document_id": 34 }, "ledger_index": "validated" }'
|
||||
```
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
[Try it! >](/resources/dev-tools/websocket-api-tool?server=wss%3A%2F%2Fs.devnet.rippletest.net%3A51233%2F#ledger_entry-oracle)
|
||||
|
||||
|
||||
### Get RippleState Object
|
||||
|
||||
@@ -759,6 +816,7 @@ The response follows the [standard format][], with a successful result containin
|
||||
| `ledger_index` | Unsigned Integer | The [ledger index][] of the ledger that was used when retrieving this data. |
|
||||
| `node` | Object | _(Omitted if `"binary": true` specified.)_ Object containing the data of this ledger entry, according to the [ledger format][]. |
|
||||
| `node_binary` | String | _(Omitted unless `"binary":true` specified)_ The [binary representation](../../../protocol/binary-format.md) of the ledger object, as hexadecimal. |
|
||||
| `deleted_ledger_index` | String | _(Clio server only, returned if `include_deleted` parameter is set.)_ The [ledger index][] where the ledger entry object was deleted. |
|
||||
|
||||
An example of a successful response:
|
||||
|
||||
|
||||
@@ -0,0 +1,171 @@
|
||||
---
|
||||
html: get_aggregate_price.html
|
||||
parent: ledger-methods.html
|
||||
blurb: Calculates the aggregate price of specified Oracle instances.
|
||||
status: not_enabled
|
||||
labels:
|
||||
- Oracle
|
||||
---
|
||||
# get_aggregate_price
|
||||
|
||||
_(Requires the [PriceOracle amendment][] {% not-enabled /%})_
|
||||
|
||||
[[Source]](https://github.com/XRPLF/rippled/blob/master/src/ripple/rpc/handlers/GetAggregatePrice.cpp "Source")
|
||||
|
||||
|
||||
The `get_aggregate_price` method retrieves the aggregate price of specified `Oracle` objects, returning three price statistics: mean, median, and trimmed mean.
|
||||
|
||||
|
||||
## Request Format
|
||||
|
||||
An example of the request format:
|
||||
|
||||
{% tabs %}
|
||||
|
||||
{% tab label="WebSocket" %}
|
||||
```json
|
||||
{
|
||||
"command": "get_aggregate_price",
|
||||
"ledger_index": "current",
|
||||
"base_asset": "XRP",
|
||||
"quote_asset": "USD",
|
||||
"trim": 20,
|
||||
"oracles": [
|
||||
{
|
||||
"account": "rp047ow9WcPmnNpVHMQV5A4BF6vaL9Abm6",
|
||||
"oracle_document_id": 34
|
||||
},
|
||||
{
|
||||
"account": "rp147ow9WcPmnNpVHMQV5A4BF6vaL9Abm7",
|
||||
"oracle_document_id": 56
|
||||
},
|
||||
{
|
||||
"account": "rp247ow9WcPmnNpVHMQV5A4BF6vaL9Abm8",
|
||||
"oracle_document_id": 2
|
||||
},
|
||||
{
|
||||
"account": "rp347ow9WcPmnNpVHMQV5A4BF6vaL9Abm9",
|
||||
"oracle_document_id": 7
|
||||
},
|
||||
{
|
||||
"account": "rp447ow9WcPmnNpVHMQV5A4BF6vaL9Abm0",
|
||||
"oracle_document_id": 109
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
{% /tab %}
|
||||
|
||||
{% tab label="JSON-RPC" %}
|
||||
```json
|
||||
{
|
||||
"method": "get_aggregate_price",
|
||||
"params": [
|
||||
{
|
||||
"ledger_index": "current",
|
||||
"base_asset": "XRP",
|
||||
"quote_asset": "USD",
|
||||
"trim": 20,
|
||||
"oracles": [
|
||||
{
|
||||
"account": "rNZ9m6AP9K7z3EVg6GhPMx36V4QmZKeWds",
|
||||
"oracle_document_id": 34
|
||||
},
|
||||
{
|
||||
"account": "rMVKq8zrVsJZQFEiTARyC6WfZznhhLMcNi",
|
||||
"oracle_document_id": 100
|
||||
},
|
||||
{
|
||||
"account": "r92kJTnUbUUq15t2BBZYGYxY79RnNc7rLQ",
|
||||
"oracle_document_id": 2
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
{% /tab %}
|
||||
|
||||
{% /tabs %}
|
||||
|
||||
|
||||
[Try it! >](/resources/dev-tools/websocket-api-tool?server=wss%3A%2F%2Fs.devnet.rippletest.net%3A51233%2F#get_aggregate_price)
|
||||
|
||||
|
||||
The request contains the following parameters:
|
||||
|
||||
| Field | Type | Required? | Description |
|
||||
|------------------------------|--------|-----------|-------------|
|
||||
| `base_asset` | String | Yes | The currency code of the asset to be priced. |
|
||||
| `quote_asset` | String | Yes | The currency code of the asset to quote the price of the base asset. |
|
||||
| `trim` | Number | No | The percentage of outliers to trim. Valid trim range is 1-25. If included, the API returns statistics for the `trimmed mean`. |
|
||||
| `trim_threshold` | Number | No | Defines a time range in seconds for filtering out older price data. Default value is 0, which doesn't filter any data. |
|
||||
| `oracles` | Array | Yes | An array of oracle identifier objects. You must list between 1 and 200 oracle identifiers. |
|
||||
|
||||
Each member of the `oracles` array is an oracle identifier object with the following fields:
|
||||
|
||||
| Field | Type | Required? | Description |
|
||||
|----------------------|--------|-----------|-------------|
|
||||
| `account` | String | Yes | The XRPL account that controls the `Oracle` object. |
|
||||
| `oracle_document_id` | Number | Yes | A unique identifier of the price oracle for the `Account` |
|
||||
|
||||
|
||||
## Response Format
|
||||
|
||||
An example of the response format:
|
||||
|
||||
```json
|
||||
{
|
||||
"result": {
|
||||
"entire_set": {
|
||||
"mean": "0.78",
|
||||
"size": 3,
|
||||
"standard_deviation": "0.03464101615137754"
|
||||
},
|
||||
"ledger_current_index": 3677185,
|
||||
"median": "0.8",
|
||||
"time": 1724877762,
|
||||
"trimmed_set": {
|
||||
"mean": "0.78",
|
||||
"size": 3,
|
||||
"standard_deviation": "0.03464101615137754"
|
||||
},
|
||||
"validated": false
|
||||
},
|
||||
"status": "success",
|
||||
"type": "response"
|
||||
}
|
||||
```
|
||||
|
||||
| Field | Type | Description |
|
||||
|----------------------------------|-----------------|-------------|
|
||||
| `entire_set` | Object | The statistics from the collected oracle prices. |
|
||||
| `entire_set.mean` | String - Number | The simple mean. |
|
||||
| `entire_set.size` | Number | The size of the data set to calculate the mean. |
|
||||
| `entire_set.standard_deviation` | String - Number | The standard deviation. |
|
||||
| `trimmed_set` | Object | The trimmed statistics from the collected oracle prices. Only appears if the `trim` field was specified in the request. |
|
||||
| `trimmed_set.mean` | String - Number | The simple mean of the trimmed data. |
|
||||
| `trimmed_set.size` | Number | The size of the data to calculate the trimmed mean. |
|
||||
| `trimmed_set.standard_deviation` | String - Number | The standard deviation of the trimmed data. |
|
||||
| `time` | Number | The most recent timestamp out of all `LastUpdateTime` values, represented in Unix time. |
|
||||
|
||||
{% admonition type="info" name="Notes" %}
|
||||
|
||||
- The most recent `Oracle` objects are obtained for the specified oracles.
|
||||
- The most recent `LastUpdateTime` among all objects is chosen as the upper time threshold.
|
||||
- An `Oracle` object is included in the aggregation dataset if it contains the specified `base_asset`/`quote_asset` pair, has an `AssetPrice` field, and its `LastUpdateTime` is within the time range specified.
|
||||
- If an `Oracle` object doesn't contain an `AssetPrice` for the specified token pair, then up to three previous `Oracle` objects are examined and the most recent one that fulfills the requirements is included.
|
||||
|
||||
{% /admonition %}
|
||||
|
||||
|
||||
## Possible Errors
|
||||
|
||||
- Any of the [universal error types][].
|
||||
- `invalidParams` - One or more fields are specified incorrectly, or one or more required fields are missing.
|
||||
- `internal` - The `trim_threshold` setting removed all prices.
|
||||
- `objectNotFound` - There are no prices in the dataset.
|
||||
- `oracleMalformed` - The `oracles` array is malformed. At least one object field is specified incorrectly or missing, or the number of objects is outside the bounds of 1 to 200.
|
||||
-
|
||||
|
||||
{% raw-partial file="/docs/_snippets/common-links.md" /%}
|
||||
@@ -0,0 +1,95 @@
|
||||
# Oracle
|
||||
|
||||
_(Requires the [PriceOracle amendment][] {% not-enabled /%})_
|
||||
|
||||
[[Source]](https://github.com/XRPLF/rippled/blob/master/src/ripple/protocol/impl/LedgerFormats.cpp#L353-L366 "Source")
|
||||
|
||||
An `Oracle` ledger entry holds data associated with a single price oracle object.
|
||||
|
||||
{% admonition type="info" name="Note" %}
|
||||
|
||||
A price oracle object can store information for up to 10 token pairs.
|
||||
|
||||
{% /admonition %}
|
||||
|
||||
|
||||
## Example Oracle JSON
|
||||
|
||||
```json
|
||||
{
|
||||
"LedgerEntryType": "Oracle",
|
||||
"Owner": "rNZ9m6AP9K7z3EVg6GhPMx36V4QmZKeWds",
|
||||
"Provider": "70726F7669646572",
|
||||
"AssetClass": "63757272656E6379",
|
||||
"PriceDataSeries": [
|
||||
{
|
||||
"PriceData": {
|
||||
"BaseAsset": "XRP",
|
||||
"QuoteAsset": "USD",
|
||||
"AssetPrice": 740,
|
||||
"Scale": 3,
|
||||
}
|
||||
},
|
||||
],
|
||||
"LastUpdateTime": 1724871860,
|
||||
"PreviousTxnID": "C53ECF838647FA5A4C780377025FEC7999AB4182590510CA461444B207AB74A9",
|
||||
"PreviousTxnLgrSeq": 3675418
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
## Oracle Fields
|
||||
|
||||
| Field | JSON Type | Internal Type | Required? | Description |
|
||||
|---------------------|-----------|---------------|-----------|-------------|
|
||||
| `Owner` | String | AccountID | Yes | The XRPL account with update and delete privileges for the oracle. It's recommended to set up [multi-signing](../../../../tutorials/how-tos/manage-account-settings/set-up-multi-signing) on this account. |
|
||||
| `Provider` | String | Blob | Yes | An arbitrary value that identifies an oracle provider, such as Chainlink, Band, or DIA. This field is a string, up to 256 ASCII hex encoded characters (0x20-0x7E). |
|
||||
| `PriceDataSeries` | Array | Array | Yes | An array of up to 10 `PriceData` objects, each representing the price information for a token pair. More than five `PriceData` objects require two owner reserves. |
|
||||
| `LastUpdateTime` | Number | UInt32 | Yes | The time the data was last updated, represented in Unix time. |
|
||||
| `URI` | String | Blob | No | An optional Universal Resource Identifier to reference price data off-chain. This field is limited to 256 bytes. |
|
||||
| `AssetClass` | String | Blob | Yes | Describes the type of asset, such as "currency", "commodity", or "index". This field is a string, up to 16 ASCII hex encoded characters (0x20-0x7E). |
|
||||
| `OwnerNode` | String | UInt64 | Yes | A hint indicating which page of the oracle owner's owner directory links to this entry, in case the directory consists of multiple pages. |
|
||||
| `PreviousTxnID` | String | UInt256 | Yes | The hash of the previous transaction that modified this entry. |
|
||||
| `PreviousTxnLgrSeq` | String | UInt32 | Yes | The ledger index that this object was most recently modified or created in. |
|
||||
|
||||
|
||||
### PriceData Fields
|
||||
|
||||
| Field | JSON Type | Internal Type | Required? | Description |
|
||||
|---------------------|-----------|---------------|-----------|-------------|
|
||||
| `BaseAsset` | String | Currency | Yes | The primary asset in a trading pair. Any valid identifier, such as a stock symbol, bond CUSIP, or currency code is allowed. |
|
||||
| `QuoteAsset` | String | Currency | Yes | The quote asset in a trading pair. The quote asset denotes the price of one unit of the base asset. |
|
||||
| `AssetPrice` | Number | UInt64 | No | The asset price after applying the `Scale` precision level. It's not included if the last update transaction didn't include the `BaseAsset`/`QuoteAsset` pair. |
|
||||
| `Scale` | Number | UInt8 | No | The scaling factor to apply to an asset price. For example, if `Scale` is 6 and original price is 0.155, then the scaled price is 155000. Valid scale ranges are 0-10. It's not included if the last update transaction didn't include the `BaseAsset`/`QuoteAsset` pair. |
|
||||
|
||||
|
||||
## Oracle Reserve
|
||||
|
||||
An `Oracle` object counts as one item for purposes of the [owner reserve](../../../../concepts/accounts/reserves.md#base-reserve-and-owner-reserve) if it contains one to five `PriceData` objects, and counts as two items if it contains six to ten `PriceData` objects.
|
||||
|
||||
|
||||
## Oracle ID Format
|
||||
|
||||
The ID of an `Oracle` object is the [SHA-512Half][] of the following values, concatenated in order:
|
||||
|
||||
1. The `Oracle` space key (`0x52`)
|
||||
2. The `Owner` Account ID.
|
||||
3. The `OracleDocumentID`.
|
||||
|
||||
|
||||
## Currency Internal Format
|
||||
|
||||
The `Currency` field type contains 160 bits of arbitrary data representing a currency or asset code. If the data matches the XRPL's standard format for [currency codes][], the API displays it as a string such as `"USD"`; otherwise, it displays as 40 characters of hexadecimal. The following JSON example represents the `912810RR9/USD` trading pair. The `BaseAsset` is a CUSIP code `912810RR9` represented as a hexadecimal string, and the `QuoteAsset` is a standard `USD` currency code:
|
||||
|
||||
```json
|
||||
{
|
||||
"PriceData" : {
|
||||
"BaseAsset" : "3931323831305252390000000000000000000000",
|
||||
"QuoteAsset" : "USD",
|
||||
"Scale" : 1,
|
||||
"SymbolPrice" : 740
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
{% raw-partial file="/docs/_snippets/common-links.md" /%}
|
||||
@@ -134,15 +134,15 @@ Example of a transaction with a Memos field:
|
||||
|
||||
The `NetworkID` field is a protection against "cross-chain" transaction replay attacks, preventing the same transaction from being copied over and executing on a [parallel network](../../../concepts/networks-and-servers/parallel-networks.md) that it wasn't intended for. For compatibility with existing chains, the `NetworkID` field must be omitted on any network with a Network ID of 1024 or less, but must be included on any network with a Network ID of 1025 or greater. The following table shows the status and values for various known networks:
|
||||
|
||||
| Network | ID | `NetworkID` Field |
|
||||
|---------------|----|-------------------|
|
||||
| Mainnet | 0 | Disallowed |
|
||||
| Testnet | 1 | Disallowed |
|
||||
| Devnet | 2 | Disallowed |
|
||||
| AMM Devnet | 25 | Disallowed |
|
||||
| Sidechains Devnet Locking Chain | 2551 | Disallowed, but will become required after an update |
|
||||
| Sidechains Devnet Issuing Chain | 2552 | Disallowed, but will become required after an update |
|
||||
| Hooks V3 Testnet | 21338 | Required |
|
||||
| Network | ID | `NetworkID` Field |
|
||||
| ------------------------------- | ----- | ---------------------------------------------------- |
|
||||
| Mainnet | 0 | Disallowed |
|
||||
| Testnet | 1 | Disallowed |
|
||||
| Devnet | 2 | Disallowed |
|
||||
| Batch Testnet | 21336 | Required |
|
||||
| Xahau Mainnet | 21337 | Required |
|
||||
| Xahau Testnet | 21338 | Required |
|
||||
| JS Hooks Testnet | 31338 | Required |
|
||||
|
||||
Transaction replay attacks are theoretically possible, but require specific conditions on the second network. All of the following must be true:
|
||||
|
||||
|
||||
44
docs/references/protocol/transactions/types/oracledelete.md
Normal file
@@ -0,0 +1,44 @@
|
||||
---
|
||||
html: oracledelete.html
|
||||
parent: transaction-types.html
|
||||
blurb: Delete an existing price oracle.
|
||||
labels:
|
||||
- Oracle
|
||||
status: not_enabled
|
||||
---
|
||||
# OracleDelete
|
||||
_(Requires the [PriceOracle amendment][] {% not-enabled /%})_
|
||||
|
||||
[[Source]](https://github.com/XRPLF/rippled/blob/master/src/ripple/app/tx/impl/DeleteOracle.cpp "Source")
|
||||
|
||||
Delete an `Oracle` ledger entry.
|
||||
|
||||
|
||||
## Example OracleDelete JSON
|
||||
|
||||
```json
|
||||
{
|
||||
"TransactionType": "OracleDelete",
|
||||
"Account": "rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW",
|
||||
"OracleDocumentID": 34
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
## OracleDelete Fields
|
||||
|
||||
| Field | JSON Type | Internal Type | Required? | Description |
|
||||
|--------------------|-----------|---------------|-----------|-------------|
|
||||
| `Account` | String | AccountID | Yes | This account must match the account in the `Owner` field of the `Oracle` object. |
|
||||
| `OracleDocumentID` | String | UInt32 | Yes | A unique identifier of the price oracle for the `Account`. |
|
||||
|
||||
|
||||
## Error Cases
|
||||
|
||||
Besides errors that can occur for all transactions, `OracleDelete` transactions can result in the following transaction result codes.
|
||||
|
||||
| Error Code | Description |
|
||||
|---------------|-------------|
|
||||
| `tecNO_ENTRY` | The `Oracle` object doesn't exist. |
|
||||
|
||||
{% raw-partial file="/docs/_snippets/common-links.md" /%}
|
||||
88
docs/references/protocol/transactions/types/oracleset.md
Normal file
@@ -0,0 +1,88 @@
|
||||
---
|
||||
html: OracleSet.html
|
||||
parent: transaction-types.html
|
||||
blurb: Create or update an existing price oracle.
|
||||
labels:
|
||||
- Oracle
|
||||
status: not_enabled
|
||||
---
|
||||
# OracleSet
|
||||
_(Requires the [PriceOracle amendment][] {% not-enabled /%})_
|
||||
|
||||
[[Source]](https://github.com/XRPLF/rippled/blob/master/src/ripple/app/tx/impl/SetOracle.cpp "Source")
|
||||
|
||||
Creates a new `Oracle` ledger entry or updates the fields of an existing one, using the Oracle Document ID.
|
||||
|
||||
|
||||
## Example OracleSet JSON
|
||||
|
||||
```json
|
||||
{
|
||||
"TransactionType": "OracleSet",
|
||||
"Account": "rNZ9m6AP9K7z3EVg6GhPMx36V4QmZKeWds",
|
||||
"OracleDocumentID": 34,
|
||||
"Provider": "70726F7669646572",
|
||||
"LastUpdateTime": 1724871860,
|
||||
"AssetClass": "63757272656E6379",
|
||||
"PriceDataSeries": [
|
||||
{
|
||||
"PriceData": {
|
||||
"BaseAsset": "XRP",
|
||||
"QuoteAsset": "USD",
|
||||
"AssetPrice": 740,
|
||||
"Scale": 3
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
## OracleSet Fields
|
||||
|
||||
| Field | JSON Type | Internal Type | Required? | Description |
|
||||
|--------------------|-----------|---------------|-----------|-------------|
|
||||
| `Account` | String | AccountID | Yes | This account must match the account in the `Owner` field of the `Oracle` object. |
|
||||
| `OracleDocumentID` | Number | UInt32 | Yes | A unique identifier of the price oracle for the `Account`. |
|
||||
| `Provider` | String | Blob | Variable | An arbitrary value that identifies an oracle provider, such as Chainlink, Band, or DIA. This field is a string, up to 256 ASCII hex encoded characters (0x20-0x7E). This field is required when creating a new `Oracle` ledger entry, but is optional for updates. |
|
||||
| `URI` | String | Blob | No | An optional Universal Resource Identifier to reference price data off-chain. This field is limited to 256 bytes. |
|
||||
| `LastUpdateTime` | Number | UInt32 | Yes | The time the data was last updated, in [seconds since the Ripple Epoch][]. |
|
||||
| `AssetClass` | String | Blob | Variable | Describes the type of asset, such as "currency", "commodity", or "index". This field is a string, up to 16 ASCII hex encoded characters (0x20-0x7E). This field is required when creating a new `Oracle` ledger entry, but is optional for updates. |
|
||||
| `PriceDataSeries` | Array | Array | Yes | An array of up to 10 `PriceData` objects, each representing the price information for a token pair. More than five `PriceData` objects require two owner reserves. |
|
||||
|
||||
|
||||
### PriceData Fields
|
||||
|
||||
| Field | JSON Type | Internal Type | Required? | Description |
|
||||
|---------------------|-----------|---------------|-----------|-------------|
|
||||
| `BaseAsset` | String | Currency | Yes | The primary asset in a trading pair. Any valid identifier, such as a stock symbol, bond CUSIP, or currency code is allowed. For example, in the BTC/USD pair, BTC is the base asset; in 912810RR9/BTC, 912810RR9 is the base asset. |
|
||||
| `QuoteAsset` | String | Currency | Yes | The quote asset in a trading pair. The quote asset denotes the price of one unit of the base asset. For example, in the BTC/USD pair, USD is the quote asset; in 912810RR9/BTC, BTC is the quote asset. |
|
||||
| `AssetPrice` | Number | UInt64 | No | The asset price after applying the `Scale` precision level. If it is not included, the PriceData object will be deleted. |
|
||||
| `Scale` | Number | UInt8 | No | The scaling factor to apply to an asset price. For example, if `Scale` is 6 and original price is 0.155, then the scaled price is 155000. Valid scale ranges are 0-10. The default value is 0. |
|
||||
|
||||
`PriceData` is created or updated, following these rules:
|
||||
|
||||
- New token pairs in the transaction are added to the object.
|
||||
- Token pairs in the transaction overwrite corresponding token pairs in the object.
|
||||
- Token pairs in the transaction with a missing `AssetPrice` field delete corresponding token pairs in the object.
|
||||
- Token pairs that only appear in the object have `AssetPrice` and `Scale` removed to signify that the price is outdated.
|
||||
|
||||
{% admonition type="info" name="Note" %}
|
||||
The order of token pairs in the transaction isn't important because each token pair uniquely identifies the location of the `PriceData` object in the `PriceDataSeries`.
|
||||
{% /admonition %}
|
||||
|
||||
|
||||
## Error Cases
|
||||
|
||||
Besides errors that can occur for all transactions, `OracleSet` transactions can result in the following transaction result codes.
|
||||
|
||||
| Error Code | Description |
|
||||
|---------------------------|-------------|
|
||||
| `temARRAY_EMPTY` | The `PriceDataSeries` has no `PriceData` objects. |
|
||||
| `tecARRAY_TOO_LARGE` | The `PriceDataSeries` exceeds the ten `PriceData` objects limit. |
|
||||
| `tecINVALID_UPDATE_TIME` | The `Oracle` object has an invalid `LastUpdateTime` value. |
|
||||
| `tecTOKEN_PAIR_NOT_FOUND` | The token pair you're trying to delete doesn't exist in the `Oracle` object. |
|
||||
| `tecARRAY_EMPTY` | The `PriceDataSeries` has no `PriceData` objects. |
|
||||
| `temARRAY_TOO_LARGE` | The `PriceDataSeries` exceeds the ten `PriceData` objects limit. |
|
||||
|
||||
{% raw-partial file="/docs/_snippets/common-links.md" /%}
|
||||
@@ -29,7 +29,7 @@ This tutorial demonstrates how to enable multi-signing for an address.
|
||||
|
||||
## 1. Design Your Configuration
|
||||
|
||||
Decide how many signers you want to include (up to 8). Choose a quorum number for your signer list and weights for your signers based on how many signatures you want to require for a given transaction. For a straightforward "M-of-N" signing setup, assign each signer weight **`1`** and set your list's quorum to be "M", the number of signatures to require.
|
||||
Decide how many signers you want to include (up to 32). Choose a quorum number for your signer list and weights for your signers based on how many signatures you want to require for a given transaction. For a straightforward "M-of-N" signing setup, assign each signer weight **`1`** and set your list's quorum to be "M", the number of signatures to require.
|
||||
|
||||
|
||||
## 2. Prepare member keys
|
||||
|
||||
@@ -10,10 +10,11 @@ labels:
|
||||
|
||||
A smart contract is a blockchain-based program that handles the conditions and executes the fulfillment of an agreement between two parties. Broken into its simplest components, a smart contract _does_ something if _something else_ happens.
|
||||
|
||||
The benefit of encoding a smart contract into a blockchain is that it enables contracts to be securely carried out without traditional third-parties, like financial or legal institutions. Instead, the contract is supervised by the distributed, decentralized network of computers that run the blockchain.
|
||||

|
||||
|
||||
This enables you to transact with anybody without having to trust they'll uphold their end of a deal; the conditions of the smart contract will force them to.
|
||||
The benefit of encoding a smart contract into a blockchain is that it enables contracts to be securely carried out without traditional third parties like financial or legal institutions. Instead, the contract is supervised by the distributed, decentralized network of computers that run the blockchain.
|
||||
|
||||
This enables you to transact with anybody without having to trust they'll uphold their end of a deal: the conditions of the smart contract force them to comply.
|
||||
|
||||
## Conditionally Held Escrow
|
||||
|
||||
@@ -22,7 +23,12 @@ Smart contracts on the XRP Ledger work through conditionally held escrows.
|
||||
|
||||
### Create the Escrow
|
||||
|
||||
A conditionally held escrow is similar to a normal escrow: you set aside funds with an escrow to guarantee funds are available to a recipient. The difference is that a conditionally held escrow on the ledger has a `Condition` attached to it, which serves as a lock on the funds. The ledger won't release those funds until an `EscrowFinish` transaction is submitted with the corresponding `Fulfillment` field. The `Condition` and `Fulfillment` fields can be viewed as a lock and key on an escrow.
|
||||
A conditionally held escrow is similar to a normal escrow: you set aside funds with an escrow to guarantee funds are available to a recipient. The difference is that a conditionally held escrow on the ledger has a `Condition` attached to it, which serves as a lock on the funds. The ledger won't release those funds until an `EscrowFinish` transaction is submitted with the corresponding `Fulfillment` field.
|
||||
|
||||

|
||||
|
||||
|
||||
The `Condition` and `Fulfillment` fields can be viewed as a lock and key on an escrow.
|
||||
|
||||
See: [`EscrowCreate`](../../references/protocol/transactions/types/escrowcreate.md).
|
||||
|
||||
@@ -31,6 +37,8 @@ See: [`EscrowCreate`](../../references/protocol/transactions/types/escrowcreate.
|
||||
|
||||
An oracle is a neutral third-party agent that can verify real-world events to either fulfill or invalidate a smart contract. Oracles are vital to making conditional escrows work by generating the condition and fulfillment, and keeping the fulfillment secret until the terms of the contract are met.
|
||||
|
||||

|
||||
|
||||
In the context of smart contracts, an oracle will most likely be software that can read real-world data. The oracle would be programmed with the terms of the contract between parties and generate the condition and fulfillment hex values.
|
||||
|
||||
The oracle gives the condition hex value to the escrow creator, enabling them to set up the escrow initially.
|
||||
@@ -44,6 +52,8 @@ See: [Generate a condition and fulfillment](../../tutorials/how-tos/use-speciali
|
||||
Smart contracts have a wide range of uses, but some uses include:
|
||||
|
||||
1. Handling payments on large-value items you would otherwise need lawyers for, such as mortgages.
|
||||

|
||||
2. Supply-chain management to ensure funds are delivered upon receipt of goods.
|
||||
3. Automating certain kinds of insurance claims that can be verified by software.
|
||||

|
||||
4. Ensuring payments are given for services rendered.
|
||||
|
||||
@@ -16,7 +16,7 @@ When you create a NFToken, you create a unique token on the XRPL that is effecti
|
||||
|
||||
As a digital artist, you’re focused on creating NFTs, presumably to sell on the XRP Ledger (it’s also possible you might create NFTs as a way of establishing provenance for your creations).
|
||||
|
||||
You can create NFTokens using an app such as the [Xumm app](https://xumm.app).
|
||||
You can create NFTokens using an app such as the [Xaman app](https://xaman.app).
|
||||
|
||||
For a more hands-on experience, you can follow the steps in the [Quickstart Tutorial 3 - Mint and Burn NFTokens](../../tutorials/javascript/nfts/mint-and-burn-nfts.md).
|
||||
|
||||
|
||||
@@ -137,7 +137,7 @@ const projects = [
|
||||
{
|
||||
id: "xaman",
|
||||
label: "Xaman labs",
|
||||
url: "https://xumm.app",
|
||||
url: "https://Xaman.app",
|
||||
},
|
||||
{
|
||||
id: "amy",
|
||||
|
||||
@@ -77,7 +77,7 @@ Each `NFTokenPage` holds 16-32 NFTs. Minting a large number of NFTs can tie up a
|
||||
|
||||
### Setting up a wallet
|
||||
|
||||
Set up a new wallet. See [Xumm](https://xumm.app/).
|
||||
Set up a new wallet. See [Xaman](https://xaman.app/).
|
||||
|
||||
When you set up your account, keep in mind that there is a base reserve requirement of 10 XRP. See [Reserves](../../concepts/accounts/reserves.md#base-reserve-and-owner-reserve).
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ When you set up a serious marketplace site with high volume, it justifies the de
|
||||
|
||||
### Setting up a wallet
|
||||
|
||||
Set up a new wallet. See [Xumm](https://xumm.app/).
|
||||
Set up a new wallet. See [Xaman](https://xaman.app/).
|
||||
|
||||
Base reserve requirements See [Reserves](../../concepts/accounts/reserves.md#base-reserve-and-owner-reserve).
|
||||
|
||||
|
||||