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

# Fund a testnet account

> Deposit collateral on-chain when the Testnet Deposit button is not enough — for API traders who need a larger or programmatic balance

<Note>
  **Most users don't need this.** In the Arcus testnet web app, connect your wallet and click **Testnet Deposit** to instantly credit **\~\$1,000 USDC** of paper-trading collateral — that's enough for nearly everything. This guide is for **API traders** who need a larger balance, or who want to fund **programmatically** as part of a test harness.
</Note>

## The flow

Funding is an on-chain deposit on **Robinhood Chain testnet**. The exchange credits your trading account automatically once it observes the deposit on-chain (typically under a minute). The steps never change:

<Steps>
  <Step title="Mint the collateral token">
    The testnet collateral token (`USDG`) has an **open mint** — anyone can mint themselves test tokens. Mint the amount you want to deposit.
  </Step>

  <Step title="Approve the deposit proxy">
    Approve the deposit proxy contract to pull your `USDG`. The spender is the **deposit proxy**, not the bridge.
  </Step>

  <Step title="Call `initiateDeposit`">
    Call `initiateDeposit` on the deposit proxy. It pulls your `USDG`, wraps it into the margin token, and forwards it to the bridge. `owner` must equal the wallet that signs the transaction.
  </Step>

  <Step title="Wait for the credit">
    Poll [`GET /v1/account`](/api-reference/public/get-account) until your balance reflects the deposit. It also shows up as an `APPLIED DEPOSIT` on [`GET /v1/accountTransferUpdates`](/api-reference/public/get-account-transfer-updates).
  </Step>
</Steps>

That sequence — **mint → approve → `initiateDeposit` → wait** — is stable. The contract addresses below are **not**.

## Testnet parameters

<Warning>
  These addresses are **testnet deployment details that change on every redeploy or network reset** — confirm them before relying on them in automation. A stale address fails in one of two ways: an obvious `WrongToken` / transfer revert, **or** a transaction that succeeds on-chain but **never credits your account** (you minted/approved/deposited against a retired deployment that the live exchange no longer watches). The *flow* is stable; the *values* are not.
</Warning>

You only ever interact with two contracts: the collateral token (`USDG`) and the deposit proxy. The proxy forwards to the bridge internally, so you never call the `BridgeVault` directly.

| Parameter                                                          | Value (testnet, verify before use)           |
| ------------------------------------------------------------------ | -------------------------------------------- |
| Chain ID                                                           | `46630`                                      |
| RPC URL                                                            | `https://rpc.testnet.chain.robinhood.com`    |
| `USDG` — collateral token (`MockERC20`, **6 decimals**, open mint) | `0x022f49dbd588908b5a1805886c2107f0315223b4` |
| `PaxosDepositProxy` — deposit entry point                          | `0x10096bec721173f70add303affc235d7c99fbfd4` |

Amounts use the token's **6 decimals** — e.g. `$1,000` = `1000000000`, `$100,000` = `100000000000`.

Your wallet also needs a **small amount of RH-testnet ETH** (≈`0.001`) to pay gas for the `cast send` transactions below.

## Deposit with `cast`

Using [Foundry's `cast`](https://book.getfoundry.sh/cast/). `$KEY` / `$ADDR` are the depositing wallet's private key / address:

```bash theme={null}
RPC=https://rpc.testnet.chain.robinhood.com
USDG=0x022f49dbd588908b5a1805886c2107f0315223b4
PROXY=0x10096bec721173f70add303affc235d7c99fbfd4
AMT=1000000000   # $1,000 at 6 decimals

# 0. Sanity-check the chain and that you have gas
cast chain-id --rpc-url $RPC          # → 46630
cast balance $ADDR --rpc-url $RPC     # → must be > 0 (RH-testnet ETH for gas)

# 1. Mint test USDG to your wallet (open mint, testnet only)
cast send $USDG "mint(address,uint256)" $ADDR $AMT --rpc-url $RPC --private-key $KEY
# 2. Approve the deposit proxy to pull your USDG (spender is the PROXY, not the bridge)
cast send $USDG "approve(address,uint256)" $PROXY $AMT --rpc-url $RPC --private-key $KEY
# 3. Deposit into account index 0 — owner must equal the caller, token must be USDG
cast send $PROXY "initiateDeposit(address,uint16,address,uint256)" $ADDR 0 $USDG $AMT --rpc-url $RPC --private-key $KEY
```

The `initiateDeposit` arguments are `(owner, accountIndex, token, amount)`. Use `accountIndex` `0` unless you trade a non-default subaccount, and `token` must be the `USDG` address (the proxy rejects anything else with `WrongToken`).

## Verify

```bash theme={null}
# Balance should reflect the deposit (testnet accounts may carry a seed balance — check the delta)
curl "https://api.testnet.arcus.xyz/v1/account?address=$ADDR&accountIndex=0"

# The deposit shows up here as an APPLIED DEPOSIT
curl "https://api.testnet.arcus.xyz/v1/accountTransferUpdates?address=$ADDR&limit=50"
```

<Note>
  Testnet accounts may already show a small seed balance, so assert the **delta** (balance after − balance before), not the absolute value.
</Note>

## Troubleshooting

| Symptom                                                        | Cause / fix                                                                                                                                                                            |
| -------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `initiateDeposit` reverts with `WrongToken`                    | The `token` argument must be the `USDG` address. If it already is, the configured underlying may have changed — confirm the current addresses.                                         |
| Reverts on transfer / allowance                                | The approval (step 2) must be on `USDG` with the **`PaxosDepositProxy`** as spender — not the bridge. Re-run step 2.                                                                   |
| `intrinsic gas too low` / `max fee per gas less than base fee` | Top up the wallet's RH-testnet ETH and retry; the base fee can rise between blocks.                                                                                                    |
| Transaction succeeds but no credit appears                     | Confirm the deposit tx landed on-chain. If it did and the balance still hasn't moved after a minute, the deposit wasn't observed — flag it to the Arcus team with your wallet address. |

## Next steps

With a funded account, place your first order — [Trade over REST](/guides/rest-trading) or [Trade over WebSocket](/guides/websocket-trading).
