polycratia

Detecting an incoming crypto deposit is the easy part. Deciding when it is real is what breaks custodial systems.

Your node tells you a transaction exists, then that it landed in a block. Neither fact means a user balance should move. How many confirmations you wait for is a risk decision — how much you are willing to lose against how long a user will tolerate a spinner — but in most systems it ends up as a constant hardcoded by whoever wrote the deposit watcher first, identical for every asset and every amount.

Then a reorg happens, and you find out your ledger has no state for "credited, but still reversible". If the only states are pending and settled, un-crediting becomes a manual adjustment. And if the user already withdrew, the adjustment is just a record of your loss.

How I build it now: the watcher records observations, never balances. A separate crediting policy decides — per asset, per amount — when an observation becomes a ledger entry. Reversals are ordinary ledger entries, not admin surgery.

The chain is the source of truth about transactions. It is never the source of truth about your balances.

Where do you draw the confirmation line — fixed per asset, or scaled with the amount at risk?

react

$ new-project --brief

or email hey@polycratia.com