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

# Gasless Onboarding

> Custom helpers Derive UX uses for onboarding.

This optional page explains the contracts and keepers the Derive UX uses for gasless onboarding. Like on a
centralized exchange, users deposit by sending funds to an address and withdraw straight to another chain.

> [!NOTE]
>
> You don't need this to onboard. You can use these contracts directly, or as inspiration for your own onboarding
> experience.

## Deposit addresses

Funds sent to a deposit address are swept by the `SlowDeposit` factory. It deposits them through
`OnchainActionManager` into the user's own subaccount.

**Step 1**

Send tokens or ETH to your deposit address, directly on Ethereum or from a source chain through a
[custom bridge](https://docs.derive.xyz/getting-started/custom-bridges.md) or bridge aggregator.

**Step 2**

A keeper detects the transfer and waits for enough confirmations.

**Step 3**

The keeper calls `processSlowDeposit` on the `SlowDeposit` factory.

**Step 4**

The factory sweeps the deposit address and wraps native ETH to WETH.

**Step 5**

It deposits through `OnchainActionManager`: `deposit` for an existing subaccount, or `depositToNewSubaccount`
when `subaccountId` is 0.

**Step 6**

`OnchainActionManager` moves the tokens into the `SpotVault` and queues the deposit.

**Step 7**

The Derive exchange reads the queued deposit and credits the subaccount. The credit is final once its batch is proven.

To get a deposit address over the API, call `public/register_deposit_address`. See the **Standard** tab in
[Programmatic Onboarding](https://docs.derive.xyz/getting-started/depositing.md).

## Withdraw addresses

A withdrawal paid to a withdraw address is swept by the `WithdrawFactory`. It bridges the funds to the recipient
on the destination chain.

> [!WARNING]
>
> Withdraw addresses only work for tokens with a [custom bridge](https://docs.derive.xyz/getting-started/custom-bridges.md), such as HYPE,
> SOL and FXRP. The `WithdrawFactory` has no route for any other token. If one lands at a withdraw address,
> `processWithdrawal` reverts and the funds stay there. Only the factory owner can recover them.

**Step 1**

Request a withdrawal with your withdraw address for the target chain as the recipient: a signed exchange
operation, or `OnchainActionManager.withdraw` on L1.

**Step 2**

The Derive exchange applies it and submits its batch to `VerifiableApp`.

**Step 3**

`VerifiableApp` verifies the proof and hands the proven withdrawals to the `WithdrawalOutbox`.

**Step 4**

The outbox pays out from the `SpotVault` to the withdraw address, subject to rate limits.

**Step 5**

A keeper detects the funds at the withdraw address.

**Step 6**

It calls `processWithdrawal(recipient, chainId, token)` on the `WithdrawFactory`.

**Step 7**

The factory sweeps the withdraw address and wraps native ETH to WETH.

**Step 8**

It sends the funds through the route configured for that token and chain, paying the bridge fee in ETH.

**Step 9**

The recipient receives the tokens on the destination chain.

## Contracts

Mainnet is Ethereum and testnet is Ethereum Sepolia. For the core contracts, see
[Contracts](https://docs.derive.xyz/getting-started/contracts.md).

### `SlowDeposit`

```text Mainnet theme={null}
0xB8B9bE9497811B11B7a7b93Eb446b5e73F8732ff
```

```text Testnet theme={null}
0xA4cDbecB37CDd36535B96A7D287f1f3D3704b442
```

The deposit factory. `getDepositAddress(owner, subaccountId, managerId)` returns a deposit address.

### `WithdrawFactory`

```text Mainnet theme={null}
0xFec48bBC648bd2284520d862Ec67fc68F709915e
```

```text Testnet theme={null}
0x6A8566c585903E4558A9BE722FFa55f173c719ef
```

`getWithdrawAddress(recipient, chainId)` returns a withdraw address. `getBridgeConfig(token, chainId)` shows whether
a token has a route to that chain.


## Related topics

- [Programmatic Onboarding](https://docs.derive.xyz/getting-started/depositing.md)
- [Smart Contracts & Multi-sigs](https://docs.derive.xyz/authentication/contract-owned-accounts.md)
- [DevEx improvements](https://docs.derive.xyz/migrating/v3-improvements.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.