Skip to content

Conversation

@lanjoni
Copy link
Member

@lanjoni lanjoni commented Jul 11, 2025

This PR tries to refactor boilerplate:

  • Using Kraken instead of CoinDesk API (due to unavailability to public API without authentication)
  • This implementation uses Ticker Information

- using kraken instead of coindesk
(s/defn get-btc-usd-price :- s/Num
[http :- schemas.types/HttpComponent]
(->> {:url "https://api.coindesk.com/v1/bpi/currentprice.json"
(->> {:url "https://api.kraken.com/0/public/Ticker?pair=XBTUSD"
Copy link
Member

Choose a reason for hiding this comment

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

Isn't pair BTCUSD that we are interested?

Copy link
Member

Choose a reason for hiding this comment

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

Replying myself:

XBT and BTC are two different ticker symbols for Bitcoin. They are both in use and there is no difference between them. The BTC abbreviation was created by the Bitcoin community, and the XBT acronym was introduced by ISO as the international Bitcoin symbol.

But I think for the sake of clarity I would stick with BTCUSD
WDYT?

Copy link
Member Author

Choose a reason for hiding this comment

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

Great! The only problem with that is: even using BTCUSD on the response it will return with XXBTZUSD.

Copy link
Member

Choose a reason for hiding this comment

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

lets keep xbt then

@rafaeldelboni rafaeldelboni merged commit 5e044b5 into main Jul 11, 2025
4 checks passed
@rafaeldelboni rafaeldelboni deleted the refactor/move-to-kraken branch July 11, 2025 13:40
@rafaeldelboni
Copy link
Member

Thanks for your contribution!

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