@whetstone-research/doppler-sdk 1.0.32 → 1.0.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +56 -17
- package/dist/evm/index.cjs +672 -175
- package/dist/evm/index.cjs.map +1 -1
- package/dist/evm/index.d.cts +272 -17
- package/dist/evm/index.d.ts +272 -17
- package/dist/evm/index.js +670 -176
- package/dist/evm/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -31,7 +31,11 @@ Use network-specific entrypoints:
|
|
|
31
31
|
|
|
32
32
|
```typescript
|
|
33
33
|
import { DopplerSDK } from '@whetstone-research/doppler-sdk/evm';
|
|
34
|
-
import {
|
|
34
|
+
import {
|
|
35
|
+
initializer,
|
|
36
|
+
cpmm,
|
|
37
|
+
cpmmMigrator,
|
|
38
|
+
} from '@whetstone-research/doppler-sdk/solana';
|
|
35
39
|
import { DopplerSolanaProvider } from '@whetstone-research/doppler-sdk/solana/react';
|
|
36
40
|
```
|
|
37
41
|
|
|
@@ -136,6 +140,7 @@ import { base } from 'viem/chains';
|
|
|
136
140
|
|
|
137
141
|
const params = new StaticAuctionBuilder(base.id)
|
|
138
142
|
.tokenConfig({
|
|
143
|
+
type: 'standard',
|
|
139
144
|
name: 'My Token',
|
|
140
145
|
symbol: 'MTK',
|
|
141
146
|
tokenURI: 'https://example.com/metadata.json',
|
|
@@ -179,7 +184,7 @@ console.log('Pool address:', result.poolAddress);
|
|
|
179
184
|
console.log('Token address:', result.tokenAddress);
|
|
180
185
|
```
|
|
181
186
|
|
|
182
|
-
|
|
187
|
+
Explicit `type: 'standard'` tokens with `cliffDuration > 0` or `allocations` use the legacy DERC20 V2 factory and expose schedule-aware reads via `sdk.getDerc20V2(tokenAddress)`. When `allocations` is provided, the SDK dedupes identical schedules internally and maps each recipient to the correct onchain schedule.
|
|
183
188
|
|
|
184
189
|
For a runnable example, see [examples/multicurve-per-beneficiary-vesting.ts](./examples/multicurve-per-beneficiary-vesting.ts).
|
|
185
190
|
|
|
@@ -316,6 +321,7 @@ console.log('Token address:', result.tokenAddress);
|
|
|
316
321
|
### Opening Auction (Lifecycle + Bid Management)
|
|
317
322
|
|
|
318
323
|
Support includes:
|
|
324
|
+
|
|
319
325
|
- `sdk.buildOpeningAuction()` for `CreateOpeningAuctionParams`
|
|
320
326
|
- `sdk.factory.simulateCreateOpeningAuction(params)` and `sdk.factory.createOpeningAuction(params)`
|
|
321
327
|
- `sdk.getOpeningAuction(hookAddress)` for hook reads + `settleAuction()` / `claimIncentives()`
|
|
@@ -359,21 +365,21 @@ const params = sdk
|
|
|
359
365
|
.withMigration({ type: 'uniswapV4', fee: 3000, tickSpacing: 60 })
|
|
360
366
|
.withUserAddress('0x...')
|
|
361
367
|
.withOpeningAuctionInitializer('0x...') // required on Base until deployed
|
|
362
|
-
.build()
|
|
368
|
+
.build();
|
|
363
369
|
|
|
364
|
-
const sim = await sdk.factory.simulateCreateOpeningAuction(params)
|
|
365
|
-
const created = await sim.execute()
|
|
370
|
+
const sim = await sdk.factory.simulateCreateOpeningAuction(params);
|
|
371
|
+
const created = await sim.execute();
|
|
366
372
|
|
|
367
|
-
const opening = await sdk.getOpeningAuction(created.openingAuctionHookAddress)
|
|
368
|
-
await opening.getPhase()
|
|
373
|
+
const opening = await sdk.getOpeningAuction(created.openingAuctionHookAddress);
|
|
374
|
+
await opening.getPhase();
|
|
369
375
|
|
|
370
|
-
const lifecycle = await sdk.getOpeningAuctionLifecycle('0x...')
|
|
371
|
-
await lifecycle.getState(created.tokenAddress)
|
|
376
|
+
const lifecycle = await sdk.getOpeningAuctionLifecycle('0x...');
|
|
377
|
+
await lifecycle.getState(created.tokenAddress);
|
|
372
378
|
|
|
373
379
|
await sdk.factory.completeOpeningAuction({
|
|
374
380
|
asset: created.tokenAddress,
|
|
375
381
|
initializerAddress: '0x...',
|
|
376
|
-
})
|
|
382
|
+
});
|
|
377
383
|
```
|
|
378
384
|
|
|
379
385
|
`completeOpeningAuction` auto-settles and auto-mines `dopplerSalt` when omitted; because completion mining can race with block timestamps/state changes, the SDK may re-mine and retry a few times if needed. `simulateCompleteOpeningAuction` requires the opening auction to already be settled.
|
|
@@ -384,9 +390,9 @@ See [examples/opening-auction-lifecycle.ts](./examples/opening-auction-lifecycle
|
|
|
384
390
|
|
|
385
391
|
### Multicurve Auction (V4 Multicurve Initializer)
|
|
386
392
|
|
|
387
|
-
Multicurve auctions use
|
|
393
|
+
Multicurve auctions use `DopplerHookInitializer` by default to seed liquidity across multiple curves in a single Uniswap V4 pool. The typed initializer modes are `dopplerHookInitializer`, `standard`, `scheduled`, `decay`, and `rehype`; use `withV4MulticurveInitializer(address)` when explicitly targeting the legacy standard initializer.
|
|
388
394
|
|
|
389
|
-
**
|
|
395
|
+
**Multicurve with Migration:**
|
|
390
396
|
|
|
391
397
|
```typescript
|
|
392
398
|
import { MulticurveBuilder } from '@whetstone-research/doppler-sdk/evm';
|
|
@@ -433,10 +439,38 @@ console.log('Pool address:', result.poolAddress);
|
|
|
433
439
|
console.log('Token address:', result.tokenAddress);
|
|
434
440
|
```
|
|
435
441
|
|
|
442
|
+
**Deterministic preview/create identities:**
|
|
443
|
+
|
|
444
|
+
By default, each independent multicurve assembly generates a new salt and may
|
|
445
|
+
predict a different token and pool identity. Supply an explicit 32-byte salt
|
|
446
|
+
when separate preview and create operations must assemble the same
|
|
447
|
+
`CreateParams`:
|
|
448
|
+
|
|
449
|
+
```typescript
|
|
450
|
+
import type { Hex } from 'viem';
|
|
451
|
+
|
|
452
|
+
const salt =
|
|
453
|
+
'0x1111111111111111111111111111111111111111111111111111111111111111' satisfies Hex;
|
|
454
|
+
|
|
455
|
+
const deterministicParams = { ...params, salt };
|
|
456
|
+
const preview =
|
|
457
|
+
await sdk.factory.simulateCreateMulticurve(deterministicParams);
|
|
458
|
+
```
|
|
459
|
+
|
|
460
|
+
Persist and reuse the salt with otherwise identical inputs for a later
|
|
461
|
+
independent create operation. Builder users can call `.withSalt(salt)` before
|
|
462
|
+
`.build()`. Omitting the salt, or clearing it with `.withSalt(undefined)`,
|
|
463
|
+
preserves the generated-salt behavior. Explicit salts must be `0x` followed by
|
|
464
|
+
exactly 64 hexadecimal characters.
|
|
465
|
+
|
|
466
|
+
|
|
436
467
|
**Market Cap Presets (Low / Medium / High):**
|
|
437
468
|
|
|
438
469
|
```typescript
|
|
439
|
-
import {
|
|
470
|
+
import {
|
|
471
|
+
MulticurveBuilder,
|
|
472
|
+
FEE_TIERS,
|
|
473
|
+
} from '@whetstone-research/doppler-sdk/evm';
|
|
440
474
|
import { parseEther } from 'viem';
|
|
441
475
|
import { base } from 'viem/chains';
|
|
442
476
|
|
|
@@ -942,7 +976,7 @@ For a runnable release-focused example covering legacy DERC20, DERC20 V2 schedul
|
|
|
942
976
|
|
|
943
977
|
### DopplerERC20V1 Tokens
|
|
944
978
|
|
|
945
|
-
|
|
979
|
+
DopplerERC20V1 is the default token template when `type` is omitted. Set `type: 'dopplerERC20V1'` to make that choice explicit, or set `type: 'standard'` to use the legacy token path, where cliff/allocation vesting routes to the legacy DERC20 template. The SDK uses the configured `dopplerERC20V1Factory` by default; `withTokenFactory(address)` takes precedence but must point to a factory compatible with the selected token path and token data ABI. `controller` is optional and defaults to the zero address, so set it only if early balance-limit disable should be possible.
|
|
946
980
|
|
|
947
981
|
When balance limiting is enabled on the default DopplerERC20V1 integration, the SDK encodes user exclusions plus determinable protocol recipients for the selected auction path into deployment-time `excludedFromBalanceLimit`, including initializers, hooks, PoolManager, migrators, known migration pools, no-op governance, launchpad governance multisigs, and standard GovernanceFactory timelocks for `default` or `custom` governance. Custom `withTokenFactory(address)` paths receive only the `excludedFromBalanceLimit` entries supplied in `tokenConfig`, so custom token factory users must provide any required deployment-time exclusions themselves. Custom `withGovernanceFactory(address)` paths skip standard-governance timelock auto-exclusion, so custom governance factory users must provide any required timelock exclusions themselves. Exclusions cannot be added later through the controller or governance.
|
|
948
982
|
|
|
@@ -1321,7 +1355,7 @@ const params = sdk
|
|
|
1321
1355
|
tickSpacing: 10,
|
|
1322
1356
|
})
|
|
1323
1357
|
.withMigration({
|
|
1324
|
-
type: '
|
|
1358
|
+
type: 'dopplerHookMigrator',
|
|
1325
1359
|
fee: 3000,
|
|
1326
1360
|
tickSpacing: 10,
|
|
1327
1361
|
lockDuration: 30 * 24 * 60 * 60,
|
|
@@ -1349,14 +1383,19 @@ const params = sdk
|
|
|
1349
1383
|
.build();
|
|
1350
1384
|
```
|
|
1351
1385
|
|
|
1352
|
-
Note: `
|
|
1386
|
+
Note: `dopplerHookMigrator` beneficiaries must include the current Airlock owner
|
|
1353
1387
|
with at least 5% shares, and total shares must sum to `1e18`.
|
|
1354
1388
|
Unlike initializer-side Rehype pools, migrator-side Rehype uses a static
|
|
1355
1389
|
`customFee`; there is no fee decay schedule in this mode.
|
|
1390
|
+
For backwards compatibility, the deprecated `DopplerHookMigrationConfig` type
|
|
1391
|
+
and its `type: 'dopplerHook'` discriminator remain accepted. New code should use
|
|
1392
|
+
`DopplerHookMigratorConfig` with `type: 'dopplerHookMigrator'`. Multicurve
|
|
1393
|
+
initializer params similarly accept the deprecated `type: 'dopplerHook'`
|
|
1394
|
+
discriminator, which resolves to `dopplerHookInitializer`.
|
|
1356
1395
|
|
|
1357
1396
|
```typescript
|
|
1358
1397
|
migration: {
|
|
1359
|
-
type: '
|
|
1398
|
+
type: 'dopplerHookMigrator',
|
|
1360
1399
|
fee: 3000,
|
|
1361
1400
|
useDynamicFee: false,
|
|
1362
1401
|
tickSpacing: 10,
|