Skip to content

feat(crypto): archive Binance and Kraken movements and replay them in Sure - #5

Merged
Gamso merged 1 commit into
mainfrom
feat/crypto-ledger
Oct 31, 2026
Merged

Gamso merged 1 commit into
mainfrom
feat/crypto-ledger

Conversation

@Gamso

@Gamso Gamso commented Oct 31, 2026

Copy link
Copy Markdown
Owner

crypto-ledger.py collects, with read-only API keys, every movement of the Binance and Kraken accounts into an append-only archive (never fetched twice), pairs the transfers between the two exchanges so that the coins keep their cost, and replays everything with an average cost per coin (carry by default: a crypto-for-crypto trade passes its cost on). summary checks the replayed quantities against the live balances and shows the latent gain; export writes positions.json, the day-by-day changes.

The bridge replays positions.json in a Sure account of type Crypto (SURE_ACCOUNT_CRYPTO), with the real dates, reusing the CRYPTO: securities Sure already has. The scheduler runs crypto-ledger.py sync before the bridge when an exchange key is set.

… Sure

crypto-ledger.py collects, with read-only API keys, every movement of the
Binance and Kraken accounts into an append-only archive (never fetched
twice), pairs the transfers between the two exchanges so that the coins keep
their cost, and replays everything with an average cost per coin (carry by
default: a crypto-for-crypto trade passes its cost on). summary checks the
replayed quantities against the live balances and shows the latent gain;
export writes positions.json, the day-by-day changes.

The bridge replays positions.json in a Sure account of type Crypto
(SURE_ACCOUNT_CRYPTO), with the real dates, reusing the CRYPTO:<coin>
securities Sure already has. The scheduler runs crypto-ledger.py sync before
the bridge when an exchange key is set.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Gamso
Gamso merged commit a3d1d46 into main Oct 31, 2026
1 check passed
@Gamso
Gamso deleted the feat/crypto-ledger branch October 31, 2026 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant