@whetstone-research/doppler-sdk 0.0.23 → 1.0.0
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 +556 -229
- package/dist/chunk-3LTCKCJC.js +319 -0
- package/dist/chunk-3LTCKCJC.js.map +1 -0
- package/dist/chunk-PZ5AY32C.js +9 -0
- package/dist/{chunk-3PNCB4W5.js.map → chunk-PZ5AY32C.js.map} +1 -1
- package/dist/chunk-RO6R66OM.js +974 -0
- package/dist/chunk-RO6R66OM.js.map +1 -0
- package/dist/evm/index.d.ts +8533 -0
- package/dist/evm/index.js +15055 -0
- package/dist/evm/index.js.map +1 -0
- package/dist/oracle-BSvZ6pxp.d.ts +820 -0
- package/dist/pda-RVIHNLRP.js +4 -0
- package/dist/pda-RVIHNLRP.js.map +1 -0
- package/dist/solana/index.d.ts +2495 -0
- package/dist/solana/index.js +2209 -0
- package/dist/solana/index.js.map +1 -0
- package/dist/solana/react/index.d.ts +1046 -0
- package/dist/solana/react/index.js +1436 -0
- package/dist/solana/react/index.js.map +1 -0
- package/package.json +37 -21
- package/dist/DopplerSDK.d.mts +0 -94
- package/dist/DopplerSDK.d.ts +0 -94
- package/dist/DopplerSDK.js +0 -51
- package/dist/DopplerSDK.js.map +0 -1
- package/dist/DopplerSDK.mjs +0 -42
- package/dist/DopplerSDK.mjs.map +0 -1
- package/dist/abis/bytecodes/derc20.d.mts +0 -3
- package/dist/abis/bytecodes/derc20.d.ts +0 -3
- package/dist/abis/bytecodes/derc20.js +0 -9
- package/dist/abis/bytecodes/derc20.js.map +0 -1
- package/dist/abis/bytecodes/derc20.mjs +0 -3
- package/dist/abis/bytecodes/derc20.mjs.map +0 -1
- package/dist/abis/bytecodes/derc2080.d.mts +0 -3
- package/dist/abis/bytecodes/derc2080.d.ts +0 -3
- package/dist/abis/bytecodes/derc2080.js +0 -9
- package/dist/abis/bytecodes/derc2080.js.map +0 -1
- package/dist/abis/bytecodes/derc2080.mjs +0 -3
- package/dist/abis/bytecodes/derc2080.mjs.map +0 -1
- package/dist/abis/bytecodes/doppler.d.mts +0 -3
- package/dist/abis/bytecodes/doppler.d.ts +0 -3
- package/dist/abis/bytecodes/doppler.js +0 -9
- package/dist/abis/bytecodes/doppler.js.map +0 -1
- package/dist/abis/bytecodes/doppler.mjs +0 -3
- package/dist/abis/bytecodes/doppler.mjs.map +0 -1
- package/dist/abis/bytecodes/dopplerDN404.d.mts +0 -3
- package/dist/abis/bytecodes/dopplerDN404.d.ts +0 -3
- package/dist/abis/bytecodes/dopplerDN404.js +0 -9
- package/dist/abis/bytecodes/dopplerDN404.js.map +0 -1
- package/dist/abis/bytecodes/dopplerDN404.mjs +0 -3
- package/dist/abis/bytecodes/dopplerDN404.mjs.map +0 -1
- package/dist/abis/bytecodes/stateView.d.mts +0 -3
- package/dist/abis/bytecodes/stateView.d.ts +0 -3
- package/dist/abis/bytecodes/stateView.js +0 -9
- package/dist/abis/bytecodes/stateView.js.map +0 -1
- package/dist/abis/bytecodes/stateView.mjs +0 -3
- package/dist/abis/bytecodes/stateView.mjs.map +0 -1
- package/dist/abis/bytecodes.d.mts +0 -5
- package/dist/abis/bytecodes.d.ts +0 -5
- package/dist/abis/bytecodes.js +0 -33
- package/dist/abis/bytecodes.js.map +0 -1
- package/dist/abis/bytecodes.mjs +0 -8
- package/dist/abis/bytecodes.mjs.map +0 -1
- package/dist/abis/index.d.mts +0 -3460
- package/dist/abis/index.d.ts +0 -3460
- package/dist/abis/index.js +0 -122
- package/dist/abis/index.js.map +0 -1
- package/dist/abis/index.mjs +0 -9
- package/dist/abis/index.mjs.map +0 -1
- package/dist/addresses.d.mts +0 -65
- package/dist/addresses.d.ts +0 -65
- package/dist/addresses.js +0 -29
- package/dist/addresses.js.map +0 -1
- package/dist/addresses.mjs +0 -4
- package/dist/addresses.mjs.map +0 -1
- package/dist/builders/DynamicAuctionBuilder.d.mts +0 -138
- package/dist/builders/DynamicAuctionBuilder.d.ts +0 -138
- package/dist/builders/DynamicAuctionBuilder.js +0 -35
- package/dist/builders/DynamicAuctionBuilder.js.map +0 -1
- package/dist/builders/DynamicAuctionBuilder.mjs +0 -26
- package/dist/builders/DynamicAuctionBuilder.mjs.map +0 -1
- package/dist/builders/MulticurveBuilder.d.mts +0 -183
- package/dist/builders/MulticurveBuilder.d.ts +0 -183
- package/dist/builders/MulticurveBuilder.js +0 -35
- package/dist/builders/MulticurveBuilder.js.map +0 -1
- package/dist/builders/MulticurveBuilder.mjs +0 -26
- package/dist/builders/MulticurveBuilder.mjs.map +0 -1
- package/dist/builders/StaticAuctionBuilder.d.mts +0 -131
- package/dist/builders/StaticAuctionBuilder.d.ts +0 -131
- package/dist/builders/StaticAuctionBuilder.js +0 -35
- package/dist/builders/StaticAuctionBuilder.js.map +0 -1
- package/dist/builders/StaticAuctionBuilder.mjs +0 -26
- package/dist/builders/StaticAuctionBuilder.mjs.map +0 -1
- package/dist/builders/index.d.mts +0 -8
- package/dist/builders/index.d.ts +0 -8
- package/dist/builders/index.js +0 -62
- package/dist/builders/index.js.map +0 -1
- package/dist/builders/index.mjs +0 -29
- package/dist/builders/index.mjs.map +0 -1
- package/dist/builders/shared.d.mts +0 -115
- package/dist/builders/shared.d.ts +0 -115
- package/dist/builders/shared.js +0 -45
- package/dist/builders/shared.js.map +0 -1
- package/dist/builders/shared.mjs +0 -24
- package/dist/builders/shared.mjs.map +0 -1
- package/dist/chunk-25GEBO3B.mjs +0 -219
- package/dist/chunk-25GEBO3B.mjs.map +0 -1
- package/dist/chunk-3MVW6UIW.js +0 -2294
- package/dist/chunk-3MVW6UIW.js.map +0 -1
- package/dist/chunk-3NMGCQJ4.mjs +0 -6
- package/dist/chunk-3NMGCQJ4.mjs.map +0 -1
- package/dist/chunk-3PNCB4W5.js +0 -4
- package/dist/chunk-4VWQNNNW.js +0 -233
- package/dist/chunk-4VWQNNNW.js.map +0 -1
- package/dist/chunk-4XN6DQBW.js +0 -4
- package/dist/chunk-4XN6DQBW.js.map +0 -1
- package/dist/chunk-5TQOT6CW.js +0 -8
- package/dist/chunk-5TQOT6CW.js.map +0 -1
- package/dist/chunk-6BQY5EPB.js +0 -144
- package/dist/chunk-6BQY5EPB.js.map +0 -1
- package/dist/chunk-6H6X3VTZ.js +0 -18
- package/dist/chunk-6H6X3VTZ.js.map +0 -1
- package/dist/chunk-6UHDSD42.js +0 -2585
- package/dist/chunk-6UHDSD42.js.map +0 -1
- package/dist/chunk-7CAAI5DL.js +0 -273
- package/dist/chunk-7CAAI5DL.js.map +0 -1
- package/dist/chunk-7M57PU6V.js +0 -28
- package/dist/chunk-7M57PU6V.js.map +0 -1
- package/dist/chunk-7P2SPZC7.mjs +0 -2583
- package/dist/chunk-7P2SPZC7.mjs.map +0 -1
- package/dist/chunk-7ZUV6WPX.mjs +0 -3
- package/dist/chunk-7ZUV6WPX.mjs.map +0 -1
- package/dist/chunk-ABT6AT7C.mjs +0 -16
- package/dist/chunk-ABT6AT7C.mjs.map +0 -1
- package/dist/chunk-C6MH7HYT.mjs +0 -138
- package/dist/chunk-C6MH7HYT.mjs.map +0 -1
- package/dist/chunk-CATH4QRQ.mjs +0 -141
- package/dist/chunk-CATH4QRQ.mjs.map +0 -1
- package/dist/chunk-CFAAYL5M.mjs +0 -26
- package/dist/chunk-CFAAYL5M.mjs.map +0 -1
- package/dist/chunk-CMNJZKTM.js +0 -140
- package/dist/chunk-CMNJZKTM.js.map +0 -1
- package/dist/chunk-CWTGQAOG.mjs +0 -72
- package/dist/chunk-CWTGQAOG.mjs.map +0 -1
- package/dist/chunk-DNB3T5P2.js +0 -269
- package/dist/chunk-DNB3T5P2.js.map +0 -1
- package/dist/chunk-DOUF6NON.mjs +0 -3
- package/dist/chunk-DOUF6NON.mjs.map +0 -1
- package/dist/chunk-DSYPZETD.js +0 -4
- package/dist/chunk-DSYPZETD.js.map +0 -1
- package/dist/chunk-E2NF4AQB.mjs +0 -2271
- package/dist/chunk-E2NF4AQB.mjs.map +0 -1
- package/dist/chunk-EH3V2BJF.js +0 -592
- package/dist/chunk-EH3V2BJF.js.map +0 -1
- package/dist/chunk-EIXUJANI.mjs +0 -590
- package/dist/chunk-EIXUJANI.mjs.map +0 -1
- package/dist/chunk-FFV6DMPA.mjs +0 -263
- package/dist/chunk-FFV6DMPA.mjs.map +0 -1
- package/dist/chunk-FLFYAWSS.mjs +0 -238
- package/dist/chunk-FLFYAWSS.mjs.map +0 -1
- package/dist/chunk-FNUBKONK.js +0 -291
- package/dist/chunk-FNUBKONK.js.map +0 -1
- package/dist/chunk-FOESYJP3.mjs +0 -3
- package/dist/chunk-FOESYJP3.mjs.map +0 -1
- package/dist/chunk-FTRCBE3J.js +0 -320
- package/dist/chunk-FTRCBE3J.js.map +0 -1
- package/dist/chunk-FZ4FIWCR.js +0 -240
- package/dist/chunk-FZ4FIWCR.js.map +0 -1
- package/dist/chunk-GDODJJ7D.mjs +0 -36
- package/dist/chunk-GDODJJ7D.mjs.map +0 -1
- package/dist/chunk-GSBQIVME.mjs +0 -278
- package/dist/chunk-GSBQIVME.mjs.map +0 -1
- package/dist/chunk-GSTY3GO7.mjs +0 -40
- package/dist/chunk-GSTY3GO7.mjs.map +0 -1
- package/dist/chunk-H3B54PFV.mjs +0 -17
- package/dist/chunk-H3B54PFV.mjs.map +0 -1
- package/dist/chunk-H7WPK5CR.js +0 -297
- package/dist/chunk-H7WPK5CR.js.map +0 -1
- package/dist/chunk-HJFVRV47.js +0 -120
- package/dist/chunk-HJFVRV47.js.map +0 -1
- package/dist/chunk-HL7ZAAD4.mjs +0 -375
- package/dist/chunk-HL7ZAAD4.mjs.map +0 -1
- package/dist/chunk-IWJOPXYN.mjs +0 -96
- package/dist/chunk-IWJOPXYN.mjs.map +0 -1
- package/dist/chunk-J62YDWIK.js +0 -8
- package/dist/chunk-J62YDWIK.js.map +0 -1
- package/dist/chunk-JB5XXPLL.js +0 -377
- package/dist/chunk-JB5XXPLL.js.map +0 -1
- package/dist/chunk-JIKAD4YL.js +0 -4
- package/dist/chunk-JIKAD4YL.js.map +0 -1
- package/dist/chunk-KAZQJ24E.mjs +0 -59
- package/dist/chunk-KAZQJ24E.mjs.map +0 -1
- package/dist/chunk-KHUE77HC.js +0 -81
- package/dist/chunk-KHUE77HC.js.map +0 -1
- package/dist/chunk-KOAC3BBP.mjs +0 -11
- package/dist/chunk-KOAC3BBP.mjs.map +0 -1
- package/dist/chunk-OHA5KJ2M.mjs +0 -6
- package/dist/chunk-OHA5KJ2M.mjs.map +0 -1
- package/dist/chunk-OX5CESVM.js +0 -40
- package/dist/chunk-OX5CESVM.js.map +0 -1
- package/dist/chunk-P25HBGP5.mjs +0 -3
- package/dist/chunk-P25HBGP5.mjs.map +0 -1
- package/dist/chunk-P7CHGWY7.js +0 -4
- package/dist/chunk-P7CHGWY7.js.map +0 -1
- package/dist/chunk-QAPQGDWK.js +0 -8
- package/dist/chunk-QAPQGDWK.js.map +0 -1
- package/dist/chunk-QOGBOT2M.mjs +0 -328
- package/dist/chunk-QOGBOT2M.mjs.map +0 -1
- package/dist/chunk-QRTABC4Z.js +0 -8
- package/dist/chunk-QRTABC4Z.js.map +0 -1
- package/dist/chunk-QSQGLWNY.mjs +0 -3
- package/dist/chunk-QSQGLWNY.mjs.map +0 -1
- package/dist/chunk-RI6SDMER.mjs +0 -295
- package/dist/chunk-RI6SDMER.mjs.map +0 -1
- package/dist/chunk-RIIVW6TQ.mjs +0 -267
- package/dist/chunk-RIIVW6TQ.mjs.map +0 -1
- package/dist/chunk-RV64M4Q6.mjs +0 -3
- package/dist/chunk-RV64M4Q6.mjs.map +0 -1
- package/dist/chunk-RXUJ4DUB.js +0 -330
- package/dist/chunk-RXUJ4DUB.js.map +0 -1
- package/dist/chunk-SD7BHT2F.mjs +0 -3
- package/dist/chunk-SD7BHT2F.mjs.map +0 -1
- package/dist/chunk-SWWLOD7Q.mjs +0 -6
- package/dist/chunk-SWWLOD7Q.mjs.map +0 -1
- package/dist/chunk-TIGHBA37.js +0 -143
- package/dist/chunk-TIGHBA37.js.map +0 -1
- package/dist/chunk-TLEVIIUE.mjs +0 -34
- package/dist/chunk-TLEVIIUE.mjs.map +0 -1
- package/dist/chunk-U3GOWK6J.mjs +0 -6
- package/dist/chunk-U3GOWK6J.mjs.map +0 -1
- package/dist/chunk-UPVKABAV.js +0 -19
- package/dist/chunk-UPVKABAV.js.map +0 -1
- package/dist/chunk-VCX6FG3E.mjs +0 -318
- package/dist/chunk-VCX6FG3E.mjs.map +0 -1
- package/dist/chunk-VEIVYUYF.js +0 -4
- package/dist/chunk-VEIVYUYF.js.map +0 -1
- package/dist/chunk-VYSOAGRU.mjs +0 -6
- package/dist/chunk-VYSOAGRU.mjs.map +0 -1
- package/dist/chunk-WJBJARLJ.js +0 -38
- package/dist/chunk-WJBJARLJ.js.map +0 -1
- package/dist/chunk-WNUB3UTT.js +0 -241
- package/dist/chunk-WNUB3UTT.js.map +0 -1
- package/dist/chunk-WQHTNL5L.js +0 -4
- package/dist/chunk-WQHTNL5L.js.map +0 -1
- package/dist/chunk-X3UMAHOJ.js +0 -4
- package/dist/chunk-X3UMAHOJ.js.map +0 -1
- package/dist/chunk-XMFOZYNI.js +0 -8
- package/dist/chunk-XMFOZYNI.js.map +0 -1
- package/dist/chunk-XNMXN5SZ.mjs +0 -3
- package/dist/chunk-XNMXN5SZ.mjs.map +0 -1
- package/dist/chunk-XRYLHTVV.mjs +0 -267
- package/dist/chunk-XRYLHTVV.mjs.map +0 -1
- package/dist/chunk-XSJTASPK.js +0 -13
- package/dist/chunk-XSJTASPK.js.map +0 -1
- package/dist/chunk-XT3BAM4H.js +0 -45
- package/dist/chunk-XT3BAM4H.js.map +0 -1
- package/dist/chunk-YBK6EBA5.mjs +0 -239
- package/dist/chunk-YBK6EBA5.mjs.map +0 -1
- package/dist/chunk-YFEPTSI2.js +0 -265
- package/dist/chunk-YFEPTSI2.js.map +0 -1
- package/dist/chunk-YYLD3AJ7.js +0 -61
- package/dist/chunk-YYLD3AJ7.js.map +0 -1
- package/dist/chunk-ZEDJUNC6.mjs +0 -115
- package/dist/chunk-ZEDJUNC6.mjs.map +0 -1
- package/dist/constants.d.mts +0 -91
- package/dist/constants.d.ts +0 -91
- package/dist/constants.js +0 -196
- package/dist/constants.js.map +0 -1
- package/dist/constants.mjs +0 -3
- package/dist/constants.mjs.map +0 -1
- package/dist/deployments.generated.d.mts +0 -267
- package/dist/deployments.generated.d.ts +0 -267
- package/dist/deployments.generated.js +0 -12
- package/dist/deployments.generated.js.map +0 -1
- package/dist/deployments.generated.mjs +0 -3
- package/dist/deployments.generated.mjs.map +0 -1
- package/dist/entities/DopplerFactory.d.mts +0 -266
- package/dist/entities/DopplerFactory.d.ts +0 -266
- package/dist/entities/DopplerFactory.js +0 -33
- package/dist/entities/DopplerFactory.js.map +0 -1
- package/dist/entities/DopplerFactory.mjs +0 -24
- package/dist/entities/DopplerFactory.mjs.map +0 -1
- package/dist/entities/auction/DynamicAuction.d.mts +0 -72
- package/dist/entities/auction/DynamicAuction.d.ts +0 -72
- package/dist/entities/auction/DynamicAuction.js +0 -21
- package/dist/entities/auction/DynamicAuction.js.map +0 -1
- package/dist/entities/auction/DynamicAuction.mjs +0 -12
- package/dist/entities/auction/DynamicAuction.mjs.map +0 -1
- package/dist/entities/auction/MulticurvePool.d.mts +0 -74
- package/dist/entities/auction/MulticurvePool.d.ts +0 -74
- package/dist/entities/auction/MulticurvePool.js +0 -24
- package/dist/entities/auction/MulticurvePool.js.map +0 -1
- package/dist/entities/auction/MulticurvePool.mjs +0 -15
- package/dist/entities/auction/MulticurvePool.mjs.map +0 -1
- package/dist/entities/auction/StaticAuction.d.mts +0 -44
- package/dist/entities/auction/StaticAuction.d.ts +0 -44
- package/dist/entities/auction/StaticAuction.js +0 -21
- package/dist/entities/auction/StaticAuction.js.map +0 -1
- package/dist/entities/auction/StaticAuction.mjs +0 -12
- package/dist/entities/auction/StaticAuction.mjs.map +0 -1
- package/dist/entities/auction/index.d.mts +0 -7
- package/dist/entities/auction/index.d.ts +0 -7
- package/dist/entities/auction/index.js +0 -35
- package/dist/entities/auction/index.js.map +0 -1
- package/dist/entities/auction/index.mjs +0 -18
- package/dist/entities/auction/index.mjs.map +0 -1
- package/dist/entities/quoter/Quoter.d.mts +0 -150
- package/dist/entities/quoter/Quoter.d.ts +0 -150
- package/dist/entities/quoter/Quoter.js +0 -21
- package/dist/entities/quoter/Quoter.js.map +0 -1
- package/dist/entities/quoter/Quoter.mjs +0 -12
- package/dist/entities/quoter/Quoter.mjs.map +0 -1
- package/dist/entities/quoter/index.d.mts +0 -5
- package/dist/entities/quoter/index.d.ts +0 -5
- package/dist/entities/quoter/index.js +0 -22
- package/dist/entities/quoter/index.js.map +0 -1
- package/dist/entities/quoter/index.mjs +0 -13
- package/dist/entities/quoter/index.mjs.map +0 -1
- package/dist/entities/token/derc20/Derc20.d.mts +0 -102
- package/dist/entities/token/derc20/Derc20.d.ts +0 -102
- package/dist/entities/token/derc20/Derc20.js +0 -19
- package/dist/entities/token/derc20/Derc20.js.map +0 -1
- package/dist/entities/token/derc20/Derc20.mjs +0 -10
- package/dist/entities/token/derc20/Derc20.mjs.map +0 -1
- package/dist/entities/token/derc20/index.d.mts +0 -5
- package/dist/entities/token/derc20/index.d.ts +0 -5
- package/dist/entities/token/derc20/index.js +0 -20
- package/dist/entities/token/derc20/index.js.map +0 -1
- package/dist/entities/token/derc20/index.mjs +0 -11
- package/dist/entities/token/derc20/index.mjs.map +0 -1
- package/dist/entities/token/eth/Eth.d.mts +0 -54
- package/dist/entities/token/eth/Eth.d.ts +0 -54
- package/dist/entities/token/eth/Eth.js +0 -12
- package/dist/entities/token/eth/Eth.js.map +0 -1
- package/dist/entities/token/eth/Eth.mjs +0 -3
- package/dist/entities/token/eth/Eth.mjs.map +0 -1
- package/dist/entities/token/eth/index.d.mts +0 -5
- package/dist/entities/token/eth/index.d.ts +0 -5
- package/dist/entities/token/eth/index.js +0 -13
- package/dist/entities/token/eth/index.js.map +0 -1
- package/dist/entities/token/eth/index.mjs +0 -4
- package/dist/entities/token/eth/index.mjs.map +0 -1
- package/dist/entities/token/index.d.mts +0 -6
- package/dist/entities/token/index.d.ts +0 -6
- package/dist/entities/token/index.js +0 -27
- package/dist/entities/token/index.js.map +0 -1
- package/dist/entities/token/index.mjs +0 -14
- package/dist/entities/token/index.mjs.map +0 -1
- package/dist/index.d.mts +0 -37
- package/dist/index.d.ts +0 -37
- package/dist/index.js +0 -565
- package/dist/index.js.map +0 -1
- package/dist/index.mjs +0 -47
- package/dist/index.mjs.map +0 -1
- package/dist/types.d.mts +0 -607
- package/dist/types.d.ts +0 -607
- package/dist/types.js +0 -30
- package/dist/types.js.map +0 -1
- package/dist/types.mjs +0 -5
- package/dist/types.mjs.map +0 -1
- package/dist/utils/airlock.d.mts +0 -11
- package/dist/utils/airlock.d.ts +0 -11
- package/dist/utils/airlock.js +0 -26
- package/dist/utils/airlock.js.map +0 -1
- package/dist/utils/airlock.mjs +0 -5
- package/dist/utils/airlock.mjs.map +0 -1
- package/dist/utils/balanceDelta.d.mts +0 -10
- package/dist/utils/balanceDelta.d.ts +0 -10
- package/dist/utils/balanceDelta.js +0 -12
- package/dist/utils/balanceDelta.js.map +0 -1
- package/dist/utils/balanceDelta.mjs +0 -3
- package/dist/utils/balanceDelta.mjs.map +0 -1
- package/dist/utils/computeOptimalGamma.d.mts +0 -7
- package/dist/utils/computeOptimalGamma.d.ts +0 -7
- package/dist/utils/computeOptimalGamma.js +0 -12
- package/dist/utils/computeOptimalGamma.js.map +0 -1
- package/dist/utils/computeOptimalGamma.mjs +0 -3
- package/dist/utils/computeOptimalGamma.mjs.map +0 -1
- package/dist/utils/dopplerHookMigrator.d.mts +0 -11
- package/dist/utils/dopplerHookMigrator.d.ts +0 -11
- package/dist/utils/dopplerHookMigrator.js +0 -12
- package/dist/utils/dopplerHookMigrator.js.map +0 -1
- package/dist/utils/dopplerHookMigrator.mjs +0 -3
- package/dist/utils/dopplerHookMigrator.mjs.map +0 -1
- package/dist/utils/index.d.mts +0 -14
- package/dist/utils/index.d.ts +0 -14
- package/dist/utils/index.js +0 -195
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/index.mjs +0 -22
- package/dist/utils/index.mjs.map +0 -1
- package/dist/utils/isToken0Expected.d.mts +0 -13
- package/dist/utils/isToken0Expected.d.ts +0 -13
- package/dist/utils/isToken0Expected.js +0 -12
- package/dist/utils/isToken0Expected.js.map +0 -1
- package/dist/utils/isToken0Expected.mjs +0 -3
- package/dist/utils/isToken0Expected.mjs.map +0 -1
- package/dist/utils/marketCapHelpers.d.mts +0 -259
- package/dist/utils/marketCapHelpers.d.ts +0 -259
- package/dist/utils/marketCapHelpers.js +0 -58
- package/dist/utils/marketCapHelpers.js.map +0 -1
- package/dist/utils/marketCapHelpers.mjs +0 -5
- package/dist/utils/marketCapHelpers.mjs.map +0 -1
- package/dist/utils/poolKey.d.mts +0 -17
- package/dist/utils/poolKey.d.ts +0 -17
- package/dist/utils/poolKey.js +0 -12
- package/dist/utils/poolKey.js.map +0 -1
- package/dist/utils/poolKey.mjs +0 -3
- package/dist/utils/poolKey.mjs.map +0 -1
- package/dist/utils/priceHelpers.d.mts +0 -86
- package/dist/utils/priceHelpers.d.ts +0 -86
- package/dist/utils/priceHelpers.js +0 -41
- package/dist/utils/priceHelpers.js.map +0 -1
- package/dist/utils/priceHelpers.mjs +0 -4
- package/dist/utils/priceHelpers.mjs.map +0 -1
- package/dist/utils/tickMath.d.mts +0 -72
- package/dist/utils/tickMath.d.ts +0 -72
- package/dist/utils/tickMath.js +0 -60
- package/dist/utils/tickMath.js.map +0 -1
- package/dist/utils/tickMath.mjs +0 -3
- package/dist/utils/tickMath.mjs.map +0 -1
- package/dist/utils/tokenAddressMiner.d.mts +0 -37
- package/dist/utils/tokenAddressMiner.d.ts +0 -37
- package/dist/utils/tokenAddressMiner.js +0 -19
- package/dist/utils/tokenAddressMiner.js.map +0 -1
- package/dist/utils/tokenAddressMiner.mjs +0 -10
- package/dist/utils/tokenAddressMiner.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -60,12 +60,25 @@ const sdk = new DopplerSDK({
|
|
|
60
60
|
Static auctions use Uniswap V3 pools with concentrated liquidity in a fixed price range. They're ideal for simple, predictable price discovery.
|
|
61
61
|
|
|
62
62
|
```typescript
|
|
63
|
-
import { StaticAuctionBuilder } from '@whetstone-research/doppler-sdk'
|
|
63
|
+
import { StaticAuctionBuilder } from '@whetstone-research/doppler-sdk';
|
|
64
64
|
|
|
65
65
|
const params = new StaticAuctionBuilder()
|
|
66
|
-
.tokenConfig({
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
.tokenConfig({
|
|
67
|
+
name: 'My Token',
|
|
68
|
+
symbol: 'MTK',
|
|
69
|
+
tokenURI: 'https://example.com/metadata.json',
|
|
70
|
+
})
|
|
71
|
+
.saleConfig({
|
|
72
|
+
initialSupply: parseEther('1000000000'),
|
|
73
|
+
numTokensToSell: parseEther('900000000'),
|
|
74
|
+
numeraire: '0x...',
|
|
75
|
+
})
|
|
76
|
+
.poolByTicks({
|
|
77
|
+
startTick: -92200,
|
|
78
|
+
endTick: -69000,
|
|
79
|
+
fee: 10000,
|
|
80
|
+
numPositions: 15,
|
|
81
|
+
})
|
|
69
82
|
.withVesting({
|
|
70
83
|
duration: BigInt(365 * 24 * 60 * 60),
|
|
71
84
|
// Optional: specify multiple recipients and amounts
|
|
@@ -74,11 +87,11 @@ const params = new StaticAuctionBuilder()
|
|
|
74
87
|
})
|
|
75
88
|
.withMigration({ type: 'uniswapV2' })
|
|
76
89
|
.withUserAddress('0x...')
|
|
77
|
-
.build()
|
|
90
|
+
.build();
|
|
78
91
|
|
|
79
|
-
const result = await sdk.factory.createStaticAuction(params)
|
|
80
|
-
console.log('Pool address:', result.poolAddress)
|
|
81
|
-
console.log('Token address:', result.tokenAddress)
|
|
92
|
+
const result = await sdk.factory.createStaticAuction(params);
|
|
93
|
+
console.log('Pool address:', result.poolAddress);
|
|
94
|
+
console.log('Token address:', result.tokenAddress);
|
|
82
95
|
```
|
|
83
96
|
|
|
84
97
|
> **Tick spacing reminder:** When you provide ticks manually via `poolByTicks`, make sure both `startTick` and `endTick` are exact multiples of the fee tier's tick spacing (100→1, 500→10, 3000→60, 10000→200). The SDK now validates this locally and will fail fast if the ticks are misaligned.
|
|
@@ -88,38 +101,51 @@ console.log('Token address:', result.tokenAddress)
|
|
|
88
101
|
When you want fee revenue to flow to specific addresses without migrating liquidity, use lockable beneficiaries. The pool enters a "Locked" state where trading fees are collected and distributed to beneficiaries:
|
|
89
102
|
|
|
90
103
|
```typescript
|
|
91
|
-
import {
|
|
92
|
-
|
|
104
|
+
import {
|
|
105
|
+
StaticAuctionBuilder,
|
|
106
|
+
WAD,
|
|
107
|
+
getAirlockOwner,
|
|
108
|
+
} from '@whetstone-research/doppler-sdk';
|
|
109
|
+
import { parseEther } from 'viem';
|
|
93
110
|
|
|
94
111
|
// Get the protocol owner (required beneficiary with min 5%)
|
|
95
|
-
const protocolOwner = await getAirlockOwner(publicClient)
|
|
112
|
+
const protocolOwner = await getAirlockOwner(publicClient);
|
|
96
113
|
|
|
97
114
|
// Define beneficiaries - shares must sum to WAD (1e18 = 100%)
|
|
98
115
|
const beneficiaries = [
|
|
99
|
-
{ beneficiary: protocolOwner, shares: parseEther('0.05') },
|
|
100
|
-
{ beneficiary: '0xTeamWallet...', shares: parseEther('0.45') },
|
|
116
|
+
{ beneficiary: protocolOwner, shares: parseEther('0.05') }, // 5% (minimum required)
|
|
117
|
+
{ beneficiary: '0xTeamWallet...', shares: parseEther('0.45') }, // 45%
|
|
101
118
|
{ beneficiary: '0xDAOTreasury...', shares: parseEther('0.50') }, // 50%
|
|
102
|
-
]
|
|
119
|
+
];
|
|
103
120
|
|
|
104
121
|
const params = new StaticAuctionBuilder(chainId)
|
|
105
|
-
.tokenConfig({
|
|
106
|
-
|
|
122
|
+
.tokenConfig({
|
|
123
|
+
name: 'My Token',
|
|
124
|
+
symbol: 'MTK',
|
|
125
|
+
tokenURI: 'https://example.com/metadata.json',
|
|
126
|
+
})
|
|
127
|
+
.saleConfig({
|
|
128
|
+
initialSupply: parseEther('1000000000'),
|
|
129
|
+
numTokensToSell: parseEther('900000000'),
|
|
130
|
+
numeraire: wethAddress,
|
|
131
|
+
})
|
|
107
132
|
.poolByTicks({
|
|
108
|
-
startTick: 174960,
|
|
133
|
+
startTick: 174960, // Must be multiple of 60 for fee 3000
|
|
109
134
|
endTick: 225000,
|
|
110
|
-
fee: 3000,
|
|
135
|
+
fee: 3000, // Set > 0 to accumulate fees for beneficiaries
|
|
111
136
|
})
|
|
112
|
-
.withBeneficiaries(beneficiaries)
|
|
113
|
-
.withMigration({ type: 'noOp' })
|
|
137
|
+
.withBeneficiaries(beneficiaries) // Lock pool and enable fee streaming
|
|
138
|
+
.withMigration({ type: 'noOp' }) // Use NoOp since pool is locked
|
|
114
139
|
.withGovernance({ type: 'default' })
|
|
115
140
|
.withUserAddress('0x...')
|
|
116
|
-
.build()
|
|
141
|
+
.build();
|
|
117
142
|
|
|
118
|
-
const result = await sdk.factory.createStaticAuction(params)
|
|
119
|
-
console.log('Pool address:', result.poolAddress)
|
|
143
|
+
const result = await sdk.factory.createStaticAuction(params);
|
|
144
|
+
console.log('Pool address:', result.poolAddress); // SAVE THIS - needed to collect fees!
|
|
120
145
|
```
|
|
121
146
|
|
|
122
147
|
**Important Notes:**
|
|
148
|
+
|
|
123
149
|
- **Shares must sum to exactly WAD (1e18 = 100%)**
|
|
124
150
|
- **Protocol owner must receive at least 5%** of fees
|
|
125
151
|
- **SDK automatically sorts beneficiaries** by address (ascending)
|
|
@@ -135,11 +161,22 @@ See [examples/static-auction-lockable-beneficiaries.ts](./examples/static-auctio
|
|
|
135
161
|
Dynamic auctions use Uniswap V4 hooks to implement gradual Dutch auctions where the price moves over time.
|
|
136
162
|
|
|
137
163
|
```typescript
|
|
138
|
-
import {
|
|
164
|
+
import {
|
|
165
|
+
DynamicAuctionBuilder,
|
|
166
|
+
DAY_SECONDS,
|
|
167
|
+
} from '@whetstone-research/doppler-sdk';
|
|
139
168
|
|
|
140
169
|
const params = new DynamicAuctionBuilder()
|
|
141
|
-
.tokenConfig({
|
|
142
|
-
|
|
170
|
+
.tokenConfig({
|
|
171
|
+
name: 'My Token',
|
|
172
|
+
symbol: 'MTK',
|
|
173
|
+
tokenURI: 'https://example.com/metadata.json',
|
|
174
|
+
})
|
|
175
|
+
.saleConfig({
|
|
176
|
+
initialSupply: parseEther('1000000'),
|
|
177
|
+
numTokensToSell: parseEther('900000'),
|
|
178
|
+
numeraire: '0x...',
|
|
179
|
+
})
|
|
143
180
|
.poolConfig({ fee: 3000, tickSpacing: 60 })
|
|
144
181
|
.auctionByTicks({
|
|
145
182
|
duration: 7 * DAY_SECONDS,
|
|
@@ -179,54 +216,151 @@ const params = new DynamicAuctionBuilder()
|
|
|
179
216
|
// .withV3Migrator('0xV3Migrator...')
|
|
180
217
|
// .withV4Migrator('0xV4Migrator...')
|
|
181
218
|
.withUserAddress('0x...')
|
|
219
|
+
.build();
|
|
220
|
+
|
|
221
|
+
const result = await sdk.factory.createDynamicAuction(params);
|
|
222
|
+
console.log('Hook address:', result.hookAddress);
|
|
223
|
+
console.log('Token address:', result.tokenAddress);
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
### Opening Auction (Lifecycle + Bid Management)
|
|
227
|
+
|
|
228
|
+
Support includes:
|
|
229
|
+
- `sdk.buildOpeningAuction()` for `CreateOpeningAuctionParams`
|
|
230
|
+
- `sdk.factory.simulateCreateOpeningAuction(params)` and `sdk.factory.createOpeningAuction(params)`
|
|
231
|
+
- `sdk.getOpeningAuction(hookAddress)` for hook reads + `settleAuction()` / `claimIncentives()`
|
|
232
|
+
- `sdk.factory.simulateCompleteOpeningAuction(...)` and `sdk.factory.completeOpeningAuction(...)` for handoff to Doppler
|
|
233
|
+
- `sdk.getOpeningAuctionLifecycle(initializerAddress?)` for initializer-level state + complete/recover/sweep helpers
|
|
234
|
+
- `sdk.getOpeningAuctionPositionManager(positionManagerAddress?)` for placing/withdrawing opening-auction bids
|
|
235
|
+
- Resolve the address via `await (await sdk.getOpeningAuctionLifecycle(initializerAddress)).getPositionManager()` when chain defaults are not configured
|
|
236
|
+
- Resolve `positionId` for incentives via `opening.getPositionId(...)` or `opening.claimIncentivesByPositionKey(...)` (no log parsing required)
|
|
237
|
+
|
|
238
|
+
> **Base caveat:** on Base mainnet (`chainId = 8453`), `openingAuctionInitializer` and `openingAuctionPositionManager` default to `0x0000000000000000000000000000000000000000` until deployment. Override with `.withOpeningAuctionInitializer('0x...')` / `.withOpeningAuctionPositionManager('0x...')` (or pass explicit addresses) before using opening-auction create/completion/bid flows there.
|
|
239
|
+
|
|
240
|
+
```typescript
|
|
241
|
+
const params = sdk
|
|
242
|
+
.buildOpeningAuction()
|
|
243
|
+
.tokenConfig({
|
|
244
|
+
name: 'My Token',
|
|
245
|
+
symbol: 'MTK',
|
|
246
|
+
tokenURI: 'https://example.com/metadata.json',
|
|
247
|
+
})
|
|
248
|
+
.saleConfig({
|
|
249
|
+
initialSupply: parseEther('1000000'),
|
|
250
|
+
numTokensToSell: parseEther('900000'),
|
|
251
|
+
numeraire: '0x...',
|
|
252
|
+
})
|
|
253
|
+
.openingAuctionConfig({
|
|
254
|
+
auctionDuration: 3600,
|
|
255
|
+
minAcceptableTickToken0: -887220,
|
|
256
|
+
minAcceptableTickToken1: -887220,
|
|
257
|
+
incentiveShareBps: 500,
|
|
258
|
+
tickSpacing: 60,
|
|
259
|
+
fee: 3000,
|
|
260
|
+
minLiquidity: 1n,
|
|
261
|
+
shareToAuctionBps: 8000,
|
|
262
|
+
})
|
|
263
|
+
.dopplerConfig({
|
|
264
|
+
minProceeds: parseEther('10'),
|
|
265
|
+
maxProceeds: parseEther('100'),
|
|
266
|
+
startTick: -69080,
|
|
267
|
+
endTick: -92103,
|
|
268
|
+
})
|
|
269
|
+
.withMigration({ type: 'uniswapV4', fee: 3000, tickSpacing: 60 })
|
|
270
|
+
.withUserAddress('0x...')
|
|
271
|
+
.withOpeningAuctionInitializer('0x...') // required on Base until deployed
|
|
182
272
|
.build()
|
|
183
273
|
|
|
184
|
-
const
|
|
185
|
-
|
|
186
|
-
|
|
274
|
+
const sim = await sdk.factory.simulateCreateOpeningAuction(params)
|
|
275
|
+
const created = await sim.execute()
|
|
276
|
+
|
|
277
|
+
const opening = await sdk.getOpeningAuction(created.openingAuctionHookAddress)
|
|
278
|
+
await opening.getPhase()
|
|
279
|
+
|
|
280
|
+
const lifecycle = await sdk.getOpeningAuctionLifecycle('0x...')
|
|
281
|
+
await lifecycle.getState(created.tokenAddress)
|
|
282
|
+
|
|
283
|
+
await sdk.factory.completeOpeningAuction({
|
|
284
|
+
asset: created.tokenAddress,
|
|
285
|
+
initializerAddress: '0x...',
|
|
286
|
+
})
|
|
187
287
|
```
|
|
188
288
|
|
|
289
|
+
`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.
|
|
290
|
+
|
|
291
|
+
Position-manager bid wrappers are available, but bid sizing is still “advanced user”: `liquidity` is Uniswap V4 liquidity units. Use `simulatePlaceBid(...)` / `simulateWithdrawBid(...)` to inspect the `BalanceDelta` (token amounts in/out) and iterate. During the active auction, liquidity withdrawals must be full (no partial removals); use `withdrawFullBid(...)` to read the onchain liquidity and withdraw safely.
|
|
292
|
+
|
|
293
|
+
See [examples/opening-auction-lifecycle.ts](./examples/opening-auction-lifecycle.ts) for the full builder/factory/lifecycle flow, and [examples/opening-auction-bidding.ts](./examples/opening-auction-bidding.ts) for the bid-management pattern + positionId resolution.
|
|
294
|
+
|
|
189
295
|
### Multicurve Auction (V4 Multicurve Initializer)
|
|
190
296
|
|
|
191
297
|
Multicurve auctions use a Uniswap V4-style initializer that seeds liquidity across multiple curves in a single pool. This enables richer distributions and can be combined with any supported migration path (V2, V3, V4, or NoOp). Multicurve initializer modes are modeled as a typed variant (`standard`, `scheduled`, `decay`, `rehype`) so new hook/initializer variations can be added without breaking existing integrations.
|
|
192
298
|
|
|
193
299
|
**Standard Multicurve with Migration:**
|
|
300
|
+
|
|
194
301
|
```typescript
|
|
195
|
-
import { MulticurveBuilder } from '@whetstone-research/doppler-sdk'
|
|
196
|
-
import { parseEther } from 'viem'
|
|
197
|
-
import { base } from 'viem/chains'
|
|
302
|
+
import { MulticurveBuilder } from '@whetstone-research/doppler-sdk';
|
|
303
|
+
import { parseEther } from 'viem';
|
|
304
|
+
import { base } from 'viem/chains';
|
|
198
305
|
|
|
199
306
|
const params = new MulticurveBuilder(base.id)
|
|
200
|
-
.tokenConfig({
|
|
201
|
-
|
|
307
|
+
.tokenConfig({
|
|
308
|
+
name: 'My Token',
|
|
309
|
+
symbol: 'MTK',
|
|
310
|
+
tokenURI: 'https://example.com/metadata.json',
|
|
311
|
+
})
|
|
312
|
+
.saleConfig({
|
|
313
|
+
initialSupply: parseEther('1000000'),
|
|
314
|
+
numTokensToSell: parseEther('900000'),
|
|
315
|
+
numeraire: '0x...',
|
|
316
|
+
})
|
|
202
317
|
.poolConfig({
|
|
203
318
|
fee: 0,
|
|
204
319
|
tickSpacing: 8,
|
|
205
320
|
curves: [
|
|
206
|
-
{
|
|
207
|
-
|
|
321
|
+
{
|
|
322
|
+
tickLower: 0,
|
|
323
|
+
tickUpper: 240000,
|
|
324
|
+
numPositions: 10,
|
|
325
|
+
shares: parseEther('0.5'),
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
tickLower: 16000,
|
|
329
|
+
tickUpper: 240000,
|
|
330
|
+
numPositions: 10,
|
|
331
|
+
shares: parseEther('0.5'),
|
|
332
|
+
},
|
|
208
333
|
],
|
|
209
334
|
})
|
|
210
335
|
.withGovernance({ type: 'default' })
|
|
211
336
|
// Choose a migration path (V2, V3, or V4)
|
|
212
337
|
.withMigration({ type: 'uniswapV2' })
|
|
213
338
|
.withUserAddress('0x...')
|
|
214
|
-
.build()
|
|
339
|
+
.build();
|
|
215
340
|
|
|
216
|
-
const result = await sdk.factory.createMulticurve(params)
|
|
217
|
-
console.log('Pool address:', result.poolAddress)
|
|
218
|
-
console.log('Token address:', result.tokenAddress)
|
|
341
|
+
const result = await sdk.factory.createMulticurve(params);
|
|
342
|
+
console.log('Pool address:', result.poolAddress);
|
|
343
|
+
console.log('Token address:', result.tokenAddress);
|
|
219
344
|
```
|
|
220
345
|
|
|
221
346
|
**Market Cap Presets (Low / Medium / High):**
|
|
347
|
+
|
|
222
348
|
```typescript
|
|
223
|
-
import { MulticurveBuilder, FEE_TIERS } from '@whetstone-research/doppler-sdk'
|
|
224
|
-
import { parseEther } from 'viem'
|
|
225
|
-
import { base } from 'viem/chains'
|
|
349
|
+
import { MulticurveBuilder, FEE_TIERS } from '@whetstone-research/doppler-sdk';
|
|
350
|
+
import { parseEther } from 'viem';
|
|
351
|
+
import { base } from 'viem/chains';
|
|
226
352
|
|
|
227
353
|
const presetParams = new MulticurveBuilder(base.id)
|
|
228
|
-
.tokenConfig({
|
|
229
|
-
|
|
354
|
+
.tokenConfig({
|
|
355
|
+
name: 'Preset Launch',
|
|
356
|
+
symbol: 'PRST',
|
|
357
|
+
tokenURI: 'ipfs://preset.json',
|
|
358
|
+
})
|
|
359
|
+
.saleConfig({
|
|
360
|
+
initialSupply: parseEther('1000000'),
|
|
361
|
+
numTokensToSell: parseEther('900000'),
|
|
362
|
+
numeraire: '0x...',
|
|
363
|
+
})
|
|
230
364
|
.withMarketCapPresets({
|
|
231
365
|
fee: FEE_TIERS.LOW, // defaults to 0.05% fee tier (tick spacing 10)
|
|
232
366
|
presets: ['low', 'medium', 'high'], // defaults to all tiers
|
|
@@ -235,14 +369,15 @@ const presetParams = new MulticurveBuilder(base.id)
|
|
|
235
369
|
.withGovernance({ type: 'default' })
|
|
236
370
|
.withMigration({ type: 'uniswapV2' })
|
|
237
371
|
.withUserAddress('0x...')
|
|
238
|
-
.build()
|
|
372
|
+
.build();
|
|
239
373
|
|
|
240
|
-
const presetResult = await sdk.factory.createMulticurve(presetParams)
|
|
241
|
-
console.log('Pool address:', presetResult.poolAddress)
|
|
242
|
-
console.log('Token address:', presetResult.tokenAddress)
|
|
374
|
+
const presetResult = await sdk.factory.createMulticurve(presetParams);
|
|
375
|
+
console.log('Pool address:', presetResult.poolAddress);
|
|
376
|
+
console.log('Token address:', presetResult.tokenAddress);
|
|
243
377
|
```
|
|
244
378
|
|
|
245
379
|
The preset helper seeds three curated curve buckets sized for ~1B token supply targets:
|
|
380
|
+
|
|
246
381
|
- `low`: ~5% of the sale allocated to a $7.5k-$30k market cap window.
|
|
247
382
|
- `medium`: ~12.5% targeting roughly $50k-$150k market caps.
|
|
248
383
|
- `high`: ~20% aimed at $250k-$750k market caps.
|
|
@@ -250,69 +385,107 @@ The preset helper seeds three curated curve buckets sized for ~1B token supply t
|
|
|
250
385
|
Pass `presets` to pick a subset (e.g. `['medium', 'high']`) or provide `overrides` to adjust ticks, positions, or shares for a specific tier. When the selected presets sum to less than 100%, the builder automatically appends a filler curve (using the highest selected tier's shape) so liquidity always covers the full sale. Shares must stay within 0-1e18 and the helper will throw if the total ever exceeds 100%.
|
|
251
386
|
|
|
252
387
|
**Scheduled Multicurve Launch:**
|
|
388
|
+
|
|
253
389
|
```typescript
|
|
254
|
-
import { MulticurveBuilder } from '@whetstone-research/doppler-sdk'
|
|
255
|
-
import { parseEther } from 'viem'
|
|
256
|
-
import { base } from 'viem/chains'
|
|
390
|
+
import { MulticurveBuilder } from '@whetstone-research/doppler-sdk';
|
|
391
|
+
import { parseEther } from 'viem';
|
|
392
|
+
import { base } from 'viem/chains';
|
|
257
393
|
|
|
258
|
-
const startTime = Math.floor(Date.now() / 1000) + 3600 // one hour from now
|
|
394
|
+
const startTime = Math.floor(Date.now() / 1000) + 3600; // one hour from now
|
|
259
395
|
|
|
260
396
|
const scheduled = new MulticurveBuilder(base.id)
|
|
261
|
-
.tokenConfig({
|
|
262
|
-
|
|
397
|
+
.tokenConfig({
|
|
398
|
+
name: 'My Token',
|
|
399
|
+
symbol: 'MTK',
|
|
400
|
+
tokenURI: 'ipfs://scheduled.json',
|
|
401
|
+
})
|
|
402
|
+
.saleConfig({
|
|
403
|
+
initialSupply: parseEther('1000000'),
|
|
404
|
+
numTokensToSell: parseEther('900000'),
|
|
405
|
+
numeraire: '0x4200000000000000000000000000000000000006',
|
|
406
|
+
})
|
|
263
407
|
.poolConfig({
|
|
264
408
|
fee: 0,
|
|
265
409
|
tickSpacing: 8,
|
|
266
410
|
curves: [
|
|
267
|
-
{
|
|
268
|
-
|
|
411
|
+
{
|
|
412
|
+
tickLower: 0,
|
|
413
|
+
tickUpper: 240000,
|
|
414
|
+
numPositions: 12,
|
|
415
|
+
shares: parseEther('0.5'),
|
|
416
|
+
},
|
|
417
|
+
{
|
|
418
|
+
tickLower: 16000,
|
|
419
|
+
tickUpper: 240000,
|
|
420
|
+
numPositions: 12,
|
|
421
|
+
shares: parseEther('0.5'),
|
|
422
|
+
},
|
|
269
423
|
],
|
|
270
424
|
})
|
|
271
425
|
.withSchedule({ startTime })
|
|
272
426
|
.withGovernance({ type: 'default' })
|
|
273
427
|
.withMigration({ type: 'uniswapV2' })
|
|
274
428
|
.withUserAddress('0x...')
|
|
275
|
-
.build()
|
|
429
|
+
.build();
|
|
276
430
|
|
|
277
|
-
const scheduledResult = await sdk.factory.createMulticurve(scheduled)
|
|
278
|
-
console.log('Pool address:', scheduledResult.poolAddress)
|
|
279
|
-
console.log('Token address:', scheduledResult.tokenAddress)
|
|
431
|
+
const scheduledResult = await sdk.factory.createMulticurve(scheduled);
|
|
432
|
+
console.log('Pool address:', scheduledResult.poolAddress);
|
|
433
|
+
console.log('Token address:', scheduledResult.tokenAddress);
|
|
280
434
|
```
|
|
281
435
|
|
|
282
436
|
Ensure the target chain has the scheduled multicurve initializer whitelisted. If you are targeting a custom deployment, override it via `.withV4ScheduledMulticurveInitializer('0x...')`.
|
|
283
437
|
|
|
284
438
|
**Decay Multicurve Launch (Dynamic Fee):**
|
|
439
|
+
|
|
285
440
|
```typescript
|
|
286
|
-
import { MulticurveBuilder } from '@whetstone-research/doppler-sdk'
|
|
287
|
-
import { parseEther } from 'viem'
|
|
288
|
-
import { baseSepolia } from 'viem/chains'
|
|
441
|
+
import { MulticurveBuilder } from '@whetstone-research/doppler-sdk';
|
|
442
|
+
import { parseEther } from 'viem';
|
|
443
|
+
import { baseSepolia } from 'viem/chains';
|
|
289
444
|
|
|
290
|
-
const startTime = Math.floor(Date.now() / 1000) + 300
|
|
445
|
+
const startTime = Math.floor(Date.now() / 1000) + 300;
|
|
291
446
|
|
|
292
447
|
const decay = new MulticurveBuilder(baseSepolia.id)
|
|
293
|
-
.tokenConfig({
|
|
294
|
-
|
|
448
|
+
.tokenConfig({
|
|
449
|
+
name: 'Decay Token',
|
|
450
|
+
symbol: 'DMC',
|
|
451
|
+
tokenURI: 'ipfs://decay.json',
|
|
452
|
+
})
|
|
453
|
+
.saleConfig({
|
|
454
|
+
initialSupply: parseEther('1000000'),
|
|
455
|
+
numTokensToSell: parseEther('900000'),
|
|
456
|
+
numeraire: '0x4200000000000000000000000000000000000006',
|
|
457
|
+
})
|
|
295
458
|
.poolConfig({
|
|
296
459
|
fee: 500, // terminal fee (0.05%)
|
|
297
460
|
tickSpacing: 10,
|
|
298
461
|
curves: [
|
|
299
|
-
{
|
|
300
|
-
|
|
462
|
+
{
|
|
463
|
+
tickLower: 0,
|
|
464
|
+
tickUpper: 220000,
|
|
465
|
+
numPositions: 12,
|
|
466
|
+
shares: parseEther('0.5'),
|
|
467
|
+
},
|
|
468
|
+
{
|
|
469
|
+
tickLower: 20000,
|
|
470
|
+
tickUpper: 220000,
|
|
471
|
+
numPositions: 12,
|
|
472
|
+
shares: parseEther('0.5'),
|
|
473
|
+
},
|
|
301
474
|
],
|
|
302
475
|
})
|
|
303
476
|
.withDecay({
|
|
304
477
|
startTime,
|
|
305
|
-
startFee: 3000,
|
|
478
|
+
startFee: 3000, // starts at 0.3%
|
|
306
479
|
durationSeconds: 3600, // decays to pool.fee over 1 hour
|
|
307
480
|
})
|
|
308
481
|
.withGovernance({ type: 'default' })
|
|
309
482
|
.withMigration({ type: 'uniswapV2' })
|
|
310
483
|
.withUserAddress('0x...')
|
|
311
|
-
.build()
|
|
484
|
+
.build();
|
|
312
485
|
|
|
313
|
-
const decayResult = await sdk.factory.createMulticurve(decay)
|
|
314
|
-
console.log('Pool address:', decayResult.poolAddress)
|
|
315
|
-
console.log('Token address:', decayResult.tokenAddress)
|
|
486
|
+
const decayResult = await sdk.factory.createMulticurve(decay);
|
|
487
|
+
console.log('Pool address:', decayResult.poolAddress);
|
|
488
|
+
console.log('Token address:', decayResult.tokenAddress);
|
|
316
489
|
```
|
|
317
490
|
|
|
318
491
|
For decay pools, `pool.fee` is always the terminal fee (`endFee`) of the schedule. `withDecay({ startTime })` is optional; if omitted, `startTime` defaults to `0`. The SDK supports `startFee` values up to `800_000` (80%) for anti-sniping configurations. Ensure your deployed decay initializer/hook also supports the same max start fee. Override the decay initializer module with `.withV4DecayMulticurveInitializer('0x...')` when targeting custom deployments.
|
|
@@ -322,36 +495,54 @@ For decay pools, `pool.fee` is always the terminal fee (`endFee`) of the schedul
|
|
|
322
495
|
When you want fee revenue to flow to specific addresses without migrating liquidity after the auction, use lockable beneficiaries with NoOp migration:
|
|
323
496
|
|
|
324
497
|
```typescript
|
|
325
|
-
import { WAD } from '@whetstone-research/doppler-sdk'
|
|
498
|
+
import { WAD } from '@whetstone-research/doppler-sdk';
|
|
326
499
|
|
|
327
500
|
// Define beneficiaries with shares that sum to WAD (1e18 = 100%)
|
|
328
501
|
// IMPORTANT: Protocol owner must be included with at least 5% shares
|
|
329
502
|
const lockableBeneficiaries = [
|
|
330
|
-
{ beneficiary: '0xProtocolOwner...', shares: WAD / 10n },
|
|
503
|
+
{ beneficiary: '0xProtocolOwner...', shares: WAD / 10n }, // 10% to protocol (>= 5% required)
|
|
331
504
|
{ beneficiary: '0xYourAddress...', shares: (WAD * 4n) / 10n }, // 40%
|
|
332
|
-
{ beneficiary: '0xOtherAddress...', shares: WAD / 2n },
|
|
333
|
-
]
|
|
505
|
+
{ beneficiary: '0xOtherAddress...', shares: WAD / 2n }, // 50%
|
|
506
|
+
];
|
|
334
507
|
|
|
335
508
|
const params = new MulticurveBuilder(base.id)
|
|
336
|
-
.tokenConfig({
|
|
337
|
-
|
|
509
|
+
.tokenConfig({
|
|
510
|
+
name: 'My Token',
|
|
511
|
+
symbol: 'MTK',
|
|
512
|
+
tokenURI: 'https://example.com/metadata.json',
|
|
513
|
+
})
|
|
514
|
+
.saleConfig({
|
|
515
|
+
initialSupply: parseEther('1000000'),
|
|
516
|
+
numTokensToSell: parseEther('900000'),
|
|
517
|
+
numeraire: '0x...',
|
|
518
|
+
})
|
|
338
519
|
.poolConfig({
|
|
339
520
|
fee: 3000, // 0.3% fee tier - set > 0 to accumulate fees for beneficiaries
|
|
340
521
|
tickSpacing: 8,
|
|
341
522
|
curves: [
|
|
342
|
-
{
|
|
343
|
-
|
|
523
|
+
{
|
|
524
|
+
tickLower: 0,
|
|
525
|
+
tickUpper: 240000,
|
|
526
|
+
numPositions: 10,
|
|
527
|
+
shares: parseEther('0.5'),
|
|
528
|
+
},
|
|
529
|
+
{
|
|
530
|
+
tickLower: 16000,
|
|
531
|
+
tickUpper: 240000,
|
|
532
|
+
numPositions: 10,
|
|
533
|
+
shares: parseEther('0.5'),
|
|
534
|
+
},
|
|
344
535
|
],
|
|
345
536
|
beneficiaries: lockableBeneficiaries, // Add beneficiaries for fee streaming
|
|
346
537
|
})
|
|
347
538
|
.withGovernance({ type: 'default' })
|
|
348
539
|
.withMigration({ type: 'noOp' }) // Use NoOp migration with lockable beneficiaries
|
|
349
540
|
.withUserAddress('0x...')
|
|
350
|
-
.build()
|
|
541
|
+
.build();
|
|
351
542
|
|
|
352
|
-
const result = await sdk.factory.createMulticurve(params)
|
|
353
|
-
const assetAddress = result.tokenAddress // SAVE THIS - you'll need it to collect fees!
|
|
354
|
-
console.log('Asset address:', assetAddress)
|
|
543
|
+
const result = await sdk.factory.createMulticurve(params);
|
|
544
|
+
const assetAddress = result.tokenAddress; // SAVE THIS - you'll need it to collect fees!
|
|
545
|
+
console.log('Asset address:', assetAddress);
|
|
355
546
|
|
|
356
547
|
// Later, to collect fees (works before and after migration):
|
|
357
548
|
// const pool = await sdk.getMulticurvePool(assetAddress)
|
|
@@ -359,6 +550,7 @@ console.log('Asset address:', assetAddress)
|
|
|
359
550
|
```
|
|
360
551
|
|
|
361
552
|
**Important Notes:**
|
|
553
|
+
|
|
362
554
|
- Set `fee` > 0 (e.g., 3000 for 0.3%) to accumulate trading fees for beneficiaries
|
|
363
555
|
- **Save the asset address** (token address) returned from creation - you need it to collect fees later
|
|
364
556
|
- Beneficiaries receive fees proportional to their shares when `collectFees()` is called
|
|
@@ -369,25 +561,35 @@ console.log('Asset address:', assetAddress)
|
|
|
369
561
|
See [examples/multicurve-lockable-beneficiaries.ts](./examples/multicurve-lockable-beneficiaries.ts) for a complete example.
|
|
370
562
|
|
|
371
563
|
#### Transaction gas override
|
|
564
|
+
|
|
372
565
|
- You can pass a gas limit to factory create calls via the `gas` field on `CreateStaticAuctionParams` / `CreateDynamicAuctionParams` / `CreateMulticurveParams`.
|
|
373
566
|
- If omitted, the SDK uses the simulation's gas estimate when available, falling back to 13,500,000 gas for the `create()` transaction.
|
|
374
567
|
- `simulateCreate*` helpers now return `gasEstimate` so you can tune overrides before sending.
|
|
375
568
|
- Builders expose `.withGasLimit(gas: bigint)` so you can set overrides fluently.
|
|
376
569
|
|
|
377
|
-
|
|
378
|
-
|
|
379
570
|
### Builder Pattern (Recommended)
|
|
380
571
|
|
|
381
572
|
Prefer using the builders to construct `CreateStaticAuctionParams` and `CreateDynamicAuctionParams` fluently and safely. Builders apply sensible defaults and can compute ticks and gamma for you.
|
|
382
573
|
|
|
383
574
|
```typescript
|
|
384
|
-
import {
|
|
385
|
-
|
|
575
|
+
import {
|
|
576
|
+
StaticAuctionBuilder,
|
|
577
|
+
DynamicAuctionBuilder,
|
|
578
|
+
} from '@whetstone-research/doppler-sdk';
|
|
579
|
+
import { parseEther } from 'viem';
|
|
386
580
|
|
|
387
581
|
// Dynamic auction via builder
|
|
388
582
|
const dynamicParams = new DynamicAuctionBuilder()
|
|
389
|
-
.tokenConfig({
|
|
390
|
-
|
|
583
|
+
.tokenConfig({
|
|
584
|
+
name: 'My Token',
|
|
585
|
+
symbol: 'MTK',
|
|
586
|
+
tokenURI: 'https://example.com/metadata.json',
|
|
587
|
+
})
|
|
588
|
+
.saleConfig({
|
|
589
|
+
initialSupply: parseEther('1000000'),
|
|
590
|
+
numTokensToSell: parseEther('500000'),
|
|
591
|
+
numeraire: wethAddress,
|
|
592
|
+
})
|
|
391
593
|
.poolConfig({ fee: 3000, tickSpacing: 60 })
|
|
392
594
|
.auctionByPriceRange({
|
|
393
595
|
priceRange: { startPrice: 0.0001, endPrice: 0.001 },
|
|
@@ -396,20 +598,31 @@ const dynamicParams = new DynamicAuctionBuilder()
|
|
|
396
598
|
})
|
|
397
599
|
.withMigration({ type: 'uniswapV2' })
|
|
398
600
|
.withUserAddress('0x...')
|
|
399
|
-
.build()
|
|
601
|
+
.build();
|
|
400
602
|
|
|
401
|
-
const dyn = await sdk.factory.createDynamicAuction(dynamicParams)
|
|
603
|
+
const dyn = await sdk.factory.createDynamicAuction(dynamicParams);
|
|
402
604
|
|
|
403
605
|
// Static auction via builder
|
|
404
606
|
const staticParams = new StaticAuctionBuilder()
|
|
405
|
-
.tokenConfig({
|
|
406
|
-
|
|
407
|
-
|
|
607
|
+
.tokenConfig({
|
|
608
|
+
name: 'My Token',
|
|
609
|
+
symbol: 'MTK',
|
|
610
|
+
tokenURI: 'https://example.com/metadata.json',
|
|
611
|
+
})
|
|
612
|
+
.saleConfig({
|
|
613
|
+
initialSupply: parseEther('1000000000'),
|
|
614
|
+
numTokensToSell: parseEther('900000000'),
|
|
615
|
+
numeraire: wethAddress,
|
|
616
|
+
})
|
|
617
|
+
.poolByPriceRange({
|
|
618
|
+
priceRange: { startPrice: 0.0001, endPrice: 0.001 },
|
|
619
|
+
fee: 3000,
|
|
620
|
+
})
|
|
408
621
|
.withMigration({ type: 'uniswapV2' })
|
|
409
622
|
.withUserAddress('0x...')
|
|
410
|
-
.build()
|
|
623
|
+
.build();
|
|
411
624
|
|
|
412
|
-
const stat = await sdk.factory.createStaticAuction(staticParams)
|
|
625
|
+
const stat = await sdk.factory.createStaticAuction(staticParams);
|
|
413
626
|
```
|
|
414
627
|
|
|
415
628
|
### Simplified Creation with Defaults
|
|
@@ -419,19 +632,35 @@ The SDK intelligently applies defaults when parameters are omitted. Here are exa
|
|
|
419
632
|
```typescript
|
|
420
633
|
// Minimal static auction via builder
|
|
421
634
|
const staticMinimal = new StaticAuctionBuilder()
|
|
422
|
-
.tokenConfig({
|
|
423
|
-
|
|
635
|
+
.tokenConfig({
|
|
636
|
+
name: 'My Token',
|
|
637
|
+
symbol: 'MTK',
|
|
638
|
+
tokenURI: 'https://example.com/metadata.json',
|
|
639
|
+
})
|
|
640
|
+
.saleConfig({
|
|
641
|
+
initialSupply: parseEther('1000000000'),
|
|
642
|
+
numTokensToSell: parseEther('900000000'),
|
|
643
|
+
numeraire: '0x...',
|
|
644
|
+
})
|
|
424
645
|
.poolByTicks({ fee: 10000 }) // uses default tick range and numPositions
|
|
425
646
|
.withMigration({ type: 'uniswapV2' })
|
|
426
647
|
.withUserAddress('0x...')
|
|
427
|
-
.build()
|
|
648
|
+
.build();
|
|
428
649
|
|
|
429
|
-
const staticResult = await sdk.factory.createStaticAuction(staticMinimal)
|
|
650
|
+
const staticResult = await sdk.factory.createStaticAuction(staticMinimal);
|
|
430
651
|
|
|
431
652
|
// Minimal dynamic auction via builder
|
|
432
653
|
const dynamicMinimal = new DynamicAuctionBuilder()
|
|
433
|
-
.tokenConfig({
|
|
434
|
-
|
|
654
|
+
.tokenConfig({
|
|
655
|
+
name: 'My Token',
|
|
656
|
+
symbol: 'MTK',
|
|
657
|
+
tokenURI: 'https://example.com/metadata.json',
|
|
658
|
+
})
|
|
659
|
+
.saleConfig({
|
|
660
|
+
initialSupply: parseEther('1000000'),
|
|
661
|
+
numTokensToSell: parseEther('900000'),
|
|
662
|
+
numeraire: '0x...',
|
|
663
|
+
})
|
|
435
664
|
.poolConfig({ fee: 3000, tickSpacing: 60 })
|
|
436
665
|
.auctionByTicks({
|
|
437
666
|
startTick: -92103,
|
|
@@ -441,9 +670,9 @@ const dynamicMinimal = new DynamicAuctionBuilder()
|
|
|
441
670
|
}) // duration/epoch defaults applied; gamma computed automatically
|
|
442
671
|
.withMigration({ type: 'uniswapV4' })
|
|
443
672
|
.withUserAddress('0x...')
|
|
444
|
-
.build()
|
|
673
|
+
.build();
|
|
445
674
|
|
|
446
|
-
const dynamicResult = await sdk.factory.createDynamicAuction(dynamicMinimal)
|
|
675
|
+
const dynamicResult = await sdk.factory.createDynamicAuction(dynamicMinimal);
|
|
447
676
|
```
|
|
448
677
|
|
|
449
678
|
## Interacting with Auctions
|
|
@@ -521,6 +750,7 @@ const numeraireAddress = await pool.getNumeraireAddress();
|
|
|
521
750
|
**Fee Collection Technical Details:**
|
|
522
751
|
|
|
523
752
|
The SDK handles the complexity of fee collection by:
|
|
753
|
+
|
|
524
754
|
1. **Retrieving pool configuration** from the multicurve initializer contract
|
|
525
755
|
2. **Detecting migration status** and, if the pool has migrated, resolving the shared `StreamableFeesLockerV2`
|
|
526
756
|
address via the multicurve migrator (no manual lookup required)
|
|
@@ -529,6 +759,7 @@ The SDK handles the complexity of fee collection by:
|
|
|
529
759
|
5. **Distributing fees** proportionally to all configured beneficiaries
|
|
530
760
|
|
|
531
761
|
**Important Notes:**
|
|
762
|
+
|
|
532
763
|
- Fees accumulate from swap activity on the pool (only if fee tier > 0)
|
|
533
764
|
- Anyone can call `collectFees()`, but fees are distributed to beneficiaries only
|
|
534
765
|
- Fees are automatically split according to configured beneficiary shares
|
|
@@ -541,6 +772,7 @@ The SDK handles the complexity of fee collection by:
|
|
|
541
772
|
- Beneficiaries must be configured at pool creation time and cannot be changed
|
|
542
773
|
|
|
543
774
|
**Common Use Cases:**
|
|
775
|
+
|
|
544
776
|
- Set up periodic fee collection (e.g., daily or weekly)
|
|
545
777
|
- Integrate with a bot that automatically collects fees when threshold is reached
|
|
546
778
|
- Allow any beneficiary to trigger collection after significant trading activity
|
|
@@ -573,9 +805,10 @@ await token.release();
|
|
|
573
805
|
```
|
|
574
806
|
|
|
575
807
|
Alternatively, you can instantiate directly if needed:
|
|
808
|
+
|
|
576
809
|
```typescript
|
|
577
|
-
import { Derc20 } from '@whetstone-research/doppler-sdk'
|
|
578
|
-
const tokenDirect = new Derc20(publicClient, walletClient, tokenAddress)
|
|
810
|
+
import { Derc20 } from '@whetstone-research/doppler-sdk';
|
|
811
|
+
const tokenDirect = new Derc20(publicClient, walletClient, tokenAddress);
|
|
579
812
|
```
|
|
580
813
|
|
|
581
814
|
### Governance Delegation (ERC20Votes)
|
|
@@ -583,81 +816,105 @@ const tokenDirect = new Derc20(publicClient, walletClient, tokenAddress)
|
|
|
583
816
|
DERC20 extends OpenZeppelin's ERC20Votes. Voting power is tracked via checkpoints and only updates once an address delegates voting power (typically to itself). The SDK exposes simple read/write helpers for delegation.
|
|
584
817
|
|
|
585
818
|
Basics:
|
|
819
|
+
|
|
586
820
|
```ts
|
|
587
|
-
import { Derc20 } from '@whetstone-research/doppler-sdk'
|
|
821
|
+
import { Derc20 } from '@whetstone-research/doppler-sdk';
|
|
588
822
|
|
|
589
|
-
const token = sdk.getDerc20(tokenAddress)
|
|
823
|
+
const token = sdk.getDerc20(tokenAddress);
|
|
590
824
|
|
|
591
825
|
// Read: who an account delegates to, and current voting power
|
|
592
|
-
const currentDelegate = await token.getDelegates(userAddress)
|
|
593
|
-
const votes = await token.getVotes(userAddress)
|
|
826
|
+
const currentDelegate = await token.getDelegates(userAddress);
|
|
827
|
+
const votes = await token.getVotes(userAddress);
|
|
594
828
|
|
|
595
829
|
// Self‑delegate to activate vote tracking
|
|
596
|
-
await token.delegate(userAddress)
|
|
830
|
+
await token.delegate(userAddress);
|
|
597
831
|
|
|
598
832
|
// Or delegate to another address
|
|
599
|
-
await token.delegate('0xDelegatee...')
|
|
833
|
+
await token.delegate('0xDelegatee...');
|
|
600
834
|
```
|
|
601
835
|
|
|
602
836
|
Historical votes:
|
|
837
|
+
|
|
603
838
|
```ts
|
|
604
839
|
// OZ v5 uses timepoints (block numbers for block‑based clocks)
|
|
605
|
-
const blockNumber = await publicClient.getBlockNumber()
|
|
606
|
-
const pastVotes = await token.getPastVotes(userAddress, blockNumber - 1n)
|
|
840
|
+
const blockNumber = await publicClient.getBlockNumber();
|
|
841
|
+
const pastVotes = await token.getPastVotes(userAddress, blockNumber - 1n);
|
|
607
842
|
```
|
|
608
843
|
|
|
609
844
|
Signature‑based delegation (delegateBySig):
|
|
845
|
+
|
|
610
846
|
```ts
|
|
611
847
|
// Signs an EIP‑712 message and submits a transaction calling delegateBySig
|
|
612
848
|
// Note: This still submits a transaction from the connected wallet.
|
|
613
|
-
const expiry = BigInt(Math.floor(Date.now() / 1000) + 3600) // 1h
|
|
614
|
-
await token.delegateBySig('0xDelegatee...', expiry)
|
|
849
|
+
const expiry = BigInt(Math.floor(Date.now() / 1000) + 3600); // 1h
|
|
850
|
+
await token.delegateBySig('0xDelegatee...', expiry);
|
|
615
851
|
```
|
|
616
852
|
|
|
617
853
|
Advanced: gasless delegation via relayer
|
|
854
|
+
|
|
618
855
|
- The token supports `delegateBySig(delegatee, nonce, expiry, v, r, s)`. A relayer can submit this on behalf of the user if it holds ETH for gas.
|
|
619
856
|
- To do this, have the user sign typed data, then send the signature to your backend that calls the contract.
|
|
620
857
|
|
|
621
858
|
Client (sign only):
|
|
859
|
+
|
|
622
860
|
```ts
|
|
623
861
|
const [nonce, name] = await Promise.all([
|
|
624
|
-
publicClient.readContract({
|
|
862
|
+
publicClient.readContract({
|
|
863
|
+
address: tokenAddress,
|
|
864
|
+
abi: derc20Abi,
|
|
865
|
+
functionName: 'nonces',
|
|
866
|
+
args: [userAddress],
|
|
867
|
+
}),
|
|
625
868
|
token.getName(),
|
|
626
|
-
])
|
|
627
|
-
const chainId = await publicClient.getChainId()
|
|
628
|
-
const domain = {
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
const
|
|
869
|
+
]);
|
|
870
|
+
const chainId = await publicClient.getChainId();
|
|
871
|
+
const domain = {
|
|
872
|
+
name,
|
|
873
|
+
version: '1',
|
|
874
|
+
chainId,
|
|
875
|
+
verifyingContract: tokenAddress,
|
|
876
|
+
} as const;
|
|
877
|
+
const types = {
|
|
878
|
+
Delegation: [
|
|
879
|
+
{ name: 'delegatee', type: 'address' },
|
|
880
|
+
{ name: 'nonce', type: 'uint256' },
|
|
881
|
+
{ name: 'expiry', type: 'uint256' },
|
|
882
|
+
],
|
|
883
|
+
} as const;
|
|
884
|
+
const message = { delegatee: '0xDelegatee...', nonce, expiry } as const;
|
|
635
885
|
|
|
636
886
|
const signature = await walletClient.signTypedData({
|
|
637
|
-
domain,
|
|
638
|
-
|
|
887
|
+
domain,
|
|
888
|
+
types,
|
|
889
|
+
primaryType: 'Delegation',
|
|
890
|
+
message,
|
|
891
|
+
account: userAddress,
|
|
892
|
+
});
|
|
639
893
|
// POST { signature, delegatee, nonce, expiry } to your relayer
|
|
640
894
|
```
|
|
641
895
|
|
|
642
896
|
Relayer (submit tx):
|
|
897
|
+
|
|
643
898
|
```ts
|
|
644
899
|
function splitSig(sig: `0x${string}`) {
|
|
645
|
-
const r = `0x${sig.slice(2, 66)}` as `0x${string}
|
|
646
|
-
const s = `0x${sig.slice(66, 130)}` as `0x${string}
|
|
647
|
-
let v = parseInt(sig.slice(130, 132), 16);
|
|
648
|
-
|
|
900
|
+
const r = `0x${sig.slice(2, 66)}` as `0x${string}`;
|
|
901
|
+
const s = `0x${sig.slice(66, 130)}` as `0x${string}`;
|
|
902
|
+
let v = parseInt(sig.slice(130, 132), 16);
|
|
903
|
+
if (v < 27) v += 27;
|
|
904
|
+
return { v, r, s };
|
|
649
905
|
}
|
|
650
906
|
|
|
651
|
-
const { v, r, s } = splitSig(signature)
|
|
907
|
+
const { v, r, s } = splitSig(signature);
|
|
652
908
|
await relayerWallet.writeContract({
|
|
653
909
|
address: tokenAddress,
|
|
654
910
|
abi: derc20Abi,
|
|
655
911
|
functionName: 'delegateBySig',
|
|
656
912
|
args: ['0xDelegatee...', nonce, expiry, v, r, s],
|
|
657
|
-
})
|
|
913
|
+
});
|
|
658
914
|
```
|
|
659
915
|
|
|
660
916
|
Notes
|
|
917
|
+
|
|
661
918
|
- Users must delegate (even to themselves) before votes appear in `getVotes`.
|
|
662
919
|
- `getPastVotes`/`getPastTotalSupply` expect a timepoint; for block‑based clocks, pass a block number that has already been mined.
|
|
663
920
|
- Events you may track: `DelegateChanged` and `DelegateVotesChanged` for live updates.
|
|
@@ -698,6 +955,7 @@ console.log('Price after swap:', quote.sqrtPriceX96After);
|
|
|
698
955
|
For static auctions, you can create the pool and execute a pre‑buy in a single transaction via the Bundler.
|
|
699
956
|
|
|
700
957
|
High‑level flow:
|
|
958
|
+
|
|
701
959
|
- Simulate create to get `CreateParams` and the predicted token address
|
|
702
960
|
- Decide `amountOut` to buy, simulate `amountIn` with `simulateBundleExactOutput(...)`
|
|
703
961
|
- Build Universal Router commands (e.g., via `doppler-router`)
|
|
@@ -714,21 +972,27 @@ before attempting these flows; if you see
|
|
|
714
972
|
|
|
715
973
|
```ts
|
|
716
974
|
// Prepare multicurve CreateParams up front
|
|
717
|
-
const createParams = sdk.factory.encodeCreateMulticurveParams(multicurveConfig)
|
|
975
|
+
const createParams = sdk.factory.encodeCreateMulticurveParams(multicurveConfig);
|
|
718
976
|
|
|
719
977
|
// Quote an exact-out bundle
|
|
720
|
-
const exactOutQuote = await sdk.factory.simulateMulticurveBundleExactOut(
|
|
721
|
-
|
|
722
|
-
|
|
978
|
+
const exactOutQuote = await sdk.factory.simulateMulticurveBundleExactOut(
|
|
979
|
+
createParams,
|
|
980
|
+
{
|
|
981
|
+
exactAmountOut: parseEther('100'),
|
|
982
|
+
},
|
|
983
|
+
);
|
|
723
984
|
|
|
724
985
|
// Quote an exact-in bundle
|
|
725
|
-
const exactInQuote = await sdk.factory.simulateMulticurveBundleExactIn(
|
|
726
|
-
|
|
727
|
-
|
|
986
|
+
const exactInQuote = await sdk.factory.simulateMulticurveBundleExactIn(
|
|
987
|
+
createParams,
|
|
988
|
+
{
|
|
989
|
+
exactAmountIn: parseEther('25'),
|
|
990
|
+
},
|
|
991
|
+
);
|
|
728
992
|
|
|
729
|
-
console.log('Predicted asset:', exactOutQuote.asset)
|
|
730
|
-
console.log('PoolKey:', exactOutQuote.poolKey)
|
|
731
|
-
console.log('Input required:', exactOutQuote.amountIn)
|
|
993
|
+
console.log('Predicted asset:', exactOutQuote.asset);
|
|
994
|
+
console.log('PoolKey:', exactOutQuote.poolKey);
|
|
995
|
+
console.log('Input required:', exactOutQuote.amountIn);
|
|
732
996
|
```
|
|
733
997
|
|
|
734
998
|
The multicurve helpers automatically normalise the returned PoolKey to maintain canonical token ordering and
|
|
@@ -739,6 +1003,7 @@ hash the result when collecting fees, so consumers no longer need to manually as
|
|
|
739
1003
|
The SDK supports flexible migration paths after auction completion:
|
|
740
1004
|
|
|
741
1005
|
### Migrate to Uniswap V2
|
|
1006
|
+
|
|
742
1007
|
```typescript
|
|
743
1008
|
migration: {
|
|
744
1009
|
type: 'uniswapV2',
|
|
@@ -746,6 +1011,7 @@ migration: {
|
|
|
746
1011
|
```
|
|
747
1012
|
|
|
748
1013
|
### Migrate to Uniswap V3
|
|
1014
|
+
|
|
749
1015
|
```typescript
|
|
750
1016
|
migration: {
|
|
751
1017
|
type: 'uniswapV3',
|
|
@@ -755,6 +1021,7 @@ migration: {
|
|
|
755
1021
|
```
|
|
756
1022
|
|
|
757
1023
|
### Migrate to Uniswap V4
|
|
1024
|
+
|
|
758
1025
|
```typescript
|
|
759
1026
|
migration: {
|
|
760
1027
|
type: 'uniswapV4',
|
|
@@ -777,7 +1044,11 @@ migrated V4 pool. This migration type is only supported for dynamic auctions.
|
|
|
777
1044
|
```typescript
|
|
778
1045
|
const params = sdk
|
|
779
1046
|
.buildDynamicAuction()
|
|
780
|
-
.tokenConfig({
|
|
1047
|
+
.tokenConfig({
|
|
1048
|
+
name: 'Example',
|
|
1049
|
+
symbol: 'EX',
|
|
1050
|
+
tokenURI: 'https://example.com/token.json',
|
|
1051
|
+
})
|
|
781
1052
|
.saleConfig({
|
|
782
1053
|
initialSupply: parseEther('1000000'),
|
|
783
1054
|
numTokensToSell: parseEther('500000'),
|
|
@@ -803,10 +1074,17 @@ const params = sdk
|
|
|
803
1074
|
rehype: {
|
|
804
1075
|
buybackDestination: '0xYourBuybackDestination...',
|
|
805
1076
|
customFee: 3000,
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
1077
|
+
feeRoutingMode: 'directBuyback',
|
|
1078
|
+
feeDistributionInfo: {
|
|
1079
|
+
assetFeesToAssetBuybackWad: parseEther('0.25'),
|
|
1080
|
+
assetFeesToNumeraireBuybackWad: parseEther('0.25'),
|
|
1081
|
+
assetFeesToBeneficiaryWad: parseEther('0.25'),
|
|
1082
|
+
assetFeesToLpWad: parseEther('0.25'),
|
|
1083
|
+
numeraireFeesToAssetBuybackWad: parseEther('0.25'),
|
|
1084
|
+
numeraireFeesToNumeraireBuybackWad: parseEther('0.25'),
|
|
1085
|
+
numeraireFeesToBeneficiaryWad: parseEther('0.25'),
|
|
1086
|
+
numeraireFeesToLpWad: parseEther('0.25'),
|
|
1087
|
+
},
|
|
810
1088
|
},
|
|
811
1089
|
})
|
|
812
1090
|
.withUserAddress('0xYourAddress...')
|
|
@@ -815,6 +1093,8 @@ const params = sdk
|
|
|
815
1093
|
|
|
816
1094
|
Note: `dopplerHook` migrator beneficiaries must include the current Airlock owner
|
|
817
1095
|
with at least 5% shares, and total shares must sum to `1e18`.
|
|
1096
|
+
Unlike initializer-side Rehype pools, migrator-side Rehype uses a static
|
|
1097
|
+
`customFee`; there is no fee decay schedule in this mode.
|
|
818
1098
|
|
|
819
1099
|
```typescript
|
|
820
1100
|
migration: {
|
|
@@ -831,10 +1111,17 @@ migration: {
|
|
|
831
1111
|
// hookAddress: '0xRehypeMigratorHook...',
|
|
832
1112
|
buybackDestination: '0xYourBuybackDestination...',
|
|
833
1113
|
customFee: 3000,
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
1114
|
+
feeRoutingMode: 'directBuyback',
|
|
1115
|
+
feeDistributionInfo: {
|
|
1116
|
+
assetFeesToAssetBuybackWad: parseEther('0.25'),
|
|
1117
|
+
assetFeesToNumeraireBuybackWad: parseEther('0.25'),
|
|
1118
|
+
assetFeesToBeneficiaryWad: parseEther('0.25'),
|
|
1119
|
+
assetFeesToLpWad: parseEther('0.25'),
|
|
1120
|
+
numeraireFeesToAssetBuybackWad: parseEther('0.25'),
|
|
1121
|
+
numeraireFeesToNumeraireBuybackWad: parseEther('0.25'),
|
|
1122
|
+
numeraireFeesToBeneficiaryWad: parseEther('0.25'),
|
|
1123
|
+
numeraireFeesToLpWad: parseEther('0.25'),
|
|
1124
|
+
},
|
|
838
1125
|
},
|
|
839
1126
|
proceedsSplit: {
|
|
840
1127
|
recipient: '0xProceedsRecipient...',
|
|
@@ -847,18 +1134,22 @@ To make configuring the first beneficiary simpler, the SDK now exposes helpers f
|
|
|
847
1134
|
airlock owner and creating the default 5% entry:
|
|
848
1135
|
|
|
849
1136
|
```ts
|
|
850
|
-
import {
|
|
851
|
-
|
|
1137
|
+
import {
|
|
1138
|
+
DopplerSDK,
|
|
1139
|
+
createAirlockBeneficiary,
|
|
1140
|
+
getAirlockOwner,
|
|
1141
|
+
} from '@whetstone-research/doppler-sdk';
|
|
1142
|
+
import { parseEther } from 'viem';
|
|
852
1143
|
|
|
853
|
-
const sdk = new DopplerSDK({ publicClient, chainId })
|
|
1144
|
+
const sdk = new DopplerSDK({ publicClient, chainId });
|
|
854
1145
|
|
|
855
1146
|
// Get the owner and construct the beneficiary entry (5% by default)
|
|
856
|
-
const airlockBeneficiary = await sdk.getAirlockBeneficiary()
|
|
1147
|
+
const airlockBeneficiary = await sdk.getAirlockBeneficiary();
|
|
857
1148
|
|
|
858
1149
|
// Or build the entry manually if you do not have an SDK instance handy
|
|
859
1150
|
// (airlockEntry will be equivalent to airlockBeneficiary above)
|
|
860
|
-
const owner = await getAirlockOwner(publicClient)
|
|
861
|
-
const airlockEntry = createAirlockBeneficiary(owner) // defaults to 5% shares
|
|
1151
|
+
const owner = await getAirlockOwner(publicClient);
|
|
1152
|
+
const airlockEntry = createAirlockBeneficiary(owner); // defaults to 5% shares
|
|
862
1153
|
|
|
863
1154
|
const migration = {
|
|
864
1155
|
type: 'uniswapV4' as const,
|
|
@@ -871,11 +1162,9 @@ const migration = {
|
|
|
871
1162
|
{ beneficiary: '0xYourDAO...', shares: parseEther('0.95') }, // 95%
|
|
872
1163
|
],
|
|
873
1164
|
},
|
|
874
|
-
}
|
|
1165
|
+
};
|
|
875
1166
|
```
|
|
876
1167
|
|
|
877
|
-
|
|
878
|
-
|
|
879
1168
|
## Supported Chains
|
|
880
1169
|
|
|
881
1170
|
The SDK exposes runtime constants and TypeScript types for supported chains:
|
|
@@ -888,21 +1177,21 @@ import {
|
|
|
888
1177
|
isSupportedChainId,
|
|
889
1178
|
type SupportedChainId,
|
|
890
1179
|
type ChainAddresses,
|
|
891
|
-
} from '@whetstone-research/doppler-sdk'
|
|
1180
|
+
} from '@whetstone-research/doppler-sdk';
|
|
892
1181
|
|
|
893
1182
|
// Validate and narrow a chain ID
|
|
894
1183
|
function ensureSupported(id: number): SupportedChainId {
|
|
895
|
-
if (!isSupportedChainId(id)) throw new Error('Unsupported chain')
|
|
896
|
-
return id
|
|
1184
|
+
if (!isSupportedChainId(id)) throw new Error('Unsupported chain');
|
|
1185
|
+
return id;
|
|
897
1186
|
}
|
|
898
1187
|
|
|
899
|
-
const chainId = ensureSupported(CHAIN_IDS.BASE)
|
|
900
|
-
const addresses: ChainAddresses = getAddresses(chainId)
|
|
901
|
-
console.log('Airlock for Base:', addresses.airlock)
|
|
1188
|
+
const chainId = ensureSupported(CHAIN_IDS.BASE);
|
|
1189
|
+
const addresses: ChainAddresses = getAddresses(chainId);
|
|
1190
|
+
console.log('Airlock for Base:', addresses.airlock);
|
|
902
1191
|
|
|
903
1192
|
// Iterate supported chains
|
|
904
1193
|
for (const id of SUPPORTED_CHAIN_IDS) {
|
|
905
|
-
console.log('Supported chain id:', id)
|
|
1194
|
+
console.log('Supported chain id:', id);
|
|
906
1195
|
}
|
|
907
1196
|
```
|
|
908
1197
|
|
|
@@ -925,6 +1214,7 @@ vesting: {
|
|
|
925
1214
|
The Doppler protocol uses CREATE2 for deterministic deployments, enabling you to find vanity addresses for both tokens and hooks before submitting transactions. The SDK provides a `mineTokenAddress` utility that mirrors on-chain calculations.
|
|
926
1215
|
|
|
927
1216
|
`mineTokenAddress` supports matching:
|
|
1217
|
+
|
|
928
1218
|
- A **prefix** (address starts with hex characters)
|
|
929
1219
|
- A **suffix** (address ends with hex characters, useful as an identifier)
|
|
930
1220
|
- Both prefix + suffix simultaneously (logical AND)
|
|
@@ -938,12 +1228,16 @@ import {
|
|
|
938
1228
|
StaticAuctionBuilder,
|
|
939
1229
|
mineTokenAddress,
|
|
940
1230
|
getAddresses,
|
|
941
|
-
} from '@whetstone-research/doppler-sdk'
|
|
942
|
-
import { parseEther } from 'viem'
|
|
943
|
-
import { base } from 'viem/chains'
|
|
1231
|
+
} from '@whetstone-research/doppler-sdk';
|
|
1232
|
+
import { parseEther } from 'viem';
|
|
1233
|
+
import { base } from 'viem/chains';
|
|
944
1234
|
|
|
945
1235
|
const builder = new StaticAuctionBuilder(base.id)
|
|
946
|
-
.tokenConfig({
|
|
1236
|
+
.tokenConfig({
|
|
1237
|
+
name: 'Vanity Token',
|
|
1238
|
+
symbol: 'VNY',
|
|
1239
|
+
tokenURI: 'https://example.com/token.json',
|
|
1240
|
+
})
|
|
947
1241
|
.saleConfig({
|
|
948
1242
|
initialSupply: parseEther('1000000'),
|
|
949
1243
|
numTokensToSell: parseEther('750000'),
|
|
@@ -952,12 +1246,13 @@ const builder = new StaticAuctionBuilder(base.id)
|
|
|
952
1246
|
.poolByTicks({ startTick: -92100, endTick: -69060, fee: 3000 })
|
|
953
1247
|
.withGovernance({ type: 'default' })
|
|
954
1248
|
.withMigration({ type: 'uniswapV3', fee: 3000, tickSpacing: 60 })
|
|
955
|
-
.withUserAddress('0x...')
|
|
1249
|
+
.withUserAddress('0x...');
|
|
956
1250
|
|
|
957
|
-
const staticParams = builder.build()
|
|
1251
|
+
const staticParams = builder.build();
|
|
958
1252
|
// Fetch the encoded create() payload without sending the transaction
|
|
959
|
-
const createParams =
|
|
960
|
-
|
|
1253
|
+
const createParams =
|
|
1254
|
+
await sdk.factory.encodeCreateStaticAuctionParams(staticParams);
|
|
1255
|
+
const addresses = getAddresses(base.id);
|
|
961
1256
|
|
|
962
1257
|
const { salt, tokenAddress, iterations } = mineTokenAddress({
|
|
963
1258
|
prefix: 'dead', // omit 0x prefix
|
|
@@ -967,9 +1262,11 @@ const { salt, tokenAddress, iterations } = mineTokenAddress({
|
|
|
967
1262
|
owner: addresses.airlock,
|
|
968
1263
|
tokenData: createParams.tokenFactoryData,
|
|
969
1264
|
maxIterations: 1_000_000, // optional safety cap
|
|
970
|
-
})
|
|
1265
|
+
});
|
|
971
1266
|
|
|
972
|
-
console.log(
|
|
1267
|
+
console.log(
|
|
1268
|
+
`Vanity token ${tokenAddress} found after ${iterations} iterations`,
|
|
1269
|
+
);
|
|
973
1270
|
// Now submit airlock.create({ ...createParams, salt }) when ready to deploy
|
|
974
1271
|
```
|
|
975
1272
|
|
|
@@ -985,7 +1282,7 @@ const { salt, tokenAddress, iterations } = mineTokenAddress({
|
|
|
985
1282
|
owner: addresses.airlock,
|
|
986
1283
|
tokenData: createParams.tokenFactoryData,
|
|
987
1284
|
maxIterations: 1_000_000,
|
|
988
|
-
})
|
|
1285
|
+
});
|
|
989
1286
|
```
|
|
990
1287
|
|
|
991
1288
|
#### Mining Hook and Token Addresses (Dynamic Auctions)
|
|
@@ -999,12 +1296,16 @@ import {
|
|
|
999
1296
|
getAddresses,
|
|
1000
1297
|
DopplerBytecode,
|
|
1001
1298
|
DAY_SECONDS,
|
|
1002
|
-
} from '@whetstone-research/doppler-sdk'
|
|
1003
|
-
import { parseEther, keccak256, encodePacked, encodeAbiParameters } from 'viem'
|
|
1004
|
-
import { base } from 'viem/chains'
|
|
1299
|
+
} from '@whetstone-research/doppler-sdk';
|
|
1300
|
+
import { parseEther, keccak256, encodePacked, encodeAbiParameters } from 'viem';
|
|
1301
|
+
import { base } from 'viem/chains';
|
|
1005
1302
|
|
|
1006
1303
|
const builder = new DynamicAuctionBuilder()
|
|
1007
|
-
.tokenConfig({
|
|
1304
|
+
.tokenConfig({
|
|
1305
|
+
name: 'My Token',
|
|
1306
|
+
symbol: 'MTK',
|
|
1307
|
+
tokenURI: 'https://example.com/token.json',
|
|
1308
|
+
})
|
|
1008
1309
|
.saleConfig({
|
|
1009
1310
|
initialSupply: parseEther('1000000'),
|
|
1010
1311
|
numTokensToSell: parseEther('900000'),
|
|
@@ -1020,20 +1321,30 @@ const builder = new DynamicAuctionBuilder()
|
|
|
1020
1321
|
maxProceeds: parseEther('1000'),
|
|
1021
1322
|
})
|
|
1022
1323
|
.withMigration({ type: 'uniswapV4', fee: 3000, tickSpacing: 60 })
|
|
1023
|
-
.withUserAddress('0x...')
|
|
1324
|
+
.withUserAddress('0x...');
|
|
1024
1325
|
|
|
1025
|
-
const dynamicParams = builder.build()
|
|
1026
|
-
const { createParams } =
|
|
1027
|
-
|
|
1326
|
+
const dynamicParams = builder.build();
|
|
1327
|
+
const { createParams } =
|
|
1328
|
+
await sdk.factory.encodeCreateDynamicAuctionParams(dynamicParams);
|
|
1329
|
+
const addresses = getAddresses(base.id);
|
|
1028
1330
|
|
|
1029
1331
|
// Compute hook init code hash (required for hook mining)
|
|
1030
1332
|
const hookInitHashData = encodeAbiParameters(
|
|
1031
1333
|
[
|
|
1032
|
-
{ type: 'address' },
|
|
1033
|
-
{ type: 'uint256' },
|
|
1034
|
-
{ type: '
|
|
1035
|
-
{ type: '
|
|
1036
|
-
{ type: '
|
|
1334
|
+
{ type: 'address' },
|
|
1335
|
+
{ type: 'uint256' },
|
|
1336
|
+
{ type: 'uint256' },
|
|
1337
|
+
{ type: 'uint256' },
|
|
1338
|
+
{ type: 'uint256' },
|
|
1339
|
+
{ type: 'uint256' },
|
|
1340
|
+
{ type: 'int24' },
|
|
1341
|
+
{ type: 'int24' },
|
|
1342
|
+
{ type: 'uint256' },
|
|
1343
|
+
{ type: 'int24' },
|
|
1344
|
+
{ type: 'bool' },
|
|
1345
|
+
{ type: 'uint256' },
|
|
1346
|
+
{ type: 'address' },
|
|
1347
|
+
{ type: 'uint24' },
|
|
1037
1348
|
],
|
|
1038
1349
|
[
|
|
1039
1350
|
addresses.poolManager,
|
|
@@ -1042,15 +1353,15 @@ const hookInitHashData = encodeAbiParameters(
|
|
|
1042
1353
|
dynamicParams.auction.maxProceeds,
|
|
1043
1354
|
/* startingTime, endingTime, startTick, endTick, epochLength, gamma, isToken0, numPDSlugs */
|
|
1044
1355
|
/* poolInitializer, fee - extract from createParams */
|
|
1045
|
-
]
|
|
1046
|
-
)
|
|
1356
|
+
],
|
|
1357
|
+
);
|
|
1047
1358
|
|
|
1048
1359
|
const hookInitHash = keccak256(
|
|
1049
|
-
encodePacked(['bytes', 'bytes'], [DopplerBytecode, hookInitHashData])
|
|
1050
|
-
)
|
|
1360
|
+
encodePacked(['bytes', 'bytes'], [DopplerBytecode, hookInitHashData]),
|
|
1361
|
+
);
|
|
1051
1362
|
|
|
1052
1363
|
const result = mineTokenAddress({
|
|
1053
|
-
prefix: 'cafe',
|
|
1364
|
+
prefix: 'cafe', // Token prefix
|
|
1054
1365
|
tokenFactory: createParams.tokenFactory,
|
|
1055
1366
|
initialSupply: createParams.initialSupply,
|
|
1056
1367
|
recipient: addresses.airlock,
|
|
@@ -1064,11 +1375,11 @@ const result = mineTokenAddress({
|
|
|
1064
1375
|
initCodeHash: hookInitHash,
|
|
1065
1376
|
prefix: '00', // Hook prefix for gas optimization
|
|
1066
1377
|
},
|
|
1067
|
-
})
|
|
1378
|
+
});
|
|
1068
1379
|
|
|
1069
|
-
console.log('Token address:', result.tokenAddress)
|
|
1070
|
-
console.log('Hook address:', result.hookAddress) // only if hook config provided
|
|
1071
|
-
console.log(`Found after ${result.iterations} iterations`)
|
|
1380
|
+
console.log('Token address:', result.tokenAddress);
|
|
1381
|
+
console.log('Hook address:', result.hookAddress); // only if hook config provided
|
|
1382
|
+
console.log(`Found after ${result.iterations} iterations`);
|
|
1072
1383
|
```
|
|
1073
1384
|
|
|
1074
1385
|
#### Mining Token Addresses (Multicurve Auctions)
|
|
@@ -1080,12 +1391,16 @@ import {
|
|
|
1080
1391
|
MulticurveBuilder,
|
|
1081
1392
|
mineTokenAddress,
|
|
1082
1393
|
getAddresses,
|
|
1083
|
-
} from '@whetstone-research/doppler-sdk'
|
|
1084
|
-
import { parseEther } from 'viem'
|
|
1085
|
-
import { base } from 'viem/chains'
|
|
1394
|
+
} from '@whetstone-research/doppler-sdk';
|
|
1395
|
+
import { parseEther } from 'viem';
|
|
1396
|
+
import { base } from 'viem/chains';
|
|
1086
1397
|
|
|
1087
1398
|
const builder = new MulticurveBuilder(base.id)
|
|
1088
|
-
.tokenConfig({
|
|
1399
|
+
.tokenConfig({
|
|
1400
|
+
name: 'Vanity Multicurve',
|
|
1401
|
+
symbol: 'VMC',
|
|
1402
|
+
tokenURI: 'https://example.com/token.json',
|
|
1403
|
+
})
|
|
1089
1404
|
.saleConfig({
|
|
1090
1405
|
initialSupply: parseEther('1000000'),
|
|
1091
1406
|
numTokensToSell: parseEther('900000'),
|
|
@@ -1095,19 +1410,29 @@ const builder = new MulticurveBuilder(base.id)
|
|
|
1095
1410
|
fee: 3000,
|
|
1096
1411
|
tickSpacing: 60,
|
|
1097
1412
|
curves: [
|
|
1098
|
-
{
|
|
1099
|
-
|
|
1413
|
+
{
|
|
1414
|
+
tickLower: 0,
|
|
1415
|
+
tickUpper: 240000,
|
|
1416
|
+
numPositions: 10,
|
|
1417
|
+
shares: parseEther('0.5'),
|
|
1418
|
+
},
|
|
1419
|
+
{
|
|
1420
|
+
tickLower: 16000,
|
|
1421
|
+
tickUpper: 240000,
|
|
1422
|
+
numPositions: 10,
|
|
1423
|
+
shares: parseEther('0.5'),
|
|
1424
|
+
},
|
|
1100
1425
|
],
|
|
1101
1426
|
})
|
|
1102
1427
|
.withGovernance({ type: 'default' })
|
|
1103
1428
|
.withMigration({ type: 'uniswapV2' })
|
|
1104
|
-
.withUserAddress('0x...')
|
|
1429
|
+
.withUserAddress('0x...');
|
|
1105
1430
|
|
|
1106
|
-
const multicurveParams = builder.build()
|
|
1107
|
-
const addresses = getAddresses(base.id)
|
|
1431
|
+
const multicurveParams = builder.build();
|
|
1432
|
+
const addresses = getAddresses(base.id);
|
|
1108
1433
|
|
|
1109
1434
|
// Get CreateParams without calling create
|
|
1110
|
-
const createParams = sdk.factory.encodeCreateMulticurveParams(multicurveParams)
|
|
1435
|
+
const createParams = sdk.factory.encodeCreateMulticurveParams(multicurveParams);
|
|
1111
1436
|
|
|
1112
1437
|
// Mine a vanity token address
|
|
1113
1438
|
const { salt, tokenAddress, iterations } = mineTokenAddress({
|
|
@@ -1118,12 +1443,14 @@ const { salt, tokenAddress, iterations } = mineTokenAddress({
|
|
|
1118
1443
|
owner: addresses.airlock,
|
|
1119
1444
|
tokenData: createParams.tokenFactoryData,
|
|
1120
1445
|
maxIterations: 500_000,
|
|
1121
|
-
})
|
|
1446
|
+
});
|
|
1122
1447
|
|
|
1123
|
-
console.log(
|
|
1448
|
+
console.log(
|
|
1449
|
+
`Vanity token ${tokenAddress} found after ${iterations} iterations`,
|
|
1450
|
+
);
|
|
1124
1451
|
|
|
1125
1452
|
// Use the mined salt in createParams
|
|
1126
|
-
const vanityCreateParams = { ...createParams, salt }
|
|
1453
|
+
const vanityCreateParams = { ...createParams, salt };
|
|
1127
1454
|
|
|
1128
1455
|
// Now submit the transaction manually with the vanity salt
|
|
1129
1456
|
await publicClient.writeContract({
|
|
@@ -1132,7 +1459,7 @@ await publicClient.writeContract({
|
|
|
1132
1459
|
functionName: 'create',
|
|
1133
1460
|
args: [vanityCreateParams],
|
|
1134
1461
|
account: walletClient.account,
|
|
1135
|
-
})
|
|
1462
|
+
});
|
|
1136
1463
|
```
|
|
1137
1464
|
|
|
1138
1465
|
**Important**: Since `encodeCreateMulticurveParams` generates a random salt internally, you must construct the final `CreateParams` manually with your mined salt. The high-level `createMulticurve` method will replace any provided salt.
|
|
@@ -1163,19 +1490,19 @@ The main SDK class providing access to all functionality.
|
|
|
1163
1490
|
|
|
1164
1491
|
```typescript
|
|
1165
1492
|
class DopplerSDK {
|
|
1166
|
-
constructor(config: DopplerSDKConfig)
|
|
1167
|
-
|
|
1493
|
+
constructor(config: DopplerSDKConfig);
|
|
1494
|
+
|
|
1168
1495
|
// Properties
|
|
1169
|
-
factory: DopplerFactory
|
|
1170
|
-
quoter: Quoter
|
|
1171
|
-
|
|
1496
|
+
factory: DopplerFactory;
|
|
1497
|
+
quoter: Quoter;
|
|
1498
|
+
|
|
1172
1499
|
// Methods
|
|
1173
|
-
getStaticAuction(poolAddress: Address): Promise<StaticAuction
|
|
1174
|
-
getDynamicAuction(hookAddress: Address): Promise<DynamicAuction
|
|
1500
|
+
getStaticAuction(poolAddress: Address): Promise<StaticAuction>;
|
|
1501
|
+
getDynamicAuction(hookAddress: Address): Promise<DynamicAuction>;
|
|
1175
1502
|
// Multicurve helper
|
|
1176
|
-
buildMulticurveAuction(): MulticurveBuilder
|
|
1177
|
-
getPoolInfo(poolAddress: Address): Promise<PoolInfo
|
|
1178
|
-
getHookInfo(hookAddress: Address): Promise<HookInfo
|
|
1503
|
+
buildMulticurveAuction(): MulticurveBuilder;
|
|
1504
|
+
getPoolInfo(poolAddress: Address): Promise<PoolInfo>;
|
|
1505
|
+
getHookInfo(hookAddress: Address): Promise<HookInfo>;
|
|
1179
1506
|
}
|
|
1180
1507
|
```
|
|
1181
1508
|
|