Publish daily BTC price in public remoteStorage #581

Merged
greg merged 2 commits from feature/btc-rate-tracker into master 2025-01-23 13:28:34 +00:00
Owner

In order to implement conversion from fiat prices to BTC for expense line items in Kredits Web with historic exchange rates, I simply stored the numbers in public RS documents, like so:

https://storage.kosmos.org/kosmos/public/btc-price/2024-12-17

This is automating the semi-manual process of importing the price history that I used before. Same as the API itself, this is keeping it dead simple: there's just a bash script that runs via systemd timer every night at 00:00, which will calculate the average between 24h before and then, and write that to a new document for the day that just ended.

The systemd timer is already started on bitcoin-2, but tonight will be the first production run of it. So if you see correct numbers tomorrow, then it's good to go.

In order to implement conversion from fiat prices to BTC for expense line items in Kredits Web with historic exchange rates, I simply stored the numbers in public RS documents, like so: https://storage.kosmos.org/kosmos/public/btc-price/2024-12-17 This is automating the semi-manual process of importing the price history that I used before. Same as the API itself, this is keeping it dead simple: there's just a bash script that runs via systemd timer every night at 00:00, which will calculate the average between 24h before and then, and write that to a new document for the day that just ended. The systemd timer is already started on `bitcoin-2`, but tonight will be the first production run of it. So if you see correct numbers tomorrow, then it's good to go.
raucao added the
feature
label 2025-01-17 17:39:57 +00:00
raucao added 1 commit 2025-01-17 17:39:57 +00:00
raucao added 1 commit 2025-01-17 19:38:36 +00:00
raucao force-pushed feature/btc-rate-tracker from 5da11394d4 to d45f782a5e 2025-01-17 19:48:54 +00:00 Compare
raucao force-pushed feature/btc-rate-tracker from d45f782a5e to 0fa61a585e 2025-01-17 19:52:37 +00:00 Compare
Author
Owner
Works just fine: https://storage.kosmos.org/kosmos/public/btc-price/2025-01-17
raucao requested review from Core 2025-01-18 13:47:56 +00:00
raucao added the
kredits-2
label 2025-01-18 13:48:22 +00:00
Author
Owner

FYI, I accidentally slipped an lndhub-go credentials update in here, which is just updating the Sentry DSN.

FYI, I accidentally slipped an lndhub-go credentials update in here, which is just updating the Sentry DSN.
greg approved these changes 2025-01-23 13:28:16 +00:00
greg left a comment
Owner

👍

👍
greg merged commit f34c7ecd9b into master 2025-01-23 13:28:34 +00:00
greg deleted branch feature/btc-rate-tracker 2025-01-23 13:28:34 +00:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kosmos/chef#581
No description provided.