Skip to content

Rate Oracle - some listed sources cannot be set #122

@rapcmia

Description

@rapcmia

Describe the bug

When you set the following as source using PUT /rate-oracle/config, does not work

coin_gecko ❌

curl -s -u ralphwashere:XXX -X PUT 'http://139-xx-xx:8000/rate-oracle/config' -H 'Content-Type: application/json' -d '{"rate_oracle_source": {"name": "hyperliquid_perpetual"}}' | jq
{
  "detail": [
    {
      "type": "enum",
      "loc": [
        "body",
        "rate_oracle_source",
        "name"
      ],
      "msg": "Input should be 'binance', 'binance_us', 'coin_gecko', 'coin_cap', 'kucoin', 'ascend_ex', 'gate_io', 'coinbase_advanced_trade', 'cube', 'dexalot', 'hyperliquid', 'derive' or 'tegro'",
      "input": "hyperliquid_perpetual",
      "ctx": {
        "expected": "'binance', 'binance_us', 'coin_gecko', 'coin_cap', 'kucoin', 'ascend_ex', 'gate_io', 'coinbase_advanced_trade', 'cube', 'dexalot', 'hyperliquid', 'derive' or 'tegro'"
      }
    }
  ]
}

coin_cap ❌

curl -s -u ralphwashere:XXX -X PUT 'http://139-xx-xx:8000/rate-oracle/config' -H 'Content-Type: application/json' -d '{"rate_oracle_source": {"name": "coin_cap"}}' | jq
{
  "detail": "Error updating configuration: CoinCapRateSource.__init__() missing 2 required positional arguments: 'assets_map' and 'api_key'"
}
logs: 12:40:05.820 PUT /rate-oracle/config INFO:     139-xx-xx:50052 - "PUT /rate-oracle/config HTTP/1.1" 500 Internal Server Error

hyperliquid_perpetual ❌

curl -s -u ralphwashere:XXX -X PUT 'http://139-xx-xx:8000/rate-oracle/config' -H 'Content-Type: application/json' -d '{"rate_oracle_source": {"name": "hyperliquid_perpetual"}}' | jq
{
  "detail": [
    {
      "type": "enum",
      "loc": [
        "body",
        "rate_oracle_source",
        "name"
      ],
      "msg": "Input should be 'binance', 'binance_us', 'coin_gecko', 'coin_cap', 'kucoin', 'ascend_ex', 'gate_io', 'coinbase_advanced_trade', 'cube', 'dexalot', 'hyperliquid', 'derive' or 'tegro'",
      "input": "hyperliquid_perpetual",
      "ctx": {
        "expected": "'binance', 'binance_us', 'coin_gecko', 'coin_cap', 'kucoin', 'ascend_ex', 'gate_io', 'coinbase_advanced_trade', 'cube', 'dexalot', 'hyperliquid', 'derive' or 'tegro'"
      }
    }
  ]
}
logs: 12:45:11.961 PUT /rate-oracle/config INFO:     139-xx-xx:40266 - "PUT /rate-oracle/config HTTP/1.1" 422 Unprocessable Entity

mexc ❌

curl -s -u ralphwashere:XXX -X PUT 'http://139-xx-xx:8000/rate-oracle/config' -H 'Content-Type: application/json' -d '{"rate_oracle_source": {"name": "mexc"}}' | jq
{
  "detail": [
    {
      "type": "enum",
      "loc": [
        "body",
        "rate_oracle_source",
        "name"
      ],
      "msg": "Input should be 'binance', 'binance_us', 'coin_gecko', 'coin_cap', 'kucoin', 'ascend_ex', 'gate_io', 'coinbase_advanced_trade', 'cube', 'dexalot', 'hyperliquid', 'derive' or 'tegro'",
      "input": "mexc",
      "ctx": {
        "expected": "'binance', 'binance_us', 'coin_gecko', 'coin_cap', 'kucoin', 'ascend_ex', 'gate_io', 'coinbase_advanced_trade', 'cube', 'dexalot', 'hyperliquid', 'derive' or 'tegro'"
      }
    }
  ]
}
logs: 13:04:58.875 PUT /rate-oracle/config INFO:     139-xx-xx:56550 - "PUT /rate-oracle/config HTTP/1.1" 422 Unprocessable Entity

Steps to reproduce bug

  1. Run PUT /rate-oracle/config and use coingecko, coincap, hyperliquid_perpetual and mexc

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions