How to build stablecoin deposit detection
Stablecoin deposit detection is how a wallet app, exchange, bank or payment provider learns that a customer sent stablecoins to an address it issued, so it can credit the right account once.
This playbook sets out the decisions in the order you’ll make them. Each one links to the use case pages and docs that cover it in detail.
Match the method to how many addresses you watch
Count the addresses you’ll watch a year from now: a few wallets suit an API call, thousands of changing addresses suit a pipeline.
- Use caseWays to detect stablecoin wallet top-upsEach way to build it side by side, with what each one suits best.
- Use caseWays to confirm stablecoin payments at checkoutEach way to build it side by side, with what each one suits best.
- Use caseWays to detect top-ups to card-backing walletsEach way to build it side by side, with what each one suits best.
Stream deposits from a watch list
Keep issued addresses in a table the pipeline checks every transfer against, and add each one the moment you issue it.
- GuideDetect incoming assets to a set of addressesKeep the addresses you watch in a dynamic table and get each deposit to them as a row you can query, a running balance or a webhook.
- DocsTurbo Pipelines dynamic tablesUpdate a lookup table in Postgres, such as a list of watched addresses, while the pipeline runs, and filter transfers against it.
- Use caseDetect stablecoin wallet top-ups by streaming to your databaseGoldsky runs a pipeline that checks every stablecoin transfer against your list of user wallets and writes each match to your database, a webhook or both.
Call or sync the transfers feed
Call the transfers API when your app needs a wallet’s deposits, or sync the feed into your database so nothing polls.
- DocsFeeds API: TransfersGet the native and token transfers in and out of one wallet across chains, newest first, with the USD value at transfer time.
- DocsSync Feeds to your databaseHave a feed’s rows pushed to your database or a webhook as they land, so your app doesn’t poll the API.
- Use caseDetect stablecoin wallet top-ups with a transfers APIYour app calls the Feeds transfers endpoint for a wallet whenever it needs to check for deposits, and gets back that wallet’s incoming transfers with token details and USD value.
- Use caseDetect stablecoin wallet top-ups with a synced transfers feedFeeds pushes new transfer rows into your database or to a webhook as they arrive, so your app reads deposits from its own tables without calling an API or running a pipeline.
Credit a user’s app or trading balance
Give each user their own deposit address, and credit each transfer once, however many times it’s delivered.
- Use caseStablecoin wallet top-upsCredit a user’s app balance when a stablecoin transfer to their embedded wallet confirms.
- Use caseCrypto on-ramp order trackingMatch each crypto purchase made through an on-ramp to the transfer that reaches the customer’s wallet, then credit it once.
- Use caseCrypto exchange deposit detectionDetect deposits to each exchange user’s addresses, wait for enough confirmations and credit the user once.
- Use caseStablecoin funding for brokerage and trading accountsDetect the stablecoins a customer sends to fund a brokerage, investing or event-trading account, so the funds can be converted and credited for trading.
Post deposits to a business or bank account
Post onchain deposits to the same account as the customer’s wires, so one balance covers both.
- Use caseStablecoin deposits to business bank accountsDetect stablecoin deposits into business bank and fintech accounts and post them to the account alongside fiat.
- Use caseStablecoin deposits credited as fiatDetect the stablecoins a customer sends to their account’s deposit address, so the provider can convert them and credit the fiat balance of the customer’s named account.
Confirm payments for orders, subscriptions and agents
Give each order its own address or reference, and decide up front what happens to short, extra and unmatched payments.
- Use caseAccept stablecoin paymentsConfirm stablecoin payments from shoppers and mark the order paid.
- Use caseScreen the payer before accepting a stablecoin paymentHold a stablecoin payment in escrow until the payer’s wallet is screened, then release it to the business or refund the payer, with every decision recorded.
- Use caseStablecoin subscription paymentsConfirm each scheduled stablecoin charge onchain and mark the subscription paid.
- Use caseConfirm x402 and agent stablecoin paymentsConfirm stablecoin payments that AI agents make, often per request, and keep each agent within its spending limits.
Keep card spend limits current
Keep each card’s limit in your own systems, updated from top-ups, because an authorization can’t wait on the chain.
- Use caseStablecoin card programsDetect stablecoin top-ups to the wallets that back a card program so spend limits update.
- Use caseSpend stablecoins from a self-custodial wallet with a cardLet a card spend stablecoins straight from the cardholder’s own wallet, under a spending limit they approve, and match each onchain debit to the card ledger.
Pay out fiat for a cash-out deposit
Record the cash-out request before the address is used, and pay out only once the deposit is final.
- Use caseStablecoin off-rampsDetect the stablecoin a customer sends to cash out, so the provider can pay fiat to their bank account or card.
- Use caseCash out stablecoins at retail locationsLet a user send stablecoins from a wallet or exchange and collect cash at a money transfer agent, with each deposit tied to its pickup reference.
Credit a deposit only once it’s final
Set a confirmation rule for each chain, and hold deposits as pending until they meet it.
- Use caseCrypto exchange deposit detectionDetect deposits to each exchange user’s addresses, wait for enough confirmations and credit the user once.
- DocsTurbo Pipelines delivery guaranteesHow Turbo Pipelines delivers every record at least once, why your destination should ignore duplicates, and how reorg corrections reach your database or queue.
Expect every deposit to arrive more than once
Deliveries can repeat after a restart or retry, so skip any credit for a transfer you’ve already booked.
- DocsTurbo Pipelines delivery guaranteesHow Turbo Pipelines delivers every record at least once, why your destination should ignore duplicates, and how reorg corrections reach your database or queue.
- DocsTurbo webhook sinkPost pipeline rows to your endpoint as JSON, with retries and at-least-once delivery, so your endpoint has to ignore repeats.
Flag deposits sent on the wrong network
Watch your addresses on chains you don’t support, so support hears about deposits sent there.
Load deposits from before you started watching
Decide how much history you need, and load it without crediting anything your old system already credited.
- GuideDetect incoming assets to a set of addressesKeep the addresses you watch in a dynamic table and get each deposit to them as a row you can query, a running balance or a webhook.
- DocsTurbo job mode: one-time backfills and batch pipelinesRun a Turbo pipeline once over a bounded block range and let it exit, for backfills and data migrations.
Post confirmed transfers to your ledger
Post every transfer in and out of your addresses, reversals included, so the ledger can be checked against the chain.
- Use casePost onchain transfers to your ledgerPost each confirmed onchain transfer to the fintech’s own ledger, corrected for reorgs.
- Use caseMonitor crypto withdrawals from your hot walletsWatch every transfer leaving an exchange’s hot wallets, tie it to a customer’s withdrawal request and flag outflows nobody requested.
Match payments to invoices
Match payments to open invoices on a reference or on a separate address for each invoice.
Turn this plan into a working build
We can help you work through each decision and get the first stage into production.