Skip to content
This repository was archived by the owner on Feb 25, 2026. It is now read-only.

Commit 1aa6a0a

Browse files
authored
Merge pull request #148 from whetstoneresearch/chore/generic-migration-pool
Generic migration pools
2 parents 5dea878 + 3bd1a8e commit 1aa6a0a

File tree

15 files changed

+249
-219
lines changed

15 files changed

+249
-219
lines changed

packages/doppler-v3-indexer/.env.local.example

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,9 @@ PONDER_RPC_URL_57073=https://rpc-gel.inkonchain.com
2727

2828
# Example with Alchemy:
2929
# PONDER_RPC_URL_1=https://eth-mainnet.g.alchemy.com/v2/YOUR_API_KEY
30-
# PONDER_RPC_URL_8453=https://base-mainnet.g.alchemy.com/v2/YOUR_API_KEY
30+
# PONDER_RPC_URL_8453=https://base-mainnet.g.alchemy.com/v2/YOUR_API_KEY
31+
32+
# Set the NODE_ENV=local
33+
NODE_ENV=local
34+
# Set ENABLE_IMAGE_FETCHING=false
35+
ENABLE_IMAGE_FETCHING=false
Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
11
# Doppler V3 Indexer — Configs & Usage
22

3+
## Multicurve Quickstart
4+
5+
- Prereqs: Bun installed and Postgres reachable; copy `.env.local.example` to `.env.local` and set required RPC URLs and DB connection.
6+
- Dev run: `bun run dev --config ./ponder.config.multicurve.ts`
7+
- Prod run: `bun run start --config ./ponder.config.multicurve.ts`
8+
9+
This uses the `ponder.config.multicurve.ts` file to index the Multicurve setup. Logs will show chains and contracts being synced according to that config.
10+
311
This package ships with multiple Ponder configs so you can index different networks or a Zora‑only subset. You can select a config at runtime via `--config` when using `ponder dev` or `ponder start`.
412

513
## Configs
614

715
- `ponder.config.ts`: Multichain (Base, Unichain, Ink) + Zora listeners on Base.
816
- `ponder.config.multichain.ts`: Multichain (same scope as above).
9-
- `ponder.config.zora.ts`: Zora‑only on Base (limits chains/contracts to Zora needs).
17+
- `ponder.config.multicurve.ts`: Multicurve indexing setup.
18+
- `ponder.confg.zora.ts`: Zora‑only on Base (limits chains/contracts to Zora needs).
1019

1120
## Run
1221

@@ -20,23 +29,10 @@ Swap the config path to target a different setup, for example:
2029
- Multichain: `ponder dev --config ./ponder.config.multichain.ts`
2130
- Zora‑only: `ponder dev --config ./ponder.config.zora.ts`
2231

23-
## Block Handlers
24-
25-
If you choose a config that does not enable certain chains/blocks, you may need to comment out the corresponding block handlers to avoid registering unused listeners.
26-
27-
- Location: `src/indexer/blockHandlers.ts`
28-
- Handlers defined:
29-
- `BaseChainlinkEthPriceFeed`
30-
- `UnichainChainlinkEthPriceFeed`
31-
- `InkChainlinkEthPriceFeed`
32-
- `ZoraUsdcPrice`
33-
34-
Comment out the `ponder.on("…:block", …)` sections for any chains you are not indexing with your chosen config. For example, when using `ponder.config.zora.ts` you can comment out `UnichainChainlinkEthPriceFeed` and `InkChainlinkEthPriceFeed` handlers.
35-
3632
## Notes
3733

3834
- RPC env vars live in `.env.local` (see `.env.local.example`). Common ones:
3935
- Base: `PONDER_RPC_URL_8453`
4036
- Unichain: `PONDER_RPC_URL_130`
4137
- Ink: `PONDER_RPC_URL_57073`
42-
- The database connection defaults to Postgres at `postgresql://postgres:postgres@localhost:5432/default` (see `docker-compose.yml`).
38+
- The database connection defaults to Postgres at `postgresql://postgres:postgres@localhost:5432/default` (see `docker-compose.yml`).

packages/doppler-v3-indexer/ponder.config.testnet.ts

Lines changed: 17 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { createConfig, factory } from "ponder";
1+
import { createConfig, factory, mergeAbis } from "ponder";
22
import { getAbiItem, http } from "viem";
33
import {
44
UniswapV3InitializerABI,
@@ -86,6 +86,22 @@ export default createConfig({
8686
},
8787
},
8888
},
89+
MigrationPool: {
90+
abi: mergeAbis([UniswapV3PoolABI, UniswapV2PairABI]),
91+
chain: {
92+
baseSepolia: {
93+
startBlock: baseSepolia.startBlock,
94+
address: factory({
95+
address: baseSepolia.addresses.shared.airlock,
96+
event: getAbiItem({
97+
abi: AirlockABI,
98+
name: "Migrate",
99+
}),
100+
parameter: "pool",
101+
}),
102+
},
103+
},
104+
},
89105
UniswapV3Initializer: {
90106
abi: UniswapV3InitializerABI,
91107
chain: {
@@ -117,19 +133,6 @@ export default createConfig({
117133
},
118134
},
119135
},
120-
UniswapV3MigrationPool: {
121-
abi: UniswapV3PoolABI,
122-
chain: {
123-
baseSepolia: {
124-
startBlock: baseSepolia.startBlock, // hardcoded for now
125-
address: factory({
126-
address: baseSepolia.addresses.v3.v3Migrator,
127-
event: getAbiItem({ abi: UniswapV3MigratorAbi, name: "Migrate" }),
128-
parameter: "pool",
129-
}),
130-
},
131-
},
132-
},
133136
UniswapV3Migrator: {
134137
abi: UniswapV3MigratorAbi,
135138
chain: {
@@ -168,22 +171,6 @@ export default createConfig({
168171
},
169172
},
170173
},
171-
UniswapV2Pair: {
172-
abi: UniswapV2PairABI,
173-
chain: {
174-
baseSepolia: {
175-
startBlock: baseSepolia.startBlock,
176-
address: factory({
177-
address: baseSepolia.addresses.shared.airlock,
178-
event: getAbiItem({
179-
abi: AirlockABI,
180-
name: "Migrate",
181-
}),
182-
parameter: "pool",
183-
}),
184-
},
185-
},
186-
},
187174
UniswapV2PairUnichain: {
188175
abi: UniswapV2PairABI,
189176
chain: {},

packages/doppler-v3-indexer/ponder.config.ts

Lines changed: 34 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { createConfig, factory } from "ponder";
1+
import { createConfig, factory, mergeAbis } from "ponder";
22
import { getAbiItem, http } from "viem";
33
import {
44
UniswapV3InitializerABI,
@@ -40,7 +40,7 @@ export default createConfig({
4040
},
4141
ink: {
4242
id: CHAIN_IDS.ink,
43-
rpc: http(process.env.PONDER_RPC_URL_130),
43+
rpc: http(process.env.PONDER_RPC_URL_57073),
4444
},
4545
base: {
4646
id: CHAIN_IDS.base,
@@ -96,6 +96,38 @@ export default createConfig({
9696
},
9797
},
9898
},
99+
MigrationPool: {
100+
abi: mergeAbis([UniswapV3PoolABI, UniswapV2PairABI]),
101+
chain: {
102+
base: {
103+
startBlock: base.startBlock,
104+
address: factory({
105+
address: base.addresses.shared.airlock,
106+
event: getAbiItem({
107+
abi: AirlockABI,
108+
name: "Migrate",
109+
}),
110+
parameter: "pool",
111+
}),
112+
},
113+
unichain: {
114+
startBlock: unichain.startBlock,
115+
address: factory({
116+
address: unichain.addresses.shared.airlock,
117+
event: getAbiItem({ abi: AirlockABI, name: "Migrate" }),
118+
parameter: "pool",
119+
}),
120+
},
121+
ink: {
122+
startBlock: ink.startBlock,
123+
address: factory({
124+
address: ink.addresses.shared.airlock,
125+
event: getAbiItem({ abi: AirlockABI, name: "Migrate" }),
126+
parameter: "pool",
127+
}),
128+
},
129+
},
130+
},
99131
UniswapV3Initializer: {
100132
abi: UniswapV3InitializerABI,
101133
chain: {
@@ -159,19 +191,6 @@ export default createConfig({
159191
},
160192
},
161193
},
162-
UniswapV3MigrationPool: {
163-
abi: UniswapV3PoolABI,
164-
chain: {
165-
base: {
166-
startBlock: base.startBlock, // hardcoded for now
167-
address: factory({
168-
address: base.addresses.v3.v3Migrator,
169-
event: getAbiItem({ abi: UniswapV3MigratorAbi, name: "Migrate" }),
170-
parameter: "pool",
171-
}),
172-
},
173-
},
174-
},
175194
UniswapV3Migrator: {
176195
abi: UniswapV3MigratorAbi,
177196
chain: {
@@ -226,33 +245,6 @@ export default createConfig({
226245
},
227246
},
228247
},
229-
UniswapV2Pair: {
230-
abi: UniswapV2PairABI,
231-
chain: {
232-
base: {
233-
startBlock: base.startBlock,
234-
address: factory({
235-
address: base.addresses.shared.airlock,
236-
event: getAbiItem({
237-
abi: AirlockABI,
238-
name: "Migrate",
239-
}),
240-
parameter: "pool",
241-
}),
242-
},
243-
ink: {
244-
startBlock: ink.startBlock,
245-
address: factory({
246-
address: ink.addresses.shared.airlock,
247-
event: getAbiItem({
248-
abi: AirlockABI,
249-
name: "Migrate",
250-
}),
251-
parameter: "pool",
252-
}),
253-
},
254-
},
255-
},
256248
UniswapV2PairUnichain: {
257249
abi: UniswapV2PairABI,
258250
chain: {

packages/doppler-v3-indexer/ponder.schema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,10 +284,10 @@ export const pool = onchainTable(
284284
migratedToPool: t.hex(),
285285
migratedToV4PoolId: t.hex(), // For V4 migrations, stores the 32-byte pool ID
286286
migratedFromPool: t.hex(),
287+
migrationType: t.text().notNull().default("unknown"),
287288
isQuoteEth: t.boolean().notNull().default(false),
288289
isQuoteZora: t.boolean().notNull().default(false),
289290
isStreaming: t.boolean().notNull().default(false),
290-
migrationType: t.text().notNull().default("v2"),
291291
isContentCoin: t.boolean().notNull().default(false),
292292
isCreatorCoin: t.boolean().notNull().default(false),
293293
poolKey: t.jsonb().notNull().default("{}"),

packages/doppler-v3-indexer/src/config/chains/base.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,15 @@ export const baseSepoliaConfig: ChainConfig = {
1919
addresses: {
2020
v2: {
2121
factory: "0x7Ae58f10f7849cA6F5fB71b7f45CB416c9204b1e" as Address,
22-
v2Migrator: "0xb2ec6559704467306d04322a5dc082b2af4562dd" as Address,
22+
v2Migrator: "0x04a898f3722c38f9def707bd17dc78920efa977c" as Address,
23+
nimCustomV2Migrator: COMMON_ADDRESSES.ZERO_ADDRESS as Address,
2324
},
2425
v3: {
2526
v3Initializer: "0x4c3062b9ccfdbcb10353f57c1b59a29d4c5cfa47" as Address,
2627
lockableV3Initializer:
2728
"0x1fb8a108ff5c16213ebe3456314858d6b069a23b" as Address,
2829
v3Migrator: "0x0A3d3678b31cfF5F926c2A0384E742E4747605A0" as Address,
30+
nimCustomV3Migrator: COMMON_ADDRESSES.ZERO_ADDRESS as Address,
2931
},
3032
zora: {
3133
zoraFactory: COMMON_ADDRESSES.ZERO_ADDRESS,
@@ -77,12 +79,14 @@ export const baseConfig: ChainConfig = {
7779
v2: {
7880
factory: "0x8909Dc15e40173Ff4699343b6eB8132c65e18eC6" as Address,
7981
v2Migrator: "0x5F3bA43D44375286296Cb85F1EA2EBfa25dde731" as Address,
82+
nimCustomV2Migrator: "0xf76b53f9bc94f531add7b980f119cf386ebf0cb8" as Address,
8083
},
8184
v3: {
8285
v3Initializer: "0xaA47D2977d622DBdFD33eeF6a8276727c52EB4e5" as Address,
8386
lockableV3Initializer:
8487
"0xE0dC4012AC9C868F09c6e4b20d66ED46D6F258d0" as Address,
8588
v3Migrator: "0x9C18A677902d2068be71e1A6bb11051fb69C74d5" as Address,
89+
nimCustomV3Migrator: "0x4fb11B8B6aa5B0861A39F6127aE3f91F0763C03e" as Address,
8690
},
8791
v4: {
8892
poolManager: "0x498581ff718922c3f8e6a244956af099b2652b2b" as Address,

packages/doppler-v3-indexer/src/config/chains/unichain.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,13 @@ export const unichainConfig: ChainConfig = {
2020
v2: {
2121
factory: "0x1f98400000000000000000000000000000000002" as Address,
2222
v2Migrator: "0xf6023127f6E937091D5B605680056A6D27524bad" as Address,
23+
nimCustomV2Migrator: COMMON_ADDRESSES.ZERO_ADDRESS,
2324
},
2425
v3: {
2526
v3Initializer: "0x9F4e56be80f08ba1A2445645EFa6d231E27b43ec" as Address,
2627
lockableV3Initializer: COMMON_ADDRESSES.ZERO_ADDRESS as Address,
2728
v3Migrator: COMMON_ADDRESSES.ZERO_ADDRESS,
29+
nimCustomV3Migrator: COMMON_ADDRESSES.ZERO_ADDRESS,
2830
},
2931
v4: {
3032
poolManager: "0x1F98400000000000000000000000000000000004" as Address,

0 commit comments

Comments
 (0)