Class GetAggregatePriceRequest
The get_aggregate_price method retrieves the aggregate price of the given
Oracle objects: the mean, the median and, when Trim is set, the trimmed mean.
Returns a GetAggregatePriceResponse.
Inherited Members
Namespace: Xrpl.Models.Methods
Assembly: Xrpl.dll
Syntax
public class GetAggregatePriceRequest : BaseLedgerRequest
Remarks
For each oracle the node takes the price of the BaseAsset/QuoteAsset pair
from the oracle's current PriceDataSeries, or from up to three earlier versions of it when the
latest update did not carry the pair. Oracles that never priced the pair are skipped; the request
fails with objectNotFound when none did.
Constructors
| Edit this page View SourceGetAggregatePriceRequest()
Creates an empty request; set BaseAsset, QuoteAsset and Oracles.
Declaration
public GetAggregatePriceRequest()
GetAggregatePriceRequest(string, string, IEnumerable<OracleIdentifier>)
Creates a request for the price of baseAsset in quoteAsset across oracles.
Declaration
public GetAggregatePriceRequest(string baseAsset, string quoteAsset, IEnumerable<OracleIdentifier> oracles)
Parameters
| Type | Name | Description |
|---|---|---|
| string | baseAsset | |
| string | quoteAsset | |
| IEnumerable<OracleIdentifier> | oracles |
Fields
| Edit this page View SourceMaxOracles
The largest number of oracles rippled accepts in one request.
Declaration
public const int MaxOracles = 200
Field Value
| Type | Description |
|---|---|
| int |
MaxTrim
The largest Trim percentage rippled accepts.
Declaration
public const uint MaxTrim = 25
Field Value
| Type | Description |
|---|---|
| uint |
Properties
| Edit this page View SourceBaseAsset
The currency code of the asset to be priced, as given in the oracles' PriceData.BaseAsset:
a three-character code such as XRP, a longer name such as RLUSD, or a 40-character hex code.
Declaration
[JsonPropertyName("base_asset")]
[JsonConverter(typeof(AggregatePriceAssetConverter))]
public string BaseAsset { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
Remarks
The node matches the pair by comparing this string with its own display form of the stored currency, so the SDK writes the code in that form: a longer name and a lowercase hex code become uppercase hex, and a hex code holding a standard three-character code becomes those three characters.
Oracles
The oracles to aggregate, between 1 and MaxOracles. A repeated oracle is counted once.
Declaration
[JsonPropertyName("oracles")]
public List<OracleIdentifier> Oracles { get; set; }
Property Value
| Type | Description |
|---|---|
| List<OracleIdentifier> |
QuoteAsset
The currency code the price of the base asset is quoted in, in the same forms as BaseAsset.
Declaration
[JsonPropertyName("quote_asset")]
[JsonConverter(typeof(AggregatePriceAssetConverter))]
public string QuoteAsset { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
TimeThreshold
A time range in seconds: prices whose LastUpdateTime is older than the most recent one by more
than this are left out. Zero, the default, keeps every price.
Declaration
[JsonPropertyName("time_threshold")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public uint? TimeThreshold { get; set; }
Property Value
| Type | Description |
|---|---|
| uint? |
Remarks
rippled reads this parameter as time_threshold; the xrpl.org reference and xrpl.js name it
trim_threshold, which the node ignores.
Trim
The percentage of outliers to trim from each end of the sorted prices, from 1 to MaxTrim. When set, the response carries TrimmedSet.
Declaration
[JsonPropertyName("trim")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public uint? Trim { get; set; }
Property Value
| Type | Description |
|---|---|
| uint? |