@whetstone-research/doppler-sdk 1.0.20 → 1.0.22
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 +27 -17
- package/dist/evm/index.cjs +426 -195
- package/dist/evm/index.cjs.map +1 -1
- package/dist/evm/index.d.cts +118 -11
- package/dist/evm/index.d.ts +118 -11
- package/dist/evm/index.js +427 -197
- package/dist/evm/index.js.map +1 -1
- package/dist/solana/index.cjs +38 -8
- package/dist/solana/index.cjs.map +1 -1
- package/dist/solana/index.d.cts +36 -7
- package/dist/solana/index.d.ts +36 -7
- package/dist/solana/index.js +39 -9
- package/dist/solana/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,6 +10,7 @@ The Doppler SDK exposes network-specific entrypoints for creating, managing, and
|
|
|
10
10
|
|
|
11
11
|
- **EVM Auctions**: Static auctions, dynamic auctions, and multicurve launches across Uniswap V3/V4 paths
|
|
12
12
|
- **EVM Migration Paths**: Support for V2, V2 split, V4, V4 split, DopplerHook, and no-op migration
|
|
13
|
+
- **EVM Multicurve Fees**: Pending-fee previews and beneficiary fee claiming for locked multicurve pools
|
|
13
14
|
- **Solana Launches**: Initializer, CPMM, migrator, hook, oracle, and Token-2022-compatible instruction helpers
|
|
14
15
|
- **Solana Clients and React**: Read clients, PDA helpers, generated codecs, and optional React bindings
|
|
15
16
|
- **Token Management**: Built-in EVM support for DERC20 tokens with vesting
|
|
@@ -603,8 +604,9 @@ const result = await sdk.factory.createMulticurve(params);
|
|
|
603
604
|
const assetAddress = result.tokenAddress; // SAVE THIS - you'll need it to collect fees!
|
|
604
605
|
console.log('Asset address:', assetAddress);
|
|
605
606
|
|
|
606
|
-
// Later, to
|
|
607
|
+
// Later, to preview and claim fees while the pool is locked:
|
|
607
608
|
// const pool = await sdk.getMulticurvePool(assetAddress)
|
|
609
|
+
// const pending = await pool.getPendingFees('0xBeneficiary...')
|
|
608
610
|
// await pool.collectFees()
|
|
609
611
|
```
|
|
610
612
|
|
|
@@ -612,12 +614,14 @@ console.log('Asset address:', assetAddress);
|
|
|
612
614
|
|
|
613
615
|
- Set `fee` > 0 (e.g., 3000 for 0.3%) to accumulate trading fees for beneficiaries
|
|
614
616
|
- **Save the asset address** (token address) returned from creation - you need it to collect fees later
|
|
615
|
-
-
|
|
617
|
+
- Use `getPendingFees(beneficiary)` to preview a beneficiary's claimable token0/token1 fees
|
|
618
|
+
- `collectFees()` claims a payout for the calling account only when the caller is a configured beneficiary
|
|
616
619
|
- Pool enters "Locked" status (status = 2) and liquidity cannot be migrated
|
|
617
620
|
- Beneficiaries are immutable and set at pool creation time
|
|
618
621
|
- The SDK automatically handles PoolKey construction and PoolId computation for you
|
|
619
622
|
|
|
620
623
|
See [examples/multicurve-lockable-beneficiaries.ts](./examples/multicurve-lockable-beneficiaries.ts) for a complete example.
|
|
624
|
+
See [docs/multicurve-fees.md](./docs/multicurve-fees.md) for pending-fee previews, claiming, and current migrated-launch limitations.
|
|
621
625
|
|
|
622
626
|
#### Transaction gas override
|
|
623
627
|
|
|
@@ -773,7 +777,8 @@ const currentEpoch = await auction.getCurrentEpoch();
|
|
|
773
777
|
|
|
774
778
|
### Multicurve Pool Interactions
|
|
775
779
|
|
|
776
|
-
Multicurve pools support fee collection and
|
|
780
|
+
Multicurve pools support fee collection and beneficiary claims when configured
|
|
781
|
+
with `pool.beneficiaries` and no-op migration.
|
|
777
782
|
|
|
778
783
|
```typescript
|
|
779
784
|
// Get a multicurve pool instance using the asset address (token address)
|
|
@@ -795,15 +800,21 @@ if (feeSchedule) {
|
|
|
795
800
|
console.log('Fee schedule:', feeSchedule);
|
|
796
801
|
}
|
|
797
802
|
|
|
798
|
-
//
|
|
799
|
-
|
|
803
|
+
// Preview pending fees for a beneficiary. This is a read-only call.
|
|
804
|
+
const pendingFees = await pool.getPendingFees(beneficiaryAddress);
|
|
805
|
+
console.log('Pending fees (token0):', pendingFees.fees0);
|
|
806
|
+
console.log('Pending fees (token1):', pendingFees.fees1);
|
|
807
|
+
|
|
808
|
+
// Claim fees from a beneficiary wallet while the pool is locked.
|
|
809
|
+
// Any account can call collectFees(), but only a configured beneficiary caller
|
|
810
|
+
// receives their pending share.
|
|
800
811
|
const { fees0, fees1, transactionHash } = await pool.collectFees();
|
|
801
812
|
console.log('Fees collected (token0):', fees0);
|
|
802
813
|
console.log('Fees collected (token1):', fees1);
|
|
803
814
|
console.log('Transaction:', transactionHash);
|
|
804
815
|
|
|
805
816
|
// Get token addresses
|
|
806
|
-
const tokenAddress =
|
|
817
|
+
const tokenAddress = pool.getTokenAddress();
|
|
807
818
|
const numeraireAddress = await pool.getNumeraireAddress();
|
|
808
819
|
```
|
|
809
820
|
|
|
@@ -812,22 +823,21 @@ const numeraireAddress = await pool.getNumeraireAddress();
|
|
|
812
823
|
The SDK handles the complexity of fee collection by:
|
|
813
824
|
|
|
814
825
|
1. **Retrieving pool configuration** from the multicurve initializer contract
|
|
815
|
-
2. **Detecting
|
|
816
|
-
address via the multicurve migrator (no manual lookup required)
|
|
826
|
+
2. **Detecting pool status** so only locked initializer-side pools proceed
|
|
817
827
|
3. **Computing the PoolId** from the PoolKey using `keccak256(abi.encode(poolKey))`
|
|
818
|
-
4. **
|
|
819
|
-
5. **
|
|
828
|
+
4. **Previewing pending fees** with a Multicall3 aggregate that simulates collection and reads beneficiary share/checkpoint data
|
|
829
|
+
5. **Calling the initializer** with the computed PoolId when a beneficiary claims via `collectFees()`
|
|
820
830
|
|
|
821
831
|
**Important Notes:**
|
|
822
832
|
|
|
823
833
|
- Fees accumulate from swap activity on the pool (only if fee tier > 0)
|
|
824
|
-
-
|
|
825
|
-
-
|
|
826
|
-
-
|
|
827
|
-
-
|
|
834
|
+
- `getPendingFees(beneficiary)` returns the beneficiary's pending share for both tokens in the pair
|
|
835
|
+
- `collectFees()` sends a transaction; the caller needs a wallet client
|
|
836
|
+
- Anyone can call `collectFees()`, but only a configured beneficiary caller receives their pending share
|
|
837
|
+
- The `collectFees()` return values are the newly collected pool fees, not necessarily the caller's beneficiary payout
|
|
838
|
+
- Works exclusively with initializer-side locked pools created with `pool.beneficiaries` and no-op migration
|
|
828
839
|
- Pools in "Locked" status (status = 2) use the multicurve initializer for collection
|
|
829
|
-
- Pools in "Exited" status (status = 3)
|
|
830
|
-
resolves the locker address and stream data for you
|
|
840
|
+
- Pools in "Exited" status (status = 3) are migrated and are not currently supported by `MulticurvePool.getPendingFees()` or `MulticurvePool.collectFees()`
|
|
831
841
|
- `getFeeSchedule()` returns decay schedule details only for dynamic-fee multicurve pools, otherwise `null`
|
|
832
842
|
- Beneficiaries must be configured at pool creation time and cannot be changed
|
|
833
843
|
|
|
@@ -838,7 +848,7 @@ The SDK handles the complexity of fee collection by:
|
|
|
838
848
|
- Allow any beneficiary to trigger collection after significant trading activity
|
|
839
849
|
- Monitor swap events to determine optimal collection timing
|
|
840
850
|
|
|
841
|
-
See [examples/multicurve-collect-fees.ts](./examples/multicurve-collect-fees.ts) for a complete example.
|
|
851
|
+
See [docs/multicurve-fees.md](./docs/multicurve-fees.md) for a focused guide and [examples/multicurve-collect-fees.ts](./examples/multicurve-collect-fees.ts) for a complete example.
|
|
842
852
|
|
|
843
853
|
## Token Management
|
|
844
854
|
|