Skip to content

Conversation

@onyb
Copy link
Member

@onyb onyb commented Jun 2, 2025

Example request:

curl -X 'POST' \
  'http://127.0.0.1:8000/api/pricing/v1/getPrices?vs_currency=usd' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '[
  {
    "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
    "chain_id": "0x1",
    "coin_type": "ETH"
  },
  {
    "address": "0xaf88d065e77c8cc2239327c5edb3a432268e5831",
    "chain_id": "0xa4b1",
    "coin_type": "ETH"
  },
  {
    "coin_type": "BTC"
  },
  {
    "coin_type": "BTC"
  },
  {
    "coin_type": "ADA"
  }
]
'

Example response:

[
  {
    "coin_type": "BTC",
    "chain_id": null,
    "address": null,
    "price": 104364,
    "vs_currency": "usd",
    "cache_status": "MISS"
  },
  {
    "coin_type": "ADA",
    "chain_id": null,
    "address": null,
    "price": 0.672391,
    "vs_currency": "usd",
    "cache_status": "MISS"
  },
  {
    "coin_type": "ETH",
    "chain_id": "0x1",
    "address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
    "price": 0.9998,
    "vs_currency": "usd",
    "cache_status": "MISS"
  },
  {
    "coin_type": "ETH",
    "chain_id": "0xa4b1",
    "address": "0xaf88d065e77c8cc2239327c5edb3a432268e5831",
    "price": 0.9998,
    "vs_currency": "usd",
    "cache_status": "MISS"
  }
]

Executing the request again, partially or otherwise, results in cache HIT.

@onyb onyb requested a review from Douglashdaniel June 2, 2025 20:01
@onyb onyb self-assigned this Jun 2, 2025
Copy link

@Douglashdaniel Douglashdaniel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@onyb onyb merged commit c516c3f into master Jun 4, 2025
5 checks passed
@onyb onyb deleted the f/pricing/coingecko branch June 4, 2025 04:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants