Show / Hide Table of Contents

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.

Inheritance
object
BaseRequest
BaseLedgerRequest
GetAggregatePriceRequest
Inherited Members
BaseLedgerRequest.LedgerHash
BaseLedgerRequest.LedgerIndex
BaseRequest.Id
BaseRequest.Command
BaseRequest.ApiVersion
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 Source

GetAggregatePriceRequest()

Creates an empty request; set BaseAsset, QuoteAsset and Oracles.

Declaration
public GetAggregatePriceRequest()
| Edit this page View Source

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 Source

MaxOracles

The largest number of oracles rippled accepts in one request.

Declaration
public const int MaxOracles = 200
Field Value
Type Description
int
| Edit this page View Source

MaxTrim

The largest Trim percentage rippled accepts.

Declaration
public const uint MaxTrim = 25
Field Value
Type Description
uint

Properties

| Edit this page View Source

BaseAsset

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.

| Edit this page View Source

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>
| Edit this page View Source

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
| Edit this page View Source

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.

| Edit this page View Source

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?
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX