Repository navigation
feat(crypto): archive Binance and Kraken movements and replay them in Sure - #5
Merged
Merged
Conversation
… 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.