> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dfns.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Automate deposits

> Detect end-user deposits, sweep funds to treasury, and process stablecoin payments programmatically with DFNS wallets, webhooks, and policies.

Detect incoming deposits, credit user accounts, and sweep funds into treasury. This solution covers deposit detection, stablecoin handling, and compliance integration.

## What you'll need

* Wallets for receiving deposits
* Webhook endpoint for deposit notifications
* For regulated entities: [travel rule integration](/integrations/travel-rule/notabene)

## Components to configure

### Deposit detection

Detect incoming transactions to your wallets using [webhooks](/guides/developers/webhooks) for real-time notifications or by [querying wallet history](/guides/developers/displaying-balances).

Key considerations:

* **Confirmed deposits** - The `wallet.blockchainevent.detected` webhook fires after DFNS's [confirmation delay](/networks/index) per network. Treat this as settlement.
* **Early detection (pre-confirmation)** - On networks that support early detection (see the [supported networks](/networks) table), the `wallet.blockchain_event.transfer.included` webhook fires as soon as a deposit lands in a block, before the confirmation delay elapses. The event carries `status: "Included"`. Surface the pending deposit to your user immediately, then treat it as settled only when `wallet.blockchainevent.detected` (`status: "Confirmed"`) arrives — unfinalized blocks can still reorg, so don't credit irreversibly or sweep until confirmed.
* **Duplicate handling** - Webhooks may be delivered multiple times; use idempotency
* **Reconciliation** - Run periodic jobs to catch any missed webhooks

### Transfer execution

Process outbound transfers via the [dashboard](/guides/transfer-assets) or [API](/guides/developers/create-transfers).

### Stablecoin support

Stablecoins enable fast, low-cost international transfers. Consider:

* **Network selection** - Layer 2 networks (Polygon, Base) have lower fees
* **Recipient compatibility** - Ensure recipient can receive on your chosen network
* **Compliance** - Large transfers may require travel rule data

See how to [send stablecoin transfers](/guides/transfer-assets) and the [Notabene integration](/integrations/travel-rule/notabene) for travel rule.

## Compliance integration

### AML/KYT screening

Screen outbound transactions for sanctions and risk using Chainalysis integration. See the [compliance solution](/solutions/apply-compliance-controls) and [Chainalysis setup guide](/integrations/aml-kyt/chainalysis).

### Travel rule

For transfers above regulatory thresholds, exchange originator and beneficiary information. See the [Notabene integration](/integrations/travel-rule/notabene).

### Deposit sweeping

If you assign unique wallets to each customer or deposit, you'll want to periodically sweep funds into a central treasury wallet. After detecting a deposit, create a [transfer](/guides/developers/create-transfers) from the deposit wallet to your treasury. See the [deposit sweeping developer guide](/guides/developers/deposit-sweeping) for a step-by-step implementation.

```mermaid theme={null}
sequenceDiagram
    participant User
    participant Network as Blockchain
    participant DFNS
    participant System as Your System

    User->>Network: 1. Send funds to deposit address
    Network->>DFNS: Transaction included (unfinalized)
    DFNS->>System: 2. Webhook (blockchain_event.transfer.included, status "Included")
    System->>System: 3. Show pending deposit to user
    Network->>DFNS: Transaction confirmed
    DFNS->>System: 4. Webhook (blockchainevent.detected, status "Confirmed")
    System->>System: 5. Credit user account
    System->>DFNS: 6. Transfer funds to treasury wallet
    DFNS->>Network: 7. Sweep transaction broadcast
```

You can sweep immediately after each deposit or batch sweeps on a schedule. For UTXO-based networks like Bitcoin, batching helps reduce fees by consolidating many small UTXOs into fewer outputs.

### Managed custody with vaults

If incoming deposits must be held until reviewed, a [vault](/core-concepts/vaults-wallets-and-keys#vaults-managed-custody-on-top-of-wallets) provides this natively: funds arrive quarantined and enter the available balance only once you accept them, holdings are segregated into available, incoming, quarantined, and locked, and every balance change is recorded in an immutable ledger. Vault addresses are available on EVM networks, so vaults complement — rather than replace — the wallet-based flow above. See [Manage vaults](/guides/manage-vaults).

## Deposit flow example

A typical deposit processing flow:

```mermaid theme={null}
sequenceDiagram
    participant User
    participant Network as Blockchain
    participant DFNS
    participant System as Your System

    User->>Network: 1. Send funds to deposit address
    Network->>DFNS: Transaction confirmed
    Note over DFNS: 2. Index after confirmation delay
    DFNS->>System: 3. Webhook (blockchainevent.detected)
    System->>System: 4. Credit user account
    System->>User: 5. Notify deposit complete
```

<Tip>
  Since DFNS waits for the confirmation delay before firing the webhook, you can credit users immediately upon receiving the event.
</Tip>

## Fiat off-ramp

After processing crypto payments, use [Payouts](/features/payouts) to convert stablecoins to fiat bank deposits. Payouts supports USDC, USDT, and EURC across 94 countries and 63 currencies. See the [developer guide](/guides/developers/payouts) for API integration.

## Related solutions

<CardGroup cols={2}>
  <Card title="Automate payments" icon="robot" href="/solutions/automate-payments">
    Automated payment workflows
  </Card>

  <Card title="Apply compliance controls" icon="magnifying-glass" href="/solutions/apply-compliance-controls">
    KYT and travel rule
  </Card>

  <Card title="Embed user wallets" icon="key" href="/solutions/embed-user-wallets">
    User wallet management
  </Card>
</CardGroup>
