On-chain confirmation is not the same thing as finality for your business. Treating them as one thing is how custodial systems lose money.
A transfer lands. The block is mined. Your node reports it. Everything looks settled, so the balance is credited and the user withdraws.
But confirmation is a probabilistic statement about a chain, not a business decision. Reorgs happen. A deposit can be credited and then quietly stop existing. Memo-tagged deposits arrive with the wrong tag or none at all. Tokens arrive on a chain you support with a contract you did not expect. And the moment you support more than one rail, each one has its own idea of when something is done.
So I stopped modelling a deposit as a boolean. I model it as a state machine with an explicit crediting policy per asset and per chain, and I keep the raw chain observation separate from the accounting entry it eventually justifies. The observation can be revised. The ledger entry is only written once the policy says the observation is durable enough to stand behind.
That separation is unglamorous and it is the thing that saves you when a chain misbehaves.
For anyone running custodial deposits: where do you draw the credit line — fixed confirmations, an economic threshold, or something per-asset?