AMM/DEX Methods
Get aggregated oracle price
wss://honeycluster.io
rpc method: get_aggregate_price

Returns an aggregated price from multiple oracle instances, with optional outlier trimming.

Try it now
Response · get_aggregate_price WS Response
{
  "result": {
    "entire_set": {
      "mean": "0.53",
      "size": 5,
      "standard_deviation": "0.02"
    },
    "median": "0.53",
    "time": 750171900,
    "trimmed_set": {
      "mean": "0.53",
      "size": 4,
      "standard_deviation": "0.01"
    },
    "ledger_index": 89012345
  },
  "status": "success",
  "type": "response",
  "id": 1
}
Request Message
get_aggregate_price WS Request
application/json
Get aggregated oracle price
FieldTypeDescription
command
required
string
WebSocket command name
id
object
Client-supplied identifier to correlate requests with responses.
base_asset
string
The base asset for the price quote (e.g. "USD").
quote_asset
string
The quote asset for the price quote (e.g. "XRP").
oracles
object[]
Array of oracle instances to aggregate prices from.
oracles[].account
required
string
The oracle provider account address.
oracles[].oracle_document_id
required
integer
The oracle document ID on the account.
trim
integer
Percentage of outlier prices to trim before aggregating (1-25).
time_threshold
integer
Maximum age in seconds for oracle data to be considered fresh.
api_version
object
API version for the response format. Version 2 is the default for rippled 2.0+.
Example
Json
{
  "command": "get_aggregate_price",
  "id": 1,
  "base_asset": "XRP",
  "quote_asset": "USD",
  "oracles": [
    {
      "account": "rG1QQv2nh2gr7RCZ1P8YYcBUKCCN633jCn",
      "oracle_document_id": 1
    }
  ],
  "trim": 20
}
Response Message
get_aggregate_price WS Response
application/json
WebSocket response for get_aggregate_price
FieldTypeDescription
result
object
status
enum<string>
Available
successerror
type
string
id
stringnumber
Echo of the client-provided correlation ID
Example
Json
{
  "result": {
    "entire_set": {
      "mean": "0.53",
      "size": 5,
      "standard_deviation": "0.02"
    },
    "median": "0.53",
    "time": 750171900,
    "trimmed_set": {
      "mean": "0.53",
      "size": 4,
      "standard_deviation": "0.01"
    },
    "ledger_index": 89012345
  },
  "status": "success",
  "type": "response",
  "id": 1
}