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

# Withdrawals overview

> Dual-signature withdrawal flow with AML / MLRO review and on-chain settlement.

Withdrawals move USDC out of the user's on-chain vault to an
external destination. Every withdrawal is:

1. **EIP-712 signed** by the user against the vault's `WithdrawERC20`
   typed-data struct.
2. **AML-screened** by core-api (Global Ledger sanction + risk check).
   If flagged, the withdrawal enters `MLRO_REVIEW` for human
   compliance review.
3. **Backend co-signed** with a second EIP-712 signature. Dual
   signatures are both required on-chain; neither party can move funds
   alone.
4. **Submitted on-chain** by PredictStreet's backend submitter
   (PredictStreet pays gas).
5. **Confirmed** when the on-chain tx receipt is observed.

## State machine

```
PENDING ─► MLRO_REVIEW ─► CO_SIGNED ─► SUBMITTED ─► CONFIRMED
                     └─► REJECTED (MLRO deny)      └─► REJECTED (revert)
       ─► CO_SIGNED ─► SUBMITTED ─► CONFIRMED
                                 └─► REJECTED (submit fail)
       ─► CANCELLED (user, pre-submit)
```

See [State machine detail](/concepts/withdrawals/state-machine).

## Withdrawal security

Two **opt-in, per-wallet** controls gate a withdrawal request before it enters
the flow above (enforced when the platform enables withdrawal-security; SSO
partners are exempt):

* **[Address whitelist](/concepts/withdrawals/address-whitelist)** — once a
  wallet has any whitelisted address, withdrawals are allowed only to listed
  destinations (`403 withdrawal_address_not_whitelisted` otherwise). No entries
  \= unrestricted.
* **[2FA (TOTP)](/concepts/withdrawals/two-factor)** — once active, every
  withdrawal must carry a `totpCode` (`403 totp_required` / `totp_invalid`
  otherwise). Manage both under `/api/me/withdrawal-security/*`.

The two are independent and stack. The existing AML / sanctions screen and
high-value review run regardless.

## Typical timeline

* **Happy path (no flag):** under 10s from request to `CONFIRMED`
  on testnet; target \< 60s on mainnet.
* **MLRO review path:** SLA 1 business day for decision, per SOP §8.

## User-visible balance effects

| Transition                                 | available | locked  | Comment                  |
| ------------------------------------------ | --------- | ------- | ------------------------ |
| Request                                    | −amount   | +amount | Locked until outcome     |
| `CONFIRMED`                                | 0         | −amount | Funds gone from platform |
| `REJECTED` / `CANCELLED` / on-chain revert | +amount   | −amount | Full refund              |

## Partner & MM notes

Market makers running high withdrawal cadence should:

* Pre-register destination wallets via **deposit sources** (see
  [Deposit sources](/concepts/withdrawals/deposit-sources)) — otherwise
  the first withdrawal to a new address triggers enhanced due diligence
  review above the threshold.
* Poll `GET /api/me/withdrawals/{id}` or subscribe to the
  `withdrawals.me` WebSocket channel for state transitions.

## Next

<CardGroup cols={2}>
  <Card title="Dual-sig flow" icon="key" href="/concepts/withdrawals/dual-sig">
    Why two signatures, how the co-sign works.
  </Card>

  <Card title="EIP-712 struct" icon="file-signature" href="/concepts/withdrawals/eip712">
    WithdrawERC20 struct + signing.
  </Card>

  <Card title="State machine" icon="diagram-project" href="/concepts/withdrawals/state-machine">
    All states + transitions.
  </Card>

  <Card title="Deposit sources" icon="filter-circle-dollar" href="/concepts/withdrawals/deposit-sources">
    Return-to-source rules and EDD.
  </Card>

  <Card title="Withdrawal 2FA" icon="shield-halved" href="/concepts/withdrawals/two-factor">
    TOTP second factor on withdrawals.
  </Card>

  <Card title="Address whitelist" icon="address-book" href="/concepts/withdrawals/address-whitelist">
    Restrict withdrawals to approved destinations.
  </Card>
</CardGroup>
