@whetstone-research/doppler-sdk 1.0.22 → 1.0.24
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 +33 -6
- package/dist/evm/index.cjs +395 -140
- package/dist/evm/index.cjs.map +1 -1
- package/dist/evm/index.d.cts +18 -1
- package/dist/evm/index.d.ts +18 -1
- package/dist/evm/index.js +396 -142
- package/dist/evm/index.js.map +1 -1
- package/dist/solana/index.cjs +0 -2
- package/dist/solana/index.cjs.map +1 -1
- package/dist/solana/index.d.cts +0 -1
- package/dist/solana/index.d.ts +0 -1
- package/dist/solana/index.js +0 -2
- package/dist/solana/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,7 +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**:
|
|
13
|
+
- **EVM Multicurve Fees**: Single-token and batched pending-fee previews plus beneficiary fee claiming for locked multicurve pools
|
|
14
14
|
- **Solana Launches**: Initializer, CPMM, migrator, hook, oracle, and Token-2022-compatible instruction helpers
|
|
15
15
|
- **Solana Clients and React**: Read clients, PDA helpers, generated codecs, and optional React bindings
|
|
16
16
|
- **Token Management**: Built-in EVM support for DERC20 tokens with vesting
|
|
@@ -555,7 +555,7 @@ For decay pools, `pool.fee` is always the terminal fee (`endFee`) of the schedul
|
|
|
555
555
|
When you want fee revenue to flow to specific addresses without migrating liquidity after the auction, use lockable beneficiaries with NoOp migration:
|
|
556
556
|
|
|
557
557
|
```typescript
|
|
558
|
-
import { WAD } from '@whetstone-research/doppler-sdk/evm';
|
|
558
|
+
import { MulticurveFees, WAD } from '@whetstone-research/doppler-sdk/evm';
|
|
559
559
|
|
|
560
560
|
// Define beneficiaries with shares that sum to WAD (1e18 = 100%)
|
|
561
561
|
// IMPORTANT: Protocol owner must be included with at least 5% shares
|
|
@@ -608,20 +608,26 @@ console.log('Asset address:', assetAddress);
|
|
|
608
608
|
// const pool = await sdk.getMulticurvePool(assetAddress)
|
|
609
609
|
// const pending = await pool.getPendingFees('0xBeneficiary...')
|
|
610
610
|
// await pool.collectFees()
|
|
611
|
+
//
|
|
612
|
+
// To preview many locked multicurve tokens at once:
|
|
613
|
+
// const fees = new MulticurveFees(publicClient, walletClient, tokenAddresses)
|
|
614
|
+
// const pendingByToken = await fees.getPendingFees('0xBeneficiary...')
|
|
611
615
|
```
|
|
612
616
|
|
|
613
617
|
**Important Notes:**
|
|
614
618
|
|
|
615
619
|
- Set `fee` > 0 (e.g., 3000 for 0.3%) to accumulate trading fees for beneficiaries
|
|
616
620
|
- **Save the asset address** (token address) returned from creation - you need it to collect fees later
|
|
617
|
-
- Use `getPendingFees(beneficiary)` to preview a beneficiary's claimable token0/token1 fees
|
|
621
|
+
- Use `MulticurvePool.getPendingFees(beneficiary)` to preview a beneficiary's claimable token0/token1 fees for one pool
|
|
622
|
+
- Use `MulticurveFees.getPendingFees(beneficiary)` to preview pending fees for multiple tokens with one multicall by default
|
|
623
|
+
- Pass `tokenBatchSize` to `MulticurveFees` when an RPC provider needs large pending-fee previews split into smaller token batches
|
|
618
624
|
- `collectFees()` claims a payout for the calling account only when the caller is a configured beneficiary
|
|
619
625
|
- Pool enters "Locked" status (status = 2) and liquidity cannot be migrated
|
|
620
626
|
- Beneficiaries are immutable and set at pool creation time
|
|
621
627
|
- The SDK automatically handles PoolKey construction and PoolId computation for you
|
|
622
628
|
|
|
623
629
|
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.
|
|
630
|
+
See [docs/multicurve-fees.md](./docs/multicurve-fees.md) for single-token and multi-token pending-fee previews, claiming, batching, and current migrated-launch limitations.
|
|
625
631
|
|
|
626
632
|
#### Transaction gas override
|
|
627
633
|
|
|
@@ -781,6 +787,8 @@ Multicurve pools support fee collection and beneficiary claims when configured
|
|
|
781
787
|
with `pool.beneficiaries` and no-op migration.
|
|
782
788
|
|
|
783
789
|
```typescript
|
|
790
|
+
import { MulticurveFees } from '@whetstone-research/doppler-sdk/evm';
|
|
791
|
+
|
|
784
792
|
// Get a multicurve pool instance using the asset address (token address)
|
|
785
793
|
const pool = await sdk.getMulticurvePool(assetAddress);
|
|
786
794
|
|
|
@@ -805,6 +813,22 @@ const pendingFees = await pool.getPendingFees(beneficiaryAddress);
|
|
|
805
813
|
console.log('Pending fees (token0):', pendingFees.fees0);
|
|
806
814
|
console.log('Pending fees (token1):', pendingFees.fees1);
|
|
807
815
|
|
|
816
|
+
// Preview pending fees for multiple launched tokens. By default this builds
|
|
817
|
+
// one multicall for all requested tokens.
|
|
818
|
+
const multicurveFees = new MulticurveFees(
|
|
819
|
+
publicClient,
|
|
820
|
+
walletClient,
|
|
821
|
+
[assetAddress, anotherAssetAddress],
|
|
822
|
+
{ tokenBatchSize: 25 },
|
|
823
|
+
);
|
|
824
|
+
const pendingFeesByToken =
|
|
825
|
+
await multicurveFees.getPendingFees(beneficiaryAddress);
|
|
826
|
+
for (const pendingFees of pendingFeesByToken) {
|
|
827
|
+
console.log('Asset:', pendingFees.tokenAddress);
|
|
828
|
+
console.log('Pending fees (token0):', pendingFees.fees0);
|
|
829
|
+
console.log('Pending fees (token1):', pendingFees.fees1);
|
|
830
|
+
}
|
|
831
|
+
|
|
808
832
|
// Claim fees from a beneficiary wallet while the pool is locked.
|
|
809
833
|
// Any account can call collectFees(), but only a configured beneficiary caller
|
|
810
834
|
// receives their pending share.
|
|
@@ -831,7 +855,9 @@ The SDK handles the complexity of fee collection by:
|
|
|
831
855
|
**Important Notes:**
|
|
832
856
|
|
|
833
857
|
- Fees accumulate from swap activity on the pool (only if fee tier > 0)
|
|
834
|
-
- `getPendingFees(beneficiary)` returns the beneficiary's pending share for both tokens in
|
|
858
|
+
- `MulticurvePool.getPendingFees(beneficiary)` returns the beneficiary's pending share for both tokens in one pair
|
|
859
|
+
- `MulticurveFees.getPendingFees(beneficiary)` returns pending fees for each requested token and uses one multicall by default
|
|
860
|
+
- `MulticurveFees` accepts `tokenBatchSize` when large token lists need to be split into smaller multicalls
|
|
835
861
|
- `collectFees()` sends a transaction; the caller needs a wallet client
|
|
836
862
|
- Anyone can call `collectFees()`, but only a configured beneficiary caller receives their pending share
|
|
837
863
|
- The `collectFees()` return values are the newly collected pool fees, not necessarily the caller's beneficiary payout
|
|
@@ -843,12 +869,13 @@ The SDK handles the complexity of fee collection by:
|
|
|
843
869
|
|
|
844
870
|
**Common Use Cases:**
|
|
845
871
|
|
|
872
|
+
- Preview pending fees for a portfolio or paginated token list
|
|
846
873
|
- Set up periodic fee collection (e.g., daily or weekly)
|
|
847
874
|
- Integrate with a bot that automatically collects fees when threshold is reached
|
|
848
875
|
- Allow any beneficiary to trigger collection after significant trading activity
|
|
849
876
|
- Monitor swap events to determine optimal collection timing
|
|
850
877
|
|
|
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
|
|
878
|
+
See [docs/multicurve-fees.md](./docs/multicurve-fees.md) for a focused guide, [examples/multicurve-get-pending-fees.ts](./examples/multicurve-get-pending-fees.ts) for batched previews, and [examples/multicurve-collect-fees.ts](./examples/multicurve-collect-fees.ts) for claims.
|
|
852
879
|
|
|
853
880
|
## Token Management
|
|
854
881
|
|