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

# Vault generation 2

> What the second generation of vaults and exchanges changes for API-key integrators, which vault and exchange each market uses, and how the rollout works.

PredictStreet deploys a second generation of contracts (vault factory,
vaults, binary and neg-risk exchanges) next to the existing one.
Generation 1 is not switched off. Every step on these pages works with
`X-Api-Key`, plus your wallet's EIP-712 signatures as today.

## What changes

| | Generation 1 | Generation 2 |
| - | - | - |
| Vault | Your current vault, deployed by `VaultFactory`, non-upgradeable | A new vault with the same owner, deployed by `VaultFactoryGen2` as a beacon proxy |
| Exchanges | `CTFExchange`, `NegRiskCtfExchange` | `CTFExchangeGen2`, `NegRiskCtfExchangeGen2` (new addresses) |
| Markets | Every market created before the switch | Canary markets first, then every new market |
| Order struct, domain `name` / `version` | `Order`, `PredictStreet` / `1` | Identical. Only `verifyingContract` differs |
| Vault EIP-712 domain | `PredictStreetVault` / `1`, `verifyingContract` = the vault | Identical, `verifyingContract` = the generation-2 vault |
| Withdrawal destination | Any address your [whitelist](https://docs.adipredictstreet.com/concepts/withdrawals/address-whitelist.md) allows | Restricted; see [Withdraw](https://docs.adipredictstreet.com/concepts/vault-gen2/vault-operations.md#withdraw) |
| Contract upgrades | None | Timelocked, publicly proposed on chain. See [Emergency exit and upgradeability](https://docs.adipredictstreet.com/concepts/vault-gen2/emergency-exit.md) |
| Emergency exit | Unchanged | Same calls; the final one needs a gas limit of at least \~0.67M |

## Two vaults

After the upgrade you hold two vaults, both listed in
`GET /api/me/vault` `vaults[]`:

| Vault | Role |
| - | - |
| Generation 2 | The active vault: deposits, on-ramp and bonuses go here. Maker of every order on a generation-2 market |
| Generation 1 | Keeps its USDC and positions, and keeps trading legacy markets until they resolve. Redeem, withdraw, split / merge on it by passing its address as `vault` |

## Which vault and exchange per market

| | Legacy (generation-1) market | Generation-2 market |
| - | - | - |
| Order `maker` (struct and body) | Generation-1 vault | Generation-2 vault |
| Order `signer` | Your wallet | Your wallet |
| `domain.verifyingContract` | Generation-1 exchange of the market's kind | Generation-2 exchange (`market.exchangeAddress`) |
| Vault for redeem, split / merge | Generation-1 vault | Generation-2 vault |

The active vault does not decide the maker. A generation-2 vault cannot
trade a legacy market, and the reverse. See
[Detect a market's generation](https://docs.adipredictstreet.com/concepts/vault-gen2/market-generation.md).

## Rollout

| Phase | What you see |
| - | - |
| Release | Nothing changes. `GET /api/platform/contracts` may already list the `*Gen2` addresses |
| Canary | Only allowlisted wallets can upgrade, move USDC and trade a few hidden canary markets. Others get `409 vault_upgrade_not_available` on upgrade and `400 market_not_tradeable` on a canary symbol |
| Rollout to all wallets | Every wallet may upgrade. New users get a generation-2 vault directly. Existing markets stay on generation 1 |
| New markets on generation 2 | Every new market is pinned to a generation-2 exchange. Legacy markets trade on generation 1 until they resolve |

Dates are announced to partners per environment. To join
the canary, ask your integration manager to allowlist your trading
wallets.

Nothing is migrated for you. Your vault, orders and positions stay as
they are until you call the upgrade, and moving USDC is a separate call.

## Migration order

**1. Make the bot generation-aware**

Choose maker and `verifyingContract` per market
([Detect a market's generation](https://docs.adipredictstreet.com/concepts/vault-gen2/market-generation.md)).
With one vault and only legacy markets this behaves exactly as today,
so it can ship before the rollout. Get a key with the new scopes
([API keys and WebSocket](https://docs.adipredictstreet.com/concepts/vault-gen2/api-keys-websocket.md)).

**2. Upgrade and fund the generation-2 vault**

[Upgrade](https://docs.adipredictstreet.com/concepts/vault-gen2/upgrade.md) when you want to quote
generation-2 markets, then
[move USDC](https://docs.adipredictstreet.com/concepts/vault-gen2/upgrade.md#move-usdc-from-the-generation-1-vault)
from the generation-1 vault.

**3. Run legacy markets from generation 1**

Keep quoting legacy markets from the generation-1 vault and redeem
there when they resolve
([Orders and vault operations](https://docs.adipredictstreet.com/concepts/vault-gen2/vault-operations.md)).

New refusal codes are listed under
[Error codes → Vault generation 2](https://docs.adipredictstreet.com/errors/codes.md#vault-generation-2).

## Canary and rollout

To join the canary, ask your integration manager to allowlist your
trading wallets.

> [!WARNING]
>
> Do not hard-code contract addresses. Read addresses from
> `GET /api/platform/contracts` at start-up and refresh them periodically,
> your vaults from `GET /api/me/vault`, and each market's
> exchange from `exchangeAddress`.

## FAQ

> [accordion] Can I go back to generation 1?
>
> No, the upgrade is one-way. The generation-1 vault keeps working for
> legacy markets, withdrawals, redeem and split / merge.

> [accordion] Does moving USDC count against deposit limits or need 2FA?
>
> No. It is a transfer between two vaults of the same owner.

> [accordion] Multi-wallet partner keys
>
> Multi-wallet partner keys: migration is enabled for your partner account by your integration manager once your payout addresses are listed for generation-2 withdrawals.


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