Connect to Binance trade stream, persist prices to binance_price table (throttled to every 5s), and live-update the home page via HTMX polling. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
10 lines
304 B
SQL
10 lines
304 B
SQL
-- queries for btcprice
|
|
|
|
-- :name insert-binance-price! :! :n
|
|
-- :doc Insert a Binance BTC price
|
|
INSERT INTO binance_price (price) VALUES (:price)
|
|
|
|
-- :name get-latest-binance-price :? :1
|
|
-- :doc Get the most recent Binance BTC price
|
|
SELECT price, recorded_at FROM binance_price ORDER BY id DESC LIMIT 1
|