@whetstone-research/doppler-sdk 0.0.1-alpha.1

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.
Files changed (228) hide show
  1. package/README.md +432 -0
  2. package/dist/DopplerSDK.d.mts +56 -0
  3. package/dist/DopplerSDK.d.ts +56 -0
  4. package/dist/DopplerSDK.js +23 -0
  5. package/dist/DopplerSDK.js.map +1 -0
  6. package/dist/DopplerSDK.mjs +14 -0
  7. package/dist/DopplerSDK.mjs.map +1 -0
  8. package/dist/__tests__/mocks/addresses.d.mts +46 -0
  9. package/dist/__tests__/mocks/addresses.d.ts +46 -0
  10. package/dist/__tests__/mocks/addresses.js +53 -0
  11. package/dist/__tests__/mocks/addresses.js.map +1 -0
  12. package/dist/__tests__/mocks/addresses.mjs +44 -0
  13. package/dist/__tests__/mocks/addresses.mjs.map +1 -0
  14. package/dist/__tests__/mocks/clients.d.mts +22 -0
  15. package/dist/__tests__/mocks/clients.d.ts +22 -0
  16. package/dist/__tests__/mocks/clients.js +17088 -0
  17. package/dist/__tests__/mocks/clients.js.map +1 -0
  18. package/dist/__tests__/mocks/clients.mjs +17084 -0
  19. package/dist/__tests__/mocks/clients.mjs.map +1 -0
  20. package/dist/abis/bytecodes.d.mts +5 -0
  21. package/dist/abis/bytecodes.d.ts +5 -0
  22. package/dist/abis/bytecodes.js +21 -0
  23. package/dist/abis/bytecodes.js.map +1 -0
  24. package/dist/abis/bytecodes.mjs +4 -0
  25. package/dist/abis/bytecodes.mjs.map +1 -0
  26. package/dist/abis/index.d.mts +1864 -0
  27. package/dist/abis/index.d.ts +1864 -0
  28. package/dist/abis/index.js +74 -0
  29. package/dist/abis/index.js.map +1 -0
  30. package/dist/abis/index.mjs +5 -0
  31. package/dist/abis/index.mjs.map +1 -0
  32. package/dist/addresses.d.mts +46 -0
  33. package/dist/addresses.d.ts +46 -0
  34. package/dist/addresses.js +21 -0
  35. package/dist/addresses.js.map +1 -0
  36. package/dist/addresses.mjs +4 -0
  37. package/dist/addresses.mjs.map +1 -0
  38. package/dist/chunk-2LPOXGKT.mjs +181 -0
  39. package/dist/chunk-2LPOXGKT.mjs.map +1 -0
  40. package/dist/chunk-4K5GBNQV.mjs +157 -0
  41. package/dist/chunk-4K5GBNQV.mjs.map +1 -0
  42. package/dist/chunk-5B7IYSVK.js +82 -0
  43. package/dist/chunk-5B7IYSVK.js.map +1 -0
  44. package/dist/chunk-6H6BP7GZ.mjs +12 -0
  45. package/dist/chunk-6H6BP7GZ.mjs.map +1 -0
  46. package/dist/chunk-6REZA4TU.mjs +268 -0
  47. package/dist/chunk-6REZA4TU.mjs.map +1 -0
  48. package/dist/chunk-AYPP5JEQ.mjs +67 -0
  49. package/dist/chunk-AYPP5JEQ.mjs.map +1 -0
  50. package/dist/chunk-AZLFJNTG.mjs +3 -0
  51. package/dist/chunk-AZLFJNTG.mjs.map +1 -0
  52. package/dist/chunk-BYK425DD.mjs +160 -0
  53. package/dist/chunk-BYK425DD.mjs.map +1 -0
  54. package/dist/chunk-BYR4WWCZ.mjs +80 -0
  55. package/dist/chunk-BYR4WWCZ.mjs.map +1 -0
  56. package/dist/chunk-CYDWEPFL.mjs +3 -0
  57. package/dist/chunk-CYDWEPFL.mjs.map +1 -0
  58. package/dist/chunk-DLL6MEJA.js +270 -0
  59. package/dist/chunk-DLL6MEJA.js.map +1 -0
  60. package/dist/chunk-DRBRT57F.js +4 -0
  61. package/dist/chunk-DRBRT57F.js.map +1 -0
  62. package/dist/chunk-ER42VG7H.js +102 -0
  63. package/dist/chunk-ER42VG7H.js.map +1 -0
  64. package/dist/chunk-FOESYJP3.mjs +3 -0
  65. package/dist/chunk-FOESYJP3.mjs.map +1 -0
  66. package/dist/chunk-IGLVXIHA.js +924 -0
  67. package/dist/chunk-IGLVXIHA.js.map +1 -0
  68. package/dist/chunk-IPW2I4JJ.mjs +922 -0
  69. package/dist/chunk-IPW2I4JJ.mjs.map +1 -0
  70. package/dist/chunk-IX32KFK3.js +14 -0
  71. package/dist/chunk-IX32KFK3.js.map +1 -0
  72. package/dist/chunk-JHKPKTCV.js +1269 -0
  73. package/dist/chunk-JHKPKTCV.js.map +1 -0
  74. package/dist/chunk-K7BWQVAX.js +185 -0
  75. package/dist/chunk-K7BWQVAX.js.map +1 -0
  76. package/dist/chunk-KEXKKQVW.js +42 -0
  77. package/dist/chunk-KEXKKQVW.js.map +1 -0
  78. package/dist/chunk-KPBCG4X2.js +76 -0
  79. package/dist/chunk-KPBCG4X2.js.map +1 -0
  80. package/dist/chunk-KRN3ROUE.js +4 -0
  81. package/dist/chunk-KRN3ROUE.js.map +1 -0
  82. package/dist/chunk-L4TKYN6R.mjs +207 -0
  83. package/dist/chunk-L4TKYN6R.mjs.map +1 -0
  84. package/dist/chunk-LOROXNH3.mjs +37 -0
  85. package/dist/chunk-LOROXNH3.mjs.map +1 -0
  86. package/dist/chunk-NDWBEGEN.mjs +8 -0
  87. package/dist/chunk-NDWBEGEN.mjs.map +1 -0
  88. package/dist/chunk-O55NMSZK.mjs +131 -0
  89. package/dist/chunk-O55NMSZK.mjs.map +1 -0
  90. package/dist/chunk-OMN7RXR4.js +12 -0
  91. package/dist/chunk-OMN7RXR4.js.map +1 -0
  92. package/dist/chunk-OPKQMN46.mjs +54 -0
  93. package/dist/chunk-OPKQMN46.mjs.map +1 -0
  94. package/dist/chunk-P7CHGWY7.js +4 -0
  95. package/dist/chunk-P7CHGWY7.js.map +1 -0
  96. package/dist/chunk-QSQGLWNY.mjs +3 -0
  97. package/dist/chunk-QSQGLWNY.mjs.map +1 -0
  98. package/dist/chunk-R3YCKIM4.js +133 -0
  99. package/dist/chunk-R3YCKIM4.js.map +1 -0
  100. package/dist/chunk-RV64M4Q6.mjs +3 -0
  101. package/dist/chunk-RV64M4Q6.mjs.map +1 -0
  102. package/dist/chunk-SIVXK7WY.js +162 -0
  103. package/dist/chunk-SIVXK7WY.js.map +1 -0
  104. package/dist/chunk-T644D54P.mjs +65 -0
  105. package/dist/chunk-T644D54P.mjs.map +1 -0
  106. package/dist/chunk-TOMVBPNZ.js +56 -0
  107. package/dist/chunk-TOMVBPNZ.js.map +1 -0
  108. package/dist/chunk-VEIVYUYF.js +4 -0
  109. package/dist/chunk-VEIVYUYF.js.map +1 -0
  110. package/dist/chunk-WQHTNL5L.js +4 -0
  111. package/dist/chunk-WQHTNL5L.js.map +1 -0
  112. package/dist/chunk-X3UMAHOJ.js +4 -0
  113. package/dist/chunk-X3UMAHOJ.js.map +1 -0
  114. package/dist/chunk-XG7K4R56.js +170 -0
  115. package/dist/chunk-XG7K4R56.js.map +1 -0
  116. package/dist/chunk-XJGF77WN.mjs +1254 -0
  117. package/dist/chunk-XJGF77WN.mjs.map +1 -0
  118. package/dist/chunk-XNMXN5SZ.mjs +3 -0
  119. package/dist/chunk-XNMXN5SZ.mjs.map +1 -0
  120. package/dist/chunk-YPNUUFAD.js +209 -0
  121. package/dist/chunk-YPNUUFAD.js.map +1 -0
  122. package/dist/constants.d.mts +50 -0
  123. package/dist/constants.d.ts +50 -0
  124. package/dist/constants.js +153 -0
  125. package/dist/constants.js.map +1 -0
  126. package/dist/constants.mjs +4 -0
  127. package/dist/constants.mjs.map +1 -0
  128. package/dist/entities/DopplerFactory.d.mts +118 -0
  129. package/dist/entities/DopplerFactory.d.ts +118 -0
  130. package/dist/entities/DopplerFactory.js +17 -0
  131. package/dist/entities/DopplerFactory.js.map +1 -0
  132. package/dist/entities/DopplerFactory.mjs +8 -0
  133. package/dist/entities/DopplerFactory.mjs.map +1 -0
  134. package/dist/entities/auction/DynamicAuction.d.mts +57 -0
  135. package/dist/entities/auction/DynamicAuction.d.ts +57 -0
  136. package/dist/entities/auction/DynamicAuction.js +16 -0
  137. package/dist/entities/auction/DynamicAuction.js.map +1 -0
  138. package/dist/entities/auction/DynamicAuction.mjs +7 -0
  139. package/dist/entities/auction/DynamicAuction.mjs.map +1 -0
  140. package/dist/entities/auction/StaticAuction.d.mts +41 -0
  141. package/dist/entities/auction/StaticAuction.d.ts +41 -0
  142. package/dist/entities/auction/StaticAuction.js +16 -0
  143. package/dist/entities/auction/StaticAuction.js.map +1 -0
  144. package/dist/entities/auction/StaticAuction.mjs +7 -0
  145. package/dist/entities/auction/StaticAuction.mjs.map +1 -0
  146. package/dist/entities/auction/index.d.mts +4 -0
  147. package/dist/entities/auction/index.d.ts +4 -0
  148. package/dist/entities/auction/index.js +22 -0
  149. package/dist/entities/auction/index.js.map +1 -0
  150. package/dist/entities/auction/index.mjs +9 -0
  151. package/dist/entities/auction/index.mjs.map +1 -0
  152. package/dist/entities/quoter/Quoter.d.mts +108 -0
  153. package/dist/entities/quoter/Quoter.d.ts +108 -0
  154. package/dist/entities/quoter/Quoter.js +16 -0
  155. package/dist/entities/quoter/Quoter.js.map +1 -0
  156. package/dist/entities/quoter/Quoter.mjs +7 -0
  157. package/dist/entities/quoter/Quoter.mjs.map +1 -0
  158. package/dist/entities/quoter/index.d.mts +2 -0
  159. package/dist/entities/quoter/index.d.ts +2 -0
  160. package/dist/entities/quoter/index.js +17 -0
  161. package/dist/entities/quoter/index.js.map +1 -0
  162. package/dist/entities/quoter/index.mjs +8 -0
  163. package/dist/entities/quoter/index.mjs.map +1 -0
  164. package/dist/entities/token/derc20/Derc20.d.mts +76 -0
  165. package/dist/entities/token/derc20/Derc20.d.ts +76 -0
  166. package/dist/entities/token/derc20/Derc20.js +15 -0
  167. package/dist/entities/token/derc20/Derc20.js.map +1 -0
  168. package/dist/entities/token/derc20/Derc20.mjs +6 -0
  169. package/dist/entities/token/derc20/Derc20.mjs.map +1 -0
  170. package/dist/entities/token/derc20/index.d.mts +2 -0
  171. package/dist/entities/token/derc20/index.d.ts +2 -0
  172. package/dist/entities/token/derc20/index.js +16 -0
  173. package/dist/entities/token/derc20/index.js.map +1 -0
  174. package/dist/entities/token/derc20/index.mjs +7 -0
  175. package/dist/entities/token/derc20/index.mjs.map +1 -0
  176. package/dist/entities/token/eth/Eth.d.mts +50 -0
  177. package/dist/entities/token/eth/Eth.d.ts +50 -0
  178. package/dist/entities/token/eth/Eth.js +13 -0
  179. package/dist/entities/token/eth/Eth.js.map +1 -0
  180. package/dist/entities/token/eth/Eth.mjs +4 -0
  181. package/dist/entities/token/eth/Eth.mjs.map +1 -0
  182. package/dist/entities/token/eth/index.d.mts +2 -0
  183. package/dist/entities/token/eth/index.d.ts +2 -0
  184. package/dist/entities/token/eth/index.js +14 -0
  185. package/dist/entities/token/eth/index.js.map +1 -0
  186. package/dist/entities/token/eth/index.mjs +5 -0
  187. package/dist/entities/token/eth/index.mjs.map +1 -0
  188. package/dist/entities/token/index.d.mts +3 -0
  189. package/dist/entities/token/index.d.ts +3 -0
  190. package/dist/entities/token/index.js +23 -0
  191. package/dist/entities/token/index.js.map +1 -0
  192. package/dist/entities/token/index.mjs +10 -0
  193. package/dist/entities/token/index.mjs.map +1 -0
  194. package/dist/index.d.mts +19 -0
  195. package/dist/index.d.ts +19 -0
  196. package/dist/index.js +338 -0
  197. package/dist/index.js.map +1 -0
  198. package/dist/index.mjs +28 -0
  199. package/dist/index.mjs.map +1 -0
  200. package/dist/magic-string.es-NMLAOY5A.js +1298 -0
  201. package/dist/magic-string.es-NMLAOY5A.js.map +1 -0
  202. package/dist/magic-string.es-QCVTE6QG.mjs +1292 -0
  203. package/dist/magic-string.es-QCVTE6QG.mjs.map +1 -0
  204. package/dist/types.d.mts +206 -0
  205. package/dist/types.d.ts +206 -0
  206. package/dist/types.js +13 -0
  207. package/dist/types.js.map +1 -0
  208. package/dist/types.mjs +4 -0
  209. package/dist/types.mjs.map +1 -0
  210. package/dist/utils/index.d.mts +2 -0
  211. package/dist/utils/index.d.ts +2 -0
  212. package/dist/utils/index.js +91 -0
  213. package/dist/utils/index.js.map +1 -0
  214. package/dist/utils/index.mjs +6 -0
  215. package/dist/utils/index.mjs.map +1 -0
  216. package/dist/utils/priceHelpers.d.mts +86 -0
  217. package/dist/utils/priceHelpers.d.ts +86 -0
  218. package/dist/utils/priceHelpers.js +42 -0
  219. package/dist/utils/priceHelpers.js.map +1 -0
  220. package/dist/utils/priceHelpers.mjs +5 -0
  221. package/dist/utils/priceHelpers.mjs.map +1 -0
  222. package/dist/utils/tickMath.d.mts +65 -0
  223. package/dist/utils/tickMath.d.ts +65 -0
  224. package/dist/utils/tickMath.js +57 -0
  225. package/dist/utils/tickMath.js.map +1 -0
  226. package/dist/utils/tickMath.mjs +4 -0
  227. package/dist/utils/tickMath.mjs.map +1 -0
  228. package/package.json +62 -0
package/dist/types.mjs ADDED
@@ -0,0 +1,4 @@
1
+ export { LockablePoolStatus } from './chunk-6H6BP7GZ.mjs';
2
+ import './chunk-LOROXNH3.mjs';
3
+ //# sourceMappingURL=types.mjs.map
4
+ //# sourceMappingURL=types.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"types.mjs"}
@@ -0,0 +1,2 @@
1
+ export { MAX_SQRT_RATIO, MAX_TICK, MIN_SQRT_RATIO, MIN_TICK, Q96, getNearestUsableTick, getSqrtRatioAtTick, getTickAtSqrtRatio, priceToSqrtPriceX96, priceToTick, sqrtPriceX96ToPrice, tickToPrice } from './tickMath.mjs';
2
+ export { calculateFDV, calculateGamma, calculateMarketCap, calculateTickRange, calculateTokensToSell, estimatePriceAtEpoch, estimateSlippage, formatTickAsPrice } from './priceHelpers.mjs';
@@ -0,0 +1,2 @@
1
+ export { MAX_SQRT_RATIO, MAX_TICK, MIN_SQRT_RATIO, MIN_TICK, Q96, getNearestUsableTick, getSqrtRatioAtTick, getTickAtSqrtRatio, priceToSqrtPriceX96, priceToTick, sqrtPriceX96ToPrice, tickToPrice } from './tickMath.js';
2
+ export { calculateFDV, calculateGamma, calculateMarketCap, calculateTickRange, calculateTokensToSell, estimatePriceAtEpoch, estimateSlippage, formatTickAsPrice } from './priceHelpers.js';
@@ -0,0 +1,91 @@
1
+ 'use strict';
2
+
3
+ require('../chunk-DRBRT57F.js');
4
+ var chunkKPBCG4X2_js = require('../chunk-KPBCG4X2.js');
5
+ var chunkXG7K4R56_js = require('../chunk-XG7K4R56.js');
6
+ require('../chunk-KEXKKQVW.js');
7
+
8
+
9
+
10
+ Object.defineProperty(exports, "calculateFDV", {
11
+ enumerable: true,
12
+ get: function () { return chunkKPBCG4X2_js.calculateFDV; }
13
+ });
14
+ Object.defineProperty(exports, "calculateGamma", {
15
+ enumerable: true,
16
+ get: function () { return chunkKPBCG4X2_js.calculateGamma; }
17
+ });
18
+ Object.defineProperty(exports, "calculateMarketCap", {
19
+ enumerable: true,
20
+ get: function () { return chunkKPBCG4X2_js.calculateMarketCap; }
21
+ });
22
+ Object.defineProperty(exports, "calculateTickRange", {
23
+ enumerable: true,
24
+ get: function () { return chunkKPBCG4X2_js.calculateTickRange; }
25
+ });
26
+ Object.defineProperty(exports, "calculateTokensToSell", {
27
+ enumerable: true,
28
+ get: function () { return chunkKPBCG4X2_js.calculateTokensToSell; }
29
+ });
30
+ Object.defineProperty(exports, "estimatePriceAtEpoch", {
31
+ enumerable: true,
32
+ get: function () { return chunkKPBCG4X2_js.estimatePriceAtEpoch; }
33
+ });
34
+ Object.defineProperty(exports, "estimateSlippage", {
35
+ enumerable: true,
36
+ get: function () { return chunkKPBCG4X2_js.estimateSlippage; }
37
+ });
38
+ Object.defineProperty(exports, "formatTickAsPrice", {
39
+ enumerable: true,
40
+ get: function () { return chunkKPBCG4X2_js.formatTickAsPrice; }
41
+ });
42
+ Object.defineProperty(exports, "MAX_SQRT_RATIO", {
43
+ enumerable: true,
44
+ get: function () { return chunkXG7K4R56_js.MAX_SQRT_RATIO; }
45
+ });
46
+ Object.defineProperty(exports, "MAX_TICK", {
47
+ enumerable: true,
48
+ get: function () { return chunkXG7K4R56_js.MAX_TICK; }
49
+ });
50
+ Object.defineProperty(exports, "MIN_SQRT_RATIO", {
51
+ enumerable: true,
52
+ get: function () { return chunkXG7K4R56_js.MIN_SQRT_RATIO; }
53
+ });
54
+ Object.defineProperty(exports, "MIN_TICK", {
55
+ enumerable: true,
56
+ get: function () { return chunkXG7K4R56_js.MIN_TICK; }
57
+ });
58
+ Object.defineProperty(exports, "Q96", {
59
+ enumerable: true,
60
+ get: function () { return chunkXG7K4R56_js.Q96; }
61
+ });
62
+ Object.defineProperty(exports, "getNearestUsableTick", {
63
+ enumerable: true,
64
+ get: function () { return chunkXG7K4R56_js.getNearestUsableTick; }
65
+ });
66
+ Object.defineProperty(exports, "getSqrtRatioAtTick", {
67
+ enumerable: true,
68
+ get: function () { return chunkXG7K4R56_js.getSqrtRatioAtTick; }
69
+ });
70
+ Object.defineProperty(exports, "getTickAtSqrtRatio", {
71
+ enumerable: true,
72
+ get: function () { return chunkXG7K4R56_js.getTickAtSqrtRatio; }
73
+ });
74
+ Object.defineProperty(exports, "priceToSqrtPriceX96", {
75
+ enumerable: true,
76
+ get: function () { return chunkXG7K4R56_js.priceToSqrtPriceX96; }
77
+ });
78
+ Object.defineProperty(exports, "priceToTick", {
79
+ enumerable: true,
80
+ get: function () { return chunkXG7K4R56_js.priceToTick; }
81
+ });
82
+ Object.defineProperty(exports, "sqrtPriceX96ToPrice", {
83
+ enumerable: true,
84
+ get: function () { return chunkXG7K4R56_js.sqrtPriceX96ToPrice; }
85
+ });
86
+ Object.defineProperty(exports, "tickToPrice", {
87
+ enumerable: true,
88
+ get: function () { return chunkXG7K4R56_js.tickToPrice; }
89
+ });
90
+ //# sourceMappingURL=index.js.map
91
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
@@ -0,0 +1,6 @@
1
+ import '../chunk-CYDWEPFL.mjs';
2
+ export { calculateFDV, calculateGamma, calculateMarketCap, calculateTickRange, calculateTokensToSell, estimatePriceAtEpoch, estimateSlippage, formatTickAsPrice } from '../chunk-AYPP5JEQ.mjs';
3
+ export { MAX_SQRT_RATIO, MAX_TICK, MIN_SQRT_RATIO, MIN_TICK, Q96, getNearestUsableTick, getSqrtRatioAtTick, getTickAtSqrtRatio, priceToSqrtPriceX96, priceToTick, sqrtPriceX96ToPrice, tickToPrice } from '../chunk-4K5GBNQV.mjs';
4
+ import '../chunk-LOROXNH3.mjs';
5
+ //# sourceMappingURL=index.mjs.map
6
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.mjs"}
@@ -0,0 +1,86 @@
1
+ /**
2
+ * Price helper utilities for common token launch scenarios
3
+ */
4
+ /**
5
+ * Calculate the tick range for a desired price range
6
+ * @param minPrice Minimum price (ETH per token)
7
+ * @param maxPrice Maximum price (ETH per token)
8
+ * @param tickSpacing The tick spacing of the pool
9
+ * @param wethDecimals Decimals of WETH (usually 18)
10
+ * @param tokenDecimals Decimals of the token (usually 18)
11
+ * @returns Object with startTick and endTick
12
+ */
13
+ declare function calculateTickRange(minPrice: number, maxPrice: number, tickSpacing: number, wethDecimals?: number, tokenDecimals?: number): {
14
+ startTick: number;
15
+ endTick: number;
16
+ };
17
+ /**
18
+ * Calculate the number of tokens to sell based on desired raise
19
+ * @param targetRaiseETH Target amount to raise in ETH
20
+ * @param avgPricePerToken Average expected price per token in ETH
21
+ * @returns Number of tokens to sell (as bigint)
22
+ */
23
+ declare function calculateTokensToSell(targetRaiseETH: number, avgPricePerToken: number): bigint;
24
+ /**
25
+ * Calculate gamma for dynamic auctions
26
+ * @param startTick Starting tick
27
+ * @param endTick Ending tick
28
+ * @param durationDays Duration in days
29
+ * @param epochLengthHours Epoch length in hours
30
+ * @returns Gamma value
31
+ */
32
+ declare function calculateGamma(startTick: number, endTick: number, durationDays: number, epochLengthHours: number): number;
33
+ /**
34
+ * Estimate the price at a specific epoch in a dynamic auction
35
+ * @param startTick Starting tick
36
+ * @param gamma Tick movement per epoch
37
+ * @param currentEpoch Current epoch number
38
+ * @param tokenDecimals Token decimals
39
+ * @param wethDecimals WETH decimals
40
+ * @param isIncreasing Whether price increases (true) or decreases (false) over time
41
+ * @returns Estimated price in ETH per token
42
+ */
43
+ declare function estimatePriceAtEpoch(startTick: number, gamma: number, currentEpoch: number, tokenDecimals?: number, wethDecimals?: number, isIncreasing?: boolean): number;
44
+ /**
45
+ * Format a tick value to a human-readable price string
46
+ * @param tick The tick value
47
+ * @param tokenSymbol Symbol of the token
48
+ * @param numeraireSymbol Symbol of the numeraire (e.g., "ETH")
49
+ * @param tokenDecimals Token decimals
50
+ * @param numeraireDecimals Numeraire decimals
51
+ * @returns Formatted price string
52
+ */
53
+ declare function formatTickAsPrice(tick: number, tokenSymbol: string, numeraireSymbol: string, tokenDecimals?: number, numeraireDecimals?: number): string;
54
+ /**
55
+ * Calculate the market cap at a given price
56
+ * @param totalSupply Total token supply (as bigint)
57
+ * @param pricePerToken Price per token in ETH
58
+ * @param ethPrice Current ETH price in USD (optional)
59
+ * @returns Market cap object with ETH and USD values
60
+ */
61
+ declare function calculateMarketCap(totalSupply: bigint, pricePerToken: number, ethPrice?: number): {
62
+ eth: string;
63
+ usd?: string;
64
+ };
65
+ /**
66
+ * Calculate fully diluted valuation (FDV)
67
+ * @param totalSupply Total token supply including vested tokens (as bigint)
68
+ * @param pricePerToken Price per token in ETH
69
+ * @param ethPrice Current ETH price in USD (optional)
70
+ * @returns FDV object with ETH and USD values
71
+ */
72
+ declare function calculateFDV(totalSupply: bigint, pricePerToken: number, ethPrice?: number): {
73
+ eth: string;
74
+ usd?: string;
75
+ };
76
+ /**
77
+ * Estimate slippage for a trade in a concentrated liquidity pool
78
+ * @param amountIn Amount to trade
79
+ * @param liquidity Current liquidity
80
+ * @param currentTick Current tick
81
+ * @param fee Pool fee (e.g., 3000 for 0.3%)
82
+ * @returns Estimated slippage percentage
83
+ */
84
+ declare function estimateSlippage(amountIn: bigint, liquidity: bigint, currentTick: number, fee: number): number;
85
+
86
+ export { calculateFDV, calculateGamma, calculateMarketCap, calculateTickRange, calculateTokensToSell, estimatePriceAtEpoch, estimateSlippage, formatTickAsPrice };
@@ -0,0 +1,86 @@
1
+ /**
2
+ * Price helper utilities for common token launch scenarios
3
+ */
4
+ /**
5
+ * Calculate the tick range for a desired price range
6
+ * @param minPrice Minimum price (ETH per token)
7
+ * @param maxPrice Maximum price (ETH per token)
8
+ * @param tickSpacing The tick spacing of the pool
9
+ * @param wethDecimals Decimals of WETH (usually 18)
10
+ * @param tokenDecimals Decimals of the token (usually 18)
11
+ * @returns Object with startTick and endTick
12
+ */
13
+ declare function calculateTickRange(minPrice: number, maxPrice: number, tickSpacing: number, wethDecimals?: number, tokenDecimals?: number): {
14
+ startTick: number;
15
+ endTick: number;
16
+ };
17
+ /**
18
+ * Calculate the number of tokens to sell based on desired raise
19
+ * @param targetRaiseETH Target amount to raise in ETH
20
+ * @param avgPricePerToken Average expected price per token in ETH
21
+ * @returns Number of tokens to sell (as bigint)
22
+ */
23
+ declare function calculateTokensToSell(targetRaiseETH: number, avgPricePerToken: number): bigint;
24
+ /**
25
+ * Calculate gamma for dynamic auctions
26
+ * @param startTick Starting tick
27
+ * @param endTick Ending tick
28
+ * @param durationDays Duration in days
29
+ * @param epochLengthHours Epoch length in hours
30
+ * @returns Gamma value
31
+ */
32
+ declare function calculateGamma(startTick: number, endTick: number, durationDays: number, epochLengthHours: number): number;
33
+ /**
34
+ * Estimate the price at a specific epoch in a dynamic auction
35
+ * @param startTick Starting tick
36
+ * @param gamma Tick movement per epoch
37
+ * @param currentEpoch Current epoch number
38
+ * @param tokenDecimals Token decimals
39
+ * @param wethDecimals WETH decimals
40
+ * @param isIncreasing Whether price increases (true) or decreases (false) over time
41
+ * @returns Estimated price in ETH per token
42
+ */
43
+ declare function estimatePriceAtEpoch(startTick: number, gamma: number, currentEpoch: number, tokenDecimals?: number, wethDecimals?: number, isIncreasing?: boolean): number;
44
+ /**
45
+ * Format a tick value to a human-readable price string
46
+ * @param tick The tick value
47
+ * @param tokenSymbol Symbol of the token
48
+ * @param numeraireSymbol Symbol of the numeraire (e.g., "ETH")
49
+ * @param tokenDecimals Token decimals
50
+ * @param numeraireDecimals Numeraire decimals
51
+ * @returns Formatted price string
52
+ */
53
+ declare function formatTickAsPrice(tick: number, tokenSymbol: string, numeraireSymbol: string, tokenDecimals?: number, numeraireDecimals?: number): string;
54
+ /**
55
+ * Calculate the market cap at a given price
56
+ * @param totalSupply Total token supply (as bigint)
57
+ * @param pricePerToken Price per token in ETH
58
+ * @param ethPrice Current ETH price in USD (optional)
59
+ * @returns Market cap object with ETH and USD values
60
+ */
61
+ declare function calculateMarketCap(totalSupply: bigint, pricePerToken: number, ethPrice?: number): {
62
+ eth: string;
63
+ usd?: string;
64
+ };
65
+ /**
66
+ * Calculate fully diluted valuation (FDV)
67
+ * @param totalSupply Total token supply including vested tokens (as bigint)
68
+ * @param pricePerToken Price per token in ETH
69
+ * @param ethPrice Current ETH price in USD (optional)
70
+ * @returns FDV object with ETH and USD values
71
+ */
72
+ declare function calculateFDV(totalSupply: bigint, pricePerToken: number, ethPrice?: number): {
73
+ eth: string;
74
+ usd?: string;
75
+ };
76
+ /**
77
+ * Estimate slippage for a trade in a concentrated liquidity pool
78
+ * @param amountIn Amount to trade
79
+ * @param liquidity Current liquidity
80
+ * @param currentTick Current tick
81
+ * @param fee Pool fee (e.g., 3000 for 0.3%)
82
+ * @returns Estimated slippage percentage
83
+ */
84
+ declare function estimateSlippage(amountIn: bigint, liquidity: bigint, currentTick: number, fee: number): number;
85
+
86
+ export { calculateFDV, calculateGamma, calculateMarketCap, calculateTickRange, calculateTokensToSell, estimatePriceAtEpoch, estimateSlippage, formatTickAsPrice };
@@ -0,0 +1,42 @@
1
+ 'use strict';
2
+
3
+ var chunkKPBCG4X2_js = require('../chunk-KPBCG4X2.js');
4
+ require('../chunk-XG7K4R56.js');
5
+ require('../chunk-KEXKKQVW.js');
6
+
7
+
8
+
9
+ Object.defineProperty(exports, "calculateFDV", {
10
+ enumerable: true,
11
+ get: function () { return chunkKPBCG4X2_js.calculateFDV; }
12
+ });
13
+ Object.defineProperty(exports, "calculateGamma", {
14
+ enumerable: true,
15
+ get: function () { return chunkKPBCG4X2_js.calculateGamma; }
16
+ });
17
+ Object.defineProperty(exports, "calculateMarketCap", {
18
+ enumerable: true,
19
+ get: function () { return chunkKPBCG4X2_js.calculateMarketCap; }
20
+ });
21
+ Object.defineProperty(exports, "calculateTickRange", {
22
+ enumerable: true,
23
+ get: function () { return chunkKPBCG4X2_js.calculateTickRange; }
24
+ });
25
+ Object.defineProperty(exports, "calculateTokensToSell", {
26
+ enumerable: true,
27
+ get: function () { return chunkKPBCG4X2_js.calculateTokensToSell; }
28
+ });
29
+ Object.defineProperty(exports, "estimatePriceAtEpoch", {
30
+ enumerable: true,
31
+ get: function () { return chunkKPBCG4X2_js.estimatePriceAtEpoch; }
32
+ });
33
+ Object.defineProperty(exports, "estimateSlippage", {
34
+ enumerable: true,
35
+ get: function () { return chunkKPBCG4X2_js.estimateSlippage; }
36
+ });
37
+ Object.defineProperty(exports, "formatTickAsPrice", {
38
+ enumerable: true,
39
+ get: function () { return chunkKPBCG4X2_js.formatTickAsPrice; }
40
+ });
41
+ //# sourceMappingURL=priceHelpers.js.map
42
+ //# sourceMappingURL=priceHelpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"priceHelpers.js"}
@@ -0,0 +1,5 @@
1
+ export { calculateFDV, calculateGamma, calculateMarketCap, calculateTickRange, calculateTokensToSell, estimatePriceAtEpoch, estimateSlippage, formatTickAsPrice } from '../chunk-AYPP5JEQ.mjs';
2
+ import '../chunk-4K5GBNQV.mjs';
3
+ import '../chunk-LOROXNH3.mjs';
4
+ //# sourceMappingURL=priceHelpers.mjs.map
5
+ //# sourceMappingURL=priceHelpers.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"priceHelpers.mjs"}
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Tick math utilities for Uniswap V3/V4 price calculations
3
+ *
4
+ * These utilities help convert between ticks, sqrtPriceX96 values, and human-readable prices
5
+ */
6
+ declare const MIN_TICK = -887272;
7
+ declare const MAX_TICK = 887272;
8
+ declare const MIN_SQRT_RATIO = 4295128739n;
9
+ declare const MAX_SQRT_RATIO = 1461446703485210103287273052203988822378723970342n;
10
+ declare const Q96: bigint;
11
+ /**
12
+ * Get the sqrt ratio at a given tick
13
+ * @param tick The tick value
14
+ * @returns The sqrt price as a Q64.96 fixed point number
15
+ */
16
+ declare function getSqrtRatioAtTick(tick: number): bigint;
17
+ /**
18
+ * Get the tick at a given sqrt ratio
19
+ * @param sqrtRatioX96 The sqrt price as a Q64.96 fixed point number
20
+ * @returns The tick value
21
+ */
22
+ declare function getTickAtSqrtRatio(sqrtRatioX96: bigint): number;
23
+ /**
24
+ * Convert sqrtPriceX96 to a human-readable price
25
+ * @param sqrtPriceX96 The sqrt price as a Q64.96 fixed point number
26
+ * @param decimals0 Decimals of token0
27
+ * @param decimals1 Decimals of token1
28
+ * @param token0IsBase Whether to return price in terms of token0 (true) or token1 (false)
29
+ * @returns The price as a number
30
+ */
31
+ declare function sqrtPriceX96ToPrice(sqrtPriceX96: bigint, decimals0: number, decimals1: number, token0IsBase?: boolean): number;
32
+ /**
33
+ * Convert a human-readable price to sqrtPriceX96
34
+ * @param price The price (token1/token0)
35
+ * @param decimals0 Decimals of token0
36
+ * @param decimals1 Decimals of token1
37
+ * @returns The sqrt price as a Q64.96 fixed point number
38
+ */
39
+ declare function priceToSqrtPriceX96(price: number, decimals0: number, decimals1: number): bigint;
40
+ /**
41
+ * Convert a tick to a human-readable price
42
+ * @param tick The tick value
43
+ * @param decimals0 Decimals of token0
44
+ * @param decimals1 Decimals of token1
45
+ * @param token0IsBase Whether to return price in terms of token0 (true) or token1 (false)
46
+ * @returns The price as a number
47
+ */
48
+ declare function tickToPrice(tick: number, decimals0: number, decimals1: number, token0IsBase?: boolean): number;
49
+ /**
50
+ * Convert a human-readable price to a tick
51
+ * @param price The price (token1/token0)
52
+ * @param decimals0 Decimals of token0
53
+ * @param decimals1 Decimals of token1
54
+ * @returns The tick value
55
+ */
56
+ declare function priceToTick(price: number, decimals0: number, decimals1: number): number;
57
+ /**
58
+ * Get the nearest usable tick for a given tick spacing
59
+ * @param tick The desired tick
60
+ * @param tickSpacing The tick spacing of the pool
61
+ * @returns The nearest valid tick
62
+ */
63
+ declare function getNearestUsableTick(tick: number, tickSpacing: number): number;
64
+
65
+ export { MAX_SQRT_RATIO, MAX_TICK, MIN_SQRT_RATIO, MIN_TICK, Q96, getNearestUsableTick, getSqrtRatioAtTick, getTickAtSqrtRatio, priceToSqrtPriceX96, priceToTick, sqrtPriceX96ToPrice, tickToPrice };
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Tick math utilities for Uniswap V3/V4 price calculations
3
+ *
4
+ * These utilities help convert between ticks, sqrtPriceX96 values, and human-readable prices
5
+ */
6
+ declare const MIN_TICK = -887272;
7
+ declare const MAX_TICK = 887272;
8
+ declare const MIN_SQRT_RATIO = 4295128739n;
9
+ declare const MAX_SQRT_RATIO = 1461446703485210103287273052203988822378723970342n;
10
+ declare const Q96: bigint;
11
+ /**
12
+ * Get the sqrt ratio at a given tick
13
+ * @param tick The tick value
14
+ * @returns The sqrt price as a Q64.96 fixed point number
15
+ */
16
+ declare function getSqrtRatioAtTick(tick: number): bigint;
17
+ /**
18
+ * Get the tick at a given sqrt ratio
19
+ * @param sqrtRatioX96 The sqrt price as a Q64.96 fixed point number
20
+ * @returns The tick value
21
+ */
22
+ declare function getTickAtSqrtRatio(sqrtRatioX96: bigint): number;
23
+ /**
24
+ * Convert sqrtPriceX96 to a human-readable price
25
+ * @param sqrtPriceX96 The sqrt price as a Q64.96 fixed point number
26
+ * @param decimals0 Decimals of token0
27
+ * @param decimals1 Decimals of token1
28
+ * @param token0IsBase Whether to return price in terms of token0 (true) or token1 (false)
29
+ * @returns The price as a number
30
+ */
31
+ declare function sqrtPriceX96ToPrice(sqrtPriceX96: bigint, decimals0: number, decimals1: number, token0IsBase?: boolean): number;
32
+ /**
33
+ * Convert a human-readable price to sqrtPriceX96
34
+ * @param price The price (token1/token0)
35
+ * @param decimals0 Decimals of token0
36
+ * @param decimals1 Decimals of token1
37
+ * @returns The sqrt price as a Q64.96 fixed point number
38
+ */
39
+ declare function priceToSqrtPriceX96(price: number, decimals0: number, decimals1: number): bigint;
40
+ /**
41
+ * Convert a tick to a human-readable price
42
+ * @param tick The tick value
43
+ * @param decimals0 Decimals of token0
44
+ * @param decimals1 Decimals of token1
45
+ * @param token0IsBase Whether to return price in terms of token0 (true) or token1 (false)
46
+ * @returns The price as a number
47
+ */
48
+ declare function tickToPrice(tick: number, decimals0: number, decimals1: number, token0IsBase?: boolean): number;
49
+ /**
50
+ * Convert a human-readable price to a tick
51
+ * @param price The price (token1/token0)
52
+ * @param decimals0 Decimals of token0
53
+ * @param decimals1 Decimals of token1
54
+ * @returns The tick value
55
+ */
56
+ declare function priceToTick(price: number, decimals0: number, decimals1: number): number;
57
+ /**
58
+ * Get the nearest usable tick for a given tick spacing
59
+ * @param tick The desired tick
60
+ * @param tickSpacing The tick spacing of the pool
61
+ * @returns The nearest valid tick
62
+ */
63
+ declare function getNearestUsableTick(tick: number, tickSpacing: number): number;
64
+
65
+ export { MAX_SQRT_RATIO, MAX_TICK, MIN_SQRT_RATIO, MIN_TICK, Q96, getNearestUsableTick, getSqrtRatioAtTick, getTickAtSqrtRatio, priceToSqrtPriceX96, priceToTick, sqrtPriceX96ToPrice, tickToPrice };
@@ -0,0 +1,57 @@
1
+ 'use strict';
2
+
3
+ var chunkXG7K4R56_js = require('../chunk-XG7K4R56.js');
4
+ require('../chunk-KEXKKQVW.js');
5
+
6
+
7
+
8
+ Object.defineProperty(exports, "MAX_SQRT_RATIO", {
9
+ enumerable: true,
10
+ get: function () { return chunkXG7K4R56_js.MAX_SQRT_RATIO; }
11
+ });
12
+ Object.defineProperty(exports, "MAX_TICK", {
13
+ enumerable: true,
14
+ get: function () { return chunkXG7K4R56_js.MAX_TICK; }
15
+ });
16
+ Object.defineProperty(exports, "MIN_SQRT_RATIO", {
17
+ enumerable: true,
18
+ get: function () { return chunkXG7K4R56_js.MIN_SQRT_RATIO; }
19
+ });
20
+ Object.defineProperty(exports, "MIN_TICK", {
21
+ enumerable: true,
22
+ get: function () { return chunkXG7K4R56_js.MIN_TICK; }
23
+ });
24
+ Object.defineProperty(exports, "Q96", {
25
+ enumerable: true,
26
+ get: function () { return chunkXG7K4R56_js.Q96; }
27
+ });
28
+ Object.defineProperty(exports, "getNearestUsableTick", {
29
+ enumerable: true,
30
+ get: function () { return chunkXG7K4R56_js.getNearestUsableTick; }
31
+ });
32
+ Object.defineProperty(exports, "getSqrtRatioAtTick", {
33
+ enumerable: true,
34
+ get: function () { return chunkXG7K4R56_js.getSqrtRatioAtTick; }
35
+ });
36
+ Object.defineProperty(exports, "getTickAtSqrtRatio", {
37
+ enumerable: true,
38
+ get: function () { return chunkXG7K4R56_js.getTickAtSqrtRatio; }
39
+ });
40
+ Object.defineProperty(exports, "priceToSqrtPriceX96", {
41
+ enumerable: true,
42
+ get: function () { return chunkXG7K4R56_js.priceToSqrtPriceX96; }
43
+ });
44
+ Object.defineProperty(exports, "priceToTick", {
45
+ enumerable: true,
46
+ get: function () { return chunkXG7K4R56_js.priceToTick; }
47
+ });
48
+ Object.defineProperty(exports, "sqrtPriceX96ToPrice", {
49
+ enumerable: true,
50
+ get: function () { return chunkXG7K4R56_js.sqrtPriceX96ToPrice; }
51
+ });
52
+ Object.defineProperty(exports, "tickToPrice", {
53
+ enumerable: true,
54
+ get: function () { return chunkXG7K4R56_js.tickToPrice; }
55
+ });
56
+ //# sourceMappingURL=tickMath.js.map
57
+ //# sourceMappingURL=tickMath.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"tickMath.js"}
@@ -0,0 +1,4 @@
1
+ export { MAX_SQRT_RATIO, MAX_TICK, MIN_SQRT_RATIO, MIN_TICK, Q96, getNearestUsableTick, getSqrtRatioAtTick, getTickAtSqrtRatio, priceToSqrtPriceX96, priceToTick, sqrtPriceX96ToPrice, tickToPrice } from '../chunk-4K5GBNQV.mjs';
2
+ import '../chunk-LOROXNH3.mjs';
3
+ //# sourceMappingURL=tickMath.mjs.map
4
+ //# sourceMappingURL=tickMath.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"tickMath.mjs"}
package/package.json ADDED
@@ -0,0 +1,62 @@
1
+ {
2
+ "name": "@whetstone-research/doppler-sdk",
3
+ "author": "Whetstone Research",
4
+ "version": "0.0.1-alpha.1",
5
+ "license": "MIT",
6
+ "main": "dist/index.js",
7
+ "module": "dist/index.mjs",
8
+ "typings": "dist/index.d.ts",
9
+ "types": "dist/index.d.ts",
10
+ "exports": {
11
+ ".": {
12
+ "import": "./dist/index.mjs",
13
+ "require": "./dist/index.js",
14
+ "types": "./dist/index.d.ts"
15
+ }
16
+ },
17
+ "directories": {
18
+ "lib": "src"
19
+ },
20
+ "files": [
21
+ "dist"
22
+ ],
23
+ "scripts": {
24
+ "start": "tsc watch ./src/**",
25
+ "test": "vitest run",
26
+ "build": "tsup",
27
+ "build:watch": "tsup --watch",
28
+ "test:watch": "vitest watch",
29
+ "test:coverage": "vitest run --coverage",
30
+ "lint": "tsc --noEmit",
31
+ "prepublishOnly": "npm run build",
32
+ "size": "size-limit",
33
+ "analyze": "size-limit --why"
34
+ },
35
+ "prettier": {
36
+ "printWidth": 80,
37
+ "semi": true,
38
+ "singleQuote": true,
39
+ "trailingComma": "es5"
40
+ },
41
+ "devDependencies": {
42
+ "@size-limit/preset-small-lib": "^11.2.0",
43
+ "@vitest/coverage-c8": "^0.33.0",
44
+ "glob": "^10.4.5",
45
+ "size-limit": "^11.2.0",
46
+ "tslib": "^2.8.1",
47
+ "typescript": "^5.8.3",
48
+ "vite-tsconfig-paths": "^5.1.4",
49
+ "vitest": "^2.1.9"
50
+ },
51
+ "dependencies": {
52
+ "@delvtech/drift": "^0.10.1",
53
+ "@uniswap/sdk-core": "^5.9.0",
54
+ "@uniswap/v3-sdk": "^3.19.0",
55
+ "@uniswap/v4-sdk": "^1.21.4",
56
+ "tsup": "^8.4.0",
57
+ "viem": "^2.21.44"
58
+ },
59
+ "engines": {
60
+ "node": ">=18.0.0"
61
+ }
62
+ }