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

# Getting Tradeable

> Register the wallet, approve collateral, and fund it.

A minted credential proves control of a wallet. It does not give that wallet an exchange account, and it does not give the exchange permission to draw its collateral.

Three conditions must hold before an order can fill. They are independent, and each fails in a distinct way:

| Step                              | Without it                                                                   |
| --------------------------------- | ---------------------------------------------------------------------------- |
| **Registered** with the exchange  | Submission is rejected outright: `ORDER_REJECTED` / `NOT_REGISTERED`         |
| **Approved** collateral allowance | Orders rest and cancel normally, then fail at settlement with `rejectCode` 9 |
| **Funded** with USDC              | Orders are accepted, then rejected for insufficient margin, `rejectCode` 3   |

The second is the easiest to miss, because nothing rejects until settlement.

<Info>
  A wallet whose key was exported from the Noise app is already registered and already approved,
  and it holds whatever balance the app account holds. Call `GET /account/balance` and confirm
  `registered` is `true`, then continue at [Orders](/trader-api/orders). An app account with no
  capital still needs funding: check `marginFree`, treating `null` as unreported rather than zero.
</Info>

## Register

`POST /account/register` creates the exchange-side account for the calling wallet, which is identified by the credential rather than by a request body.

```ts theme={null}
await call("POST", "/api/trader/v1/account/register");
```

It takes no request body, so sign the empty string as the body component.

The response is `{ "status": "pending" }` or `{ "status": "registered" }`. Registration is **asynchronous**, so the first call returns `pending` because the exchange has not applied the record yet. It is also idempotent: an already-registered wallet returns `registered` and nothing is written.

Poll `GET /account/balance` and wait for `registered` to be `true`:

```json theme={null}
{
  "registered": true,
  "availCash": "1000.00",
  "totalEquity": "1000.00",
  "realizedPnl": "0",
  "unrealizedPnl": null,
  "marginUsed": "0",
  "marginFree": "1000.00",
  "currency": "USDC"
}
```

## Approve collateral

`GET /account/approval` returns an unsigned transaction granting the clearing house an allowance to move the collateral token. The wallet broadcasts it.

```json theme={null}
{ "transaction": { "to": "0x...", "value": "0", "data": "0x..." } }
```

<Warning>
  Send the returned `data` bytes **verbatim**. Do not re-encode the call from its arguments: the
  bytes carry an ERC-8021 builder attribution suffix, which is lost on reconstruction.
</Warning>

Noise neither signs nor submits this transaction, and it is the only step that spends gas from the wallet. The resulting allowance is a plain on-chain read, so query it directly against the collateral token. The API cannot report whether an allowance exists.

```ts theme={null}
import { createWalletClient, http } from "viem";
import { base } from "viem/chains";

const wallet = createWalletClient({ account, chain: base, transport: http(RPC_URL) });
const { transaction } = await call("GET", "/api/trader/v1/account/approval").then((r) => r.json());

const hash = await wallet.sendTransaction({
  to: transaction.to as `0x${string}`,
  data: transaction.data as `0x${string}`,
  value: 0n,
});
```

## Fund

Send USDC on Base to the wallet address. Use the `exchange.collateralTokenAddress` from `GET /status` as the token, because it is not always canonical Circle USDC. Do not assume the well-known address.

Size new orders against **`marginFree`** rather than `availCash`. `availCash` is the balance free to draw on and `totalEquity` includes open position value; `marginFree` is the amount actually available to commit to a new order. The two can differ by capital the exchange has already allocated to an open market, which is not currently published separately.

## Verify

```bash theme={null}
GET /account/balance    # registered: true, and capital available to commit
GET /assets             # the market's marketId, tickSize, lotSize, tickerState
```

Once both are correct, place a small limit order well away from the market price and confirm it appears on `GET /account/orders` before running a strategy.
