mirror of
https://github.com/saymrwulf/BraiinsRatchet.git
synced 2026-05-14 20:37:52 +00:00
1.4 KiB
1.4 KiB
Braiins Public Market Collector
The public Braiins Hashpower page loads market data from unauthenticated browser endpoints under:
https://hashpower.braiins.com/webapi
The monitor-only collector currently reads:
/spot/stats: market status, last average price, total available hashrate, matched hashrate./orderbook: public bids and asks.
No token is required for these calls. The collector does not send an apikey header and only performs HTTP GET.
Price Selection
For a buyer, the conservative live reference price is:
- Best ask, if available.
- Last average price, if no ask exists.
- Best bid, if neither ask nor last price exists.
The chosen value is stored as best_price_btc_per_eh_day for strategy evaluation. The raw fields are also stored:
best_bid_btc_per_eh_daybest_ask_btc_per_eh_daylast_price_btc_per_eh_daytotal_hashrate_eh_savailable_hashrate_eh_sstatus
Commands
Collect one public Braiins snapshot:
PYTHONPATH=src ./.venv/bin/python -m braiins_ratchet.cli collect-braiins-public
Then evaluate the current strategy:
PYTHONPATH=src ./.venv/bin/python -m braiins_ratchet.cli evaluate
Failure Mode
These endpoints are discovered from the public web app, not from a stable public API contract. If Braiins changes field names or requires authentication later, tests and collection should fail visibly. Do not add an owner token to recover functionality.