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

# V3 Scripts

> create-v3-pools, seed-v3-liquidity.

## `create-v3-pools`

Creates `Pool<YES, DUSDC>` + `Pool<NO, DUSDC>` on DeepBook V3 via `create_permissionless_pool` (**500 DEEP fee each**). Writes pool ids back into `registry.json`. Skips legs whose pool already exists.

```bash theme={"system"}
pnpm tsx scripts/create-v3-pools.ts --slug btc_80k_eoy --execute
```

**Flags**

| Flag          | Required | Description                     |
| ------------- | -------- | ------------------------------- |
| `--slug`      | yes      | Market slug from registry       |
| `--tick-size` | no       | V3 tick size (default: 1\_000)  |
| `--lot-size`  | no       | V3 lot size (default: 100\_000) |
| `--execute`   | no       | Sign + submit                   |

The script auto-buys DEEP with SUI when the book can fill, else exits with the exact ask.

<Note>
  **Testnet DEEP** had been blocked until 2026-06-11. The DeepBook team granted 1000 DEEP + 200 DUSDC and pool creation worked exactly as designed. The full 1000 DEEP was consumed as the 2×500 creation fees (tx `3Bq5VDoacnmgdHU6WfHaMVxkwC7LD5U86MUYFxetYm6W`).
</Note>

## `seed-v3-liquidity`

Bootstraps a two-sided book on both pools in one PTB:

1. Mint YES + NO pairs from wallet DUSDC (5% fee headroom).
2. Deposit tokens + bid funds into a BalanceManager (created + shared in-PTB, or reused via `--bm`).
3. POST\_ONLY bid/ask per pool with `pay_with_deep=false` (input-token fees).

```bash theme={"system"}
pnpm tsx scripts/seed-v3-liquidity.ts \
  --slug btc_80k_eoy \
  --qty 50 \
  --bid 0.45 \
  --ask 0.55 \
  --execute
```

**Flags**

| Flag        | Required | Description                                |
| ----------- | -------- | ------------------------------------------ |
| `--slug`    | yes      | Market slug from registry                  |
| `--qty`     | no       | Per-side quantity (default: 50)            |
| `--bid`     | no       | Bid price (default: 0.45)                  |
| `--ask`     | no       | Ask price (default: 0.55)                  |
| `--bm`      | no       | Reuse an existing seeder BalanceManager id |
| `--execute` | no       | Sign + submit                              |

Exits 3 with DEEP guidance until `create-v3-pools` has run.

The seeder BalanceManager id (printed at first run) gets reused via `--bm` to top up or re-quote without re-creating.
