> ## 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 user deposits, process transfers, and handle stablecoin payments with compliance.

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:

* **Already confirmed** - The `wallet.blockchainevent.detected` webhook fires after Dfns's [confirmation delay](/networks/index) per network
* **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/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 confirmed
    Dfns->>System: 2. Webhook (blockchainevent.detected)
    System->>System: 3. Credit user account
    System->>Dfns: 4. Transfer funds to treasury wallet
    Dfns->>Network: 5. 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.

## 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>
