Add Strike quote endpoint for real sats price with fee-adjusted amount
Use POST /v1/currency-exchange-quotes to get actual buy price including spread, matching the Strike app. Fee is cached daily to calculate the pre-fee amount from the configured total (default 55 EUR). Store quote_sats in the strike_price DB table. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1 @@
|
||||
ALTER TABLE strike_price DROP COLUMN quote_sats;
|
||||
@@ -0,0 +1 @@
|
||||
ALTER TABLE strike_price ADD COLUMN quote_sats BIGINT;
|
||||
@@ -45,7 +45,7 @@ SELECT ts FROM kraken_day ORDER BY ts DESC LIMIT 1
|
||||
|
||||
-- :name insert-strike-price! :! :n
|
||||
-- :doc Insert a Strike ticker snapshot
|
||||
INSERT INTO strike_price (rates) VALUES (:rates)
|
||||
INSERT INTO strike_price (rates, quote_sats) VALUES (:rates, :quote-sats)
|
||||
|
||||
-- :name get-latest-strike-price :? :1
|
||||
-- :doc Get the most recent Strike ticker snapshot
|
||||
|
||||
@@ -64,5 +64,6 @@
|
||||
{:url #or [#env FRANKFURTER_URL "http://localhost:8080"]}
|
||||
|
||||
:strike/ticker
|
||||
{:query-fn #ig/ref :db.sql/query-fn
|
||||
:api-key #env STRIKE_API_KEY}}
|
||||
{:query-fn #ig/ref :db.sql/query-fn
|
||||
:api-key #env STRIKE_API_KEY
|
||||
:sats-eur-amount #or [#env SATS_EUR_AMOUNT "55"]}}
|
||||
|
||||
Reference in New Issue
Block a user