Use quote-sats from btcdata instead of local EUR/BTC calculation
Sats value now comes from btcdata's Strike quote endpoint which includes the actual fee/spread, matching the Strike app. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -117,16 +117,9 @@
|
||||
amount))
|
||||
"\u2014"))
|
||||
|
||||
(def ^:private sats-eur-amount
|
||||
(double (bigdec (or (System/getenv "SATS_EUR_AMOUNT") "54.46"))))
|
||||
|
||||
(defn- eur-to-sats [rates]
|
||||
(when-let [eur-btc (get rates "EUR/BTC")]
|
||||
(long (* sats-eur-amount (double (bigdec eur-btc)) 100000000))))
|
||||
|
||||
(defn- strike-json->html [text]
|
||||
(let [rates (json/read-str text)
|
||||
sats (eur-to-sats rates)]
|
||||
sats (get rates "quote-sats")]
|
||||
(str "<div id=\"strike-display\">"
|
||||
"<div class=\"rounded-2xl shadow-sm border border-gray-200 p-6\" style=\"background:#f3f4f6;\">"
|
||||
(if sats
|
||||
|
||||
Reference in New Issue
Block a user