20 Compute Units.
Reference: Here
Parameters
base_asset(string, required) The currency code of the asset to be priced.quote_asset(string, required) The currency code of the asset to quote the price of the base asset.trim(number, optional) The percentage of outliers to trim. Valid range is 1 to 25. If included, the API returns statistics for the trimmed mean.trim_threshold(number, optional) A time range in seconds for filtering out older price data. Default is 0, which does not filter any data.oracles(array, required) Between 1 and 200 oracle identifier objects, each withaccount(the account that controls the Oracle object) andoracle_document_id(a number).ledger_hash(string, optional) The unique hash of the ledger version to use.ledger_index(number or string, optional) The ledger index of the ledger to use, or a shortcut string such asvalidated,closedorcurrent.
Returns
entire_set(object) Statistics from the collected oracle prices:mean,sizeandstandard_deviation.trimmed_set(object) Statistics from the collected oracle prices after trimming outliers:mean,sizeandstandard_deviation. Only present iftrimwas given.median(string) The median price.time(number) The most recent timestamp out of theLastUpdateTimevalues, in Unix time.ledger_hash,ledger_indexorledger_current_index,validatedThe ledger version used.
{"id":1,"command":"get_aggregate_price","base_asset":"XRP","quote_asset":"USD","trim":20,"oracles":[{"account":"rsNvoAZ9MquZSRhu4cEY9wTv1VqHXpVPPt","oracle_document_id":1}],"ledger_index":"validated"} to wss://mainnet.xrpl.validationcloud.io/v1/<YOUR_API_KEY_HERE>.
The oracle in this example is the Band Protocol price feed on mainnet. Useledger_entrywith anoracleselector to inspect the assets an oracle publishes before aggregating. Oracle accounts that fail address validation returninvalidParams; a valid account with no such oracle returnsobjectNotFound.