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

# Wallets & accounts

> Robin keys everything on the user's Polymarket on-chain account — a DepositWallet or a Gnosis Safe proxy — not their EOA. Resolve it once and use it everywhere.

A user connects an EOA (e.g. MetaMask), but their Polymarket conditional tokens and Robin vault shares never live in that EOA. They live in the user's **Polymarket on-chain account**, a separate smart-contract wallet the EOA controls. Resolve that account once, then key every per-user read and write on it.

<Warning>
  The EOA is only a signer. It holds no conditional tokens and no vault shares. If you query balances, positions, or vault state against the raw EOA you will get zero. Always use the resolved Polymarket account address.
</Warning>

## Two account kinds

Every Polymarket user controls exactly one of two on-chain account types, depending on when their Polymarket account was created.

| Kind                  | Who has it                     | Notes                                                                        |
| --------------------- | ------------------------------ | ---------------------------------------------------------------------------- |
| **DepositWallet**     | Every fresh Polymarket account | The newer account type. Submits transactions through the Polymarket relayer. |
| **Gnosis Safe proxy** | Legacy Polymarket accounts     | A Safe deployed by Polymarket's Safe proxy factory.                          |

<Note>
  A deployed **DepositWallet** always takes priority. Only fall back to the **Safe proxy** if no DepositWallet is deployed for the EOA.
</Note>

## Resolving the wallet

Resolution is deterministic from the EOA — both addresses are derivable off-chain, then you confirm which is actually deployed on-chain.

<Steps>
  <Step title="Derive and check the DepositWallet">
    Derive the EOA's DepositWallet address through the Polymarket relay client (`deriveDepositWalletAddress`), then ask the relay client whether it is deployed (`getDeployed(address, "WALLET")`). Both calls are read-only and prompt no signature.
  </Step>

  <Step title="Fall back to the Safe proxy">
    If no DepositWallet is deployed, compute the Safe proxy address from Polymarket's Safe proxy factory (`computeProxyAddress(eoa)`) and check that the address has bytecode on-chain (`getCode` returns more than `0x`).
  </Step>

  <Step title="Handle the unresolved case">
    If neither is deployed, the EOA has no Polymarket account yet. The user must transact on Polymarket once to deploy their wallet.
  </Step>
</Steps>

## Transaction transport per kind

The resolved kind also decides how you submit deposits and withdrawals. Both kinds support deposit and withdraw, only the transport and the available deposit flow differ.

| Kind              | Transport                                      | Deposit flow     | Withdraw  |
| ----------------- | ---------------------------------------------- | ---------------- | --------- |
| **Safe proxy**    | `Safe.execTransaction` (via Safe protocol-kit) | Pull **or** push | Supported |
| **DepositWallet** | Polymarket relayer `executeDepositWalletBatch` | **Push only**    | Supported |

<Warning>
  A DepositWallet can only push. The Polymarket relayer **blocks** `approve` (and `setApprovalForAll`), so the pull deposit path is impossible — you must use the single `ConditionalTokens.safeBatchTransferFrom` push into the vault. The Safe proxy has no such restriction and can do either. See [Deposits](/developers/deposits) for both flows.
</Warning>

Both transports accept the same shape of batched call (`{ to, value, data }`), so you can build the call list once and dispatch it through whichever transport the resolved kind requires.

<Note>
  **Robin does not sponsor gas**
</Note>

## Reference implementation

The runnable `resolveWallet()` and `executeViaWallet()` helpers live in `src/wallet.ts` of the `robin-markets-integration` example repo. They cover both kinds end to end — DepositWallet derivation, the deployment checks, the Safe protocol-kit path, and the relayer batch.

## Next steps

<CardGroup cols={2}>
  <Card title="Deposits" icon="arrow-down-to-bracket" href="/developers/deposits">
    Build pull and push deposits for the wallet kind you resolved.
  </Card>

  <Card title="Withdrawals" icon="arrow-up-from-bracket" href="/developers/withdrawals">
    Burn shares and reclaim outcome tokens plus organic yield.
  </Card>
</CardGroup>
