Underestimating regional settlement latency on a custom fiat-crypto gateway
A few quarters back, we tried to build our own automated treasury sweep for a cross-border merchant client, routing $USDC to domestic fiat via local liquidity providers in Latin America. The mistake was relying on a naive API integration that assumed local RTGS systems would behave consistently under load. We hit a weekend bottleneck where a processing partner's API returned a false 'pending' state instead of a hard fail, causing our automated script to retry the payout loop twice. We ended up double-funding a batch before the manual reconciliation team even logged in on Monday.
The lesson here was expensive but simple: when building on/off-ramps, never rely solely on standard HTTP response codes from third-party wrappers to determine settlement status. If the state isn't explicitly confirmed on-chain or via a cryptographically signed webhook, you must halt the queue automatically. We now enforce a hard circuit breaker on all outbound treasury transfers to prevent loops, regardless of how stable the API documentation claims to be.
Ran into a similar issue with LatAm settlement last year. You absolutely cannot trust status endpoints during weekend peaks; we ended up having to build manual reconciliation fallbacks with a strict timeout and automatic rollover to a secondary provider.