XRPLF / clio

An XRP Ledger API Server
https://xrpl.org
ISC License
56 stars 48 forks source link

[get_aggregate_price] with decimal trim value returns error on Clio #1370

Closed mounikakun closed 1 month ago

mounikakun commented 2 months ago

Issue Description

Steps to Reproduce


{
  "method": "get_aggregate_price",
  "params": [
    {
      "base_asset": "BTC",
      "quote_asset": "ETH",
      "trim": 1.2,
      "oracles": [
        {
          "account": "rwz8i5bUKa12tYxQjsSuzDQaBwKkuGUqa5",
          "oracle_document_id": 1
        },
        {
          "account": "rDtBhKmzKveCSd5jmrcQD6CU8kidCLCy7h",
          "oracle_document_id": 1
        }
      ]
    }
  ]
}

Expected Result

Rippled response:

{
    "result": {
        "entire_set": {
            "mean": "74",
            "size": 2,
            "standard_deviation": "0"
        },
        "ledger_current_index": 81783,
        "median": "74",
        "status": "success",
        "time": 1713826145,
        "trimmed_set": {
            "mean": "74",
            "size": 2,
            "standard_deviation": "0"
        },
        "validated": false
    }
}

Actual Result

{
    "result": {
        "error": "invalidParams",
        "error_code": 31,
        "error_message": "Invalid parameters.",
        "status": "error",
        "type": "response",
        "request": {
            "method": "get_aggregate_price",
            "params": [
                {
                    "base_asset": "BTC",
                    "quote_asset": "ETH",
                    "trim": 1.2E0,
                    "oracles": [
                        {
                            "account": "rwz8i5bUKa12tYxQjsSuzDQaBwKkuGUqa5",
                            "oracle_document_id": 1
                        },
                        {
                            "account": "rDtBhKmzKveCSd5jmrcQD6CU8kidCLCy7h",
                            "oracle_document_id": 1
                        }
                    ]
                }
            ]
        }
    },
    "warnings": [
        {
            "id": 2001,
            "message": "This is a clio server. clio only serves validated data. If you want to talk to rippled, include 'ledger_index':'current' in your request"
        }
    ]
}

Environment

Supporting Files

cindyyan317 commented 2 months ago

Same case:https://github.com/XRPLF/clio/issues/1371#issuecomment-2071704621

mounikakun commented 1 month ago

Fixed on rippled end