get_aggregate_price
POST
Aggregates the prices from multiple Price Oracles and returns the mean, median and trimmed mean.Specify
trim to obtain statistics with outliers excluded.param[0]
parametersobjectrequired
base_assetstringrequired
The currency code of the asset being priced.quote_assetstringrequired
The currency code used to quote the base asset price.oraclesarrayrequired
The Oracles to aggregate. Pass between 1 and 200 of them.accountstringrequired
The address of the account that owns the Oracle.oracle_document_idintegerrequired
The number that identifies the Oracle within the account.triminteger
The percentage of outliers to remove. Pass a value between 1 and 25.Providing this value adds trimmed_set to the response.trim_thresholdinteger
The cutoff time used to exclude older prices from the aggregation, in seconds.Pass 0 to apply no time-based filter.Responses
Statistics computed over every Oracle price collected.
meanstring
The arithmetic mean.sizeinteger
The number of data points used to compute the mean.standard_deviationstring
The standard deviation of the price distribution.Statistics computed with outliers excluded. Returned only when
trim is specified in the request.meanstring
The arithmetic mean with outliers excluded.sizeinteger
The number of data points with outliers excluded.standard_deviationstring
The standard deviation of the price distribution with outliers excluded.medianstring
The median of the prices collected.timeinteger
The most recent update time among the Oracles used, in Unix timestamp seconds.codestringrequired
Code identifying the cause of the failed request.messagestringrequired
Detailed message including the name and value of the invalid parameter.{"code": "ERROR_CODE","message": "Unauthorized"}
cURL
curl -X POST 'https://xrpl-mainnet.nodit.io' \-H 'Content-Type: application/json' \-H 'X-API-KEY: nodit-demo' \-d '{"method": "get_aggregate_price","params": [{"base_asset": "XRP","quote_asset": "USD","oracles": [{"account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59","oracle_document_id": 1}],"trim": 20,"trim_threshold": 0}]}'