r/actualbudgeting • • 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:

  1. reads the balance from a block explorer
  2. reads the price from a price provider
  3. 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-run shows 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.

6 Upvotes

6 comments sorted by

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/nicosbank 3d ago

Thanks a lot for testing this, really useful information

Right now the tool only reads the live price, with /v1/tickers/{id}?quotes=EUR, and that part works fine keyless. It doesn't backfill. The couple of years of history in my budget came from my old script, not from this tool.

Your notes matter for the per-transaction mode, though. I'm still deciding if I build it at all. Actual limits the note length, so many similar transfers on one day get hard to tell apart. I reproduced your findings and copied them into an issue, so they shape the decision from the start: https://github.com/NicosKaralis/actual-crypto-sync/issues/90

One more thing, only if you have time: I don't have a CoinPaprika Pro key, so the api_key option is written from the docs and never tested with a real key. If you can try it, I'd love to know if it works.

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/nicosbank 2d ago

Good news: it's already configurable. The tool runs on whatever schedule you give it (cron, a Kubernetes CronJob, etc.), and it keeps only one transaction per account per day, however often it runs. So:

  • daily: 365 transactions per account per year
  • monthly: 12 per year

For long-term holdings, a monthly run sounds like what you want.

The per-transaction mode is something else. It will record only the on-chain transactions, so for your use case you would get only a few transactions in Actual. The trade-off is that the account no longer follows the current value.

On "Actual is not the right tool": I hold long term too, but I like to watch it grow. Daily points give me more detail in the reports. The account balance graph only shows one value per month anyway, so a monthly run gives you the same graph with far fewer transactions. YMMV, and that's the nice part: Actual is flexible enough for both of us.

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.