@whetstone-research/doppler-sdk 0.0.24 → 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 +69 -0
- 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-4XN6DQBW.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 +36 -20
- package/dist/DopplerSDK.d.mts +0 -106
- package/dist/DopplerSDK.d.ts +0 -106
- package/dist/DopplerSDK.js +0 -53
- package/dist/DopplerSDK.js.map +0 -1
- package/dist/DopplerSDK.mjs +0 -44
- 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 -3871
- package/dist/abis/index.d.ts +0 -3871
- package/dist/abis/index.js +0 -130
- 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 -69
- package/dist/addresses.d.ts +0 -69
- 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 -196
- package/dist/builders/MulticurveBuilder.d.ts +0 -196
- 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 -46
- package/dist/builders/shared.js.map +0 -1
- package/dist/builders/shared.mjs +0 -25
- 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-2A3B3NVB.js +0 -737
- package/dist/chunk-2A3B3NVB.js.map +0 -1
- package/dist/chunk-3NMGCQJ4.mjs +0 -6
- package/dist/chunk-3NMGCQJ4.mjs.map +0 -1
- package/dist/chunk-44CYUEPG.js +0 -377
- package/dist/chunk-44CYUEPG.js.map +0 -1
- 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-5GQJRNFL.mjs +0 -40
- package/dist/chunk-5GQJRNFL.mjs.map +0 -1
- package/dist/chunk-5JHXBDZD.js +0 -265
- package/dist/chunk-5JHXBDZD.js.map +0 -1
- package/dist/chunk-5TQOT6CW.js +0 -8
- package/dist/chunk-5TQOT6CW.js.map +0 -1
- package/dist/chunk-65CESA3J.js +0 -46
- package/dist/chunk-65CESA3J.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-7A4DBBXA.js +0 -311
- package/dist/chunk-7A4DBBXA.js.map +0 -1
- package/dist/chunk-7M57PU6V.js +0 -28
- package/dist/chunk-7M57PU6V.js.map +0 -1
- package/dist/chunk-7ZUV6WPX.mjs +0 -3
- package/dist/chunk-7ZUV6WPX.mjs.map +0 -1
- package/dist/chunk-A2CJYRRQ.js +0 -330
- package/dist/chunk-A2CJYRRQ.js.map +0 -1
- package/dist/chunk-ABT6AT7C.mjs +0 -16
- package/dist/chunk-ABT6AT7C.mjs.map +0 -1
- package/dist/chunk-BK3S6SVR.js +0 -2707
- package/dist/chunk-BK3S6SVR.js.map +0 -1
- package/dist/chunk-BQZTELUX.js +0 -45
- package/dist/chunk-BQZTELUX.js.map +0 -1
- package/dist/chunk-CFAAYL5M.mjs +0 -26
- package/dist/chunk-CFAAYL5M.mjs.map +0 -1
- package/dist/chunk-CFXXUZJY.js +0 -275
- package/dist/chunk-CFXXUZJY.js.map +0 -1
- package/dist/chunk-CWTGQAOG.mjs +0 -72
- package/dist/chunk-CWTGQAOG.mjs.map +0 -1
- package/dist/chunk-DCWF3EMP.js +0 -171
- package/dist/chunk-DCWF3EMP.js.map +0 -1
- package/dist/chunk-DOUF6NON.mjs +0 -3
- package/dist/chunk-DOUF6NON.mjs.map +0 -1
- package/dist/chunk-DQJXCZU2.mjs +0 -318
- package/dist/chunk-DQJXCZU2.mjs.map +0 -1
- package/dist/chunk-DSYPZETD.js +0 -4
- package/dist/chunk-DSYPZETD.js.map +0 -1
- package/dist/chunk-F2BYG63D.mjs +0 -145
- package/dist/chunk-F2BYG63D.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-FXTGIKQG.mjs +0 -3
- package/dist/chunk-FXTGIKQG.mjs.map +0 -1
- package/dist/chunk-GSBQIVME.mjs +0 -278
- package/dist/chunk-GSBQIVME.mjs.map +0 -1
- package/dist/chunk-H3B54PFV.mjs +0 -17
- package/dist/chunk-H3B54PFV.mjs.map +0 -1
- package/dist/chunk-HJFVRV47.js +0 -120
- package/dist/chunk-HJFVRV47.js.map +0 -1
- package/dist/chunk-IIM2CSDQ.js +0 -147
- package/dist/chunk-IIM2CSDQ.js.map +0 -1
- package/dist/chunk-IUTIHSLH.mjs +0 -295
- package/dist/chunk-IUTIHSLH.mjs.map +0 -1
- package/dist/chunk-IUZ3BBQP.mjs +0 -117
- package/dist/chunk-IUZ3BBQP.mjs.map +0 -1
- package/dist/chunk-IWJOPXYN.mjs +0 -96
- package/dist/chunk-IWJOPXYN.mjs.map +0 -1
- package/dist/chunk-IX4V4UGW.mjs +0 -141
- package/dist/chunk-IX4V4UGW.mjs.map +0 -1
- package/dist/chunk-J62YDWIK.js +0 -8
- package/dist/chunk-J62YDWIK.js.map +0 -1
- package/dist/chunk-JIKAD4YL.js +0 -4
- package/dist/chunk-JIKAD4YL.js.map +0 -1
- package/dist/chunk-JLUOFAE4.mjs +0 -2531
- package/dist/chunk-JLUOFAE4.mjs.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-LW3CYA27.mjs +0 -2705
- package/dist/chunk-LW3CYA27.mjs.map +0 -1
- package/dist/chunk-MEA2C5YX.js +0 -143
- package/dist/chunk-MEA2C5YX.js.map +0 -1
- package/dist/chunk-MU56HCUI.js +0 -2556
- package/dist/chunk-MU56HCUI.js.map +0 -1
- package/dist/chunk-OCIY7QEJ.mjs +0 -169
- package/dist/chunk-OCIY7QEJ.mjs.map +0 -1
- package/dist/chunk-OHA5KJ2M.mjs +0 -6
- package/dist/chunk-OHA5KJ2M.mjs.map +0 -1
- package/dist/chunk-P25HBGP5.mjs +0 -3
- package/dist/chunk-P25HBGP5.mjs.map +0 -1
- package/dist/chunk-P563HTVU.js +0 -164
- package/dist/chunk-P563HTVU.js.map +0 -1
- package/dist/chunk-P7CHGWY7.js +0 -4
- package/dist/chunk-P7CHGWY7.js.map +0 -1
- package/dist/chunk-PGYTMRP3.js +0 -277
- package/dist/chunk-PGYTMRP3.js.map +0 -1
- package/dist/chunk-QAPQGDWK.js +0 -8
- package/dist/chunk-QAPQGDWK.js.map +0 -1
- package/dist/chunk-QHBKRUBY.mjs +0 -328
- package/dist/chunk-QHBKRUBY.mjs.map +0 -1
- package/dist/chunk-QOYI7WCH.js +0 -120
- package/dist/chunk-QOYI7WCH.js.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-QUBD6HUZ.mjs +0 -735
- package/dist/chunk-QUBD6HUZ.mjs.map +0 -1
- package/dist/chunk-RDTIXP6S.mjs +0 -263
- package/dist/chunk-RDTIXP6S.mjs.map +0 -1
- package/dist/chunk-RLOZWHRR.js +0 -320
- package/dist/chunk-RLOZWHRR.js.map +0 -1
- package/dist/chunk-RV64M4Q6.mjs +0 -3
- package/dist/chunk-RV64M4Q6.mjs.map +0 -1
- package/dist/chunk-SWWLOD7Q.mjs +0 -6
- package/dist/chunk-SWWLOD7Q.mjs.map +0 -1
- package/dist/chunk-T3UA4MJL.js +0 -4
- package/dist/chunk-T3UA4MJL.js.map +0 -1
- package/dist/chunk-TEWAXP5C.mjs +0 -162
- package/dist/chunk-TEWAXP5C.mjs.map +0 -1
- package/dist/chunk-THEIRDGE.mjs +0 -273
- package/dist/chunk-THEIRDGE.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-VEIVYUYF.js +0 -4
- package/dist/chunk-VEIVYUYF.js.map +0 -1
- package/dist/chunk-VKSD3KXF.mjs +0 -275
- package/dist/chunk-VKSD3KXF.mjs.map +0 -1
- package/dist/chunk-VYSOAGRU.mjs +0 -6
- package/dist/chunk-VYSOAGRU.mjs.map +0 -1
- package/dist/chunk-WDC53TM7.mjs +0 -305
- package/dist/chunk-WDC53TM7.mjs.map +0 -1
- package/dist/chunk-WKWP42TD.mjs +0 -39
- package/dist/chunk-WKWP42TD.mjs.map +0 -1
- package/dist/chunk-WNUB3UTT.js +0 -241
- package/dist/chunk-WNUB3UTT.js.map +0 -1
- package/dist/chunk-WNWK2QMU.mjs +0 -375
- package/dist/chunk-WNWK2QMU.mjs.map +0 -1
- package/dist/chunk-WQHTNL5L.js +0 -4
- package/dist/chunk-WQHTNL5L.js.map +0 -1
- package/dist/chunk-WZF5XNBC.js +0 -297
- package/dist/chunk-WZF5XNBC.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-XSJTASPK.js +0 -13
- package/dist/chunk-XSJTASPK.js.map +0 -1
- package/dist/chunk-YBK6EBA5.mjs +0 -239
- package/dist/chunk-YBK6EBA5.mjs.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 -275
- package/dist/deployments.generated.d.ts +0 -275
- 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 -272
- package/dist/entities/DopplerFactory.d.ts +0 -272
- package/dist/entities/DopplerFactory.js +0 -34
- package/dist/entities/DopplerFactory.js.map +0 -1
- package/dist/entities/DopplerFactory.mjs +0 -25
- 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 -78
- package/dist/entities/auction/MulticurvePool.d.ts +0 -78
- 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/RehypeDopplerHook.d.mts +0 -57
- package/dist/entities/auction/RehypeDopplerHook.d.ts +0 -57
- package/dist/entities/auction/RehypeDopplerHook.js +0 -34
- package/dist/entities/auction/RehypeDopplerHook.js.map +0 -1
- package/dist/entities/auction/RehypeDopplerHook.mjs +0 -25
- package/dist/entities/auction/RehypeDopplerHook.mjs.map +0 -1
- package/dist/entities/auction/RehypeDopplerHookMigrator.d.mts +0 -48
- package/dist/entities/auction/RehypeDopplerHookMigrator.d.ts +0 -48
- package/dist/entities/auction/RehypeDopplerHookMigrator.js +0 -34
- package/dist/entities/auction/RehypeDopplerHookMigrator.js.map +0 -1
- package/dist/entities/auction/RehypeDopplerHookMigrator.mjs +0 -25
- package/dist/entities/auction/RehypeDopplerHookMigrator.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 -9
- package/dist/entities/auction/index.d.ts +0 -9
- package/dist/entities/auction/index.js +0 -55
- package/dist/entities/auction/index.js.map +0 -1
- package/dist/entities/auction/index.mjs +0 -30
- 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 -39
- package/dist/index.d.ts +0 -39
- package/dist/index.js +0 -587
- package/dist/index.js.map +0 -1
- package/dist/index.mjs +0 -49
- package/dist/index.mjs.map +0 -1
- package/dist/types.d.mts +0 -662
- package/dist/types.d.ts +0 -662
- package/dist/types.js +0 -34
- 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 -18
- package/dist/utils/dopplerHookMigrator.d.ts +0 -18
- package/dist/utils/dopplerHookMigrator.js +0 -20
- package/dist/utils/dopplerHookMigrator.js.map +0 -1
- package/dist/utils/dopplerHookMigrator.mjs +0 -7
- 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 -197
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/index.mjs +0 -24
- 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/dist/chunk-FNUBKONK.js
DELETED
|
@@ -1,291 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var chunk6H6X3VTZ_js = require('./chunk-6H6X3VTZ.js');
|
|
4
|
-
var chunk4VWQNNNW_js = require('./chunk-4VWQNNNW.js');
|
|
5
|
-
|
|
6
|
-
// src/utils/marketCapHelpers.ts
|
|
7
|
-
function getMaxTickRounded(tickSpacing) {
|
|
8
|
-
return Math.floor(chunk4VWQNNNW_js.MAX_TICK / tickSpacing) * tickSpacing;
|
|
9
|
-
}
|
|
10
|
-
function marketCapToTokenPrice(marketCapUSD, tokenSupply, tokenDecimals = 18) {
|
|
11
|
-
if (marketCapUSD <= 0) {
|
|
12
|
-
throw new Error("Market cap must be positive");
|
|
13
|
-
}
|
|
14
|
-
if (tokenSupply <= 0n) {
|
|
15
|
-
throw new Error("Token supply must be positive");
|
|
16
|
-
}
|
|
17
|
-
const supplyNum = Number(tokenSupply) / 10 ** tokenDecimals;
|
|
18
|
-
return marketCapUSD / supplyNum;
|
|
19
|
-
}
|
|
20
|
-
function tokenPriceToRatio(tokenPriceUSD, numerairePriceUSD, tokenDecimals = 18, numeraireDecimals = 18) {
|
|
21
|
-
if (tokenPriceUSD <= 0) {
|
|
22
|
-
throw new Error("Token price must be positive");
|
|
23
|
-
}
|
|
24
|
-
if (numerairePriceUSD <= 0) {
|
|
25
|
-
throw new Error("Numeraire price must be positive");
|
|
26
|
-
}
|
|
27
|
-
const ratio = numerairePriceUSD / tokenPriceUSD;
|
|
28
|
-
const decimalAdjustment = 10 ** (tokenDecimals - numeraireDecimals);
|
|
29
|
-
return ratio * decimalAdjustment;
|
|
30
|
-
}
|
|
31
|
-
function ratioToTick(ratio) {
|
|
32
|
-
if (ratio <= 0) {
|
|
33
|
-
throw new Error("Ratio must be positive");
|
|
34
|
-
}
|
|
35
|
-
return Math.log(ratio) / Math.log(1.0001);
|
|
36
|
-
}
|
|
37
|
-
function isToken1(tokenAddress, numeraireAddress) {
|
|
38
|
-
return tokenAddress.toLowerCase() > numeraireAddress.toLowerCase();
|
|
39
|
-
}
|
|
40
|
-
function _computeRawTick(marketCapUSD, tokenSupply, numerairePriceUSD, tokenDecimals, numeraireDecimals, tickSpacing) {
|
|
41
|
-
if (marketCapUSD <= 0) {
|
|
42
|
-
throw new Error("Market cap must be positive");
|
|
43
|
-
}
|
|
44
|
-
const tokenPrice = marketCapToTokenPrice(
|
|
45
|
-
marketCapUSD,
|
|
46
|
-
tokenSupply,
|
|
47
|
-
tokenDecimals
|
|
48
|
-
);
|
|
49
|
-
const ratio = tokenPriceToRatio(
|
|
50
|
-
tokenPrice,
|
|
51
|
-
numerairePriceUSD,
|
|
52
|
-
tokenDecimals,
|
|
53
|
-
numeraireDecimals
|
|
54
|
-
);
|
|
55
|
-
const rawTick = ratioToTick(ratio);
|
|
56
|
-
const alignedTick = Math.floor(rawTick / tickSpacing) * tickSpacing;
|
|
57
|
-
if (alignedTick < chunk4VWQNNNW_js.MIN_TICK || alignedTick > chunk4VWQNNNW_js.MAX_TICK) {
|
|
58
|
-
throw new Error(
|
|
59
|
-
`Calculated tick ${alignedTick} is out of bounds [${chunk4VWQNNNW_js.MIN_TICK}, ${chunk4VWQNNNW_js.MAX_TICK}]. Market cap ${marketCapUSD.toLocaleString()} may be too extreme for the given parameters.`
|
|
60
|
-
);
|
|
61
|
-
}
|
|
62
|
-
return alignedTick;
|
|
63
|
-
}
|
|
64
|
-
function marketCapToTicksForStaticAuction(params) {
|
|
65
|
-
const {
|
|
66
|
-
marketCapRange,
|
|
67
|
-
tokenSupply,
|
|
68
|
-
numerairePriceUSD,
|
|
69
|
-
tickSpacing,
|
|
70
|
-
tokenDecimals = 18,
|
|
71
|
-
numeraireDecimals = 18
|
|
72
|
-
} = params;
|
|
73
|
-
if (marketCapRange.start <= 0) {
|
|
74
|
-
throw new Error("Start market cap must be positive");
|
|
75
|
-
}
|
|
76
|
-
if (marketCapRange.end <= 0) {
|
|
77
|
-
throw new Error("End market cap must be positive");
|
|
78
|
-
}
|
|
79
|
-
if (marketCapRange.start >= marketCapRange.end) {
|
|
80
|
-
throw new Error("Start market cap must be less than end market cap");
|
|
81
|
-
}
|
|
82
|
-
const tickAtStart = _computeRawTick(
|
|
83
|
-
marketCapRange.start,
|
|
84
|
-
tokenSupply,
|
|
85
|
-
numerairePriceUSD,
|
|
86
|
-
tokenDecimals,
|
|
87
|
-
numeraireDecimals,
|
|
88
|
-
tickSpacing
|
|
89
|
-
);
|
|
90
|
-
const tickAtEnd = _computeRawTick(
|
|
91
|
-
marketCapRange.end,
|
|
92
|
-
tokenSupply,
|
|
93
|
-
numerairePriceUSD,
|
|
94
|
-
tokenDecimals,
|
|
95
|
-
numeraireDecimals,
|
|
96
|
-
tickSpacing
|
|
97
|
-
);
|
|
98
|
-
const startTick = Math.min(Math.abs(tickAtStart), Math.abs(tickAtEnd));
|
|
99
|
-
const endTick = Math.max(Math.abs(tickAtStart), Math.abs(tickAtEnd));
|
|
100
|
-
if (startTick === endTick) {
|
|
101
|
-
throw new Error(
|
|
102
|
-
`Market cap range ${marketCapRange.start.toLocaleString()} - ${marketCapRange.end.toLocaleString()} resulted in same tick (${startTick}). Try a wider range or smaller tick spacing.`
|
|
103
|
-
);
|
|
104
|
-
}
|
|
105
|
-
return { startTick, endTick };
|
|
106
|
-
}
|
|
107
|
-
function marketCapToTicksForDynamicAuction(params) {
|
|
108
|
-
const {
|
|
109
|
-
marketCapRange,
|
|
110
|
-
tokenSupply,
|
|
111
|
-
numerairePriceUSD,
|
|
112
|
-
numeraire,
|
|
113
|
-
tickSpacing,
|
|
114
|
-
tokenDecimals = 18,
|
|
115
|
-
numeraireDecimals = 18
|
|
116
|
-
} = params;
|
|
117
|
-
if (marketCapRange.start <= 0 || marketCapRange.end <= 0) {
|
|
118
|
-
throw new Error("Market cap values must be positive");
|
|
119
|
-
}
|
|
120
|
-
if (marketCapRange.start >= marketCapRange.end) {
|
|
121
|
-
throw new Error("Start market cap must be less than end market cap");
|
|
122
|
-
}
|
|
123
|
-
const tickAtStart = _computeRawTick(
|
|
124
|
-
marketCapRange.start,
|
|
125
|
-
tokenSupply,
|
|
126
|
-
numerairePriceUSD,
|
|
127
|
-
tokenDecimals,
|
|
128
|
-
numeraireDecimals,
|
|
129
|
-
tickSpacing
|
|
130
|
-
);
|
|
131
|
-
const tickAtEnd = _computeRawTick(
|
|
132
|
-
marketCapRange.end,
|
|
133
|
-
tokenSupply,
|
|
134
|
-
numerairePriceUSD,
|
|
135
|
-
tokenDecimals,
|
|
136
|
-
numeraireDecimals,
|
|
137
|
-
tickSpacing
|
|
138
|
-
);
|
|
139
|
-
const tokenIsToken0 = chunk6H6X3VTZ_js.isToken0Expected(numeraire);
|
|
140
|
-
if (tokenIsToken0) {
|
|
141
|
-
const startTick = -Math.min(Math.abs(tickAtStart), Math.abs(tickAtEnd));
|
|
142
|
-
const endTick = -Math.max(Math.abs(tickAtStart), Math.abs(tickAtEnd));
|
|
143
|
-
if (startTick === endTick) {
|
|
144
|
-
throw new Error(
|
|
145
|
-
`Market cap range resulted in same tick (${startTick}). Try a wider range.`
|
|
146
|
-
);
|
|
147
|
-
}
|
|
148
|
-
return { startTick, endTick };
|
|
149
|
-
} else {
|
|
150
|
-
const startTick = Math.min(Math.abs(tickAtStart), Math.abs(tickAtEnd));
|
|
151
|
-
const endTick = Math.max(Math.abs(tickAtStart), Math.abs(tickAtEnd));
|
|
152
|
-
if (startTick === endTick) {
|
|
153
|
-
throw new Error(
|
|
154
|
-
`Market cap range resulted in same tick (${startTick}). Try a wider range.`
|
|
155
|
-
);
|
|
156
|
-
}
|
|
157
|
-
return { startTick, endTick };
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
function marketCapToTicksForMulticurve(params) {
|
|
161
|
-
const {
|
|
162
|
-
marketCapLower,
|
|
163
|
-
marketCapUpper,
|
|
164
|
-
tokenSupply,
|
|
165
|
-
numerairePriceUSD,
|
|
166
|
-
tickSpacing,
|
|
167
|
-
tokenDecimals = 18,
|
|
168
|
-
numeraireDecimals = 18
|
|
169
|
-
} = params;
|
|
170
|
-
if (marketCapLower <= 0) {
|
|
171
|
-
throw new Error("Lower market cap must be positive");
|
|
172
|
-
}
|
|
173
|
-
if (marketCapUpper !== "max" && marketCapUpper <= 0) {
|
|
174
|
-
throw new Error("Upper market cap must be positive");
|
|
175
|
-
}
|
|
176
|
-
if (marketCapUpper !== "max" && marketCapLower >= marketCapUpper) {
|
|
177
|
-
throw new Error("Lower market cap must be less than upper market cap");
|
|
178
|
-
}
|
|
179
|
-
const tickAtLower = -_computeRawTick(
|
|
180
|
-
marketCapLower,
|
|
181
|
-
tokenSupply,
|
|
182
|
-
numerairePriceUSD,
|
|
183
|
-
tokenDecimals,
|
|
184
|
-
numeraireDecimals,
|
|
185
|
-
tickSpacing
|
|
186
|
-
);
|
|
187
|
-
const tickAtUpper = marketCapUpper === "max" ? getMaxTickRounded(tickSpacing) : -_computeRawTick(
|
|
188
|
-
marketCapUpper,
|
|
189
|
-
tokenSupply,
|
|
190
|
-
numerairePriceUSD,
|
|
191
|
-
tokenDecimals,
|
|
192
|
-
numeraireDecimals,
|
|
193
|
-
tickSpacing
|
|
194
|
-
);
|
|
195
|
-
const tickLower = Math.min(tickAtLower, tickAtUpper);
|
|
196
|
-
const tickUpper = Math.max(tickAtLower, tickAtUpper);
|
|
197
|
-
if (tickLower === tickUpper) {
|
|
198
|
-
const upperLabel = marketCapUpper === "max" ? "max" : `$${marketCapUpper.toLocaleString()}`;
|
|
199
|
-
throw new Error(
|
|
200
|
-
`Market cap range $${marketCapLower.toLocaleString()} - ${upperLabel} resulted in same tick (${tickLower}). Try a wider range or smaller tick spacing.`
|
|
201
|
-
);
|
|
202
|
-
}
|
|
203
|
-
return { tickLower, tickUpper };
|
|
204
|
-
}
|
|
205
|
-
function marketCapToTickForMulticurve(params) {
|
|
206
|
-
const {
|
|
207
|
-
marketCapUSD,
|
|
208
|
-
tokenSupply,
|
|
209
|
-
numerairePriceUSD,
|
|
210
|
-
tickSpacing,
|
|
211
|
-
tokenDecimals = 18,
|
|
212
|
-
numeraireDecimals = 18
|
|
213
|
-
} = params;
|
|
214
|
-
const rawTick = -_computeRawTick(
|
|
215
|
-
marketCapUSD,
|
|
216
|
-
tokenSupply,
|
|
217
|
-
numerairePriceUSD,
|
|
218
|
-
tokenDecimals,
|
|
219
|
-
numeraireDecimals,
|
|
220
|
-
tickSpacing
|
|
221
|
-
);
|
|
222
|
-
return rawTick === 0 ? 0 : rawTick;
|
|
223
|
-
}
|
|
224
|
-
function applyTickOffsets(pegTick, offsetLower, offsetUpper, numeraire) {
|
|
225
|
-
return {
|
|
226
|
-
tickLower: pegTick + offsetLower,
|
|
227
|
-
tickUpper: pegTick + offsetUpper
|
|
228
|
-
};
|
|
229
|
-
}
|
|
230
|
-
function validateMarketCapParameters(marketCap, tokenSupply, tokenDecimals = 18) {
|
|
231
|
-
const warnings = [];
|
|
232
|
-
if (marketCap < 1e3) {
|
|
233
|
-
warnings.push(
|
|
234
|
-
`Market cap $${marketCap.toLocaleString()} is very small. Consider if this is intentional.`
|
|
235
|
-
);
|
|
236
|
-
}
|
|
237
|
-
if (marketCap > 1e12) {
|
|
238
|
-
warnings.push(
|
|
239
|
-
`Market cap $${marketCap.toLocaleString()} is very large (> $1T). Verify this is correct.`
|
|
240
|
-
);
|
|
241
|
-
}
|
|
242
|
-
const tokenPrice = marketCapToTokenPrice(
|
|
243
|
-
marketCap,
|
|
244
|
-
tokenSupply,
|
|
245
|
-
tokenDecimals
|
|
246
|
-
);
|
|
247
|
-
if (tokenPrice < 1e-6) {
|
|
248
|
-
warnings.push(
|
|
249
|
-
`Implied token price $${tokenPrice.toExponential(2)} is very small. This may cause precision issues.`
|
|
250
|
-
);
|
|
251
|
-
}
|
|
252
|
-
if (tokenPrice > 1e6) {
|
|
253
|
-
warnings.push(
|
|
254
|
-
`Implied token price $${tokenPrice.toLocaleString()} is very large. Verify your token supply and market cap values.`
|
|
255
|
-
);
|
|
256
|
-
}
|
|
257
|
-
return {
|
|
258
|
-
valid: warnings.length === 0,
|
|
259
|
-
warnings
|
|
260
|
-
};
|
|
261
|
-
}
|
|
262
|
-
function tickToMarketCap(params) {
|
|
263
|
-
const {
|
|
264
|
-
tick,
|
|
265
|
-
tokenSupply,
|
|
266
|
-
numerairePriceUSD,
|
|
267
|
-
tokenDecimals = 18,
|
|
268
|
-
numeraireDecimals = 18
|
|
269
|
-
} = params;
|
|
270
|
-
const adjustedTick = Math.abs(tick);
|
|
271
|
-
const ratio = Math.pow(1.0001, adjustedTick);
|
|
272
|
-
const decimalAdjustment = 10 ** (tokenDecimals - numeraireDecimals);
|
|
273
|
-
const tokenPriceUSD = numerairePriceUSD / (ratio / decimalAdjustment);
|
|
274
|
-
const supplyNum = Number(tokenSupply) / 10 ** tokenDecimals;
|
|
275
|
-
return tokenPriceUSD * supplyNum;
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
exports.applyTickOffsets = applyTickOffsets;
|
|
279
|
-
exports.getMaxTickRounded = getMaxTickRounded;
|
|
280
|
-
exports.isToken1 = isToken1;
|
|
281
|
-
exports.marketCapToTickForMulticurve = marketCapToTickForMulticurve;
|
|
282
|
-
exports.marketCapToTicksForDynamicAuction = marketCapToTicksForDynamicAuction;
|
|
283
|
-
exports.marketCapToTicksForMulticurve = marketCapToTicksForMulticurve;
|
|
284
|
-
exports.marketCapToTicksForStaticAuction = marketCapToTicksForStaticAuction;
|
|
285
|
-
exports.marketCapToTokenPrice = marketCapToTokenPrice;
|
|
286
|
-
exports.ratioToTick = ratioToTick;
|
|
287
|
-
exports.tickToMarketCap = tickToMarketCap;
|
|
288
|
-
exports.tokenPriceToRatio = tokenPriceToRatio;
|
|
289
|
-
exports.validateMarketCapParameters = validateMarketCapParameters;
|
|
290
|
-
//# sourceMappingURL=chunk-FNUBKONK.js.map
|
|
291
|
-
//# sourceMappingURL=chunk-FNUBKONK.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils/marketCapHelpers.ts"],"names":["MAX_TICK","MIN_TICK","isToken0Expected"],"mappings":";;;;;;AAmCO,SAAS,kBAAkB,WAAA,EAA6B;AAC7D,EAAA,OAAO,IAAA,CAAK,KAAA,CAAMA,yBAAA,GAAW,WAAW,CAAA,GAAI,WAAA;AAC9C;AAiBO,SAAS,qBAAA,CACd,YAAA,EACA,WAAA,EACA,aAAA,GAAwB,EAAA,EAChB;AACR,EAAA,IAAI,gBAAgB,CAAA,EAAG;AACrB,IAAA,MAAM,IAAI,MAAM,6BAA6B,CAAA;AAAA,EAC/C;AACA,EAAA,IAAI,eAAe,EAAA,EAAI;AACrB,IAAA,MAAM,IAAI,MAAM,+BAA+B,CAAA;AAAA,EACjD;AAGA,EAAA,MAAM,SAAA,G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jB,SAAA;AAAA,IACA,WAAA;AAAA,IACA;AAAA,GACF;AAGA,EAAA,IAAI,aAAa,IAAA,EAAU;AACzB,IAAA,QAAA,CAAS,IAAA;AAAA,MACP,CAAA,qBAAA,EAAwB,UAAA,CAAW,aAAA,CAAc,CAAC,CAAC,CAAA,gDAAA;AAAA,KAErD;AAAA,EACF;AAGA,EAAA,IAAI,aAAa,GAAA,EAAW;AAC1B,IAAA,QAAA,CAAS,IAAA;AAAA,MACP,CAAA,qBAAA,EAAwB,UAAA,CAAW,cAAA,EAAgB,CAAA,+DAAA;AAAA,KAErD;AAAA,EACF;AAEA,EAAA,OAAO;AAAA,IACL,KAAA,EAAO,SAAS,MAAA,KAAW,CAAA;AAAA,IAC3B;AAAA,GACF;AACF;AA4BO,SAAS,gBAAgB,MAAA,EAAuC;AACrE,EAAA,MAAM;AAAA,IACJ,IAAA;AAAA,IACA,WAAA;AAAA,IACA,iBAAA;AAAA,IACA,aAAA,GAAgB,EAAA;AAAA,IAChB,iBAAA,GAAoB;AAAA,GACtB,GAAI,MAAA;AAIJ,EAAA,MAAM,YAAA,GAAe,IAAA,CAAK,GAAA,CAAI,IAAI,CAAA;AAGlC,EAAA,MAAM,KAAA,GAAQ,IAAA,CAAK,GAAA,CAAI,MAAA,EAAQ,YAAY,CAAA;AAK3C,EAAA,MAAM,iBAAA,GAAoB,OAAO,aAAA,GAAgB,iBAAA,CAAA;AACjD,EAAA,MAAM,aAAA,GAAgB,qBAAqB,KAAA,GAAQ,iBAAA,CAAA;AAGnD,EAAA,MAAM,SAAA,GAAY,MAAA,CAAO,WAAW,CAAA,GAAI,EAAA,IAAM,aAAA;AAC9C,EAAA,OAAO,aAAA,GAAgB,SAAA;AACzB","file":"chunk-FNUBKONK.js","sourcesContent":["/**\n * Market cap conversion utilities for token launches\n *\n * These utilities convert between market cap (USD) and Uniswap ticks\n * following the mathematical relationship:\n *\n * Market Cap (USD) → Token Price (USD) → Ratio (numeraire/token) → Tick\n *\n * Based on reference implementation: plan/priceMultiCurve.py\n */\n\nimport type { Address } from 'viem';\nimport type {\n MarketCapRange,\n MarketCapValidationResult,\n StaticAuctionTickParams,\n DynamicAuctionTickParams,\n MulticurveTickRangeParams,\n MulticurveTickParams,\n TickToMarketCapParams,\n} from '../types';\nimport { MIN_TICK, MAX_TICK } from './tickMath';\nimport { isToken0Expected } from './isToken0Expected';\n\n// Re-export types from types.ts for convenience\nexport type {\n MarketCapRange,\n MarketCapValidationResult,\n StaticAuctionTickParams,\n DynamicAuctionTickParams,\n MulticurveTickRangeParams,\n MulticurveTickParams,\n TickToMarketCapParams,\n} from '../types';\n\nexport function getMaxTickRounded(tickSpacing: number): number {\n return Math.floor(MAX_TICK / tickSpacing) * tickSpacing;\n}\n\n/**\n * Convert market cap to token price\n *\n * @param marketCapUSD - Market capitalization in USD\n * @param tokenSupply - Total token supply (as bigint with decimals, e.g., parseEther('1000000000'))\n * @param tokenDecimals - Token decimals (default: 18)\n * @returns Price of one token in USD\n *\n * @example\n * ```ts\n * // $1M market cap with 1B tokens (18 decimals)\n * const price = marketCapToTokenPrice(1_000_000, parseEther('1000000000'))\n * // Returns: 0.001 (each token is worth $0.001)\n * ```\n */\nexport function marketCapToTokenPrice(\n marketCapUSD: number,\n tokenSupply: bigint,\n tokenDecimals: number = 18,\n): number {\n if (marketCapUSD <= 0) {\n throw new Error('Market cap must be positive');\n }\n if (tokenSupply <= 0n) {\n throw new Error('Token supply must be positive');\n }\n\n // Convert supply from bigint with decimals to human-readable number\n const supplyNum = Number(tokenSupply) / 10 ** tokenDecimals;\n return marketCapUSD / supplyNum;\n}\n\n/**\n * Convert token price to price ratio (numeraire per token)\n *\n * @param tokenPriceUSD - Price of one token in USD\n * @param numerairePriceUSD - Price of numeraire (e.g., ETH) in USD\n * @param tokenDecimals - Token decimals (default: 18)\n * @param numeraireDecimals - Numeraire decimals (default: 18)\n * @returns Price ratio adjusted for decimals\n *\n * @example\n * ```ts\n * // Token at $0.001, ETH at $3000, both 18 decimals\n * const ratio = tokenPriceToRatio(0.001, 3000, 18, 18)\n * // Returns: 3,000,000 (3M ETH wei per token wei at this ratio)\n * ```\n */\nexport function tokenPriceToRatio(\n tokenPriceUSD: number,\n numerairePriceUSD: number,\n tokenDecimals: number = 18,\n numeraireDecimals: number = 18,\n): number {\n if (tokenPriceUSD <= 0) {\n throw new Error('Token price must be positive');\n }\n if (numerairePriceUSD <= 0) {\n throw new Error('Numeraire price must be positive');\n }\n\n // How much numeraire per token (in USD terms first)\n // numerairePriceUSD / tokenPriceUSD = numeraire units per token\n const ratio = numerairePriceUSD / tokenPriceUSD;\n\n // Adjust for decimal differences\n // Formula: (numeraire / tokenPrice) * (10 ** (assetDecimals - numeraireDecimals))\n const decimalAdjustment = 10 ** (tokenDecimals - numeraireDecimals);\n\n return ratio * decimalAdjustment;\n}\n\n/**\n * Convert ratio to tick using Uniswap's formula: tick = log(ratio) / log(1.0001)\n *\n * @param ratio - Price ratio (must be positive)\n * @returns Raw tick value (before spacing adjustment)\n *\n * @example\n * ```ts\n * ratioToTick(1) // Returns: 0\n * ratioToTick(1.0001) // Returns: ~1\n * ratioToTick(Math.pow(1.0001, 1000)) // Returns: ~1000\n * ```\n */\nexport function ratioToTick(ratio: number): number {\n if (ratio <= 0) {\n throw new Error('Ratio must be positive');\n }\n\n // Uniswap tick formula: tick = log(price) / log(1.0001)\n return Math.log(ratio) / Math.log(1.0001);\n}\n\n/**\n * Determine if the new token will be token1 in the Uniswap pair\n *\n * Uniswap orders tokens by address (token0 < token1 in hex comparison).\n * This affects how ticks are interpreted for price calculations.\n *\n * @param tokenAddress - Address of the new token\n * @param numeraireAddress - Address of the numeraire (e.g., WETH)\n * @returns true if token will be token1, false if token0\n *\n * @example\n * ```ts\n * isToken1('0xB000...', '0xA000...') // true (B > A)\n * isToken1('0xA000...', '0xB000...') // false (A < B)\n * ```\n */\nexport function isToken1(\n tokenAddress: string,\n numeraireAddress: string,\n): boolean {\n return tokenAddress.toLowerCase() > numeraireAddress.toLowerCase();\n}\n\n// ═══════════════════════════════════════════════════════════════════════════════\n// CORE TICK COMPUTATION (Internal)\n// ═══════════════════════════════════════════════════════════════════════════════\n\n/**\n * Core tick computation - NO sign manipulation.\n * Returns the raw mathematical tick for a given market cap.\n *\n * @internal Not exported - use auction-specific functions instead.\n */\nfunction _computeRawTick(\n marketCapUSD: number,\n tokenSupply: bigint,\n numerairePriceUSD: number,\n tokenDecimals: number,\n numeraireDecimals: number,\n tickSpacing: number,\n): number {\n if (marketCapUSD <= 0) {\n throw new Error('Market cap must be positive');\n }\n\n // Step 1: Market cap → token price\n const tokenPrice = marketCapToTokenPrice(\n marketCapUSD,\n tokenSupply,\n tokenDecimals,\n );\n\n // Step 2: Token price → ratio\n const ratio = tokenPriceToRatio(\n tokenPrice,\n numerairePriceUSD,\n tokenDecimals,\n numeraireDecimals,\n );\n\n // Step 3: Ratio → raw tick\n const rawTick = ratioToTick(ratio);\n\n // Step 4: Align to tick spacing (floor division)\n const alignedTick = Math.floor(rawTick / tickSpacing) * tickSpacing;\n\n // Step 5: Bounds check\n if (alignedTick < MIN_TICK || alignedTick > MAX_TICK) {\n throw new Error(\n `Calculated tick ${alignedTick} is out of bounds [${MIN_TICK}, ${MAX_TICK}]. ` +\n `Market cap ${marketCapUSD.toLocaleString()} may be too extreme for the given parameters.`,\n );\n }\n\n return alignedTick;\n}\n\n// ═══════════════════════════════════════════════════════════════════════════════\n// AUCTION-SPECIFIC TICK FUNCTIONS\n// ═══════════════════════════════════════════════════════════════════════════════\n\n/**\n * Convert market cap range to ticks for V3 Static Auctions.\n *\n * V3 Static auctions ALWAYS use positive ticks with startTick < endTick.\n * This is because CREATE2 mining ensures token address > numeraire (token1).\n *\n * @param params - Configuration object with market cap range and token parameters\n * @returns { startTick, endTick } - positive ticks, startTick < endTick\n *\n * @example\n * ```ts\n * const { startTick, endTick } = marketCapToTicksForStaticAuction({\n * marketCapRange: { start: 100_000, end: 10_000_000 },\n * tokenSupply: parseEther('1000000000'),\n * numerairePriceUSD: 3000,\n * tickSpacing: 60,\n * })\n * // Returns: { startTick: 120000, endTick: 170000 } (both positive)\n * ```\n */\nexport function marketCapToTicksForStaticAuction(\n params: StaticAuctionTickParams,\n): { startTick: number; endTick: number } {\n const {\n marketCapRange,\n tokenSupply,\n numerairePriceUSD,\n tickSpacing,\n tokenDecimals = 18,\n numeraireDecimals = 18,\n } = params;\n\n if (marketCapRange.start <= 0) {\n throw new Error('Start market cap must be positive');\n }\n if (marketCapRange.end <= 0) {\n throw new Error('End market cap must be positive');\n }\n if (marketCapRange.start >= marketCapRange.end) {\n throw new Error('Start market cap must be less than end market cap');\n }\n\n // Compute raw ticks\n const tickAtStart = _computeRawTick(\n marketCapRange.start,\n tokenSupply,\n numerairePriceUSD,\n tokenDecimals,\n numeraireDecimals,\n tickSpacing,\n );\n const tickAtEnd = _computeRawTick(\n marketCapRange.end,\n tokenSupply,\n numerairePriceUSD,\n tokenDecimals,\n numeraireDecimals,\n tickSpacing,\n );\n\n // V3 Static: Always positive ticks, startTick < endTick\n // Take absolute value and ensure proper ordering\n const startTick = Math.min(Math.abs(tickAtStart), Math.abs(tickAtEnd));\n const endTick = Math.max(Math.abs(tickAtStart), Math.abs(tickAtEnd));\n\n if (startTick === endTick) {\n throw new Error(\n `Market cap range ${marketCapRange.start.toLocaleString()} - ${marketCapRange.end.toLocaleString()} ` +\n `resulted in same tick (${startTick}). Try a wider range or smaller tick spacing.`,\n );\n }\n\n return { startTick, endTick };\n}\n\n/**\n * Convert market cap range to ticks for V4 Dynamic Auctions (Doppler).\n *\n * Dynamic auctions compute tick sign based on expected token ordering:\n * - Token1 (ETH numeraire): positive ticks, startTick < endTick\n * - Token0 (stablecoin numeraire): negative ticks, startTick > endTick\n *\n * Unlike Multicurve, Doppler contract does NOT auto-flip ticks.\n *\n * @param params - Configuration object with market cap range and token parameters\n * @returns { startTick, endTick } with correct sign and ordering for Doppler contract\n *\n * @example\n * ```ts\n * // ETH numeraire (token1) - positive ticks\n * const eth = marketCapToTicksForDynamicAuction({\n * marketCapRange: { start: 50_000, end: 500_000 },\n * tokenSupply: parseEther('1000000000'),\n * numerairePriceUSD: 3000,\n * numeraire: WETH_ADDRESS,\n * tickSpacing: 30,\n * })\n * // Returns: { startTick: 120000, endTick: 170000 } (positive, ascending)\n *\n * // USDC numeraire (token0) - negative ticks\n * const usdc = marketCapToTicksForDynamicAuction({\n * marketCapRange: { start: 50_000, end: 500_000 },\n * tokenSupply: parseEther('1000000000'),\n * numerairePriceUSD: 1,\n * numeraire: USDC_ADDRESS,\n * tickSpacing: 30,\n * tokenDecimals: 18,\n * numeraireDecimals: 6,\n * })\n * // Returns: { startTick: -120000, endTick: -170000 } (negative, descending)\n * ```\n */\nexport function marketCapToTicksForDynamicAuction(\n params: DynamicAuctionTickParams,\n): { startTick: number; endTick: number } {\n const {\n marketCapRange,\n tokenSupply,\n numerairePriceUSD,\n numeraire,\n tickSpacing,\n tokenDecimals = 18,\n numeraireDecimals = 18,\n } = params;\n\n if (marketCapRange.start <= 0 || marketCapRange.end <= 0) {\n throw new Error('Market cap values must be positive');\n }\n if (marketCapRange.start >= marketCapRange.end) {\n throw new Error('Start market cap must be less than end market cap');\n }\n\n // Compute raw ticks\n const tickAtStart = _computeRawTick(\n marketCapRange.start,\n tokenSupply,\n numerairePriceUSD,\n tokenDecimals,\n numeraireDecimals,\n tickSpacing,\n );\n const tickAtEnd = _computeRawTick(\n marketCapRange.end,\n tokenSupply,\n numerairePriceUSD,\n tokenDecimals,\n numeraireDecimals,\n tickSpacing,\n );\n\n // Determine token ordering from numeraire address\n const tokenIsToken0 = isToken0Expected(numeraire);\n\n if (tokenIsToken0) {\n // Token0 (stablecoin numeraire): negative ticks, startTick > endTick\n const startTick = -Math.min(Math.abs(tickAtStart), Math.abs(tickAtEnd));\n const endTick = -Math.max(Math.abs(tickAtStart), Math.abs(tickAtEnd));\n\n if (startTick === endTick) {\n throw new Error(\n `Market cap range resulted in same tick (${startTick}). Try a wider range.`,\n );\n }\n\n return { startTick, endTick }; // e.g., { -120000, -170000 }\n } else {\n // Token1 (ETH numeraire): positive ticks, startTick < endTick\n const startTick = Math.min(Math.abs(tickAtStart), Math.abs(tickAtEnd));\n const endTick = Math.max(Math.abs(tickAtStart), Math.abs(tickAtEnd));\n\n if (startTick === endTick) {\n throw new Error(\n `Market cap range resulted in same tick (${startTick}). Try a wider range.`,\n );\n }\n\n return { startTick, endTick }; // e.g., { 120000, 170000 }\n }\n}\n\n/**\n * Convert market cap range to ticks for V4 Multicurve pools.\n *\n * Tick sign depends on the underlying price ratio - can be positive or negative.\n * The contract's adjustCurves() handles token ordering internally.\n *\n * @param params - Configuration object with market cap range and token parameters\n * @returns { tickLower, tickUpper } - tick range where tickLower < tickUpper\n *\n * @example\n * ```ts\n * const { tickLower, tickUpper } = marketCapToTicksForMulticurve({\n * marketCapLower: 500_000,\n * marketCapUpper: 5_000_000,\n * tokenSupply: parseEther('1000000000'),\n * numerairePriceUSD: 3000,\n * tickSpacing: 60,\n * })\n * ```\n */\nexport function marketCapToTicksForMulticurve(\n params: MulticurveTickRangeParams,\n): { tickLower: number; tickUpper: number } {\n const {\n marketCapLower,\n marketCapUpper,\n tokenSupply,\n numerairePriceUSD,\n tickSpacing,\n tokenDecimals = 18,\n numeraireDecimals = 18,\n } = params;\n\n if (marketCapLower <= 0) {\n throw new Error('Lower market cap must be positive');\n }\n if (marketCapUpper !== 'max' && marketCapUpper <= 0) {\n throw new Error('Upper market cap must be positive');\n }\n if (marketCapUpper !== 'max' && marketCapLower >= marketCapUpper) {\n throw new Error('Lower market cap must be less than upper market cap');\n }\n\n // Compute raw ticks\n const tickAtLower = -_computeRawTick(\n marketCapLower,\n tokenSupply,\n numerairePriceUSD,\n tokenDecimals,\n numeraireDecimals,\n tickSpacing,\n );\n const tickAtUpper =\n marketCapUpper === 'max'\n ? getMaxTickRounded(tickSpacing)\n : -_computeRawTick(\n marketCapUpper,\n tokenSupply,\n numerairePriceUSD,\n tokenDecimals,\n numeraireDecimals,\n tickSpacing,\n );\n\n // Use natural tick ordering (lower market cap = lower tick value)\n const tickLower = Math.min(tickAtLower, tickAtUpper);\n const tickUpper = Math.max(tickAtLower, tickAtUpper);\n\n if (tickLower === tickUpper) {\n const upperLabel =\n marketCapUpper === 'max' ? 'max' : `$${marketCapUpper.toLocaleString()}`;\n throw new Error(\n `Market cap range $${marketCapLower.toLocaleString()} - ${upperLabel} ` +\n `resulted in same tick (${tickLower}). Try a wider range or smaller tick spacing.`,\n );\n }\n\n return { tickLower, tickUpper };\n}\n\n/**\n * Convert a single market cap to a tick for Multicurve use cases.\n *\n * Used for farTick and pegTick calculations.\n * Tick sign depends on the underlying price ratio - can be positive or negative.\n *\n * @param params - Configuration object with market cap and token parameters\n * @returns Tick value (sign depends on price ratio)\n *\n * @example\n * ```ts\n * const farTick = marketCapToTickForMulticurve({\n * marketCapUSD: 50_000_000,\n * tokenSupply: supply,\n * numerairePriceUSD: 3000,\n * tickSpacing: 60,\n * })\n * ```\n */\nexport function marketCapToTickForMulticurve(\n params: MulticurveTickParams,\n): number {\n const {\n marketCapUSD,\n tokenSupply,\n numerairePriceUSD,\n tickSpacing,\n tokenDecimals = 18,\n numeraireDecimals = 18,\n } = params;\n\n // Multicurve uses a canonical tick space where the contract's adjustCurves()\n // resolves token ordering. This must match marketCapToTicksForMulticurve().\n const rawTick = -_computeRawTick(\n marketCapUSD,\n tokenSupply,\n numerairePriceUSD,\n tokenDecimals,\n numeraireDecimals,\n tickSpacing,\n );\n\n // Normalize -0 to 0\n return rawTick === 0 ? 0 : rawTick;\n}\n\n/**\n * Apply curvature offsets to a peg tick for Multicurve positions.\n *\n * Tick sign depends on the underlying price ratio - can be positive or negative.\n * The contract's adjustCurves() handles token ordering internally.\n *\n * @example\n * ```ts\n * // Peg at 200000, curve extends 10000 ticks toward higher market cap\n * applyTickOffsets(200000, 0, 10000, WETH)\n * // Returns: { tickLower: 200000, tickUpper: 210000 }\n * ```\n */\nexport function applyTickOffsets(\n pegTick: number,\n offsetLower: number,\n offsetUpper: number,\n numeraire: Address,\n): { tickLower: number; tickUpper: number } {\n void numeraire; // Kept for API compatibility\n return {\n tickLower: pegTick + offsetLower,\n tickUpper: pegTick + offsetUpper,\n };\n}\n\n/**\n * Validate market cap parameters and return warnings for unusual values\n *\n * This doesn't prevent execution but helps catch potential mistakes:\n * - Very small market caps (< $1,000)\n * - Very large market caps (> $1 trillion)\n * - Extreme token prices (< $0.000001 or > $1M)\n *\n * @param marketCap - Market cap value to validate\n * @param tokenSupply - Token supply (with decimals)\n * @param tokenDecimals - Token decimals (default: 18)\n * @returns Validation result with warnings array\n *\n * @example\n * ```ts\n * const result = validateMarketCapParameters(500, parseEther('1000000'))\n * if (result.warnings.length > 0) {\n * console.warn('Warnings:', result.warnings)\n * }\n * ```\n */\nexport function validateMarketCapParameters(\n marketCap: number,\n tokenSupply: bigint,\n tokenDecimals: number = 18,\n): MarketCapValidationResult {\n const warnings: string[] = [];\n\n // Check for unreasonably small market caps\n if (marketCap < 1000) {\n warnings.push(\n `Market cap $${marketCap.toLocaleString()} is very small. Consider if this is intentional.`,\n );\n }\n\n // Check for unreasonably large market caps\n if (marketCap > 1_000_000_000_000) {\n warnings.push(\n `Market cap $${marketCap.toLocaleString()} is very large (> $1T). Verify this is correct.`,\n );\n }\n\n // Calculate implied token price\n const tokenPrice = marketCapToTokenPrice(\n marketCap,\n tokenSupply,\n tokenDecimals,\n );\n\n // Check for extremely small token prices\n if (tokenPrice < 0.000001) {\n warnings.push(\n `Implied token price $${tokenPrice.toExponential(2)} is very small. ` +\n `This may cause precision issues.`,\n );\n }\n\n // Check for extremely large token prices\n if (tokenPrice > 1_000_000) {\n warnings.push(\n `Implied token price $${tokenPrice.toLocaleString()} is very large. ` +\n `Verify your token supply and market cap values.`,\n );\n }\n\n return {\n valid: warnings.length === 0,\n warnings,\n };\n}\n\n/**\n * Calculate market cap from a tick (reverse conversion)\n *\n * Useful for displaying what market cap a given tick represents.\n * Works with ticks from any auction type (Static, Dynamic, Multicurve).\n *\n * @param params - Configuration object with tick and token parameters\n * @returns Market cap in USD\n *\n * @example\n * ```ts\n * // Works with negative ticks (Multicurve)\n * tickToMarketCap({\n * tick: -156000,\n * tokenSupply: supply,\n * numerairePriceUSD: 3000,\n * })\n *\n * // Works with positive ticks (Static/Dynamic)\n * tickToMarketCap({\n * tick: 156000,\n * tokenSupply: supply,\n * numerairePriceUSD: 3000,\n * })\n * ```\n */\nexport function tickToMarketCap(params: TickToMarketCapParams): number {\n const {\n tick,\n tokenSupply,\n numerairePriceUSD,\n tokenDecimals = 18,\n numeraireDecimals = 18,\n } = params;\n\n // Use absolute value since tick sign varies by auction type\n // but the underlying ratio is always positive\n const adjustedTick = Math.abs(tick);\n\n // Tick → ratio (reverse of ratioToTick)\n const ratio = Math.pow(1.0001, adjustedTick);\n\n // Ratio → token price (reverse of tokenPriceToRatio)\n // ratio = (numerairePriceUSD / tokenPriceUSD) * 10^(tokenDecimals - numeraireDecimals)\n // tokenPriceUSD = numerairePriceUSD / (ratio / decimalAdjustment)\n const decimalAdjustment = 10 ** (tokenDecimals - numeraireDecimals);\n const tokenPriceUSD = numerairePriceUSD / (ratio / decimalAdjustment);\n\n // Token price → market cap (reverse of marketCapToTokenPrice)\n const supplyNum = Number(tokenSupply) / 10 ** tokenDecimals;\n return tokenPriceUSD * supplyNum;\n}\n"]}
|
package/dist/chunk-FOESYJP3.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"chunk-FOESYJP3.mjs"}
|
package/dist/chunk-FXTGIKQG.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"names":[],"mappings":"","file":"chunk-FXTGIKQG.mjs"}
|
package/dist/chunk-GSBQIVME.mjs
DELETED
|
@@ -1,278 +0,0 @@
|
|
|
1
|
-
import { isToken0Expected } from './chunk-ABT6AT7C.mjs';
|
|
2
|
-
import { MAX_TICK, MIN_TICK } from './chunk-25GEBO3B.mjs';
|
|
3
|
-
|
|
4
|
-
// src/utils/marketCapHelpers.ts
|
|
5
|
-
function getMaxTickRounded(tickSpacing) {
|
|
6
|
-
return Math.floor(MAX_TICK / tickSpacing) * tickSpacing;
|
|
7
|
-
}
|
|
8
|
-
function marketCapToTokenPrice(marketCapUSD, tokenSupply, tokenDecimals = 18) {
|
|
9
|
-
if (marketCapUSD <= 0) {
|
|
10
|
-
throw new Error("Market cap must be positive");
|
|
11
|
-
}
|
|
12
|
-
if (tokenSupply <= 0n) {
|
|
13
|
-
throw new Error("Token supply must be positive");
|
|
14
|
-
}
|
|
15
|
-
const supplyNum = Number(tokenSupply) / 10 ** tokenDecimals;
|
|
16
|
-
return marketCapUSD / supplyNum;
|
|
17
|
-
}
|
|
18
|
-
function tokenPriceToRatio(tokenPriceUSD, numerairePriceUSD, tokenDecimals = 18, numeraireDecimals = 18) {
|
|
19
|
-
if (tokenPriceUSD <= 0) {
|
|
20
|
-
throw new Error("Token price must be positive");
|
|
21
|
-
}
|
|
22
|
-
if (numerairePriceUSD <= 0) {
|
|
23
|
-
throw new Error("Numeraire price must be positive");
|
|
24
|
-
}
|
|
25
|
-
const ratio = numerairePriceUSD / tokenPriceUSD;
|
|
26
|
-
const decimalAdjustment = 10 ** (tokenDecimals - numeraireDecimals);
|
|
27
|
-
return ratio * decimalAdjustment;
|
|
28
|
-
}
|
|
29
|
-
function ratioToTick(ratio) {
|
|
30
|
-
if (ratio <= 0) {
|
|
31
|
-
throw new Error("Ratio must be positive");
|
|
32
|
-
}
|
|
33
|
-
return Math.log(ratio) / Math.log(1.0001);
|
|
34
|
-
}
|
|
35
|
-
function isToken1(tokenAddress, numeraireAddress) {
|
|
36
|
-
return tokenAddress.toLowerCase() > numeraireAddress.toLowerCase();
|
|
37
|
-
}
|
|
38
|
-
function _computeRawTick(marketCapUSD, tokenSupply, numerairePriceUSD, tokenDecimals, numeraireDecimals, tickSpacing) {
|
|
39
|
-
if (marketCapUSD <= 0) {
|
|
40
|
-
throw new Error("Market cap must be positive");
|
|
41
|
-
}
|
|
42
|
-
const tokenPrice = marketCapToTokenPrice(
|
|
43
|
-
marketCapUSD,
|
|
44
|
-
tokenSupply,
|
|
45
|
-
tokenDecimals
|
|
46
|
-
);
|
|
47
|
-
const ratio = tokenPriceToRatio(
|
|
48
|
-
tokenPrice,
|
|
49
|
-
numerairePriceUSD,
|
|
50
|
-
tokenDecimals,
|
|
51
|
-
numeraireDecimals
|
|
52
|
-
);
|
|
53
|
-
const rawTick = ratioToTick(ratio);
|
|
54
|
-
const alignedTick = Math.floor(rawTick / tickSpacing) * tickSpacing;
|
|
55
|
-
if (alignedTick < MIN_TICK || alignedTick > MAX_TICK) {
|
|
56
|
-
throw new Error(
|
|
57
|
-
`Calculated tick ${alignedTick} is out of bounds [${MIN_TICK}, ${MAX_TICK}]. Market cap ${marketCapUSD.toLocaleString()} may be too extreme for the given parameters.`
|
|
58
|
-
);
|
|
59
|
-
}
|
|
60
|
-
return alignedTick;
|
|
61
|
-
}
|
|
62
|
-
function marketCapToTicksForStaticAuction(params) {
|
|
63
|
-
const {
|
|
64
|
-
marketCapRange,
|
|
65
|
-
tokenSupply,
|
|
66
|
-
numerairePriceUSD,
|
|
67
|
-
tickSpacing,
|
|
68
|
-
tokenDecimals = 18,
|
|
69
|
-
numeraireDecimals = 18
|
|
70
|
-
} = params;
|
|
71
|
-
if (marketCapRange.start <= 0) {
|
|
72
|
-
throw new Error("Start market cap must be positive");
|
|
73
|
-
}
|
|
74
|
-
if (marketCapRange.end <= 0) {
|
|
75
|
-
throw new Error("End market cap must be positive");
|
|
76
|
-
}
|
|
77
|
-
if (marketCapRange.start >= marketCapRange.end) {
|
|
78
|
-
throw new Error("Start market cap must be less than end market cap");
|
|
79
|
-
}
|
|
80
|
-
const tickAtStart = _computeRawTick(
|
|
81
|
-
marketCapRange.start,
|
|
82
|
-
tokenSupply,
|
|
83
|
-
numerairePriceUSD,
|
|
84
|
-
tokenDecimals,
|
|
85
|
-
numeraireDecimals,
|
|
86
|
-
tickSpacing
|
|
87
|
-
);
|
|
88
|
-
const tickAtEnd = _computeRawTick(
|
|
89
|
-
marketCapRange.end,
|
|
90
|
-
tokenSupply,
|
|
91
|
-
numerairePriceUSD,
|
|
92
|
-
tokenDecimals,
|
|
93
|
-
numeraireDecimals,
|
|
94
|
-
tickSpacing
|
|
95
|
-
);
|
|
96
|
-
const startTick = Math.min(Math.abs(tickAtStart), Math.abs(tickAtEnd));
|
|
97
|
-
const endTick = Math.max(Math.abs(tickAtStart), Math.abs(tickAtEnd));
|
|
98
|
-
if (startTick === endTick) {
|
|
99
|
-
throw new Error(
|
|
100
|
-
`Market cap range ${marketCapRange.start.toLocaleString()} - ${marketCapRange.end.toLocaleString()} resulted in same tick (${startTick}). Try a wider range or smaller tick spacing.`
|
|
101
|
-
);
|
|
102
|
-
}
|
|
103
|
-
return { startTick, endTick };
|
|
104
|
-
}
|
|
105
|
-
function marketCapToTicksForDynamicAuction(params) {
|
|
106
|
-
const {
|
|
107
|
-
marketCapRange,
|
|
108
|
-
tokenSupply,
|
|
109
|
-
numerairePriceUSD,
|
|
110
|
-
numeraire,
|
|
111
|
-
tickSpacing,
|
|
112
|
-
tokenDecimals = 18,
|
|
113
|
-
numeraireDecimals = 18
|
|
114
|
-
} = params;
|
|
115
|
-
if (marketCapRange.start <= 0 || marketCapRange.end <= 0) {
|
|
116
|
-
throw new Error("Market cap values must be positive");
|
|
117
|
-
}
|
|
118
|
-
if (marketCapRange.start >= marketCapRange.end) {
|
|
119
|
-
throw new Error("Start market cap must be less than end market cap");
|
|
120
|
-
}
|
|
121
|
-
const tickAtStart = _computeRawTick(
|
|
122
|
-
marketCapRange.start,
|
|
123
|
-
tokenSupply,
|
|
124
|
-
numerairePriceUSD,
|
|
125
|
-
tokenDecimals,
|
|
126
|
-
numeraireDecimals,
|
|
127
|
-
tickSpacing
|
|
128
|
-
);
|
|
129
|
-
const tickAtEnd = _computeRawTick(
|
|
130
|
-
marketCapRange.end,
|
|
131
|
-
tokenSupply,
|
|
132
|
-
numerairePriceUSD,
|
|
133
|
-
tokenDecimals,
|
|
134
|
-
numeraireDecimals,
|
|
135
|
-
tickSpacing
|
|
136
|
-
);
|
|
137
|
-
const tokenIsToken0 = isToken0Expected(numeraire);
|
|
138
|
-
if (tokenIsToken0) {
|
|
139
|
-
const startTick = -Math.min(Math.abs(tickAtStart), Math.abs(tickAtEnd));
|
|
140
|
-
const endTick = -Math.max(Math.abs(tickAtStart), Math.abs(tickAtEnd));
|
|
141
|
-
if (startTick === endTick) {
|
|
142
|
-
throw new Error(
|
|
143
|
-
`Market cap range resulted in same tick (${startTick}). Try a wider range.`
|
|
144
|
-
);
|
|
145
|
-
}
|
|
146
|
-
return { startTick, endTick };
|
|
147
|
-
} else {
|
|
148
|
-
const startTick = Math.min(Math.abs(tickAtStart), Math.abs(tickAtEnd));
|
|
149
|
-
const endTick = Math.max(Math.abs(tickAtStart), Math.abs(tickAtEnd));
|
|
150
|
-
if (startTick === endTick) {
|
|
151
|
-
throw new Error(
|
|
152
|
-
`Market cap range resulted in same tick (${startTick}). Try a wider range.`
|
|
153
|
-
);
|
|
154
|
-
}
|
|
155
|
-
return { startTick, endTick };
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
function marketCapToTicksForMulticurve(params) {
|
|
159
|
-
const {
|
|
160
|
-
marketCapLower,
|
|
161
|
-
marketCapUpper,
|
|
162
|
-
tokenSupply,
|
|
163
|
-
numerairePriceUSD,
|
|
164
|
-
tickSpacing,
|
|
165
|
-
tokenDecimals = 18,
|
|
166
|
-
numeraireDecimals = 18
|
|
167
|
-
} = params;
|
|
168
|
-
if (marketCapLower <= 0) {
|
|
169
|
-
throw new Error("Lower market cap must be positive");
|
|
170
|
-
}
|
|
171
|
-
if (marketCapUpper !== "max" && marketCapUpper <= 0) {
|
|
172
|
-
throw new Error("Upper market cap must be positive");
|
|
173
|
-
}
|
|
174
|
-
if (marketCapUpper !== "max" && marketCapLower >= marketCapUpper) {
|
|
175
|
-
throw new Error("Lower market cap must be less than upper market cap");
|
|
176
|
-
}
|
|
177
|
-
const tickAtLower = -_computeRawTick(
|
|
178
|
-
marketCapLower,
|
|
179
|
-
tokenSupply,
|
|
180
|
-
numerairePriceUSD,
|
|
181
|
-
tokenDecimals,
|
|
182
|
-
numeraireDecimals,
|
|
183
|
-
tickSpacing
|
|
184
|
-
);
|
|
185
|
-
const tickAtUpper = marketCapUpper === "max" ? getMaxTickRounded(tickSpacing) : -_computeRawTick(
|
|
186
|
-
marketCapUpper,
|
|
187
|
-
tokenSupply,
|
|
188
|
-
numerairePriceUSD,
|
|
189
|
-
tokenDecimals,
|
|
190
|
-
numeraireDecimals,
|
|
191
|
-
tickSpacing
|
|
192
|
-
);
|
|
193
|
-
const tickLower = Math.min(tickAtLower, tickAtUpper);
|
|
194
|
-
const tickUpper = Math.max(tickAtLower, tickAtUpper);
|
|
195
|
-
if (tickLower === tickUpper) {
|
|
196
|
-
const upperLabel = marketCapUpper === "max" ? "max" : `$${marketCapUpper.toLocaleString()}`;
|
|
197
|
-
throw new Error(
|
|
198
|
-
`Market cap range $${marketCapLower.toLocaleString()} - ${upperLabel} resulted in same tick (${tickLower}). Try a wider range or smaller tick spacing.`
|
|
199
|
-
);
|
|
200
|
-
}
|
|
201
|
-
return { tickLower, tickUpper };
|
|
202
|
-
}
|
|
203
|
-
function marketCapToTickForMulticurve(params) {
|
|
204
|
-
const {
|
|
205
|
-
marketCapUSD,
|
|
206
|
-
tokenSupply,
|
|
207
|
-
numerairePriceUSD,
|
|
208
|
-
tickSpacing,
|
|
209
|
-
tokenDecimals = 18,
|
|
210
|
-
numeraireDecimals = 18
|
|
211
|
-
} = params;
|
|
212
|
-
const rawTick = -_computeRawTick(
|
|
213
|
-
marketCapUSD,
|
|
214
|
-
tokenSupply,
|
|
215
|
-
numerairePriceUSD,
|
|
216
|
-
tokenDecimals,
|
|
217
|
-
numeraireDecimals,
|
|
218
|
-
tickSpacing
|
|
219
|
-
);
|
|
220
|
-
return rawTick === 0 ? 0 : rawTick;
|
|
221
|
-
}
|
|
222
|
-
function applyTickOffsets(pegTick, offsetLower, offsetUpper, numeraire) {
|
|
223
|
-
return {
|
|
224
|
-
tickLower: pegTick + offsetLower,
|
|
225
|
-
tickUpper: pegTick + offsetUpper
|
|
226
|
-
};
|
|
227
|
-
}
|
|
228
|
-
function validateMarketCapParameters(marketCap, tokenSupply, tokenDecimals = 18) {
|
|
229
|
-
const warnings = [];
|
|
230
|
-
if (marketCap < 1e3) {
|
|
231
|
-
warnings.push(
|
|
232
|
-
`Market cap $${marketCap.toLocaleString()} is very small. Consider if this is intentional.`
|
|
233
|
-
);
|
|
234
|
-
}
|
|
235
|
-
if (marketCap > 1e12) {
|
|
236
|
-
warnings.push(
|
|
237
|
-
`Market cap $${marketCap.toLocaleString()} is very large (> $1T). Verify this is correct.`
|
|
238
|
-
);
|
|
239
|
-
}
|
|
240
|
-
const tokenPrice = marketCapToTokenPrice(
|
|
241
|
-
marketCap,
|
|
242
|
-
tokenSupply,
|
|
243
|
-
tokenDecimals
|
|
244
|
-
);
|
|
245
|
-
if (tokenPrice < 1e-6) {
|
|
246
|
-
warnings.push(
|
|
247
|
-
`Implied token price $${tokenPrice.toExponential(2)} is very small. This may cause precision issues.`
|
|
248
|
-
);
|
|
249
|
-
}
|
|
250
|
-
if (tokenPrice > 1e6) {
|
|
251
|
-
warnings.push(
|
|
252
|
-
`Implied token price $${tokenPrice.toLocaleString()} is very large. Verify your token supply and market cap values.`
|
|
253
|
-
);
|
|
254
|
-
}
|
|
255
|
-
return {
|
|
256
|
-
valid: warnings.length === 0,
|
|
257
|
-
warnings
|
|
258
|
-
};
|
|
259
|
-
}
|
|
260
|
-
function tickToMarketCap(params) {
|
|
261
|
-
const {
|
|
262
|
-
tick,
|
|
263
|
-
tokenSupply,
|
|
264
|
-
numerairePriceUSD,
|
|
265
|
-
tokenDecimals = 18,
|
|
266
|
-
numeraireDecimals = 18
|
|
267
|
-
} = params;
|
|
268
|
-
const adjustedTick = Math.abs(tick);
|
|
269
|
-
const ratio = Math.pow(1.0001, adjustedTick);
|
|
270
|
-
const decimalAdjustment = 10 ** (tokenDecimals - numeraireDecimals);
|
|
271
|
-
const tokenPriceUSD = numerairePriceUSD / (ratio / decimalAdjustment);
|
|
272
|
-
const supplyNum = Number(tokenSupply) / 10 ** tokenDecimals;
|
|
273
|
-
return tokenPriceUSD * supplyNum;
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
export { applyTickOffsets, getMaxTickRounded, isToken1, marketCapToTickForMulticurve, marketCapToTicksForDynamicAuction, marketCapToTicksForMulticurve, marketCapToTicksForStaticAuction, marketCapToTokenPrice, ratioToTick, tickToMarketCap, tokenPriceToRatio, validateMarketCapParameters };
|
|
277
|
-
//# sourceMappingURL=chunk-GSBQIVME.mjs.map
|
|
278
|
-
//# sourceMappingURL=chunk-GSBQIVME.mjs.map
|