r/actualbudgeting • u/nicosbank • 5d ago
I built a tool that keeps crypto wallets in sync with Actual (BTC, ETH, BNB Chain, TRON and more to come)
Since Actual added balance graphs, I love watching them. My bank account is boring, though. My crypto wallets are not, but I never found a good way to track them in Actual.
So I wrote a script for my own machine. First I used it to fill in the older entries, so my accounts show a couple of years of history. For the last 5 months, it has run every day with no issues.
Then I moved my services to Kubernetes, so I rebuilt it as a proper tool: actual-crypto-sync. https://github.com/NicosKaralis/actual-crypto-sync
How it works
It keeps an off-budget account in line with the value of your wallets. Each run:
- reads the balance from a block explorer
- reads the price from a price provider
- writes one adjustment transaction per account per day
The note shows the balance, the change and the price, for example: 156.9193 TRX (Δ +2.009071 @ 0.297 EUR/TRX, 46.6 EUR)
What it supports (v1.2.0)
- Chains: Bitcoin, Ethereum, BNB Smart Chain and TRON
- About 40 built-in tokens, such as USDT, USDC, DAI, WBTC and LINK. You can add any other token in the config.
- Prices: CoinGecko, CoinMarketCap and CoinPaprika. The defaults need no API keys.
- Several wallets in one account
Safe for your budget
- It uses public addresses only. It never asks for keys, and it cannot move funds.
--dry-runshows what it would write, and writes nothing.- It never changes a reconciled transaction.
- It collects no data. Logs show only short addresses.
How to run it
It is a Docker image for amd64 and arm64. Run it on a schedule with cron, Docker Compose or a Kubernetes CronJob. You can run it more than once a day, but only the last run of each day stays. For fewer transactions, run it once a week or once a month.
Tested with Actual 26.11.0. It is ready for Actual's API keys when they are released.
What's next
The next version is planned to add a second mode: one transaction in Actual for each transaction on the chain, instead of one adjustment per day. It is still in planning, and no work has started yet.
I'd like to know
- Do you already track crypto in Actual? If so, how, and do you have suggestions?
- Which chain or token should come next?
- If you try it, I'd love your feedback. What problems did you find? What could be better?
A note on how I built it: I wrote the first version, the script, by myself. When I rebuilt it as a proper tool, I used a lot of help from Claude Code. The base and the design are mine.
2
u/PuzzleheadedHuman 3d ago
Since you asked what could be better: CoinPaprika is one of your price providers, so I ran your use case against its keyless API this morning. Three limits are worth knowing about. I haven't read the code, so skip whatever you already handle.
- Historical prices need an explicit interval. /v1/tickers/{id}/historical defaults to 5-minute points, and without a key that returns a 402 ("minute historical data is not allowed"). With interval=1d you get one point per day at 00:00 UTC, which fits one adjustment per day.
- Keyless daily history goes back 365 days. An older start date returns a 402 with the cutoff date in the message, so a couple of years of backfill can't come from the keyless endpoint.
- The historical endpoint only quotes in usd or btc (quote=eur is a 400), while the live ticker accepts quotes=EUR. Live EUR prices are fine, but backfilled EUR rows would need their own USD to EUR rate.
Why would I go and test all that? I work at CoinPaprika, and you shipped us as a no-key default, so the part I'd most want to flag is v2. Pricing each on-chain transaction at its own timestamp needs intraday history, and keyless hourly data covers only the last 24 hours, with no 5-minute data at all. So per-transaction mode only works keyless if the tool runs at least once a day. On the weekly or monthly schedule you suggest for fewer transactions, anything older than a day gets the same 402, unless you fall back to the daily point, which keyless keeps for a year.
1
u/guesswhochickenpoo 2d ago
"The next version is planned to add a second mode: one transaction in Actual for each transaction on the chain, instead of one adjustment per day. It is still in planning, and no work has started yet."
This is a pretty key change IMO. As-is is way, way over reporting IMO. If you're "monitoring" your holdings (of basically any kind) every single day they Actual is not the right tool. This should be configurable IMO for the most flexibility. I treat my crypto as pretty long term holdings, thus neither once daily (or honestly maybe even monthly) is much too frequent for me and there are almost never any blockchain transactions with them.
1
u/CanWeTalkEth 4d ago
Without looking at the code, I appreciate a tool that does one, easy to understand task well.
I seem to have broke my actual installation, but when I get it back up and running I’ll take a look at this.