How many ETH confirmations do you wait before crediting a payout?

mike_t_2019

Member
Messages
60
Reaction score
0
Location
Leeds, UK

Running a crash + plinko backend on PHP 8.2 with a Redis queue handling withdrawals and I keep flip flopping on confirmations.

Right now I sit at 3 blocks before I mark a payout done. Problem is my geth websocket drops every few hours (cheap VPS, I know) and the fallback poller re-broadcasts the tx because my nonce check is borderline garbage. Ended up double sending 0.4 ETH once. That one hurt.

So what are you all actually running in prod? 1 block and eat the risk? 12 and make people stare at a spinner for 3 minutes? Offshore sites credit off the mempool instantly and honestly it feels great as a user, but that's exactly how you get reorg'd into a hole. Meanwhile the regulated stuff up here takes 45 minutes and charges you for the privilege lol.

Also wondering if anyone does the intermediate step, show "detected" right away then flip to confirmed once it hits depth. Does that actually cut support tickets or does it just create a new kind of ticket where people think every pending tx is stuck?

patrick_jones88

New Member
Messages
60
Reaction score
0
Location
Glasgow, UK

Your confirmation depth isn't the problem, your nonce handling is.

Double sending 0.4 ETH because a poller re-broadcast a tx it already sent is a nonce bug, not a 3-blocks-vs-12-blocks bug. Post-merge ETH reorgs past 2 blocks are basically a rounding error now. I've been running 2 confirmations on a mid-size op for about 18 months and haven't eaten a single reorg. Websocket dropping is annoying but it should never trigger a rebroadcast if your nonce logic is sane.

What fixed it for me: stop letting the poller decide anything. Keep a monotonic nonce counter in Redis with a SETNX lock per hot wallet, pull the pending nonce from geth only on startup or after a confirmed gap, and never broadcast a raw tx twice without checking txpool_content first. If it's already in the pool, you wait. That one change killed 90% of my weirdness.

On detected vs confirmed: yes it cuts tickets, but only if you set expectations. I show "sent" immediately, "detected" once it's in the mempool, "confirmed" at depth, and I never show a countdown. The second you put a ticking clock on screen people screenshot it and open a ticket when it hits zero. You'll still get the "why is my withdrawal pending for 20 min" crowd, but that's better than total silence.

Curious what you're using to sign and send. Most of these double-send stories trace back to whatever lib is handing you the nonce.

tallguy_tx

New Member
Messages
61
Reaction score
0
Location
Austin, TX

The SETNX lock thing is what I ended up on too, after my own 0.4 ETH double send. Mine lives in Redis with a 30s TTL refreshed on each attempt, and the poller is literally not allowed to call eth_sendRawTransaction at all anymore. It only reads txpool_content and matches on hash. Sounds obvious in hindsight but when you're wiring this up at 2am you convince yourself the poller is smart enough to know what it already sent. It isn't. Kill its write access.

Where I'll push back though: 2 confirmations feels thin for real money. Not the classic reorg angle, I agree those basically died post-merge, but slot timing and MEV. I've watched a tx sit at 1 conf for almost a minute while the next proposer built on a competing block. Rare as hell but not zero, and it always seems to land on the biggest withdrawal of the week. I run 4 for anything over a threshold and 2 for dust. Probably paranoia, but sleep matters more than shaving 20 seconds off a payout.

On the detected vs confirmed thing, yeah, the countdown was the killer. I pulled the ETA entirely and just show a block progress bar that fills with depth. Pending withdrawal tickets dropped maybe 60% after that. You still get the "is it stuck??" messages at the 3 minute mark, but that's a way cheaper ticket than "your ETA said 90 seconds and it's been an hour."

What are you doing for hot wallet rotation? That's the wall I'm hitting next, running everything through one address makes me twitchy.

bananapeel42

New Member
Messages
53
Reaction score
0
Location
Manchester, UK

I'll push back on the detected state being a free win. I ran it for about six months and pulled it, tickets went down after I killed it, not up.

Reason being my users don't read. They see a green checkmark next to "detected" and assume the money landed. Then the tx sits at 0 conf for 40 minutes because we underbid the fee, and now you've got a guy who mentally already spent it calling you a scam. A plain "pending" at least signals "not done yet." Maybe patrick's flow handles that better than mine did, but I don't think "detected" is the free ticket-killer this thread is making it out to be. It just relocates the confusion.

tallguy_tx on the slot timing thing though, yeah. I got burned once on a 6 ETH withdrawal that sat at 1 conf while the next proposer built elsewhere. Rare, but it was the biggest payout of the week, exactly like you said. I run 2 for small, 5 for anything over a couple ETH now. Not because I think a deep reorg is coming, more because I don't want that one-in-a-thousand sitting on my conscience at 3am.

Curious what you set as the threshold where you flip from 2 to 4. Flat dollar amount or do you scale it?

bananapeel42

New Member
Messages
53
Reaction score
0
Location
Manchester, UK

Since nobody answered my own threshold question, I'll do it: mine isn't a dollar amount, it's a fraction of what the hot wallet can eat. Anything over ~10% of the daily payout ceiling gets 5 confs, everything else gets 2. Flat dollar sounds cleaner but it breaks the second you spin up a second hot wallet with a different float.

New angle nobody's brought up though. Everyone's arguing confirmation depth like it's the safety mechanism. It isn't. It's a UX knob. Your actual safety mechanism is a unique withdrawal ID that maps to exactly one tx hash in the DB, plus a reconciler that refuses to build a second tx for an ID that already has one. Once that exists, the 0.4 ETH double send is a duplicate row you catch with a query, not money you're chasing through etherscan at 4am.

So patrick's right that it was a nonce bug, but I'd go further: the nonce bug was a symptom. If a re-broadcast can move money twice, your withdrawal row was never the source of truth in the first place. Fix the row, then argue about 2 vs 5.

And the offshore sites crediting off mempool, people keep holding that up like it's a design flex. It's just a different balance sheet. They're eating reorg risk against volume and thin margins and a support team that's already paid for. You can't copy the UX without the float.

w0lfpack88

New Member
Messages
72
Reaction score
0
Location
Oslo, NO

bananapeel42 dropped the actual answer at the bottom and everyone's scrolling past it. Withdrawal ID as source of truth, reconciler that refuses to build a second tx for an ID that already has one. Everything else in this thread is tuning. Nonce logic, 2 vs 5 confs, detected vs pending, none of it matters if a re-broadcast can move money twice. Fix the row first, then go fiddle with the depth knob.

From the player side though I've gotta push back on the detected-is-bad take. I play mostly on Curacao books because the local ones are blocked to hell and back, and the sites that credit off mempool are the ones I keep coming back to. A site with a 45 min spinner gets one deposit from me and then I'm gone. Yeah I know that's literally the reorg risk you're all sitting here arguing about eating. But the UX is the product for a lot of us.

That said banana's not wrong that a green check next to "detected" is asking for trouble. I've sat refreshing like an idiot waiting for a tx that showed as detected and took 40 minutes. Still prefer it to staring at nothing though. Maybe that's just me being impatient.

Real question though, what happens on the reverse case? Withdrawal credits off mempool, then the tx gets dropped from the pool entirely because you underbid and the mempool cleared it. Does the credit get clawed back or does the row just sit there until someone notices? Cos I've had a site do the claw back thing to me and the support ticket that followed was not fun for anyone.

emilyb85

New Member
Messages
67
Reaction score
0
Location
Amsterdam, NL

bananapeel42's "fix the row first" is correct in spirit but the way people actually implement it is exactly where it breaks. I've watched this pattern fail twice now and both times the depth setting was completely innocent. The reconciler was racing itself.

If your unique withdrawal ID is enforced in app code (SELECT, then INSERT) and you've got two workers, or a retry that fires before the first insert has committed, you get two rows. Same ID, two tx hashes. Now your reconciler that "refuses to build a second tx for an ID that already has one" does absolutely nothing, because both rows sincerely believe they're the first one. The fix is a UNIQUE constraint in the DB on the withdrawal ID and letting the insert itself blow up, not a check that happens before it. Feels pedantic until it's 3am and you're doing etherscan forensics again.

The part of this thread I actually want to push on is w0lfpack88's framing that the UX is the product. Sure, but the sites crediting off mempool aren't eating that reorg risk out of generosity or superior engineering. They're eating it because their float is large enough that a clawback is a support email, not an insolvency event. Different balance sheet, like banana said. When a reorg does hit, those same sites quietly debit you and most players never post about it because it feels like their fault. I've seen it happen and the forum threads are always "my deposit vanished" with 40 replies calling the guy a liar.

So the honest answer to the OP is that mempool crediting is a business decision, not a technical one. You can build the exact same UX with a 2-conf gate and a big enough float to absorb the rare bad block. The question isn't "how fast can I credit" it's "how much can I write off before it stops being funny."

@w0lfpack88 did you ever have a deposit clawed back after a reorg? Genuinely curious how the Curacao books handle that on the player side.

w0lfpack88

New Member
Messages
72
Reaction score
0
Location
Oslo, NO

Emily's DB point is the one that'll actually bite people and it's not pedantic at all. SELECT then INSERT is a race with extra steps. I've watched a book double-credit my deposit and then quietly claw the extra back three days later with zero explanation, which tells me they had two rows sitting in a table and nobody noticed until some monthly sweep ran. So yeah, UNIQUE constraint and let the insert blow up. Good shout.

But the float framing cuts both ways and I don't think it lands the way you mean it to. A big book can eat a reorg as a support email, sure, except in my experience that support email is "we've adjusted your balance for a technical error" and if I've already wagered that money through, I'm now sitting at a negative balance with my account frozen while they "review" it. That's not a support email to me, that's my money gone and my account held hostage. So when I said the UX is the product, it's not because I don't understand the reorg risk. It's because I've been on the receiving end of the correction and I'd genuinely rather the site under-promise than hand me a green check and take it back later.

Which is kind of why I'm still torn on the detected vs pending thing in this thread. bananapeel42 says detected just relocates the confusion and honestly he might be right. I still lean toward seeing something rather than nothing, but reading my own posts back I realize I'm the impatient user that every design decision in this thread is trying to manage around lol.

Real question for you though Emily, since you've watched this fail twice. When the clawback hits a user who already spent the credited money, what do you actually do? Eat it, or lock the account and force a deposit to clear the negative? Because that decision probably matters more to your ticket volume than anything in the confirmation depth argument.

greg_ohio

New Member
Messages
71
Reaction score
0
Location
Columbus, OH

bhai most of this thread went over my head but w0lfpack88's last bit hit home. I've had a book claw back my balance with a "technical error" message after a deposit, and by then I'd already played through half of it. Account frozen 2 days while they "reviewed". So yeah I'd take a boring "pending" over a green tick any day of the week. At least pending tells me don't touch it yet 🙏

Honest question though, does any of this confirmation depth stuff even matter for small deposits? I mostly do 20-30 USDT on slots sites and they credit in like 30 seconds flat. Is that mempool crediting or are they just sitting on a fat float? Always wondered if the fast ones are risky for me or just for them.

And patrick_jones88 running 2 confirmations for 18 months is honestly wild to me, I always assumed everyone was doing like 12+. Guess that's the offshore vs regulated thing again lol.

greg_ohio

New Member
Messages
71
Reaction score
0
Location
Columbus, OH

ok since nobody answered my small deposit question I went and actually asked live chat on one of the slots sites I play on 😅 guy said they credit from mempool but "reserve the right to adjust the balance" if the tx doesn't confirm. So basically what emilyb85 said about float, they're fronting me the money and hoping it lands. Which is fine by me tbh, as long as nobody freezes my account over 20 USDT lol.

I did pull up etherscan on my last deposit just to watch, and yeah it sat at like 4/12 confirmations for ages while the site had already given me the balance. Weird feeling knowing they're basically trusting me not to blow it before it lands.

Question for patrick_jones88 or tallguy_tx, at what size does the float thing actually matter? Like do you even bother with a proper reconciler for 20-30 dollar deposits or is it just whatever the payment processor spits out and you move on. I'm not running any backend myself obviously, just trying to understand why the fast sites feel so chill about it. Thanks for the DB stuff btw emily, that UNIQUE constraint bit made more sense to me than half the nonce talk 😄

ChrisM85

New Member
Messages
62
Reaction score
0
Location
Dublin, IE

emilyb85's UNIQUE constraint point is the one I'd frame on the wall. Watched this exact race eat a shop I did contract work for, two workers plus a retry loop that fired before the first insert committed, boom, two rows, and the reconciler sat there doing absolutely nothing because both rows sincerely believed they were first. Took a week to surface and only because a guy complained about a double debit. Not pedantic at all.

On greg_ohio's small deposit question, I can't give you the float math but I can tell you what it looks like from my side of the counter. I'm in a state where every regulated book is geo-blocked into oblivion, so I'm on offshore and crypto-only stuff, VPN on a residential IP because datacenter ranges get flagged in about 12 seconds flat. The sites that credit 20-30 USDT instantly have never once clawed me back. Meanwhile the "legal" option up here wanted 45 minutes, a selfie, and a utility bill, and charged me a fee for the privilege. So whatever balance sheet those fast books are running, it works for me and I'll keep using it, clawback risk and all. That's the trade I'm making.

One thing nobody's mentioned though: confirmation depth is irrelevant if your deposit address rotates. Two of the crypto books I use hand out a new address per deposit, and one time it showed confirmed against an address that had already been retired. Three days of support tickets and an etherscan screenshot to get it credited. Reconciler can be flawless and you still lose a tx if the address-to-user mapping isn't treated as source of truth too. Anyone else run into that or is it just the two sketchy joints I keep logging into?

You must log in or register to reply here.