@exponent-labs/exponent-sdk 0.1.7 → 0.9.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.
Files changed (1602) hide show
  1. package/build/CodamaEventDecoder.d.ts +49 -0
  2. package/build/CodamaEventDecoder.js +113 -0
  3. package/build/CodamaEventDecoder.js.map +1 -0
  4. package/build/addressLookupTableUtil.d.ts +31 -10
  5. package/build/addressLookupTableUtil.js +65 -5
  6. package/build/addressLookupTableUtil.js.map +1 -1
  7. package/build/client/clmm/accounts/lpPosition.d.ts +29 -0
  8. package/build/client/clmm/accounts/lpPosition.js +82 -0
  9. package/build/client/clmm/accounts/lpPosition.js.map +1 -0
  10. package/build/client/clmm/accounts/marketThree.d.ts +47 -0
  11. package/build/client/clmm/accounts/marketThree.js +139 -0
  12. package/build/client/clmm/accounts/marketThree.js.map +1 -0
  13. package/build/client/clmm/accounts/vault.d.ts +48 -0
  14. package/build/client/clmm/accounts/vault.js +128 -0
  15. package/build/client/clmm/accounts/vault.js.map +1 -0
  16. package/build/client/clmm/eventRegistry.d.ts +59 -0
  17. package/build/client/clmm/eventRegistry.js +58 -0
  18. package/build/client/clmm/eventRegistry.js.map +1 -0
  19. package/build/client/clmm/index.d.ts +78 -0
  20. package/build/client/clmm/index.js +96 -0
  21. package/build/client/clmm/index.js.map +1 -0
  22. package/build/client/clmm/instructions/addFarm.d.ts +19 -0
  23. package/build/client/clmm/instructions/addFarm.js +31 -0
  24. package/build/client/clmm/instructions/addFarm.js.map +1 -0
  25. package/build/client/clmm/instructions/addLiquidity.d.ts +26 -0
  26. package/build/client/clmm/instructions/addLiquidity.js +38 -0
  27. package/build/client/clmm/instructions/addLiquidity.js.map +1 -0
  28. package/build/client/clmm/instructions/addMarketEmission.d.ts +15 -0
  29. package/build/client/clmm/instructions/addMarketEmission.js +27 -0
  30. package/build/client/clmm/instructions/addMarketEmission.js.map +1 -0
  31. package/build/client/clmm/instructions/buyPt.d.ts +24 -0
  32. package/build/client/clmm/instructions/buyPt.js +36 -0
  33. package/build/client/clmm/instructions/buyPt.js.map +1 -0
  34. package/build/client/clmm/instructions/buyYt.d.ts +26 -0
  35. package/build/client/clmm/instructions/buyYt.js +42 -0
  36. package/build/client/clmm/instructions/buyYt.js.map +1 -0
  37. package/build/client/clmm/instructions/claimFarmEmission.d.ts +18 -0
  38. package/build/client/clmm/instructions/claimFarmEmission.js +30 -0
  39. package/build/client/clmm/instructions/claimFarmEmission.js.map +1 -0
  40. package/build/client/clmm/instructions/closeMarket.d.ts +17 -0
  41. package/build/client/clmm/instructions/closeMarket.js +26 -0
  42. package/build/client/clmm/instructions/closeMarket.js.map +1 -0
  43. package/build/client/clmm/instructions/depositLiquidity.d.ts +25 -0
  44. package/build/client/clmm/instructions/depositLiquidity.js +37 -0
  45. package/build/client/clmm/instructions/depositLiquidity.js.map +1 -0
  46. package/build/client/clmm/instructions/initializeMarket.d.ts +47 -0
  47. package/build/client/clmm/instructions/initializeMarket.js +63 -0
  48. package/build/client/clmm/instructions/initializeMarket.js.map +1 -0
  49. package/build/client/clmm/instructions/marketAccrueEmission.d.ts +13 -0
  50. package/build/client/clmm/instructions/marketAccrueEmission.js +22 -0
  51. package/build/client/clmm/instructions/marketAccrueEmission.js.map +1 -0
  52. package/build/client/clmm/instructions/marketCollectEmission.d.ts +18 -0
  53. package/build/client/clmm/instructions/marketCollectEmission.js +30 -0
  54. package/build/client/clmm/instructions/marketCollectEmission.js.map +1 -0
  55. package/build/client/clmm/instructions/modifyFarm.d.ts +17 -0
  56. package/build/client/clmm/instructions/modifyFarm.js +29 -0
  57. package/build/client/clmm/instructions/modifyFarm.js.map +1 -0
  58. package/build/client/clmm/instructions/modifyMarketSetting.d.ts +11 -0
  59. package/build/client/clmm/instructions/modifyMarketSetting.js +23 -0
  60. package/build/client/clmm/instructions/modifyMarketSetting.js.map +1 -0
  61. package/build/client/clmm/instructions/sellPt.d.ts +24 -0
  62. package/build/client/clmm/instructions/sellPt.js +36 -0
  63. package/build/client/clmm/instructions/sellPt.js.map +1 -0
  64. package/build/client/clmm/instructions/sellYt.d.ts +26 -0
  65. package/build/client/clmm/instructions/sellYt.js +42 -0
  66. package/build/client/clmm/instructions/sellYt.js.map +1 -0
  67. package/build/client/clmm/instructions/tradePt.d.ts +25 -0
  68. package/build/client/clmm/instructions/tradePt.js +37 -0
  69. package/build/client/clmm/instructions/tradePt.js.map +1 -0
  70. package/build/client/clmm/instructions/tradePtExactOut.d.ts +25 -0
  71. package/build/client/clmm/instructions/tradePtExactOut.js +37 -0
  72. package/build/client/clmm/instructions/tradePtExactOut.js.map +1 -0
  73. package/build/client/clmm/instructions/withdrawLiquidity.d.ts +23 -0
  74. package/build/client/clmm/instructions/withdrawLiquidity.js +35 -0
  75. package/build/client/clmm/instructions/withdrawLiquidity.js.map +1 -0
  76. package/build/client/clmm/instructions/wrapperBuyYt.d.ts +28 -0
  77. package/build/client/clmm/instructions/wrapperBuyYt.js +48 -0
  78. package/build/client/clmm/instructions/wrapperBuyYt.js.map +1 -0
  79. package/build/client/clmm/instructions/wrapperProvideLiquidity.d.ts +33 -0
  80. package/build/client/clmm/instructions/wrapperProvideLiquidity.js +53 -0
  81. package/build/client/clmm/instructions/wrapperProvideLiquidity.js.map +1 -0
  82. package/build/client/clmm/instructions/wrapperProvideLiquidityBase.d.ts +32 -0
  83. package/build/client/clmm/instructions/wrapperProvideLiquidityBase.js +52 -0
  84. package/build/client/clmm/instructions/wrapperProvideLiquidityBase.js.map +1 -0
  85. package/build/client/clmm/instructions/wrapperProvideLiquidityClassic.d.ts +28 -0
  86. package/build/client/clmm/instructions/wrapperProvideLiquidityClassic.js +44 -0
  87. package/build/client/clmm/instructions/wrapperProvideLiquidityClassic.js.map +1 -0
  88. package/build/client/clmm/instructions/wrapperSellYt.d.ts +27 -0
  89. package/build/client/clmm/instructions/wrapperSellYt.js +47 -0
  90. package/build/client/clmm/instructions/wrapperSellYt.js.map +1 -0
  91. package/build/client/clmm/instructions/wrapperWithdrawLiquidity.d.ts +25 -0
  92. package/build/client/clmm/instructions/wrapperWithdrawLiquidity.js +41 -0
  93. package/build/client/clmm/instructions/wrapperWithdrawLiquidity.js.map +1 -0
  94. package/build/client/clmm/instructions/wrapperWithdrawLiquidityClassic.d.ts +22 -0
  95. package/build/client/clmm/instructions/wrapperWithdrawLiquidityClassic.js +38 -0
  96. package/build/client/clmm/instructions/wrapperWithdrawLiquidityClassic.js.map +1 -0
  97. package/build/client/clmm/types/addFarmEvent.d.ts +35 -0
  98. package/build/client/clmm/types/addFarmEvent.js +24 -0
  99. package/build/client/clmm/types/addFarmEvent.js.map +1 -0
  100. package/build/client/clmm/types/amount.d.ts +33 -0
  101. package/build/client/clmm/types/amount.js +20 -0
  102. package/build/client/clmm/types/amount.js.map +1 -0
  103. package/build/client/clmm/types/buyPtEvent.d.ts +23 -0
  104. package/build/client/clmm/types/buyPtEvent.js +18 -0
  105. package/build/client/clmm/types/buyPtEvent.js.map +1 -0
  106. package/build/client/clmm/types/buyYtEvent.d.ts +56 -0
  107. package/build/client/clmm/types/buyYtEvent.js +36 -0
  108. package/build/client/clmm/types/buyYtEvent.js.map +1 -0
  109. package/build/client/clmm/types/claimFarmEmissionsEvent.d.ts +171 -0
  110. package/build/client/clmm/types/claimFarmEmissionsEvent.js +42 -0
  111. package/build/client/clmm/types/claimFarmEmissionsEvent.js.map +1 -0
  112. package/build/client/clmm/types/claimLimits.d.ts +22 -0
  113. package/build/client/clmm/types/claimLimits.js +11 -0
  114. package/build/client/clmm/types/claimLimits.js.map +1 -0
  115. package/build/client/clmm/types/closeMarketEvent.d.ts +23 -0
  116. package/build/client/clmm/types/closeMarketEvent.js +18 -0
  117. package/build/client/clmm/types/closeMarketEvent.js.map +1 -0
  118. package/build/client/clmm/types/configurationOptions.d.ts +34 -0
  119. package/build/client/clmm/types/configurationOptions.js +14 -0
  120. package/build/client/clmm/types/configurationOptions.js.map +1 -0
  121. package/build/client/clmm/types/cpiAccounts.d.ts +107 -0
  122. package/build/client/clmm/types/cpiAccounts.js +13 -0
  123. package/build/client/clmm/types/cpiAccounts.js.map +1 -0
  124. package/build/client/clmm/types/cpiCoreAccounts.d.ts +47 -0
  125. package/build/client/clmm/types/cpiCoreAccounts.js +10 -0
  126. package/build/client/clmm/types/cpiCoreAccounts.js.map +1 -0
  127. package/build/client/clmm/types/cpiInterfaceContext.d.ts +18 -0
  128. package/build/client/clmm/types/cpiInterfaceContext.js +10 -0
  129. package/build/client/clmm/types/cpiInterfaceContext.js.map +1 -0
  130. package/build/client/clmm/types/crossingSplit.d.ts +124 -0
  131. package/build/client/clmm/types/crossingSplit.js +20 -0
  132. package/build/client/clmm/types/crossingSplit.js.map +1 -0
  133. package/build/client/clmm/types/depositLiquidityEvent.d.ts +171 -0
  134. package/build/client/clmm/types/depositLiquidityEvent.js +42 -0
  135. package/build/client/clmm/types/depositLiquidityEvent.js.map +1 -0
  136. package/build/client/clmm/types/depositLiquidityReturnData.d.ts +67 -0
  137. package/build/client/clmm/types/depositLiquidityReturnData.js +38 -0
  138. package/build/client/clmm/types/depositLiquidityReturnData.js.map +1 -0
  139. package/build/client/clmm/types/emissionInfo.d.ts +36 -0
  140. package/build/client/clmm/types/emissionInfo.js +22 -0
  141. package/build/client/clmm/types/emissionInfo.js.map +1 -0
  142. package/build/client/clmm/types/farmEmission.d.ts +24 -0
  143. package/build/client/clmm/types/farmEmission.js +16 -0
  144. package/build/client/clmm/types/farmEmission.js.map +1 -0
  145. package/build/client/clmm/types/index.d.ts +48 -0
  146. package/build/client/clmm/types/index.js +65 -0
  147. package/build/client/clmm/types/index.js.map +1 -0
  148. package/build/client/clmm/types/liquidityNetBalanceLimits.d.ts +26 -0
  149. package/build/client/clmm/types/liquidityNetBalanceLimits.js +12 -0
  150. package/build/client/clmm/types/liquidityNetBalanceLimits.js.map +1 -0
  151. package/build/client/clmm/types/lpFarm.d.ts +35 -0
  152. package/build/client/clmm/types/lpFarm.js +10 -0
  153. package/build/client/clmm/types/lpFarm.js.map +1 -0
  154. package/build/client/clmm/types/marketAccrueEmissionEvent.d.ts +151 -0
  155. package/build/client/clmm/types/marketAccrueEmissionEvent.js +31 -0
  156. package/build/client/clmm/types/marketAccrueEmissionEvent.js.map +1 -0
  157. package/build/client/clmm/types/marketAdminAction.d.ts +359 -0
  158. package/build/client/clmm/types/marketAdminAction.js +72 -0
  159. package/build/client/clmm/types/marketAdminAction.js.map +1 -0
  160. package/build/client/clmm/types/marketCollectEmissionEvent.d.ts +163 -0
  161. package/build/client/clmm/types/marketCollectEmissionEvent.js +37 -0
  162. package/build/client/clmm/types/marketCollectEmissionEvent.js.map +1 -0
  163. package/build/client/clmm/types/marketEmission.d.ts +20 -0
  164. package/build/client/clmm/types/marketEmission.js +15 -0
  165. package/build/client/clmm/types/marketEmission.js.map +1 -0
  166. package/build/client/clmm/types/marketEmissions.d.ts +27 -0
  167. package/build/client/clmm/types/marketEmissions.js +9 -0
  168. package/build/client/clmm/types/marketEmissions.js.map +1 -0
  169. package/build/client/clmm/types/marketFinancials.d.ts +26 -0
  170. package/build/client/clmm/types/marketFinancials.js +12 -0
  171. package/build/client/clmm/types/marketFinancials.js.map +1 -0
  172. package/build/client/clmm/types/marketThreeInitEvent.d.ts +71 -0
  173. package/build/client/clmm/types/marketThreeInitEvent.js +42 -0
  174. package/build/client/clmm/types/marketThreeInitEvent.js.map +1 -0
  175. package/build/client/clmm/types/mergeEvent.d.ts +84 -0
  176. package/build/client/clmm/types/mergeEvent.js +55 -0
  177. package/build/client/clmm/types/mergeEvent.js.map +1 -0
  178. package/build/client/clmm/types/modifiedTick.d.ts +18 -0
  179. package/build/client/clmm/types/modifiedTick.js +10 -0
  180. package/build/client/clmm/types/modifiedTick.js.map +1 -0
  181. package/build/client/clmm/types/modifiedTicks.d.ts +43 -0
  182. package/build/client/clmm/types/modifiedTicks.js +13 -0
  183. package/build/client/clmm/types/modifiedTicks.js.map +1 -0
  184. package/build/client/clmm/types/modifyFarmEvent.d.ts +43 -0
  185. package/build/client/clmm/types/modifyFarmEvent.js +26 -0
  186. package/build/client/clmm/types/modifyFarmEvent.js.map +1 -0
  187. package/build/client/clmm/types/number.d.ts +2 -0
  188. package/build/client/clmm/types/number.js +8 -0
  189. package/build/client/clmm/types/number.js.map +1 -0
  190. package/build/client/clmm/types/personalYieldTracker.d.ts +15 -0
  191. package/build/client/clmm/types/personalYieldTracker.js +10 -0
  192. package/build/client/clmm/types/personalYieldTracker.js.map +1 -0
  193. package/build/client/clmm/types/personalYieldTrackers.d.ts +23 -0
  194. package/build/client/clmm/types/personalYieldTrackers.js +9 -0
  195. package/build/client/clmm/types/personalYieldTrackers.js.map +1 -0
  196. package/build/client/clmm/types/principalShare.d.ts +51 -0
  197. package/build/client/clmm/types/principalShare.js +14 -0
  198. package/build/client/clmm/types/principalShare.js.map +1 -0
  199. package/build/client/clmm/types/principalShareTrackers.d.ts +63 -0
  200. package/build/client/clmm/types/principalShareTrackers.js +9 -0
  201. package/build/client/clmm/types/principalShareTrackers.js.map +1 -0
  202. package/build/client/clmm/types/sellPtEvent.d.ts +23 -0
  203. package/build/client/clmm/types/sellPtEvent.js +18 -0
  204. package/build/client/clmm/types/sellPtEvent.js.map +1 -0
  205. package/build/client/clmm/types/sellYtEvent.d.ts +47 -0
  206. package/build/client/clmm/types/sellYtEvent.js +33 -0
  207. package/build/client/clmm/types/sellYtEvent.js.map +1 -0
  208. package/build/client/clmm/types/stripEvent.d.ts +84 -0
  209. package/build/client/clmm/types/stripEvent.js +58 -0
  210. package/build/client/clmm/types/stripEvent.js.map +1 -0
  211. package/build/client/clmm/types/swapDirection.d.ts +5 -0
  212. package/build/client/clmm/types/swapDirection.js +11 -0
  213. package/build/client/clmm/types/swapDirection.js.map +1 -0
  214. package/build/client/clmm/types/tradePtEvent.d.ts +110 -0
  215. package/build/client/clmm/types/tradePtEvent.js +37 -0
  216. package/build/client/clmm/types/tradePtEvent.js.map +1 -0
  217. package/build/client/clmm/types/withdrawLiquidityEvent.d.ts +183 -0
  218. package/build/client/clmm/types/withdrawLiquidityEvent.js +45 -0
  219. package/build/client/clmm/types/withdrawLiquidityEvent.js.map +1 -0
  220. package/build/client/clmm/types/withdrawLiquidityReturnData.d.ts +46 -0
  221. package/build/client/clmm/types/withdrawLiquidityReturnData.js +17 -0
  222. package/build/client/clmm/types/withdrawLiquidityReturnData.js.map +1 -0
  223. package/build/client/clmm/types/wrapperBuyYtEvent.d.ts +23 -0
  224. package/build/client/clmm/types/wrapperBuyYtEvent.js +18 -0
  225. package/build/client/clmm/types/wrapperBuyYtEvent.js.map +1 -0
  226. package/build/client/clmm/types/wrapperProvideLiquidityBaseEvent.d.ts +56 -0
  227. package/build/client/clmm/types/wrapperProvideLiquidityBaseEvent.js +30 -0
  228. package/build/client/clmm/types/wrapperProvideLiquidityBaseEvent.js.map +1 -0
  229. package/build/client/clmm/types/wrapperProvideLiquidityClassicEvent.d.ts +52 -0
  230. package/build/client/clmm/types/wrapperProvideLiquidityClassicEvent.js +29 -0
  231. package/build/client/clmm/types/wrapperProvideLiquidityClassicEvent.js.map +1 -0
  232. package/build/client/clmm/types/wrapperProvideLiquidityEvent.d.ts +56 -0
  233. package/build/client/clmm/types/wrapperProvideLiquidityEvent.js +30 -0
  234. package/build/client/clmm/types/wrapperProvideLiquidityEvent.js.map +1 -0
  235. package/build/client/clmm/types/wrapperSellYtEvent.d.ts +23 -0
  236. package/build/client/clmm/types/wrapperSellYtEvent.js +18 -0
  237. package/build/client/clmm/types/wrapperSellYtEvent.js.map +1 -0
  238. package/build/client/clmm/types/wrapperWithdrawLiquidityClassicEvent.d.ts +60 -0
  239. package/build/client/clmm/types/wrapperWithdrawLiquidityClassicEvent.js +31 -0
  240. package/build/client/clmm/types/wrapperWithdrawLiquidityClassicEvent.js.map +1 -0
  241. package/build/client/clmm/types/wrapperWithdrawLiquidityEvent.d.ts +60 -0
  242. package/build/client/clmm/types/wrapperWithdrawLiquidityEvent.js +31 -0
  243. package/build/client/clmm/types/wrapperWithdrawLiquidityEvent.js.map +1 -0
  244. package/build/client/core/accounts/admin.d.ts +18 -0
  245. package/build/client/core/accounts/admin.js +71 -0
  246. package/build/client/core/accounts/admin.js.map +1 -0
  247. package/build/client/core/accounts/lpPosition.d.ts +20 -0
  248. package/build/client/core/accounts/lpPosition.js +73 -0
  249. package/build/client/core/accounts/lpPosition.js.map +1 -0
  250. package/build/client/core/accounts/marketTwo.d.ts +42 -0
  251. package/build/client/core/accounts/marketTwo.js +122 -0
  252. package/build/client/core/accounts/marketTwo.js.map +1 -0
  253. package/build/client/core/accounts/vault.d.ts +48 -0
  254. package/build/client/core/accounts/vault.js +128 -0
  255. package/build/client/core/accounts/vault.js.map +1 -0
  256. package/build/client/core/accounts/yieldTokenPosition.d.ts +20 -0
  257. package/build/client/core/accounts/yieldTokenPosition.js +74 -0
  258. package/build/client/core/accounts/yieldTokenPosition.js.map +1 -0
  259. package/build/client/core/eventRegistry.d.ts +87 -0
  260. package/build/client/core/eventRegistry.js +86 -0
  261. package/build/client/core/eventRegistry.js.map +1 -0
  262. package/build/client/core/index.d.ts +109 -0
  263. package/build/client/core/index.js +127 -0
  264. package/build/client/core/index.js.map +1 -0
  265. package/build/client/core/instructions/addEmission.d.ts +19 -0
  266. package/build/client/core/instructions/addEmission.js +35 -0
  267. package/build/client/core/instructions/addEmission.js.map +1 -0
  268. package/build/client/core/instructions/addFarm.d.ts +17 -0
  269. package/build/client/core/instructions/addFarm.js +29 -0
  270. package/build/client/core/instructions/addFarm.js.map +1 -0
  271. package/build/client/core/instructions/addLpTokensMetadata.d.ts +16 -0
  272. package/build/client/core/instructions/addLpTokensMetadata.js +32 -0
  273. package/build/client/core/instructions/addLpTokensMetadata.js.map +1 -0
  274. package/build/client/core/instructions/addMarketEmission.d.ts +16 -0
  275. package/build/client/core/instructions/addMarketEmission.js +28 -0
  276. package/build/client/core/instructions/addMarketEmission.js.map +1 -0
  277. package/build/client/core/instructions/buyYt.d.ts +28 -0
  278. package/build/client/core/instructions/buyYt.js +44 -0
  279. package/build/client/core/instructions/buyYt.js.map +1 -0
  280. package/build/client/core/instructions/claimFarmEmissions.d.ts +17 -0
  281. package/build/client/core/instructions/claimFarmEmissions.js +29 -0
  282. package/build/client/core/instructions/claimFarmEmissions.js.map +1 -0
  283. package/build/client/core/instructions/collectEmission.d.ts +21 -0
  284. package/build/client/core/instructions/collectEmission.js +37 -0
  285. package/build/client/core/instructions/collectEmission.js.map +1 -0
  286. package/build/client/core/instructions/collectInterest.d.ts +20 -0
  287. package/build/client/core/instructions/collectInterest.js +36 -0
  288. package/build/client/core/instructions/collectInterest.js.map +1 -0
  289. package/build/client/core/instructions/collectTreasuryEmission.d.ts +21 -0
  290. package/build/client/core/instructions/collectTreasuryEmission.js +33 -0
  291. package/build/client/core/instructions/collectTreasuryEmission.js.map +1 -0
  292. package/build/client/core/instructions/collectTreasuryInterest.d.ts +20 -0
  293. package/build/client/core/instructions/collectTreasuryInterest.js +32 -0
  294. package/build/client/core/instructions/collectTreasuryInterest.js.map +1 -0
  295. package/build/client/core/instructions/depositYt.d.ts +19 -0
  296. package/build/client/core/instructions/depositYt.js +31 -0
  297. package/build/client/core/instructions/depositYt.js.map +1 -0
  298. package/build/client/core/instructions/initLpPosition.d.ts +11 -0
  299. package/build/client/core/instructions/initLpPosition.js +20 -0
  300. package/build/client/core/instructions/initLpPosition.js.map +1 -0
  301. package/build/client/core/instructions/initMarketTwo.d.ts +37 -0
  302. package/build/client/core/instructions/initMarketTwo.js +53 -0
  303. package/build/client/core/instructions/initMarketTwo.js.map +1 -0
  304. package/build/client/core/instructions/initializeVault.d.ts +34 -0
  305. package/build/client/core/instructions/initializeVault.js +58 -0
  306. package/build/client/core/instructions/initializeVault.js.map +1 -0
  307. package/build/client/core/instructions/initializeYieldPosition.d.ts +10 -0
  308. package/build/client/core/instructions/initializeYieldPosition.js +19 -0
  309. package/build/client/core/instructions/initializeYieldPosition.js.map +1 -0
  310. package/build/client/core/instructions/marketCollectEmission.d.ts +17 -0
  311. package/build/client/core/instructions/marketCollectEmission.js +29 -0
  312. package/build/client/core/instructions/marketCollectEmission.js.map +1 -0
  313. package/build/client/core/instructions/marketDepositLp.d.ts +19 -0
  314. package/build/client/core/instructions/marketDepositLp.js +31 -0
  315. package/build/client/core/instructions/marketDepositLp.js.map +1 -0
  316. package/build/client/core/instructions/marketTwoDepositLiquidity.d.ts +22 -0
  317. package/build/client/core/instructions/marketTwoDepositLiquidity.js +34 -0
  318. package/build/client/core/instructions/marketTwoDepositLiquidity.js.map +1 -0
  319. package/build/client/core/instructions/marketTwoWithdrawLiquidity.d.ts +22 -0
  320. package/build/client/core/instructions/marketTwoWithdrawLiquidity.js +34 -0
  321. package/build/client/core/instructions/marketTwoWithdrawLiquidity.js.map +1 -0
  322. package/build/client/core/instructions/marketWithdrawLp.d.ts +19 -0
  323. package/build/client/core/instructions/marketWithdrawLp.js +31 -0
  324. package/build/client/core/instructions/marketWithdrawLp.js.map +1 -0
  325. package/build/client/core/instructions/merge.d.ts +22 -0
  326. package/build/client/core/instructions/merge.js +32 -0
  327. package/build/client/core/instructions/merge.js.map +1 -0
  328. package/build/client/core/instructions/modifyFarm.d.ts +15 -0
  329. package/build/client/core/instructions/modifyFarm.js +27 -0
  330. package/build/client/core/instructions/modifyFarm.js.map +1 -0
  331. package/build/client/core/instructions/modifyMarketSetting.d.ts +12 -0
  332. package/build/client/core/instructions/modifyMarketSetting.js +24 -0
  333. package/build/client/core/instructions/modifyMarketSetting.js.map +1 -0
  334. package/build/client/core/instructions/modifyVaultSetting.d.ts +12 -0
  335. package/build/client/core/instructions/modifyVaultSetting.js +24 -0
  336. package/build/client/core/instructions/modifyVaultSetting.js.map +1 -0
  337. package/build/client/core/instructions/reallocMarket.d.ts +12 -0
  338. package/build/client/core/instructions/reallocMarket.js +24 -0
  339. package/build/client/core/instructions/reallocMarket.js.map +1 -0
  340. package/build/client/core/instructions/sellYt.d.ts +28 -0
  341. package/build/client/core/instructions/sellYt.js +44 -0
  342. package/build/client/core/instructions/sellYt.js.map +1 -0
  343. package/build/client/core/instructions/stageYtYield.d.ts +13 -0
  344. package/build/client/core/instructions/stageYtYield.js +22 -0
  345. package/build/client/core/instructions/stageYtYield.js.map +1 -0
  346. package/build/client/core/instructions/strip.d.ts +22 -0
  347. package/build/client/core/instructions/strip.js +32 -0
  348. package/build/client/core/instructions/strip.js.map +1 -0
  349. package/build/client/core/instructions/tradePt.d.ts +20 -0
  350. package/build/client/core/instructions/tradePt.js +32 -0
  351. package/build/client/core/instructions/tradePt.js.map +1 -0
  352. package/build/client/core/instructions/withdrawYt.d.ts +20 -0
  353. package/build/client/core/instructions/withdrawYt.js +32 -0
  354. package/build/client/core/instructions/withdrawYt.js.map +1 -0
  355. package/build/client/core/instructions/wrapperBuyPt.d.ts +21 -0
  356. package/build/client/core/instructions/wrapperBuyPt.js +33 -0
  357. package/build/client/core/instructions/wrapperBuyPt.js.map +1 -0
  358. package/build/client/core/instructions/wrapperBuyYt.d.ts +32 -0
  359. package/build/client/core/instructions/wrapperBuyYt.js +52 -0
  360. package/build/client/core/instructions/wrapperBuyYt.js.map +1 -0
  361. package/build/client/core/instructions/wrapperCollectInterest.d.ts +19 -0
  362. package/build/client/core/instructions/wrapperCollectInterest.js +35 -0
  363. package/build/client/core/instructions/wrapperCollectInterest.js.map +1 -0
  364. package/build/client/core/instructions/wrapperMerge.d.ts +24 -0
  365. package/build/client/core/instructions/wrapperMerge.js +44 -0
  366. package/build/client/core/instructions/wrapperMerge.js.map +1 -0
  367. package/build/client/core/instructions/wrapperProvideLiquidity.d.ts +35 -0
  368. package/build/client/core/instructions/wrapperProvideLiquidity.js +59 -0
  369. package/build/client/core/instructions/wrapperProvideLiquidity.js.map +1 -0
  370. package/build/client/core/instructions/wrapperProvideLiquidityBase.d.ts +28 -0
  371. package/build/client/core/instructions/wrapperProvideLiquidityBase.js +44 -0
  372. package/build/client/core/instructions/wrapperProvideLiquidityBase.js.map +1 -0
  373. package/build/client/core/instructions/wrapperProvideLiquidityClassic.d.ts +26 -0
  374. package/build/client/core/instructions/wrapperProvideLiquidityClassic.js +42 -0
  375. package/build/client/core/instructions/wrapperProvideLiquidityClassic.js.map +1 -0
  376. package/build/client/core/instructions/wrapperSellPt.d.ts +21 -0
  377. package/build/client/core/instructions/wrapperSellPt.js +33 -0
  378. package/build/client/core/instructions/wrapperSellPt.js.map +1 -0
  379. package/build/client/core/instructions/wrapperSellYt.d.ts +29 -0
  380. package/build/client/core/instructions/wrapperSellYt.js +49 -0
  381. package/build/client/core/instructions/wrapperSellYt.js.map +1 -0
  382. package/build/client/core/instructions/wrapperStrip.d.ts +26 -0
  383. package/build/client/core/instructions/wrapperStrip.js +46 -0
  384. package/build/client/core/instructions/wrapperStrip.js.map +1 -0
  385. package/build/client/core/instructions/wrapperWithdrawLiquidity.d.ts +26 -0
  386. package/build/client/core/instructions/wrapperWithdrawLiquidity.js +42 -0
  387. package/build/client/core/instructions/wrapperWithdrawLiquidity.js.map +1 -0
  388. package/build/client/core/instructions/wrapperWithdrawLiquidityClassic.d.ts +24 -0
  389. package/build/client/core/instructions/wrapperWithdrawLiquidityClassic.js +40 -0
  390. package/build/client/core/instructions/wrapperWithdrawLiquidityClassic.js.map +1 -0
  391. package/build/client/core/types/adminAction.d.ts +326 -0
  392. package/build/client/core/types/adminAction.js +87 -0
  393. package/build/client/core/types/adminAction.js.map +1 -0
  394. package/build/client/core/types/amount.d.ts +33 -0
  395. package/build/client/core/types/amount.js +20 -0
  396. package/build/client/core/types/amount.js.map +1 -0
  397. package/build/client/core/types/buyPtEvent.d.ts +27 -0
  398. package/build/client/core/types/buyPtEvent.js +19 -0
  399. package/build/client/core/types/buyPtEvent.js.map +1 -0
  400. package/build/client/core/types/buyYtEvent.d.ts +68 -0
  401. package/build/client/core/types/buyYtEvent.js +45 -0
  402. package/build/client/core/types/buyYtEvent.js.map +1 -0
  403. package/build/client/core/types/claimFarmEmissionsEvent.d.ts +43 -0
  404. package/build/client/core/types/claimFarmEmissionsEvent.js +35 -0
  405. package/build/client/core/types/claimFarmEmissionsEvent.js.map +1 -0
  406. package/build/client/core/types/claimFarmEmissionsEventV2.d.ts +98 -0
  407. package/build/client/core/types/claimFarmEmissionsEventV2.js +38 -0
  408. package/build/client/core/types/claimFarmEmissionsEventV2.js.map +1 -0
  409. package/build/client/core/types/claimLimits.d.ts +22 -0
  410. package/build/client/core/types/claimLimits.js +11 -0
  411. package/build/client/core/types/claimLimits.js.map +1 -0
  412. package/build/client/core/types/collectEmissionEvent.d.ts +35 -0
  413. package/build/client/core/types/collectEmissionEvent.js +24 -0
  414. package/build/client/core/types/collectEmissionEvent.js.map +1 -0
  415. package/build/client/core/types/collectEmissionEventV2.d.ts +68 -0
  416. package/build/client/core/types/collectEmissionEventV2.js +27 -0
  417. package/build/client/core/types/collectEmissionEventV2.js.map +1 -0
  418. package/build/client/core/types/collectInterestEvent.d.ts +31 -0
  419. package/build/client/core/types/collectInterestEvent.js +23 -0
  420. package/build/client/core/types/collectInterestEvent.js.map +1 -0
  421. package/build/client/core/types/collectInterestEventV2.d.ts +64 -0
  422. package/build/client/core/types/collectInterestEventV2.js +26 -0
  423. package/build/client/core/types/collectInterestEventV2.js.map +1 -0
  424. package/build/client/core/types/collectTreasuryEmissionKind.d.ts +5 -0
  425. package/build/client/core/types/collectTreasuryEmissionKind.js +11 -0
  426. package/build/client/core/types/collectTreasuryEmissionKind.js.map +1 -0
  427. package/build/client/core/types/collectTreasuryInterestKind.d.ts +5 -0
  428. package/build/client/core/types/collectTreasuryInterestKind.js +11 -0
  429. package/build/client/core/types/collectTreasuryInterestKind.js.map +1 -0
  430. package/build/client/core/types/cpiAccounts.d.ts +107 -0
  431. package/build/client/core/types/cpiAccounts.js +13 -0
  432. package/build/client/core/types/cpiAccounts.js.map +1 -0
  433. package/build/client/core/types/cpiInterfaceContext.d.ts +18 -0
  434. package/build/client/core/types/cpiInterfaceContext.js +10 -0
  435. package/build/client/core/types/cpiInterfaceContext.js.map +1 -0
  436. package/build/client/core/types/depositLiquidityEvent.d.ts +67 -0
  437. package/build/client/core/types/depositLiquidityEvent.js +47 -0
  438. package/build/client/core/types/depositLiquidityEvent.js.map +1 -0
  439. package/build/client/core/types/depositLpEvent.d.ts +43 -0
  440. package/build/client/core/types/depositLpEvent.js +35 -0
  441. package/build/client/core/types/depositLpEvent.js.map +1 -0
  442. package/build/client/core/types/depositLpEventV2.d.ts +98 -0
  443. package/build/client/core/types/depositLpEventV2.js +38 -0
  444. package/build/client/core/types/depositLpEventV2.js.map +1 -0
  445. package/build/client/core/types/depositYtEvent.d.ts +56 -0
  446. package/build/client/core/types/depositYtEvent.js +39 -0
  447. package/build/client/core/types/depositYtEvent.js.map +1 -0
  448. package/build/client/core/types/depositYtEventV2.d.ts +89 -0
  449. package/build/client/core/types/depositYtEventV2.js +42 -0
  450. package/build/client/core/types/depositYtEventV2.js.map +1 -0
  451. package/build/client/core/types/emissionInfo.d.ts +36 -0
  452. package/build/client/core/types/emissionInfo.js +22 -0
  453. package/build/client/core/types/emissionInfo.js.map +1 -0
  454. package/build/client/core/types/farmEmission.d.ts +24 -0
  455. package/build/client/core/types/farmEmission.js +16 -0
  456. package/build/client/core/types/farmEmission.js.map +1 -0
  457. package/build/client/core/types/index.d.ts +60 -0
  458. package/build/client/core/types/index.js +77 -0
  459. package/build/client/core/types/index.js.map +1 -0
  460. package/build/client/core/types/initLpPositionEvent.d.ts +35 -0
  461. package/build/client/core/types/initLpPositionEvent.js +27 -0
  462. package/build/client/core/types/initLpPositionEvent.js.map +1 -0
  463. package/build/client/core/types/initializeYieldPositionEvent.d.ts +23 -0
  464. package/build/client/core/types/initializeYieldPositionEvent.js +21 -0
  465. package/build/client/core/types/initializeYieldPositionEvent.js.map +1 -0
  466. package/build/client/core/types/liquidityNetBalanceLimits.d.ts +26 -0
  467. package/build/client/core/types/liquidityNetBalanceLimits.js +12 -0
  468. package/build/client/core/types/liquidityNetBalanceLimits.js.map +1 -0
  469. package/build/client/core/types/lpFarm.d.ts +35 -0
  470. package/build/client/core/types/lpFarm.js +10 -0
  471. package/build/client/core/types/lpFarm.js.map +1 -0
  472. package/build/client/core/types/marketAdminAction.d.ts +286 -0
  473. package/build/client/core/types/marketAdminAction.js +61 -0
  474. package/build/client/core/types/marketAdminAction.js.map +1 -0
  475. package/build/client/core/types/marketCollectEmissionEvent.d.ts +39 -0
  476. package/build/client/core/types/marketCollectEmissionEvent.js +31 -0
  477. package/build/client/core/types/marketCollectEmissionEvent.js.map +1 -0
  478. package/build/client/core/types/marketCollectEmissionEventV2.d.ts +94 -0
  479. package/build/client/core/types/marketCollectEmissionEventV2.js +34 -0
  480. package/build/client/core/types/marketCollectEmissionEventV2.js.map +1 -0
  481. package/build/client/core/types/marketEmission.d.ts +20 -0
  482. package/build/client/core/types/marketEmission.js +15 -0
  483. package/build/client/core/types/marketEmission.js.map +1 -0
  484. package/build/client/core/types/marketEmissions.d.ts +27 -0
  485. package/build/client/core/types/marketEmissions.js +9 -0
  486. package/build/client/core/types/marketEmissions.js.map +1 -0
  487. package/build/client/core/types/marketFinancials.d.ts +30 -0
  488. package/build/client/core/types/marketFinancials.js +13 -0
  489. package/build/client/core/types/marketFinancials.js.map +1 -0
  490. package/build/client/core/types/mergeEvent.d.ts +84 -0
  491. package/build/client/core/types/mergeEvent.js +55 -0
  492. package/build/client/core/types/mergeEvent.js.map +1 -0
  493. package/build/client/core/types/number.d.ts +2 -0
  494. package/build/client/core/types/number.js +8 -0
  495. package/build/client/core/types/number.js.map +1 -0
  496. package/build/client/core/types/personalYieldTracker.d.ts +15 -0
  497. package/build/client/core/types/personalYieldTracker.js +10 -0
  498. package/build/client/core/types/personalYieldTracker.js.map +1 -0
  499. package/build/client/core/types/personalYieldTrackers.d.ts +23 -0
  500. package/build/client/core/types/personalYieldTrackers.js +9 -0
  501. package/build/client/core/types/personalYieldTrackers.js.map +1 -0
  502. package/build/client/core/types/principleDetails.d.ts +11 -0
  503. package/build/client/core/types/principleDetails.js +12 -0
  504. package/build/client/core/types/principleDetails.js.map +1 -0
  505. package/build/client/core/types/principles.d.ts +79 -0
  506. package/build/client/core/types/principles.js +14 -0
  507. package/build/client/core/types/principles.js.map +1 -0
  508. package/build/client/core/types/sellPtEvent.d.ts +27 -0
  509. package/build/client/core/types/sellPtEvent.js +19 -0
  510. package/build/client/core/types/sellPtEvent.js.map +1 -0
  511. package/build/client/core/types/sellYtEvent.d.ts +59 -0
  512. package/build/client/core/types/sellYtEvent.js +42 -0
  513. package/build/client/core/types/sellYtEvent.js.map +1 -0
  514. package/build/client/core/types/stageYieldEvent.d.ts +44 -0
  515. package/build/client/core/types/stageYieldEvent.js +30 -0
  516. package/build/client/core/types/stageYieldEvent.js.map +1 -0
  517. package/build/client/core/types/stageYieldEventV2.d.ts +73 -0
  518. package/build/client/core/types/stageYieldEventV2.js +32 -0
  519. package/build/client/core/types/stageYieldEventV2.js.map +1 -0
  520. package/build/client/core/types/stripEvent.d.ts +84 -0
  521. package/build/client/core/types/stripEvent.js +58 -0
  522. package/build/client/core/types/stripEvent.js.map +1 -0
  523. package/build/client/core/types/tradePtEvent.d.ts +52 -0
  524. package/build/client/core/types/tradePtEvent.js +38 -0
  525. package/build/client/core/types/tradePtEvent.js.map +1 -0
  526. package/build/client/core/types/withdrawLiquidityEvent.d.ts +59 -0
  527. package/build/client/core/types/withdrawLiquidityEvent.js +45 -0
  528. package/build/client/core/types/withdrawLiquidityEvent.js.map +1 -0
  529. package/build/client/core/types/withdrawLpEvent.d.ts +43 -0
  530. package/build/client/core/types/withdrawLpEvent.js +35 -0
  531. package/build/client/core/types/withdrawLpEvent.js.map +1 -0
  532. package/build/client/core/types/withdrawLpEventV2.d.ts +98 -0
  533. package/build/client/core/types/withdrawLpEventV2.js +38 -0
  534. package/build/client/core/types/withdrawLpEventV2.js.map +1 -0
  535. package/build/client/core/types/withdrawYtEvent.d.ts +56 -0
  536. package/build/client/core/types/withdrawYtEvent.js +39 -0
  537. package/build/client/core/types/withdrawYtEvent.js.map +1 -0
  538. package/build/client/core/types/withdrawYtEventV2.d.ts +89 -0
  539. package/build/client/core/types/withdrawYtEventV2.js +42 -0
  540. package/build/client/core/types/withdrawYtEventV2.js.map +1 -0
  541. package/build/client/core/types/wrapperBuyYtEvent.d.ts +27 -0
  542. package/build/client/core/types/wrapperBuyYtEvent.js +19 -0
  543. package/build/client/core/types/wrapperBuyYtEvent.js.map +1 -0
  544. package/build/client/core/types/wrapperCollectInterestEvent.d.ts +23 -0
  545. package/build/client/core/types/wrapperCollectInterestEvent.js +18 -0
  546. package/build/client/core/types/wrapperCollectInterestEvent.js.map +1 -0
  547. package/build/client/core/types/wrapperMergeEvent.d.ts +27 -0
  548. package/build/client/core/types/wrapperMergeEvent.js +19 -0
  549. package/build/client/core/types/wrapperMergeEvent.js.map +1 -0
  550. package/build/client/core/types/wrapperProvideLiquidityBaseEvent.d.ts +35 -0
  551. package/build/client/core/types/wrapperProvideLiquidityBaseEvent.js +21 -0
  552. package/build/client/core/types/wrapperProvideLiquidityBaseEvent.js.map +1 -0
  553. package/build/client/core/types/wrapperProvideLiquidityClassicEvent.d.ts +31 -0
  554. package/build/client/core/types/wrapperProvideLiquidityClassicEvent.js +20 -0
  555. package/build/client/core/types/wrapperProvideLiquidityClassicEvent.js.map +1 -0
  556. package/build/client/core/types/wrapperProvideLiquidityEvent.d.ts +31 -0
  557. package/build/client/core/types/wrapperProvideLiquidityEvent.js +20 -0
  558. package/build/client/core/types/wrapperProvideLiquidityEvent.js.map +1 -0
  559. package/build/client/core/types/wrapperSellYtEvent.d.ts +27 -0
  560. package/build/client/core/types/wrapperSellYtEvent.js +19 -0
  561. package/build/client/core/types/wrapperSellYtEvent.js.map +1 -0
  562. package/build/client/core/types/wrapperStripEvent.d.ts +27 -0
  563. package/build/client/core/types/wrapperStripEvent.js +19 -0
  564. package/build/client/core/types/wrapperStripEvent.js.map +1 -0
  565. package/build/client/core/types/wrapperWithdrawLiquidityClassicEvent.d.ts +31 -0
  566. package/build/client/core/types/wrapperWithdrawLiquidityClassicEvent.js +20 -0
  567. package/build/client/core/types/wrapperWithdrawLiquidityClassicEvent.js.map +1 -0
  568. package/build/client/core/types/wrapperWithdrawLiquidityEvent.d.ts +27 -0
  569. package/build/client/core/types/wrapperWithdrawLiquidityEvent.js +19 -0
  570. package/build/client/core/types/wrapperWithdrawLiquidityEvent.js.map +1 -0
  571. package/build/client/core/types/yieldTokenTracker.d.ts +15 -0
  572. package/build/client/core/types/yieldTokenTracker.js +10 -0
  573. package/build/client/core/types/yieldTokenTracker.js.map +1 -0
  574. package/build/client/orderbook/accounts/cpiAccountsOrderbook.d.ts +18 -0
  575. package/build/client/orderbook/accounts/cpiAccountsOrderbook.js +66 -0
  576. package/build/client/orderbook/accounts/cpiAccountsOrderbook.js.map +1 -0
  577. package/build/client/orderbook/accounts/vault.d.ts +48 -0
  578. package/build/client/orderbook/accounts/vault.js +128 -0
  579. package/build/client/orderbook/accounts/vault.js.map +1 -0
  580. package/build/client/orderbook/eventRegistry.d.ts +45 -0
  581. package/build/client/orderbook/eventRegistry.js +44 -0
  582. package/build/client/orderbook/eventRegistry.js.map +1 -0
  583. package/build/client/orderbook/index.d.ts +51 -0
  584. package/build/client/orderbook/index.js +69 -0
  585. package/build/client/orderbook/index.js.map +1 -0
  586. package/build/client/orderbook/instructions/collectAdminEmission.d.ts +14 -0
  587. package/build/client/orderbook/instructions/collectAdminEmission.js +26 -0
  588. package/build/client/orderbook/instructions/collectAdminEmission.js.map +1 -0
  589. package/build/client/orderbook/instructions/collectAdminFee.d.ts +21 -0
  590. package/build/client/orderbook/instructions/collectAdminFee.js +34 -0
  591. package/build/client/orderbook/instructions/collectAdminFee.js.map +1 -0
  592. package/build/client/orderbook/instructions/collectInterest.d.ts +21 -0
  593. package/build/client/orderbook/instructions/collectInterest.js +37 -0
  594. package/build/client/orderbook/instructions/collectInterest.js.map +1 -0
  595. package/build/client/orderbook/instructions/initializeOrderbook.d.ts +36 -0
  596. package/build/client/orderbook/instructions/initializeOrderbook.js +52 -0
  597. package/build/client/orderbook/instructions/initializeOrderbook.js.map +1 -0
  598. package/build/client/orderbook/instructions/marketOffer.d.ts +30 -0
  599. package/build/client/orderbook/instructions/marketOffer.js +46 -0
  600. package/build/client/orderbook/instructions/marketOffer.js.map +1 -0
  601. package/build/client/orderbook/instructions/postOffer.d.ts +33 -0
  602. package/build/client/orderbook/instructions/postOffer.js +49 -0
  603. package/build/client/orderbook/instructions/postOffer.js.map +1 -0
  604. package/build/client/orderbook/instructions/reallocOrderbookAccount.d.ts +12 -0
  605. package/build/client/orderbook/instructions/reallocOrderbookAccount.js +24 -0
  606. package/build/client/orderbook/instructions/reallocOrderbookAccount.js.map +1 -0
  607. package/build/client/orderbook/instructions/removeExpiredOffers.d.ts +12 -0
  608. package/build/client/orderbook/instructions/removeExpiredOffers.js +21 -0
  609. package/build/client/orderbook/instructions/removeExpiredOffers.js.map +1 -0
  610. package/build/client/orderbook/instructions/removeOffer.d.ts +24 -0
  611. package/build/client/orderbook/instructions/removeOffer.js +40 -0
  612. package/build/client/orderbook/instructions/removeOffer.js.map +1 -0
  613. package/build/client/orderbook/instructions/setConfigurationOptions.d.ts +10 -0
  614. package/build/client/orderbook/instructions/setConfigurationOptions.js +22 -0
  615. package/build/client/orderbook/instructions/setConfigurationOptions.js.map +1 -0
  616. package/build/client/orderbook/instructions/withdrawFunds.d.ts +27 -0
  617. package/build/client/orderbook/instructions/withdrawFunds.js +43 -0
  618. package/build/client/orderbook/instructions/withdrawFunds.js.map +1 -0
  619. package/build/client/orderbook/instructions/wrapperCollectAdminFee.d.ts +24 -0
  620. package/build/client/orderbook/instructions/wrapperCollectAdminFee.js +40 -0
  621. package/build/client/orderbook/instructions/wrapperCollectAdminFee.js.map +1 -0
  622. package/build/client/orderbook/instructions/wrapperCollectInterest.d.ts +20 -0
  623. package/build/client/orderbook/instructions/wrapperCollectInterest.js +36 -0
  624. package/build/client/orderbook/instructions/wrapperCollectInterest.js.map +1 -0
  625. package/build/client/orderbook/instructions/wrapperMarketOffer.d.ts +32 -0
  626. package/build/client/orderbook/instructions/wrapperMarketOffer.js +48 -0
  627. package/build/client/orderbook/instructions/wrapperMarketOffer.js.map +1 -0
  628. package/build/client/orderbook/instructions/wrapperPostOffer.d.ts +34 -0
  629. package/build/client/orderbook/instructions/wrapperPostOffer.js +50 -0
  630. package/build/client/orderbook/instructions/wrapperPostOffer.js.map +1 -0
  631. package/build/client/orderbook/instructions/wrapperRemoveOffer.d.ts +25 -0
  632. package/build/client/orderbook/instructions/wrapperRemoveOffer.js +41 -0
  633. package/build/client/orderbook/instructions/wrapperRemoveOffer.js.map +1 -0
  634. package/build/client/orderbook/instructions/wrapperWithdrawFunds.d.ts +28 -0
  635. package/build/client/orderbook/instructions/wrapperWithdrawFunds.js +44 -0
  636. package/build/client/orderbook/instructions/wrapperWithdrawFunds.js.map +1 -0
  637. package/build/client/orderbook/types/amount.d.ts +33 -0
  638. package/build/client/orderbook/types/amount.js +20 -0
  639. package/build/client/orderbook/types/amount.js.map +1 -0
  640. package/build/client/orderbook/types/claimLimits.d.ts +22 -0
  641. package/build/client/orderbook/types/claimLimits.js +11 -0
  642. package/build/client/orderbook/types/claimLimits.js.map +1 -0
  643. package/build/client/orderbook/types/collectAdminEmissionEvent.d.ts +27 -0
  644. package/build/client/orderbook/types/collectAdminEmissionEvent.js +19 -0
  645. package/build/client/orderbook/types/collectAdminEmissionEvent.js.map +1 -0
  646. package/build/client/orderbook/types/collectAdminFeeEvent.d.ts +26 -0
  647. package/build/client/orderbook/types/collectAdminFeeEvent.js +12 -0
  648. package/build/client/orderbook/types/collectAdminFeeEvent.js.map +1 -0
  649. package/build/client/orderbook/types/collectEmissionEventV2.d.ts +68 -0
  650. package/build/client/orderbook/types/collectEmissionEventV2.js +27 -0
  651. package/build/client/orderbook/types/collectEmissionEventV2.js.map +1 -0
  652. package/build/client/orderbook/types/collectInterestEventV2.d.ts +64 -0
  653. package/build/client/orderbook/types/collectInterestEventV2.js +26 -0
  654. package/build/client/orderbook/types/collectInterestEventV2.js.map +1 -0
  655. package/build/client/orderbook/types/collectUserInterestEvent.d.ts +23 -0
  656. package/build/client/orderbook/types/collectUserInterestEvent.js +18 -0
  657. package/build/client/orderbook/types/collectUserInterestEvent.js.map +1 -0
  658. package/build/client/orderbook/types/cpiAccounts.d.ts +107 -0
  659. package/build/client/orderbook/types/cpiAccounts.js +13 -0
  660. package/build/client/orderbook/types/cpiAccounts.js.map +1 -0
  661. package/build/client/orderbook/types/cpiInterfaceContext.d.ts +18 -0
  662. package/build/client/orderbook/types/cpiInterfaceContext.js +10 -0
  663. package/build/client/orderbook/types/cpiInterfaceContext.js.map +1 -0
  664. package/build/client/orderbook/types/emissionInfo.d.ts +36 -0
  665. package/build/client/orderbook/types/emissionInfo.js +22 -0
  666. package/build/client/orderbook/types/emissionInfo.js.map +1 -0
  667. package/build/client/orderbook/types/exponentCoreCpiAccounts.d.ts +107 -0
  668. package/build/client/orderbook/types/exponentCoreCpiAccounts.js +13 -0
  669. package/build/client/orderbook/types/exponentCoreCpiAccounts.js.map +1 -0
  670. package/build/client/orderbook/types/filledOffersEvent.d.ts +30 -0
  671. package/build/client/orderbook/types/filledOffersEvent.js +13 -0
  672. package/build/client/orderbook/types/filledOffersEvent.js.map +1 -0
  673. package/build/client/orderbook/types/index.d.ts +30 -0
  674. package/build/client/orderbook/types/index.js +47 -0
  675. package/build/client/orderbook/types/index.js.map +1 -0
  676. package/build/client/orderbook/types/marketOfferEvent.d.ts +93 -0
  677. package/build/client/orderbook/types/marketOfferEvent.js +33 -0
  678. package/build/client/orderbook/types/marketOfferEvent.js.map +1 -0
  679. package/build/client/orderbook/types/mergeEvent.d.ts +84 -0
  680. package/build/client/orderbook/types/mergeEvent.js +55 -0
  681. package/build/client/orderbook/types/mergeEvent.js.map +1 -0
  682. package/build/client/orderbook/types/number.d.ts +2 -0
  683. package/build/client/orderbook/types/number.js +8 -0
  684. package/build/client/orderbook/types/number.js.map +1 -0
  685. package/build/client/orderbook/types/offerOptions.d.ts +24 -0
  686. package/build/client/orderbook/types/offerOptions.js +22 -0
  687. package/build/client/orderbook/types/offerOptions.js.map +1 -0
  688. package/build/client/orderbook/types/offerType.d.ts +5 -0
  689. package/build/client/orderbook/types/offerType.js +11 -0
  690. package/build/client/orderbook/types/offerType.js.map +1 -0
  691. package/build/client/orderbook/types/orderbookInitEvent.d.ts +39 -0
  692. package/build/client/orderbook/types/orderbookInitEvent.js +25 -0
  693. package/build/client/orderbook/types/orderbookInitEvent.js.map +1 -0
  694. package/build/client/orderbook/types/postOfferEvent.d.ts +118 -0
  695. package/build/client/orderbook/types/postOfferEvent.js +36 -0
  696. package/build/client/orderbook/types/postOfferEvent.js.map +1 -0
  697. package/build/client/orderbook/types/removeOfferEvent.d.ts +39 -0
  698. package/build/client/orderbook/types/removeOfferEvent.js +31 -0
  699. package/build/client/orderbook/types/removeOfferEvent.js.map +1 -0
  700. package/build/client/orderbook/types/setConfigurationOptionsEnum.d.ts +72 -0
  701. package/build/client/orderbook/types/setConfigurationOptionsEnum.js +34 -0
  702. package/build/client/orderbook/types/setConfigurationOptionsEnum.js.map +1 -0
  703. package/build/client/orderbook/types/stripEvent.d.ts +84 -0
  704. package/build/client/orderbook/types/stripEvent.js +58 -0
  705. package/build/client/orderbook/types/stripEvent.js.map +1 -0
  706. package/build/client/orderbook/types/withdrawFundsEvent.d.ts +39 -0
  707. package/build/client/orderbook/types/withdrawFundsEvent.js +31 -0
  708. package/build/client/orderbook/types/withdrawFundsEvent.js.map +1 -0
  709. package/build/client/orderbook/types/wrapperCollectAdminFeeEvent.d.ts +18 -0
  710. package/build/client/orderbook/types/wrapperCollectAdminFeeEvent.js +10 -0
  711. package/build/client/orderbook/types/wrapperCollectAdminFeeEvent.js.map +1 -0
  712. package/build/client/orderbook/types/wrapperCollectInterestEvent.d.ts +15 -0
  713. package/build/client/orderbook/types/wrapperCollectInterestEvent.js +13 -0
  714. package/build/client/orderbook/types/wrapperCollectInterestEvent.js.map +1 -0
  715. package/build/client/orderbook/types/wrapperMarketOfferEvent.d.ts +19 -0
  716. package/build/client/orderbook/types/wrapperMarketOfferEvent.js +14 -0
  717. package/build/client/orderbook/types/wrapperMarketOfferEvent.js.map +1 -0
  718. package/build/client/orderbook/types/wrapperPostOfferEvent.d.ts +39 -0
  719. package/build/client/orderbook/types/wrapperPostOfferEvent.js +34 -0
  720. package/build/client/orderbook/types/wrapperPostOfferEvent.js.map +1 -0
  721. package/build/client/orderbook/types/wrapperRemoveOfferEvent.d.ts +15 -0
  722. package/build/client/orderbook/types/wrapperRemoveOfferEvent.js +13 -0
  723. package/build/client/orderbook/types/wrapperRemoveOfferEvent.js.map +1 -0
  724. package/build/client/orderbook/types/wrapperWithdrawFundsEvent.d.ts +27 -0
  725. package/build/client/orderbook/types/wrapperWithdrawFundsEvent.js +19 -0
  726. package/build/client/orderbook/types/wrapperWithdrawFundsEvent.js.map +1 -0
  727. package/build/client/orderbook/types/yieldTokenTracker.d.ts +15 -0
  728. package/build/client/orderbook/types/yieldTokenTracker.js +10 -0
  729. package/build/client/orderbook/types/yieldTokenTracker.js.map +1 -0
  730. package/build/client/vaults/accounts/actionProposal.d.ts +30 -0
  731. package/build/client/vaults/accounts/actionProposal.js +84 -0
  732. package/build/client/vaults/accounts/actionProposal.js.map +1 -0
  733. package/build/client/vaults/accounts/exponentStrategyVault.d.ts +39 -0
  734. package/build/client/vaults/accounts/exponentStrategyVault.js +113 -0
  735. package/build/client/vaults/accounts/exponentStrategyVault.js.map +1 -0
  736. package/build/client/vaults/accounts/programConfig.d.ts +19 -0
  737. package/build/client/vaults/accounts/programConfig.js +76 -0
  738. package/build/client/vaults/accounts/programConfig.js.map +1 -0
  739. package/build/client/vaults/accounts/voteAccount.d.ts +23 -0
  740. package/build/client/vaults/accounts/voteAccount.js +80 -0
  741. package/build/client/vaults/accounts/voteAccount.js.map +1 -0
  742. package/build/client/vaults/accounts/withdrawalAccount.d.ts +23 -0
  743. package/build/client/vaults/accounts/withdrawalAccount.js +78 -0
  744. package/build/client/vaults/accounts/withdrawalAccount.js.map +1 -0
  745. package/build/client/vaults/eventRegistry.d.ts +27 -0
  746. package/build/client/vaults/eventRegistry.js +27 -0
  747. package/build/client/vaults/eventRegistry.js.map +1 -0
  748. package/build/client/vaults/index.d.ts +106 -0
  749. package/build/client/vaults/index.js +125 -0
  750. package/build/client/vaults/index.js.map +1 -0
  751. package/build/client/vaults/instructions/activateProposal.d.ts +12 -0
  752. package/build/client/vaults/instructions/activateProposal.js +25 -0
  753. package/build/client/vaults/instructions/activateProposal.js.map +1 -0
  754. package/build/client/vaults/instructions/addPolicy.d.ts +16 -0
  755. package/build/client/vaults/instructions/addPolicy.js +33 -0
  756. package/build/client/vaults/instructions/addPolicy.js.map +1 -0
  757. package/build/client/vaults/instructions/appendProposalActions.d.ts +13 -0
  758. package/build/client/vaults/instructions/appendProposalActions.js +26 -0
  759. package/build/client/vaults/instructions/appendProposalActions.js.map +1 -0
  760. package/build/client/vaults/instructions/cancelProposal.d.ts +7 -0
  761. package/build/client/vaults/instructions/cancelProposal.js +17 -0
  762. package/build/client/vaults/instructions/cancelProposal.js.map +1 -0
  763. package/build/client/vaults/instructions/cancelWithdrawal.d.ts +10 -0
  764. package/build/client/vaults/instructions/cancelWithdrawal.js +20 -0
  765. package/build/client/vaults/instructions/cancelWithdrawal.js.map +1 -0
  766. package/build/client/vaults/instructions/collectManagementFee.d.ts +9 -0
  767. package/build/client/vaults/instructions/collectManagementFee.js +19 -0
  768. package/build/client/vaults/instructions/collectManagementFee.js.map +1 -0
  769. package/build/client/vaults/instructions/depositLiquidity.d.ts +20 -0
  770. package/build/client/vaults/instructions/depositLiquidity.js +33 -0
  771. package/build/client/vaults/instructions/depositLiquidity.js.map +1 -0
  772. package/build/client/vaults/instructions/executeProposal.d.ts +11 -0
  773. package/build/client/vaults/instructions/executeProposal.js +21 -0
  774. package/build/client/vaults/instructions/executeProposal.js.map +1 -0
  775. package/build/client/vaults/instructions/executeWithdrawal.d.ts +18 -0
  776. package/build/client/vaults/instructions/executeWithdrawal.js +31 -0
  777. package/build/client/vaults/instructions/executeWithdrawal.js.map +1 -0
  778. package/build/client/vaults/instructions/executeWithdrawalFromReserves.d.ts +22 -0
  779. package/build/client/vaults/instructions/executeWithdrawalFromReserves.js +35 -0
  780. package/build/client/vaults/instructions/executeWithdrawalFromReserves.js.map +1 -0
  781. package/build/client/vaults/instructions/fillWithdrawal.d.ts +17 -0
  782. package/build/client/vaults/instructions/fillWithdrawal.js +34 -0
  783. package/build/client/vaults/instructions/fillWithdrawal.js.map +1 -0
  784. package/build/client/vaults/instructions/finalizeProposal.d.ts +7 -0
  785. package/build/client/vaults/instructions/finalizeProposal.js +17 -0
  786. package/build/client/vaults/instructions/finalizeProposal.js.map +1 -0
  787. package/build/client/vaults/instructions/initProposal.d.ts +12 -0
  788. package/build/client/vaults/instructions/initProposal.js +25 -0
  789. package/build/client/vaults/instructions/initProposal.js.map +1 -0
  790. package/build/client/vaults/instructions/initializePrices.d.ts +7 -0
  791. package/build/client/vaults/instructions/initializePrices.js +17 -0
  792. package/build/client/vaults/instructions/initializePrices.js.map +1 -0
  793. package/build/client/vaults/instructions/initializeVault.d.ts +44 -0
  794. package/build/client/vaults/instructions/initializeVault.js +80 -0
  795. package/build/client/vaults/instructions/initializeVault.js.map +1 -0
  796. package/build/client/vaults/instructions/makeSentienelManager.d.ts +7 -0
  797. package/build/client/vaults/instructions/makeSentienelManager.js +17 -0
  798. package/build/client/vaults/instructions/makeSentienelManager.js.map +1 -0
  799. package/build/client/vaults/instructions/managePrices.d.ts +11 -0
  800. package/build/client/vaults/instructions/managePrices.js +24 -0
  801. package/build/client/vaults/instructions/managePrices.js.map +1 -0
  802. package/build/client/vaults/instructions/manageVaultSettings.d.ts +12 -0
  803. package/build/client/vaults/instructions/manageVaultSettings.js +25 -0
  804. package/build/client/vaults/instructions/manageVaultSettings.js.map +1 -0
  805. package/build/client/vaults/instructions/managerUpdatePosition.d.ts +12 -0
  806. package/build/client/vaults/instructions/managerUpdatePosition.js +25 -0
  807. package/build/client/vaults/instructions/managerUpdatePosition.js.map +1 -0
  808. package/build/client/vaults/instructions/proposeAction.d.ts +16 -0
  809. package/build/client/vaults/instructions/proposeAction.js +29 -0
  810. package/build/client/vaults/instructions/proposeAction.js.map +1 -0
  811. package/build/client/vaults/instructions/queueWithdrawal.d.ts +14 -0
  812. package/build/client/vaults/instructions/queueWithdrawal.js +27 -0
  813. package/build/client/vaults/instructions/queueWithdrawal.js.map +1 -0
  814. package/build/client/vaults/instructions/removePolicy.d.ts +13 -0
  815. package/build/client/vaults/instructions/removePolicy.js +27 -0
  816. package/build/client/vaults/instructions/removePolicy.js.map +1 -0
  817. package/build/client/vaults/instructions/sentinelSetVaultFlags.d.ts +10 -0
  818. package/build/client/vaults/instructions/sentinelSetVaultFlags.js +23 -0
  819. package/build/client/vaults/instructions/sentinelSetVaultFlags.js.map +1 -0
  820. package/build/client/vaults/instructions/stakeVote.d.ts +18 -0
  821. package/build/client/vaults/instructions/stakeVote.js +31 -0
  822. package/build/client/vaults/instructions/stakeVote.js.map +1 -0
  823. package/build/client/vaults/instructions/unstakeVote.d.ts +14 -0
  824. package/build/client/vaults/instructions/unstakeVote.js +24 -0
  825. package/build/client/vaults/instructions/unstakeVote.js.map +1 -0
  826. package/build/client/vaults/instructions/updatePolicy.d.ts +17 -0
  827. package/build/client/vaults/instructions/updatePolicy.js +34 -0
  828. package/build/client/vaults/instructions/updatePolicy.js.map +1 -0
  829. package/build/client/vaults/instructions/updatePolicyManager.d.ts +13 -0
  830. package/build/client/vaults/instructions/updatePolicyManager.js +27 -0
  831. package/build/client/vaults/instructions/updatePolicyManager.js.map +1 -0
  832. package/build/client/vaults/instructions/updatePrice.d.ts +9 -0
  833. package/build/client/vaults/instructions/updatePrice.js +22 -0
  834. package/build/client/vaults/instructions/updatePrice.js.map +1 -0
  835. package/build/client/vaults/instructions/validateInteractionHook.d.ts +16 -0
  836. package/build/client/vaults/instructions/validateInteractionHook.js +33 -0
  837. package/build/client/vaults/instructions/validateInteractionHook.js.map +1 -0
  838. package/build/client/vaults/instructions/wrapperAddPolicy.d.ts +16 -0
  839. package/build/client/vaults/instructions/wrapperAddPolicy.js +33 -0
  840. package/build/client/vaults/instructions/wrapperAddPolicy.js.map +1 -0
  841. package/build/client/vaults/instructions/wrapperExecuteWithdrawal.d.ts +27 -0
  842. package/build/client/vaults/instructions/wrapperExecuteWithdrawal.js +40 -0
  843. package/build/client/vaults/instructions/wrapperExecuteWithdrawal.js.map +1 -0
  844. package/build/client/vaults/instructions/wrapperManageVaultSettings.d.ts +12 -0
  845. package/build/client/vaults/instructions/wrapperManageVaultSettings.js +25 -0
  846. package/build/client/vaults/instructions/wrapperManageVaultSettings.js.map +1 -0
  847. package/build/client/vaults/instructions/wrapperManagerUpdatePosition.d.ts +12 -0
  848. package/build/client/vaults/instructions/wrapperManagerUpdatePosition.js +25 -0
  849. package/build/client/vaults/instructions/wrapperManagerUpdatePosition.js.map +1 -0
  850. package/build/client/vaults/instructions/wrapperRemovePolicy.d.ts +13 -0
  851. package/build/client/vaults/instructions/wrapperRemovePolicy.js +27 -0
  852. package/build/client/vaults/instructions/wrapperRemovePolicy.js.map +1 -0
  853. package/build/client/vaults/instructions/wrapperUpdatePolicy.d.ts +17 -0
  854. package/build/client/vaults/instructions/wrapperUpdatePolicy.js +34 -0
  855. package/build/client/vaults/instructions/wrapperUpdatePolicy.js.map +1 -0
  856. package/build/client/vaults/types/accountConstraint.d.ts +20 -0
  857. package/build/client/vaults/types/accountConstraint.js +16 -0
  858. package/build/client/vaults/types/accountConstraint.js.map +1 -0
  859. package/build/client/vaults/types/accountConstraintType.d.ts +18 -0
  860. package/build/client/vaults/types/accountConstraintType.js +38 -0
  861. package/build/client/vaults/types/accountConstraintType.js.map +1 -0
  862. package/build/client/vaults/types/allowedSettingsChange.d.ts +79 -0
  863. package/build/client/vaults/types/allowedSettingsChange.js +45 -0
  864. package/build/client/vaults/types/allowedSettingsChange.js.map +1 -0
  865. package/build/client/vaults/types/cancelProposalEvent.d.ts +27 -0
  866. package/build/client/vaults/types/cancelProposalEvent.js +23 -0
  867. package/build/client/vaults/types/cancelProposalEvent.js.map +1 -0
  868. package/build/client/vaults/types/clmmPositionEntry.d.ts +88 -0
  869. package/build/client/vaults/types/clmmPositionEntry.js +20 -0
  870. package/build/client/vaults/types/clmmPositionEntry.js.map +1 -0
  871. package/build/client/vaults/types/dataConstraint.d.ts +116 -0
  872. package/build/client/vaults/types/dataConstraint.js +13 -0
  873. package/build/client/vaults/types/dataConstraint.js.map +1 -0
  874. package/build/client/vaults/types/dataOperator.d.ts +9 -0
  875. package/build/client/vaults/types/dataOperator.js +16 -0
  876. package/build/client/vaults/types/dataOperator.js.map +1 -0
  877. package/build/client/vaults/types/dataValue.d.ts +104 -0
  878. package/build/client/vaults/types/dataValue.js +33 -0
  879. package/build/client/vaults/types/dataValue.js.map +1 -0
  880. package/build/client/vaults/types/depositLiquidityEvent.d.ts +55 -0
  881. package/build/client/vaults/types/depositLiquidityEvent.js +42 -0
  882. package/build/client/vaults/types/depositLiquidityEvent.js.map +1 -0
  883. package/build/client/vaults/types/executeProposalEvent.d.ts +27 -0
  884. package/build/client/vaults/types/executeProposalEvent.js +23 -0
  885. package/build/client/vaults/types/executeProposalEvent.js.map +1 -0
  886. package/build/client/vaults/types/executeWithdrawalEvent.d.ts +14 -0
  887. package/build/client/vaults/types/executeWithdrawalEvent.js +10 -0
  888. package/build/client/vaults/types/executeWithdrawalEvent.js.map +1 -0
  889. package/build/client/vaults/types/fillParam.d.ts +14 -0
  890. package/build/client/vaults/types/fillParam.js +10 -0
  891. package/build/client/vaults/types/fillParam.js.map +1 -0
  892. package/build/client/vaults/types/finalizeProposalEvent.d.ts +48 -0
  893. package/build/client/vaults/types/finalizeProposalEvent.js +26 -0
  894. package/build/client/vaults/types/finalizeProposalEvent.js.map +1 -0
  895. package/build/client/vaults/types/hook.d.ts +44 -0
  896. package/build/client/vaults/types/hook.js +18 -0
  897. package/build/client/vaults/types/hook.js.map +1 -0
  898. package/build/client/vaults/types/hookCompiledInstruction.d.ts +18 -0
  899. package/build/client/vaults/types/hookCompiledInstruction.js +11 -0
  900. package/build/client/vaults/types/hookCompiledInstruction.js.map +1 -0
  901. package/build/client/vaults/types/index.d.ts +65 -0
  902. package/build/client/vaults/types/index.js +83 -0
  903. package/build/client/vaults/types/index.js.map +1 -0
  904. package/build/client/vaults/types/instructionConstraint.d.ts +173 -0
  905. package/build/client/vaults/types/instructionConstraint.js +17 -0
  906. package/build/client/vaults/types/instructionConstraint.js.map +1 -0
  907. package/build/client/vaults/types/internalFundTransferPolicyCreationPayload.d.ts +19 -0
  908. package/build/client/vaults/types/internalFundTransferPolicyCreationPayload.js +18 -0
  909. package/build/client/vaults/types/internalFundTransferPolicyCreationPayload.js.map +1 -0
  910. package/build/client/vaults/types/kaminoObligationEntry.d.ts +117 -0
  911. package/build/client/vaults/types/kaminoObligationEntry.js +23 -0
  912. package/build/client/vaults/types/kaminoObligationEntry.js.map +1 -0
  913. package/build/client/vaults/types/limitedQuantityConstraints.d.ts +10 -0
  914. package/build/client/vaults/types/limitedQuantityConstraints.js +9 -0
  915. package/build/client/vaults/types/limitedQuantityConstraints.js.map +1 -0
  916. package/build/client/vaults/types/limitedSpendingLimit.d.ts +105 -0
  917. package/build/client/vaults/types/limitedSpendingLimit.js +17 -0
  918. package/build/client/vaults/types/limitedSpendingLimit.js.map +1 -0
  919. package/build/client/vaults/types/limitedTimeConstraints.d.ts +67 -0
  920. package/build/client/vaults/types/limitedTimeConstraints.js +12 -0
  921. package/build/client/vaults/types/limitedTimeConstraints.js.map +1 -0
  922. package/build/client/vaults/types/loopscaleLoanEntry.d.ts +11 -0
  923. package/build/client/vaults/types/loopscaleLoanEntry.js +13 -0
  924. package/build/client/vaults/types/loopscaleLoanEntry.js.map +1 -0
  925. package/build/client/vaults/types/loopscaleStrategyEntry.d.ts +11 -0
  926. package/build/client/vaults/types/loopscaleStrategyEntry.js +13 -0
  927. package/build/client/vaults/types/loopscaleStrategyEntry.js.map +1 -0
  928. package/build/client/vaults/types/number.d.ts +2 -0
  929. package/build/client/vaults/types/number.js +9 -0
  930. package/build/client/vaults/types/number.js.map +1 -0
  931. package/build/client/vaults/types/obligationType.d.ts +13 -0
  932. package/build/client/vaults/types/obligationType.js +24 -0
  933. package/build/client/vaults/types/obligationType.js.map +1 -0
  934. package/build/client/vaults/types/orderbookEntry.d.ts +64 -0
  935. package/build/client/vaults/types/orderbookEntry.js +25 -0
  936. package/build/client/vaults/types/orderbookEntry.js.map +1 -0
  937. package/build/client/vaults/types/periodV2.d.ts +60 -0
  938. package/build/client/vaults/types/periodV2.js +24 -0
  939. package/build/client/vaults/types/periodV2.js.map +1 -0
  940. package/build/client/vaults/types/permissions.d.ts +10 -0
  941. package/build/client/vaults/types/permissions.js +7 -0
  942. package/build/client/vaults/types/permissions.js.map +1 -0
  943. package/build/client/vaults/types/policyAction.d.ts +61 -0
  944. package/build/client/vaults/types/policyAction.js +29 -0
  945. package/build/client/vaults/types/policyAction.js.map +1 -0
  946. package/build/client/vaults/types/policyConfig.d.ts +10 -0
  947. package/build/client/vaults/types/policyConfig.js +15 -0
  948. package/build/client/vaults/types/policyConfig.js.map +1 -0
  949. package/build/client/vaults/types/policyCreationPayload.d.ts +287 -0
  950. package/build/client/vaults/types/policyCreationPayload.js +50 -0
  951. package/build/client/vaults/types/policyCreationPayload.js.map +1 -0
  952. package/build/client/vaults/types/policyExpirationArgs.d.ts +33 -0
  953. package/build/client/vaults/types/policyExpirationArgs.js +21 -0
  954. package/build/client/vaults/types/policyExpirationArgs.js.map +1 -0
  955. package/build/client/vaults/types/positionUpdate.d.ts +45 -0
  956. package/build/client/vaults/types/positionUpdate.js +89 -0
  957. package/build/client/vaults/types/positionUpdate.js.map +1 -0
  958. package/build/client/vaults/types/priceId.d.ts +40 -0
  959. package/build/client/vaults/types/priceId.js +21 -0
  960. package/build/client/vaults/types/priceId.js.map +1 -0
  961. package/build/client/vaults/types/priceType.d.ts +19 -0
  962. package/build/client/vaults/types/priceType.js +26 -0
  963. package/build/client/vaults/types/priceType.js.map +1 -0
  964. package/build/client/vaults/types/programInteractionPolicyCreationPayload.d.ts +11 -0
  965. package/build/client/vaults/types/programInteractionPolicyCreationPayload.js +16 -0
  966. package/build/client/vaults/types/programInteractionPolicyCreationPayload.js.map +1 -0
  967. package/build/client/vaults/types/proposalAction.d.ts +226 -0
  968. package/build/client/vaults/types/proposalAction.js +40 -0
  969. package/build/client/vaults/types/proposalAction.js.map +1 -0
  970. package/build/client/vaults/types/proposalActionKind.d.ts +7 -0
  971. package/build/client/vaults/types/proposalActionKind.js +14 -0
  972. package/build/client/vaults/types/proposalActionKind.js.map +1 -0
  973. package/build/client/vaults/types/proposalStatus.d.ts +9 -0
  974. package/build/client/vaults/types/proposalStatus.js +16 -0
  975. package/build/client/vaults/types/proposalStatus.js.map +1 -0
  976. package/build/client/vaults/types/proposalVoteConfig.d.ts +46 -0
  977. package/build/client/vaults/types/proposalVoteConfig.js +18 -0
  978. package/build/client/vaults/types/proposalVoteConfig.js.map +1 -0
  979. package/build/client/vaults/types/proposeActionEvent.d.ts +48 -0
  980. package/build/client/vaults/types/proposeActionEvent.js +29 -0
  981. package/build/client/vaults/types/proposeActionEvent.js.map +1 -0
  982. package/build/client/vaults/types/quantityConstraints.d.ts +18 -0
  983. package/build/client/vaults/types/quantityConstraints.js +11 -0
  984. package/build/client/vaults/types/quantityConstraints.js.map +1 -0
  985. package/build/client/vaults/types/reservePriceMapping.d.ts +48 -0
  986. package/build/client/vaults/types/reservePriceMapping.js +15 -0
  987. package/build/client/vaults/types/reservePriceMapping.js.map +1 -0
  988. package/build/client/vaults/types/settingsChangePolicyCreationPayload.d.ts +81 -0
  989. package/build/client/vaults/types/settingsChangePolicyCreationPayload.js +10 -0
  990. package/build/client/vaults/types/settingsChangePolicyCreationPayload.js.map +1 -0
  991. package/build/client/vaults/types/spendingLimitPolicyCreationPayload.d.ts +142 -0
  992. package/build/client/vaults/types/spendingLimitPolicyCreationPayload.js +24 -0
  993. package/build/client/vaults/types/spendingLimitPolicyCreationPayload.js.map +1 -0
  994. package/build/client/vaults/types/stakeVoteEvent.d.ts +40 -0
  995. package/build/client/vaults/types/stakeVoteEvent.js +27 -0
  996. package/build/client/vaults/types/stakeVoteEvent.js.map +1 -0
  997. package/build/client/vaults/types/strategyPosition.d.ts +43 -0
  998. package/build/client/vaults/types/strategyPosition.js +54 -0
  999. package/build/client/vaults/types/strategyPosition.js.map +1 -0
  1000. package/build/client/vaults/types/timeConstraints.d.ts +71 -0
  1001. package/build/client/vaults/types/timeConstraints.js +13 -0
  1002. package/build/client/vaults/types/timeConstraints.js.map +1 -0
  1003. package/build/client/vaults/types/tokenAccountBalance.d.ts +52 -0
  1004. package/build/client/vaults/types/tokenAccountBalance.js +19 -0
  1005. package/build/client/vaults/types/tokenAccountBalance.js.map +1 -0
  1006. package/build/client/vaults/types/tokenAccountEntry.d.ts +72 -0
  1007. package/build/client/vaults/types/tokenAccountEntry.js +15 -0
  1008. package/build/client/vaults/types/tokenAccountEntry.js.map +1 -0
  1009. package/build/client/vaults/types/tokenEntry.d.ts +60 -0
  1010. package/build/client/vaults/types/tokenEntry.js +24 -0
  1011. package/build/client/vaults/types/tokenEntry.js.map +1 -0
  1012. package/build/client/vaults/types/unstakeVoteEvent.d.ts +36 -0
  1013. package/build/client/vaults/types/unstakeVoteEvent.js +26 -0
  1014. package/build/client/vaults/types/unstakeVoteEvent.js.map +1 -0
  1015. package/build/client/vaults/types/updatePriceAction.d.ts +174 -0
  1016. package/build/client/vaults/types/updatePriceAction.js +104 -0
  1017. package/build/client/vaults/types/updatePriceAction.js.map +1 -0
  1018. package/build/client/vaults/types/updatePriceInput.d.ts +14 -0
  1019. package/build/client/vaults/types/updatePriceInput.js +10 -0
  1020. package/build/client/vaults/types/updatePriceInput.js.map +1 -0
  1021. package/build/client/vaults/types/usageState.d.ts +14 -0
  1022. package/build/client/vaults/types/usageState.js +10 -0
  1023. package/build/client/vaults/types/usageState.js.map +1 -0
  1024. package/build/client/vaults/types/vaultConfig.d.ts +87 -0
  1025. package/build/client/vaults/types/vaultConfig.js +19 -0
  1026. package/build/client/vaults/types/vaultConfig.js.map +1 -0
  1027. package/build/client/vaults/types/vaultFinancials.d.ts +58 -0
  1028. package/build/client/vaults/types/vaultFinancials.js +21 -0
  1029. package/build/client/vaults/types/vaultFinancials.js.map +1 -0
  1030. package/build/client/vaults/types/vaultFlagAction.d.ts +56 -0
  1031. package/build/client/vaults/types/vaultFlagAction.js +22 -0
  1032. package/build/client/vaults/types/vaultFlagAction.js.map +1 -0
  1033. package/build/client/vaults/types/vaultFlagsUpdatedEvent.d.ts +23 -0
  1034. package/build/client/vaults/types/vaultFlagsUpdatedEvent.js +19 -0
  1035. package/build/client/vaults/types/vaultFlagsUpdatedEvent.js.map +1 -0
  1036. package/build/client/vaults/types/vaultRoleKind.d.ts +7 -0
  1037. package/build/client/vaults/types/vaultRoleKind.js +14 -0
  1038. package/build/client/vaults/types/vaultRoleKind.js.map +1 -0
  1039. package/build/client/vaults/types/vaultRoles.d.ts +23 -0
  1040. package/build/client/vaults/types/vaultRoles.js +25 -0
  1041. package/build/client/vaults/types/vaultRoles.js.map +1 -0
  1042. package/build/client/vaults/types/vaultSettingsAction.d.ts +109 -0
  1043. package/build/client/vaults/types/vaultSettingsAction.js +161 -0
  1044. package/build/client/vaults/types/vaultSettingsAction.js.map +1 -0
  1045. package/build/client/vaults/types/voteChoice.d.ts +5 -0
  1046. package/build/client/vaults/types/voteChoice.js +12 -0
  1047. package/build/client/vaults/types/voteChoice.js.map +1 -0
  1048. package/build/client/vaults/types/withdrawalPeriodSettings.d.ts +48 -0
  1049. package/build/client/vaults/types/withdrawalPeriodSettings.js +28 -0
  1050. package/build/client/vaults/types/withdrawalPeriodSettings.js.map +1 -0
  1051. package/build/client/vaults/types/withdrawalTokenFill.d.ts +19 -0
  1052. package/build/client/vaults/types/withdrawalTokenFill.js +18 -0
  1053. package/build/client/vaults/types/withdrawalTokenFill.js.map +1 -0
  1054. package/build/client/vaults/types/yieldPositionEntry.d.ts +52 -0
  1055. package/build/client/vaults/types/yieldPositionEntry.js +19 -0
  1056. package/build/client/vaults/types/yieldPositionEntry.js.map +1 -0
  1057. package/build/clmm/codamaEvents.d.ts +23 -0
  1058. package/build/clmm/codamaEvents.js +24 -0
  1059. package/build/clmm/codamaEvents.js.map +1 -0
  1060. package/build/clmm/index.d.ts +1 -0
  1061. package/build/clmm/index.js +18 -0
  1062. package/build/clmm/index.js.map +1 -0
  1063. package/build/codamaEvents.d.ts +18 -0
  1064. package/build/codamaEvents.js +21 -0
  1065. package/build/codamaEvents.js.map +1 -0
  1066. package/build/environment.d.ts +8 -7
  1067. package/build/environment.js +8 -7
  1068. package/build/environment.js.map +1 -1
  1069. package/build/exponentVaults/aumCalculator.d.ts +182 -0
  1070. package/build/exponentVaults/aumCalculator.js +778 -0
  1071. package/build/exponentVaults/aumCalculator.js.map +1 -0
  1072. package/build/exponentVaults/events.d.ts +8 -0
  1073. package/build/exponentVaults/events.js +12 -0
  1074. package/build/exponentVaults/events.js.map +1 -0
  1075. package/build/exponentVaults/index.d.ts +30 -0
  1076. package/build/exponentVaults/index.js +176 -0
  1077. package/build/exponentVaults/index.js.map +1 -0
  1078. package/build/exponentVaults/kamino-markets.d.ts +887 -0
  1079. package/build/exponentVaults/kamino-markets.js +345 -0
  1080. package/build/exponentVaults/kamino-markets.js.map +1 -0
  1081. package/build/exponentVaults/loopscale-client.d.ts +541 -0
  1082. package/build/exponentVaults/loopscale-client.js +732 -0
  1083. package/build/exponentVaults/loopscale-client.js.map +1 -0
  1084. package/build/exponentVaults/policyBuilders.d.ts +694 -0
  1085. package/build/exponentVaults/policyBuilders.js +1131 -0
  1086. package/build/exponentVaults/policyBuilders.js.map +1 -0
  1087. package/build/exponentVaults/policyMatcher.d.ts +82 -0
  1088. package/build/exponentVaults/policyMatcher.js +730 -0
  1089. package/build/exponentVaults/policyMatcher.js.map +1 -0
  1090. package/build/exponentVaults/scope-refresh.d.ts +10 -0
  1091. package/build/exponentVaults/scope-refresh.js +140 -0
  1092. package/build/exponentVaults/scope-refresh.js.map +1 -0
  1093. package/build/exponentVaults/squadsVaultTxnResolver/constants.d.ts +2 -0
  1094. package/build/exponentVaults/squadsVaultTxnResolver/constants.js +61 -0
  1095. package/build/exponentVaults/squadsVaultTxnResolver/constants.js.map +1 -0
  1096. package/build/exponentVaults/squadsVaultTxnResolver/helpers.d.ts +26 -0
  1097. package/build/exponentVaults/squadsVaultTxnResolver/helpers.js +268 -0
  1098. package/build/exponentVaults/squadsVaultTxnResolver/helpers.js.map +1 -0
  1099. package/build/exponentVaults/squadsVaultTxnResolver/index.d.ts +5 -0
  1100. package/build/exponentVaults/squadsVaultTxnResolver/index.js +15 -0
  1101. package/build/exponentVaults/squadsVaultTxnResolver/index.js.map +1 -0
  1102. package/build/exponentVaults/squadsVaultTxnResolver/resolvers/exponent.d.ts +6 -0
  1103. package/build/exponentVaults/squadsVaultTxnResolver/resolvers/exponent.js +361 -0
  1104. package/build/exponentVaults/squadsVaultTxnResolver/resolvers/exponent.js.map +1 -0
  1105. package/build/exponentVaults/squadsVaultTxnResolver/resolvers/helpers.d.ts +2 -0
  1106. package/build/exponentVaults/squadsVaultTxnResolver/resolvers/helpers.js +28 -0
  1107. package/build/exponentVaults/squadsVaultTxnResolver/resolvers/helpers.js.map +1 -0
  1108. package/build/exponentVaults/squadsVaultTxnResolver/resolvers/index.d.ts +2 -0
  1109. package/build/exponentVaults/squadsVaultTxnResolver/resolvers/index.js +25 -0
  1110. package/build/exponentVaults/squadsVaultTxnResolver/resolvers/index.js.map +1 -0
  1111. package/build/exponentVaults/squadsVaultTxnResolver/resolvers/kamino.d.ts +2 -0
  1112. package/build/exponentVaults/squadsVaultTxnResolver/resolvers/kamino.js +67 -0
  1113. package/build/exponentVaults/squadsVaultTxnResolver/resolvers/kamino.js.map +1 -0
  1114. package/build/exponentVaults/squadsVaultTxnResolver/resolvers/loopscale.d.ts +2 -0
  1115. package/build/exponentVaults/squadsVaultTxnResolver/resolvers/loopscale.js +73 -0
  1116. package/build/exponentVaults/squadsVaultTxnResolver/resolvers/loopscale.js.map +1 -0
  1117. package/build/exponentVaults/squadsVaultTxnResolver/resolvers/titan.d.ts +2 -0
  1118. package/build/exponentVaults/squadsVaultTxnResolver/resolvers/titan.js +35 -0
  1119. package/build/exponentVaults/squadsVaultTxnResolver/resolvers/titan.js.map +1 -0
  1120. package/build/exponentVaults/squadsVaultTxnResolver/squadsVaultTxnResolver.d.ts +21 -0
  1121. package/build/exponentVaults/squadsVaultTxnResolver/squadsVaultTxnResolver.js +64 -0
  1122. package/build/exponentVaults/squadsVaultTxnResolver/squadsVaultTxnResolver.js.map +1 -0
  1123. package/build/exponentVaults/squadsVaultTxnResolver/types.d.ts +111 -0
  1124. package/build/exponentVaults/squadsVaultTxnResolver/types.js +92 -0
  1125. package/build/exponentVaults/squadsVaultTxnResolver/types.js.map +1 -0
  1126. package/build/exponentVaults/squadsVaultTxnResolver/utils.d.ts +3 -0
  1127. package/build/exponentVaults/squadsVaultTxnResolver/utils.js +8 -0
  1128. package/build/exponentVaults/squadsVaultTxnResolver/utils.js.map +1 -0
  1129. package/build/exponentVaults/syncTransaction.d.ts +84 -0
  1130. package/build/exponentVaults/syncTransaction.js +341 -0
  1131. package/build/exponentVaults/syncTransaction.js.map +1 -0
  1132. package/build/exponentVaults/titan-quote.d.ts +22 -0
  1133. package/build/exponentVaults/titan-quote.js +167 -0
  1134. package/build/exponentVaults/titan-quote.js.map +1 -0
  1135. package/build/exponentVaults/vault-interaction.d.ts +3475 -0
  1136. package/build/exponentVaults/vault-interaction.js +2251 -0
  1137. package/build/exponentVaults/vault-interaction.js.map +1 -0
  1138. package/build/exponentVaults/vault.d.ts +613 -0
  1139. package/build/exponentVaults/vault.js +1437 -0
  1140. package/build/exponentVaults/vault.js.map +1 -0
  1141. package/build/exponentVaults/vaultTransactionBuilder.d.ts +319 -0
  1142. package/build/exponentVaults/vaultTransactionBuilder.js +470 -0
  1143. package/build/exponentVaults/vaultTransactionBuilder.js.map +1 -0
  1144. package/build/flavors.d.ts +5 -3
  1145. package/build/flavors.js +195 -137
  1146. package/build/flavors.js.map +1 -1
  1147. package/build/index.d.ts +17 -4
  1148. package/build/index.js +33 -7
  1149. package/build/index.js.map +1 -1
  1150. package/build/lpPosition.d.ts +13 -15
  1151. package/build/lpPosition.js +6 -7
  1152. package/build/lpPosition.js.map +1 -1
  1153. package/build/market.d.ts +213 -228
  1154. package/build/market.js +331 -384
  1155. package/build/market.js.map +1 -1
  1156. package/build/marketThree.d.ts +798 -0
  1157. package/build/marketThree.js +1749 -0
  1158. package/build/marketThree.js.map +1 -0
  1159. package/build/marketThree.test.d.ts +1 -0
  1160. package/build/marketThree.test.js +166 -0
  1161. package/build/marketThree.test.js.map +1 -0
  1162. package/build/orderbook/codamaEvents.d.ts +19 -0
  1163. package/build/orderbook/codamaEvents.js +22 -0
  1164. package/build/orderbook/codamaEvents.js.map +1 -0
  1165. package/build/orderbook/index.d.ts +7 -0
  1166. package/build/orderbook/index.js +45 -0
  1167. package/build/orderbook/index.js.map +1 -0
  1168. package/build/orderbook/math.d.ts +28 -0
  1169. package/build/orderbook/math.js +123 -0
  1170. package/build/orderbook/math.js.map +1 -0
  1171. package/build/orderbook/orderbook.d.ts +253 -0
  1172. package/build/orderbook/orderbook.js +923 -0
  1173. package/build/orderbook/orderbook.js.map +1 -0
  1174. package/build/orderbook/types.d.ts +35 -0
  1175. package/build/orderbook/types.js +47 -0
  1176. package/build/orderbook/types.js.map +1 -0
  1177. package/build/orderbook/utils.d.ts +16 -0
  1178. package/build/orderbook/utils.js +66 -0
  1179. package/build/orderbook/utils.js.map +1 -0
  1180. package/build/router.d.ts +152 -0
  1181. package/build/router.js +544 -0
  1182. package/build/router.js.map +1 -0
  1183. package/build/syPosition.d.ts +2 -2
  1184. package/build/syPosition.js +13 -7
  1185. package/build/syPosition.js.map +1 -1
  1186. package/build/tokenUtil.d.ts +3 -3
  1187. package/build/tokenUtil.js.map +1 -1
  1188. package/build/utils/index.d.ts +5 -5
  1189. package/build/utils/index.js +2 -2
  1190. package/build/utils/index.js.map +1 -1
  1191. package/build/utils/ix.d.ts +2 -2
  1192. package/build/vault.d.ts +111 -222
  1193. package/build/vault.js +228 -149
  1194. package/build/vault.js.map +1 -1
  1195. package/build/ytPosition.d.ts +29 -35
  1196. package/build/ytPosition.js +89 -67
  1197. package/build/ytPosition.js.map +1 -1
  1198. package/package.json +59 -24
  1199. package/src/CodamaEventDecoder.ts +151 -0
  1200. package/src/addressLookupTableUtil.ts +85 -10
  1201. package/src/client/clmm/accounts/lpPosition.ts +143 -0
  1202. package/src/client/clmm/accounts/marketThree.ts +274 -0
  1203. package/src/client/clmm/accounts/vault.ts +234 -0
  1204. package/src/client/clmm/eventRegistry.ts +92 -0
  1205. package/src/client/clmm/index.ts +82 -0
  1206. package/src/client/clmm/instructions/addFarm.ts +57 -0
  1207. package/src/client/clmm/instructions/addLiquidity.ts +78 -0
  1208. package/src/client/clmm/instructions/addMarketEmission.ts +50 -0
  1209. package/src/client/clmm/instructions/buyPt.ts +73 -0
  1210. package/src/client/clmm/instructions/buyYt.ts +80 -0
  1211. package/src/client/clmm/instructions/claimFarmEmission.ts +56 -0
  1212. package/src/client/clmm/instructions/closeMarket.ts +47 -0
  1213. package/src/client/clmm/instructions/depositLiquidity.ts +71 -0
  1214. package/src/client/clmm/instructions/initializeMarket.ts +127 -0
  1215. package/src/client/clmm/instructions/marketAccrueEmission.ts +39 -0
  1216. package/src/client/clmm/instructions/marketCollectEmission.ts +57 -0
  1217. package/src/client/clmm/instructions/modifyFarm.ts +55 -0
  1218. package/src/client/clmm/instructions/modifyMarketSetting.ts +45 -0
  1219. package/src/client/clmm/instructions/sellPt.ts +73 -0
  1220. package/src/client/clmm/instructions/sellYt.ts +80 -0
  1221. package/src/client/clmm/instructions/tradePt.ts +73 -0
  1222. package/src/client/clmm/instructions/tradePtExactOut.ts +75 -0
  1223. package/src/client/clmm/instructions/withdrawLiquidity.ts +67 -0
  1224. package/src/client/clmm/instructions/wrapperBuyYt.ts +85 -0
  1225. package/src/client/clmm/instructions/wrapperProvideLiquidity.ts +100 -0
  1226. package/src/client/clmm/instructions/wrapperProvideLiquidityBase.ts +98 -0
  1227. package/src/client/clmm/instructions/wrapperProvideLiquidityClassic.ts +86 -0
  1228. package/src/client/clmm/instructions/wrapperSellYt.ts +83 -0
  1229. package/src/client/clmm/instructions/wrapperWithdrawLiquidity.ts +75 -0
  1230. package/src/client/clmm/instructions/wrapperWithdrawLiquidityClassic.ts +69 -0
  1231. package/src/client/clmm/types/addFarmEvent.ts +51 -0
  1232. package/src/client/clmm/types/amount.ts +51 -0
  1233. package/src/client/clmm/types/buyPtEvent.ts +36 -0
  1234. package/src/client/clmm/types/buyYtEvent.ts +74 -0
  1235. package/src/client/clmm/types/claimFarmEmissionsEvent.ts +94 -0
  1236. package/src/client/clmm/types/claimLimits.ts +15 -0
  1237. package/src/client/clmm/types/closeMarketEvent.ts +36 -0
  1238. package/src/client/clmm/types/configurationOptions.ts +29 -0
  1239. package/src/client/clmm/types/cpiAccounts.ts +21 -0
  1240. package/src/client/clmm/types/cpiCoreAccounts.ts +15 -0
  1241. package/src/client/clmm/types/cpiInterfaceContext.ts +13 -0
  1242. package/src/client/clmm/types/crossingSplit.ts +40 -0
  1243. package/src/client/clmm/types/depositLiquidityEvent.ts +93 -0
  1244. package/src/client/clmm/types/depositLiquidityReturnData.ts +81 -0
  1245. package/src/client/clmm/types/emissionInfo.ts +44 -0
  1246. package/src/client/clmm/types/farmEmission.ts +31 -0
  1247. package/src/client/clmm/types/index.ts +48 -0
  1248. package/src/client/clmm/types/liquidityNetBalanceLimits.ts +22 -0
  1249. package/src/client/clmm/types/lpFarm.ts +12 -0
  1250. package/src/client/clmm/types/marketAccrueEmissionEvent.ts +69 -0
  1251. package/src/client/clmm/types/marketAdminAction.ts +239 -0
  1252. package/src/client/clmm/types/marketCollectEmissionEvent.ts +83 -0
  1253. package/src/client/clmm/types/marketEmission.ts +28 -0
  1254. package/src/client/clmm/types/marketEmissions.ts +10 -0
  1255. package/src/client/clmm/types/marketFinancials.ts +17 -0
  1256. package/src/client/clmm/types/marketThreeInitEvent.ts +92 -0
  1257. package/src/client/clmm/types/mergeEvent.ts +118 -0
  1258. package/src/client/clmm/types/modifiedTick.ts +13 -0
  1259. package/src/client/clmm/types/modifiedTicks.ts +18 -0
  1260. package/src/client/clmm/types/modifyFarmEvent.ts +56 -0
  1261. package/src/client/clmm/types/number.ts +7 -0
  1262. package/src/client/clmm/types/personalYieldTracker.ts +12 -0
  1263. package/src/client/clmm/types/personalYieldTrackers.ts +13 -0
  1264. package/src/client/clmm/types/principalShare.ts +22 -0
  1265. package/src/client/clmm/types/principalShareTrackers.ts +10 -0
  1266. package/src/client/clmm/types/sellPtEvent.ts +36 -0
  1267. package/src/client/clmm/types/sellYtEvent.ts +69 -0
  1268. package/src/client/clmm/types/stripEvent.ts +124 -0
  1269. package/src/client/clmm/types/swapDirection.ts +8 -0
  1270. package/src/client/clmm/types/tradePtEvent.ts +76 -0
  1271. package/src/client/clmm/types/withdrawLiquidityEvent.ts +99 -0
  1272. package/src/client/clmm/types/withdrawLiquidityReturnData.ts +27 -0
  1273. package/src/client/clmm/types/wrapperBuyYtEvent.ts +36 -0
  1274. package/src/client/clmm/types/wrapperProvideLiquidityBaseEvent.ts +60 -0
  1275. package/src/client/clmm/types/wrapperProvideLiquidityClassicEvent.ts +58 -0
  1276. package/src/client/clmm/types/wrapperProvideLiquidityEvent.ts +60 -0
  1277. package/src/client/clmm/types/wrapperSellYtEvent.ts +36 -0
  1278. package/src/client/clmm/types/wrapperWithdrawLiquidityClassicEvent.ts +62 -0
  1279. package/src/client/clmm/types/wrapperWithdrawLiquidityEvent.ts +62 -0
  1280. package/src/client/core/accounts/admin.ts +112 -0
  1281. package/src/client/core/accounts/lpPosition.ts +122 -0
  1282. package/src/client/core/accounts/marketTwo.ts +234 -0
  1283. package/src/client/core/accounts/vault.ts +234 -0
  1284. package/src/client/core/accounts/yieldTokenPosition.ts +126 -0
  1285. package/src/client/core/eventRegistry.ts +134 -0
  1286. package/src/client/core/index.ts +113 -0
  1287. package/src/client/core/instructions/addEmission.ts +62 -0
  1288. package/src/client/core/instructions/addFarm.ts +53 -0
  1289. package/src/client/core/instructions/addLpTokensMetadata.ts +62 -0
  1290. package/src/client/core/instructions/addMarketEmission.ts +52 -0
  1291. package/src/client/core/instructions/buyYt.ts +79 -0
  1292. package/src/client/core/instructions/claimFarmEmissions.ts +54 -0
  1293. package/src/client/core/instructions/collectEmission.ts +66 -0
  1294. package/src/client/core/instructions/collectInterest.ts +64 -0
  1295. package/src/client/core/instructions/collectTreasuryEmission.ts +64 -0
  1296. package/src/client/core/instructions/collectTreasuryInterest.ts +62 -0
  1297. package/src/client/core/instructions/depositYt.ts +59 -0
  1298. package/src/client/core/instructions/initLpPosition.ts +35 -0
  1299. package/src/client/core/instructions/initMarketTwo.ts +103 -0
  1300. package/src/client/core/instructions/initializeVault.ts +107 -0
  1301. package/src/client/core/instructions/initializeYieldPosition.ts +33 -0
  1302. package/src/client/core/instructions/marketCollectEmission.ts +55 -0
  1303. package/src/client/core/instructions/marketDepositLp.ts +59 -0
  1304. package/src/client/core/instructions/marketTwoDepositLiquidity.ts +65 -0
  1305. package/src/client/core/instructions/marketTwoWithdrawLiquidity.ts +65 -0
  1306. package/src/client/core/instructions/marketWithdrawLp.ts +59 -0
  1307. package/src/client/core/instructions/merge.ts +61 -0
  1308. package/src/client/core/instructions/modifyFarm.ts +51 -0
  1309. package/src/client/core/instructions/modifyMarketSetting.ts +47 -0
  1310. package/src/client/core/instructions/modifyVaultSetting.ts +44 -0
  1311. package/src/client/core/instructions/reallocMarket.ts +45 -0
  1312. package/src/client/core/instructions/sellYt.ts +79 -0
  1313. package/src/client/core/instructions/stageYtYield.ts +39 -0
  1314. package/src/client/core/instructions/strip.ts +61 -0
  1315. package/src/client/core/instructions/tradePt.ts +59 -0
  1316. package/src/client/core/instructions/withdrawYt.ts +61 -0
  1317. package/src/client/core/instructions/wrapperBuyPt.ts +63 -0
  1318. package/src/client/core/instructions/wrapperBuyYt.ts +93 -0
  1319. package/src/client/core/instructions/wrapperCollectInterest.ts +63 -0
  1320. package/src/client/core/instructions/wrapperMerge.ts +77 -0
  1321. package/src/client/core/instructions/wrapperProvideLiquidity.ts +103 -0
  1322. package/src/client/core/instructions/wrapperProvideLiquidityBase.ts +81 -0
  1323. package/src/client/core/instructions/wrapperProvideLiquidityClassic.ts +77 -0
  1324. package/src/client/core/instructions/wrapperSellPt.ts +63 -0
  1325. package/src/client/core/instructions/wrapperSellYt.ts +87 -0
  1326. package/src/client/core/instructions/wrapperStrip.ts +81 -0
  1327. package/src/client/core/instructions/wrapperWithdrawLiquidity.ts +77 -0
  1328. package/src/client/core/instructions/wrapperWithdrawLiquidityClassic.ts +73 -0
  1329. package/src/client/core/types/adminAction.ts +255 -0
  1330. package/src/client/core/types/amount.ts +51 -0
  1331. package/src/client/core/types/buyPtEvent.ts +39 -0
  1332. package/src/client/core/types/buyYtEvent.ts +95 -0
  1333. package/src/client/core/types/claimFarmEmissionsEvent.ts +75 -0
  1334. package/src/client/core/types/claimFarmEmissionsEventV2.ts +83 -0
  1335. package/src/client/core/types/claimLimits.ts +15 -0
  1336. package/src/client/core/types/collectEmissionEvent.ts +51 -0
  1337. package/src/client/core/types/collectEmissionEventV2.ts +60 -0
  1338. package/src/client/core/types/collectInterestEvent.ts +48 -0
  1339. package/src/client/core/types/collectInterestEventV2.ts +57 -0
  1340. package/src/client/core/types/collectTreasuryEmissionKind.ts +8 -0
  1341. package/src/client/core/types/collectTreasuryInterestKind.ts +8 -0
  1342. package/src/client/core/types/cpiAccounts.ts +21 -0
  1343. package/src/client/core/types/cpiInterfaceContext.ts +13 -0
  1344. package/src/client/core/types/depositLiquidityEvent.ts +101 -0
  1345. package/src/client/core/types/depositLpEvent.ts +75 -0
  1346. package/src/client/core/types/depositLpEventV2.ts +83 -0
  1347. package/src/client/core/types/depositYtEvent.ts +82 -0
  1348. package/src/client/core/types/depositYtEventV2.ts +91 -0
  1349. package/src/client/core/types/emissionInfo.ts +44 -0
  1350. package/src/client/core/types/farmEmission.ts +31 -0
  1351. package/src/client/core/types/index.ts +60 -0
  1352. package/src/client/core/types/initLpPositionEvent.ts +57 -0
  1353. package/src/client/core/types/initializeYieldPositionEvent.ts +43 -0
  1354. package/src/client/core/types/liquidityNetBalanceLimits.ts +22 -0
  1355. package/src/client/core/types/lpFarm.ts +12 -0
  1356. package/src/client/core/types/marketAdminAction.ts +212 -0
  1357. package/src/client/core/types/marketCollectEmissionEvent.ts +67 -0
  1358. package/src/client/core/types/marketCollectEmissionEventV2.ts +75 -0
  1359. package/src/client/core/types/marketEmission.ts +28 -0
  1360. package/src/client/core/types/marketEmissions.ts +10 -0
  1361. package/src/client/core/types/marketFinancials.ts +19 -0
  1362. package/src/client/core/types/mergeEvent.ts +118 -0
  1363. package/src/client/core/types/number.ts +7 -0
  1364. package/src/client/core/types/personalYieldTracker.ts +12 -0
  1365. package/src/client/core/types/personalYieldTrackers.ts +13 -0
  1366. package/src/client/core/types/principleDetails.ts +25 -0
  1367. package/src/client/core/types/principles.ts +23 -0
  1368. package/src/client/core/types/sellPtEvent.ts +39 -0
  1369. package/src/client/core/types/sellYtEvent.ts +90 -0
  1370. package/src/client/core/types/stageYieldEvent.ts +63 -0
  1371. package/src/client/core/types/stageYieldEventV2.ts +69 -0
  1372. package/src/client/core/types/stripEvent.ts +124 -0
  1373. package/src/client/core/types/tradePtEvent.ts +80 -0
  1374. package/src/client/core/types/withdrawLiquidityEvent.ts +97 -0
  1375. package/src/client/core/types/withdrawLpEvent.ts +75 -0
  1376. package/src/client/core/types/withdrawLpEventV2.ts +83 -0
  1377. package/src/client/core/types/withdrawYtEvent.ts +82 -0
  1378. package/src/client/core/types/withdrawYtEventV2.ts +91 -0
  1379. package/src/client/core/types/wrapperBuyYtEvent.ts +39 -0
  1380. package/src/client/core/types/wrapperCollectInterestEvent.ts +37 -0
  1381. package/src/client/core/types/wrapperMergeEvent.ts +38 -0
  1382. package/src/client/core/types/wrapperProvideLiquidityBaseEvent.ts +43 -0
  1383. package/src/client/core/types/wrapperProvideLiquidityClassicEvent.ts +41 -0
  1384. package/src/client/core/types/wrapperProvideLiquidityEvent.ts +41 -0
  1385. package/src/client/core/types/wrapperSellYtEvent.ts +39 -0
  1386. package/src/client/core/types/wrapperStripEvent.ts +38 -0
  1387. package/src/client/core/types/wrapperWithdrawLiquidityClassicEvent.ts +41 -0
  1388. package/src/client/core/types/wrapperWithdrawLiquidityEvent.ts +39 -0
  1389. package/src/client/core/types/yieldTokenTracker.ts +12 -0
  1390. package/src/client/orderbook/accounts/cpiAccountsOrderbook.ts +101 -0
  1391. package/src/client/orderbook/accounts/vault.ts +234 -0
  1392. package/src/client/orderbook/eventRegistry.ts +71 -0
  1393. package/src/client/orderbook/index.ts +55 -0
  1394. package/src/client/orderbook/instructions/collectAdminEmission.ts +48 -0
  1395. package/src/client/orderbook/instructions/collectAdminFee.ts +59 -0
  1396. package/src/client/orderbook/instructions/collectInterest.ts +66 -0
  1397. package/src/client/orderbook/instructions/initializeOrderbook.ts +104 -0
  1398. package/src/client/orderbook/instructions/marketOffer.ts +89 -0
  1399. package/src/client/orderbook/instructions/postOffer.ts +96 -0
  1400. package/src/client/orderbook/instructions/reallocOrderbookAccount.ts +45 -0
  1401. package/src/client/orderbook/instructions/removeExpiredOffers.ts +37 -0
  1402. package/src/client/orderbook/instructions/removeOffer.ts +73 -0
  1403. package/src/client/orderbook/instructions/setConfigurationOptions.ts +43 -0
  1404. package/src/client/orderbook/instructions/withdrawFunds.ts +78 -0
  1405. package/src/client/orderbook/instructions/wrapperCollectAdminFee.ts +73 -0
  1406. package/src/client/orderbook/instructions/wrapperCollectInterest.ts +65 -0
  1407. package/src/client/orderbook/instructions/wrapperMarketOffer.ts +94 -0
  1408. package/src/client/orderbook/instructions/wrapperPostOffer.ts +99 -0
  1409. package/src/client/orderbook/instructions/wrapperRemoveOffer.ts +75 -0
  1410. package/src/client/orderbook/instructions/wrapperWithdrawFunds.ts +80 -0
  1411. package/src/client/orderbook/types/amount.ts +51 -0
  1412. package/src/client/orderbook/types/claimLimits.ts +15 -0
  1413. package/src/client/orderbook/types/collectAdminEmissionEvent.ts +39 -0
  1414. package/src/client/orderbook/types/collectAdminFeeEvent.ts +17 -0
  1415. package/src/client/orderbook/types/collectEmissionEventV2.ts +60 -0
  1416. package/src/client/orderbook/types/collectInterestEventV2.ts +57 -0
  1417. package/src/client/orderbook/types/collectUserInterestEvent.ts +36 -0
  1418. package/src/client/orderbook/types/cpiAccounts.ts +21 -0
  1419. package/src/client/orderbook/types/cpiInterfaceContext.ts +13 -0
  1420. package/src/client/orderbook/types/emissionInfo.ts +44 -0
  1421. package/src/client/orderbook/types/exponentCoreCpiAccounts.ts +21 -0
  1422. package/src/client/orderbook/types/filledOffersEvent.ts +19 -0
  1423. package/src/client/orderbook/types/index.ts +30 -0
  1424. package/src/client/orderbook/types/marketOfferEvent.ts +72 -0
  1425. package/src/client/orderbook/types/mergeEvent.ts +118 -0
  1426. package/src/client/orderbook/types/number.ts +7 -0
  1427. package/src/client/orderbook/types/offerOptions.ts +56 -0
  1428. package/src/client/orderbook/types/offerType.ts +8 -0
  1429. package/src/client/orderbook/types/orderbookInitEvent.ts +54 -0
  1430. package/src/client/orderbook/types/postOfferEvent.ts +78 -0
  1431. package/src/client/orderbook/types/removeOfferEvent.ts +67 -0
  1432. package/src/client/orderbook/types/setConfigurationOptionsEnum.ts +116 -0
  1433. package/src/client/orderbook/types/stripEvent.ts +124 -0
  1434. package/src/client/orderbook/types/withdrawFundsEvent.ts +65 -0
  1435. package/src/client/orderbook/types/wrapperCollectAdminFeeEvent.ts +13 -0
  1436. package/src/client/orderbook/types/wrapperCollectInterestEvent.ts +25 -0
  1437. package/src/client/orderbook/types/wrapperMarketOfferEvent.ts +27 -0
  1438. package/src/client/orderbook/types/wrapperPostOfferEvent.ts +72 -0
  1439. package/src/client/orderbook/types/wrapperRemoveOfferEvent.ts +25 -0
  1440. package/src/client/orderbook/types/wrapperWithdrawFundsEvent.ts +38 -0
  1441. package/src/client/orderbook/types/yieldTokenTracker.ts +12 -0
  1442. package/src/client/vaults/accounts/actionProposal.ts +144 -0
  1443. package/src/client/vaults/accounts/exponentStrategyVault.ts +211 -0
  1444. package/src/client/vaults/accounts/programConfig.ts +123 -0
  1445. package/src/client/vaults/accounts/voteAccount.ts +132 -0
  1446. package/src/client/vaults/accounts/withdrawalAccount.ts +132 -0
  1447. package/src/client/vaults/eventRegistry.ts +45 -0
  1448. package/src/client/vaults/index.ts +111 -0
  1449. package/src/client/vaults/instructions/activateProposal.ts +46 -0
  1450. package/src/client/vaults/instructions/addPolicy.ts +57 -0
  1451. package/src/client/vaults/instructions/appendProposalActions.ts +47 -0
  1452. package/src/client/vaults/instructions/cancelProposal.ts +28 -0
  1453. package/src/client/vaults/instructions/cancelWithdrawal.ts +34 -0
  1454. package/src/client/vaults/instructions/collectManagementFee.ts +32 -0
  1455. package/src/client/vaults/instructions/depositLiquidity.ts +62 -0
  1456. package/src/client/vaults/instructions/executeProposal.ts +36 -0
  1457. package/src/client/vaults/instructions/executeWithdrawal.ts +58 -0
  1458. package/src/client/vaults/instructions/executeWithdrawalFromReserves.ts +66 -0
  1459. package/src/client/vaults/instructions/fillWithdrawal.ts +59 -0
  1460. package/src/client/vaults/instructions/finalizeProposal.ts +28 -0
  1461. package/src/client/vaults/instructions/initProposal.ts +46 -0
  1462. package/src/client/vaults/instructions/initializePrices.ts +28 -0
  1463. package/src/client/vaults/instructions/initializeVault.ts +148 -0
  1464. package/src/client/vaults/instructions/makeSentienelManager.ts +28 -0
  1465. package/src/client/vaults/instructions/managePrices.ts +46 -0
  1466. package/src/client/vaults/instructions/manageVaultSettings.ts +48 -0
  1467. package/src/client/vaults/instructions/managerUpdatePosition.ts +45 -0
  1468. package/src/client/vaults/instructions/queueWithdrawal.ts +50 -0
  1469. package/src/client/vaults/instructions/removePolicy.ts +44 -0
  1470. package/src/client/vaults/instructions/sentinelSetVaultFlags.ts +44 -0
  1471. package/src/client/vaults/instructions/stakeVote.ts +57 -0
  1472. package/src/client/vaults/instructions/unstakeVote.ts +42 -0
  1473. package/src/client/vaults/instructions/updatePolicy.ts +59 -0
  1474. package/src/client/vaults/instructions/updatePolicyManager.ts +44 -0
  1475. package/src/client/vaults/instructions/updatePrice.ts +42 -0
  1476. package/src/client/vaults/instructions/validateInteractionHook.ts +60 -0
  1477. package/src/client/vaults/instructions/wrapperAddPolicy.ts +57 -0
  1478. package/src/client/vaults/instructions/wrapperExecuteWithdrawal.ts +76 -0
  1479. package/src/client/vaults/instructions/wrapperManageVaultSettings.ts +48 -0
  1480. package/src/client/vaults/instructions/wrapperManagerUpdatePosition.ts +45 -0
  1481. package/src/client/vaults/instructions/wrapperRemovePolicy.ts +44 -0
  1482. package/src/client/vaults/instructions/wrapperUpdatePolicy.ts +59 -0
  1483. package/src/client/vaults/types/accountConstraint.ts +35 -0
  1484. package/src/client/vaults/types/accountConstraintType.ts +93 -0
  1485. package/src/client/vaults/types/allowedSettingsChange.ts +136 -0
  1486. package/src/client/vaults/types/cancelProposalEvent.ts +47 -0
  1487. package/src/client/vaults/types/clmmPositionEntry.ts +37 -0
  1488. package/src/client/vaults/types/dataConstraint.ts +16 -0
  1489. package/src/client/vaults/types/dataOperator.ts +13 -0
  1490. package/src/client/vaults/types/dataValue.ts +119 -0
  1491. package/src/client/vaults/types/depositLiquidityEvent.ts +89 -0
  1492. package/src/client/vaults/types/executeProposalEvent.ts +47 -0
  1493. package/src/client/vaults/types/executeWithdrawalEvent.ts +12 -0
  1494. package/src/client/vaults/types/fillParam.ts +12 -0
  1495. package/src/client/vaults/types/finalizeProposalEvent.ts +51 -0
  1496. package/src/client/vaults/types/hook.ts +40 -0
  1497. package/src/client/vaults/types/hookCompiledInstruction.ts +20 -0
  1498. package/src/client/vaults/types/index.ts +66 -0
  1499. package/src/client/vaults/types/instructionConstraint.ts +33 -0
  1500. package/src/client/vaults/types/internalFundTransferPolicyCreationPayload.ts +35 -0
  1501. package/src/client/vaults/types/kaminoObligationEntry.ts +48 -0
  1502. package/src/client/vaults/types/limitedQuantityConstraints.ts +10 -0
  1503. package/src/client/vaults/types/limitedSpendingLimit.ts +35 -0
  1504. package/src/client/vaults/types/limitedTimeConstraints.ts +15 -0
  1505. package/src/client/vaults/types/loopscaleLoanEntry.ts +23 -0
  1506. package/src/client/vaults/types/loopscaleStrategyEntry.ts +23 -0
  1507. package/src/client/vaults/types/number.ts +8 -0
  1508. package/src/client/vaults/types/obligationType.ts +63 -0
  1509. package/src/client/vaults/types/orderbookEntry.ts +50 -0
  1510. package/src/client/vaults/types/periodV2.ts +76 -0
  1511. package/src/client/vaults/types/permissions.ts +8 -0
  1512. package/src/client/vaults/types/policyAction.ts +74 -0
  1513. package/src/client/vaults/types/policyConfig.ts +32 -0
  1514. package/src/client/vaults/types/policyCreationPayload.ts +147 -0
  1515. package/src/client/vaults/types/policyExpirationArgs.ts +67 -0
  1516. package/src/client/vaults/types/positionUpdate.ts +251 -0
  1517. package/src/client/vaults/types/priceId.ts +57 -0
  1518. package/src/client/vaults/types/priceType.ts +23 -0
  1519. package/src/client/vaults/types/programInteractionPolicyCreationPayload.ts +32 -0
  1520. package/src/client/vaults/types/proposalAction.ts +100 -0
  1521. package/src/client/vaults/types/proposalActionKind.ts +11 -0
  1522. package/src/client/vaults/types/proposalStatus.ts +13 -0
  1523. package/src/client/vaults/types/proposalVoteConfig.ts +36 -0
  1524. package/src/client/vaults/types/proposeActionEvent.ts +62 -0
  1525. package/src/client/vaults/types/quantityConstraints.ts +14 -0
  1526. package/src/client/vaults/types/reservePriceMapping.ts +26 -0
  1527. package/src/client/vaults/types/settingsChangePolicyCreationPayload.ts +14 -0
  1528. package/src/client/vaults/types/spendingLimitPolicyCreationPayload.ts +54 -0
  1529. package/src/client/vaults/types/stakeVoteEvent.ts +54 -0
  1530. package/src/client/vaults/types/strategyPosition.ts +161 -0
  1531. package/src/client/vaults/types/timeConstraints.ts +22 -0
  1532. package/src/client/vaults/types/tokenAccountBalance.ts +35 -0
  1533. package/src/client/vaults/types/tokenAccountEntry.ts +30 -0
  1534. package/src/client/vaults/types/tokenEntry.ts +48 -0
  1535. package/src/client/vaults/types/unstakeVoteEvent.ts +53 -0
  1536. package/src/client/vaults/types/updatePriceAction.ts +268 -0
  1537. package/src/client/vaults/types/updatePriceInput.ts +12 -0
  1538. package/src/client/vaults/types/usageState.ts +12 -0
  1539. package/src/client/vaults/types/vaultConfig.ts +38 -0
  1540. package/src/client/vaults/types/vaultFinancials.ts +40 -0
  1541. package/src/client/vaults/types/vaultFlagAction.ts +75 -0
  1542. package/src/client/vaults/types/vaultFlagsUpdatedEvent.ts +37 -0
  1543. package/src/client/vaults/types/vaultRoleKind.ts +11 -0
  1544. package/src/client/vaults/types/vaultRoles.ts +59 -0
  1545. package/src/client/vaults/types/vaultSettingsAction.ts +533 -0
  1546. package/src/client/vaults/types/voteChoice.ts +9 -0
  1547. package/src/client/vaults/types/withdrawalPeriodSettings.ts +83 -0
  1548. package/src/client/vaults/types/withdrawalTokenFill.ts +35 -0
  1549. package/src/client/vaults/types/yieldPositionEntry.ts +35 -0
  1550. package/src/clmm/codamaEvents.ts +34 -0
  1551. package/src/clmm/index.ts +1 -0
  1552. package/src/codamaEvents.ts +27 -0
  1553. package/src/environment.ts +15 -13
  1554. package/src/exponentVaults/aumCalculator.ts +1013 -0
  1555. package/src/exponentVaults/events.ts +15 -0
  1556. package/src/exponentVaults/index.ts +298 -0
  1557. package/src/exponentVaults/kamino-markets.ts +363 -0
  1558. package/src/exponentVaults/loopscale-client.ts +1373 -0
  1559. package/src/exponentVaults/policyBuilders.ts +1559 -0
  1560. package/src/exponentVaults/policyMatcher.ts +895 -0
  1561. package/src/exponentVaults/scope-refresh.ts +169 -0
  1562. package/src/exponentVaults/squadsVaultTxnResolver/constants.ts +59 -0
  1563. package/src/exponentVaults/squadsVaultTxnResolver/helpers.ts +355 -0
  1564. package/src/exponentVaults/squadsVaultTxnResolver/index.ts +16 -0
  1565. package/src/exponentVaults/squadsVaultTxnResolver/resolvers/exponent.ts +472 -0
  1566. package/src/exponentVaults/squadsVaultTxnResolver/resolvers/helpers.ts +33 -0
  1567. package/src/exponentVaults/squadsVaultTxnResolver/resolvers/index.ts +38 -0
  1568. package/src/exponentVaults/squadsVaultTxnResolver/resolvers/kamino.ts +83 -0
  1569. package/src/exponentVaults/squadsVaultTxnResolver/resolvers/loopscale.ts +94 -0
  1570. package/src/exponentVaults/squadsVaultTxnResolver/resolvers/titan.ts +41 -0
  1571. package/src/exponentVaults/squadsVaultTxnResolver/squadsVaultTxnResolver.ts +91 -0
  1572. package/src/exponentVaults/squadsVaultTxnResolver/types.ts +171 -0
  1573. package/src/exponentVaults/squadsVaultTxnResolver/utils.ts +3 -0
  1574. package/src/exponentVaults/syncTransaction.ts +495 -0
  1575. package/src/exponentVaults/titan-quote.ts +260 -0
  1576. package/src/exponentVaults/vault-interaction.ts +3479 -0
  1577. package/src/exponentVaults/vault.ts +2256 -0
  1578. package/src/exponentVaults/vaultTransactionBuilder.ts +785 -0
  1579. package/src/flavors.ts +192 -121
  1580. package/src/index.ts +19 -4
  1581. package/src/lpPosition.ts +17 -19
  1582. package/src/market.ts +532 -546
  1583. package/src/marketThree.test.ts +210 -0
  1584. package/src/marketThree.ts +2853 -0
  1585. package/src/orderbook/codamaEvents.ts +28 -0
  1586. package/src/orderbook/index.ts +13 -0
  1587. package/src/orderbook/math.ts +138 -0
  1588. package/src/orderbook/orderbook.ts +1354 -0
  1589. package/src/orderbook/types.ts +40 -0
  1590. package/src/orderbook/utils.ts +66 -0
  1591. package/src/router.ts +810 -0
  1592. package/src/syPosition.ts +19 -16
  1593. package/src/tokenUtil.ts +4 -4
  1594. package/src/utils/index.ts +6 -7
  1595. package/src/utils/ix.ts +2 -2
  1596. package/src/vault.ts +365 -372
  1597. package/src/ytPosition.ts +100 -122
  1598. package/tsconfig.json +9 -1
  1599. package/build/events.d.ts +0 -372
  1600. package/build/events.js +0 -252
  1601. package/build/events.js.map +0 -1
  1602. package/src/events.ts +0 -668
@@ -0,0 +1,1749 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || function (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.MarketThree = exports.SwapDirection = void 0;
30
+ const spl_token_1 = require("@solana/spl-token");
31
+ const bs58_1 = __importDefault(require("bs58"));
32
+ const decimal_js_1 = __importDefault(require("decimal.js"));
33
+ const exponent_clmm_pda_1 = require("@exponent-labs/exponent-clmm-pda");
34
+ const exponent_fetcher_1 = require("@exponent-labs/exponent-fetcher");
35
+ const exponent_pda_1 = require("@exponent-labs/exponent-pda");
36
+ const market_three_math_1 = require("@exponent-labs/market-three-math");
37
+ const addressLookupTableUtil_1 = require("./addressLookupTableUtil");
38
+ const flavors_1 = require("./flavors");
39
+ const syPosition_1 = require("./syPosition");
40
+ const utils_1 = require("./utils");
41
+ const vault_1 = require("./vault");
42
+ const web3_js_1 = require("@solana/web3.js");
43
+ const exponentClmm = __importStar(require("./client/clmm"));
44
+ const clmm_1 = require("./client/clmm");
45
+ const exponentCore = __importStar(require("./client/core"));
46
+ const SECONDS_PER_YEAR = 365 * 24 * 60 * 60;
47
+ var clmm_2 = require("./client/clmm");
48
+ Object.defineProperty(exports, "SwapDirection", { enumerable: true, get: function () { return clmm_2.SwapDirection; } });
49
+ /**
50
+ * CLMM (Concentrated Liquidity Market Maker) market client for the Exponent protocol.
51
+ *
52
+ * Provides instruction builders for trading PT/YT tokens, managing concentrated liquidity positions,
53
+ * and administering market settings. Each `ix*` method returns one or more Solana `TransactionInstruction`s
54
+ * ready to be included in a transaction.
55
+ *
56
+ * "Wrapper" methods (e.g. `ixWrapperBuyPt`) combine a base-asset mint/redeem step with the
57
+ * underlying trade so the caller can operate directly with the base asset rather than SY.
58
+ */
59
+ class MarketThree {
60
+ state;
61
+ selfAddress;
62
+ env;
63
+ connection;
64
+ xponPda;
65
+ pda;
66
+ constructor(state, selfAddress, env, connection) {
67
+ this.state = state;
68
+ this.selfAddress = selfAddress;
69
+ this.env = env;
70
+ this.connection = connection;
71
+ this.xponPda = new exponent_pda_1.ExponentPDA(env.coreProgramId);
72
+ this.pda = new exponent_clmm_pda_1.ExponentCLMMPDA();
73
+ }
74
+ /**
75
+ * Build the modify_market_setting instruction without loading the full market.
76
+ * Use this when the market's ALT is invalid/unset (e.g. repair flow) to avoid fetching the ALT.
77
+ */
78
+ static buildModifyMarketSettingIx(connection, marketAddress, { signer, adminAction }) {
79
+ return exponentClmm
80
+ .createModifyMarketSettingInstruction({
81
+ market: marketAddress,
82
+ signer,
83
+ systemProgram: web3_js_1.SystemProgram.programId,
84
+ }, { 'action': adminAction });
85
+ }
86
+ /**
87
+ * Load a MarketThree instance from on-chain state.
88
+ *
89
+ * Fetches the market account, its address lookup table, vault, and ticks data in parallel.
90
+ * Pre-loaded vault/ticks can be passed to avoid redundant fetches.
91
+ *
92
+ * @param env - Environment configuration (program IDs, cluster)
93
+ * @param connection - Solana RPC connection
94
+ * @param address - On-chain address of the market account
95
+ * @param vault - Optional pre-loaded vault (fetched automatically if omitted)
96
+ * @param ticks - Optional pre-loaded ticks data (fetched automatically if omitted)
97
+ * @param options - Optional load options (e.g. SY config overrides)
98
+ */
99
+ static async load(env, connection, address, vault, ticks, options = {}) {
100
+ const fetcher = new exponent_fetcher_1.ExponentFetcher({ connection });
101
+ const fetchedMarket = await fetcher.fetchMarketThree(address);
102
+ const [alt, loadedVault, loadedTicks] = await Promise.all([
103
+ (0, addressLookupTableUtil_1.fetchAddressLookupTable)(connection, fetchedMarket.addressLookupTable),
104
+ vault || vault_1.Vault.load(env, connection, fetchedMarket.vault, options),
105
+ ticks || fetcher.fetchMarketThreeTicks(fetchedMarket.ticks),
106
+ ]);
107
+ const cpiSyAccounts = (0, addressLookupTableUtil_1.makeCpiAccountMetaLists)(alt, fetchedMarket.cpiSyAccounts);
108
+ const cpiCoreAccounts = (0, addressLookupTableUtil_1.makeMarketCoreCpiAccountMetaLists)(alt, fetchedMarket.cpiCoreAccounts);
109
+ const flavor = (() => {
110
+ switch (loadedVault.flavor.flavor) {
111
+ case "marginfi":
112
+ return (0, flavors_1.makeFlavorMarginfiSync)(loadedVault.flavor);
113
+ case "kamino":
114
+ return (0, flavors_1.makeFlavorKaminoSync)(loadedVault.flavor);
115
+ case "jitoRestaking":
116
+ return (0, flavors_1.makeFlavorJitoRestakingSync)(loadedVault.flavor);
117
+ case "perena":
118
+ return (0, flavors_1.makeFlavorPerenaSync)(loadedVault.flavor);
119
+ case "generic":
120
+ return (0, flavors_1.makeFlavorGenericSync)(loadedVault.flavor, options.syConfig);
121
+ default:
122
+ throw new Error(`Unknown flavor: ${loadedVault.flavor}`);
123
+ }
124
+ })();
125
+ const syPosition = await (0, syPosition_1.makeSyPosition)(fetcher, flavor, fetchedMarket.syProgram, address);
126
+ //? Assuming that the owner is the same for both accounts feeAccounts
127
+ const treasuryFeeOwner = await MarketThree.fetchTreasuryFeeOwner(fetchedMarket.tokenFeeTreasuryPt, connection);
128
+ const state = {
129
+ ...fetchedMarket,
130
+ vault: loadedVault,
131
+ flavor,
132
+ ticks: loadedTicks,
133
+ syPosition,
134
+ cpiSyAccounts,
135
+ cpiCoreAccounts,
136
+ ticksAccount: fetchedMarket.ticks,
137
+ treasuryFeeOwner,
138
+ };
139
+ return new MarketThree(state, address, env, connection);
140
+ }
141
+ async reload(connection = this.connection) {
142
+ const market = await MarketThree.load(this.env, connection, this.selfAddress);
143
+ this.state = market.state;
144
+ return market;
145
+ }
146
+ get vault() {
147
+ return this.state.vault;
148
+ }
149
+ get flavor() {
150
+ return this.state.flavor;
151
+ }
152
+ get lpBalance() {
153
+ return this.state.financials.liquidityBalance;
154
+ }
155
+ get syBalance() {
156
+ return this.state.financials.syBalance;
157
+ }
158
+ get ptBalance() {
159
+ return this.state.financials.ptBalance;
160
+ }
161
+ get mintSy() {
162
+ return this.state.mintSy;
163
+ }
164
+ get mintPt() {
165
+ return this.state.mintPt;
166
+ }
167
+ get statusFlags() {
168
+ return this.state.statusFlags;
169
+ }
170
+ get mintYt() {
171
+ return this.state.mintYt;
172
+ }
173
+ get addressLookupTable() {
174
+ return this.state.addressLookupTable;
175
+ }
176
+ get syProgram() {
177
+ return this.state.syProgram;
178
+ }
179
+ get cpiSyAccounts() {
180
+ return this.state.cpiSyAccounts;
181
+ }
182
+ get cpiCoreAccounts() {
183
+ return this.state.cpiCoreAccounts;
184
+ }
185
+ get marketEmissions() {
186
+ return this.state.emissions;
187
+ }
188
+ get ticksKey() {
189
+ return this.state.ticksAccount;
190
+ }
191
+ get corePda() {
192
+ return new exponent_pda_1.ExponentPDA();
193
+ }
194
+ get coreEventAuthority() {
195
+ return (0, utils_1.emitEventAuthority)(exponentCore.EXPONENTCORE_PROGRAM_ID);
196
+ }
197
+ get emissions() {
198
+ if (this.flavor.flavor === "marginfi") {
199
+ return this.flavor.mfiSyState.account.emissions.map((e) => ({
200
+ escrowAccountAddress: e.escrowAccount,
201
+ mint: e.mint,
202
+ tokenProgramAddress: e.tokenProgram,
203
+ totalClaimed: BigInt(e.totalClaimedEmissions.toString()),
204
+ lastSeenTotalAccruedEmissions: BigInt(e.lastSeenTotalAccruedEmissions.toString()),
205
+ index: e.index,
206
+ }));
207
+ }
208
+ if (this.flavor.flavor === "kamino") {
209
+ return this.flavor.kaminoSyState.account.emissions.map((e) => ({
210
+ escrowAccountAddress: e.escrowAccount,
211
+ mint: e.mint,
212
+ tokenProgramAddress: e.tokenProgram,
213
+ totalClaimed: BigInt(e.totalClaimedEmissions.toString()),
214
+ lastSeenTotalAccruedEmissions: BigInt(e.lastSeenTotalAccruedEmissions.toString()),
215
+ index: e.index,
216
+ }));
217
+ }
218
+ if (this.flavor.flavor === "jitoRestaking") {
219
+ return this.flavor.jitoSyState.account.emissions.map((e) => ({
220
+ escrowAccountAddress: e.escrowAccount,
221
+ mint: e.mint,
222
+ tokenProgramAddress: e.tokenProgram,
223
+ totalClaimed: BigInt(e.totalClaimedEmissions.toString()),
224
+ lastSeenTotalAccruedEmissions: BigInt(e.lastSeenTotalAccruedEmissions.toString()),
225
+ index: e.index,
226
+ }));
227
+ }
228
+ if (this.flavor.flavor === "perena") {
229
+ return this.flavor.perenaSyState.account.emissions.map((e) => ({
230
+ escrowAccountAddress: e.escrowAccount,
231
+ mint: e.mint,
232
+ tokenProgramAddress: e.tokenProgram,
233
+ totalClaimed: BigInt(e.totalClaimedEmissions.toString()),
234
+ lastSeenTotalAccruedEmissions: BigInt(e.lastSeenTotalAccruedEmissions.toString()),
235
+ index: e.index,
236
+ }));
237
+ }
238
+ if (this.flavor.flavor === "generic") {
239
+ return this.flavor.genericSyState.account.emissions.map((e) => ({
240
+ escrowAccountAddress: e.escrowAccount,
241
+ mint: e.mint,
242
+ tokenProgramAddress: e.tokenProgram,
243
+ totalClaimed: BigInt(e.totalClaimedEmissions.toString()),
244
+ lastSeenTotalAccruedEmissions: BigInt(e.lastSeenTotalAccruedEmissions.toString()),
245
+ index: e.index,
246
+ }));
247
+ }
248
+ throw new Error("Unknown flavor");
249
+ }
250
+ /** Get the escrow token account addresses for the emissions, in order */
251
+ get emissionTokenAccounts() {
252
+ return this.emissions.map((e) => e.escrowAccountAddress);
253
+ }
254
+ /** Pass-through SY account owned by the market */
255
+ get tokenSyEscrow() {
256
+ return this.state.tokenSyEscrow;
257
+ }
258
+ /** Pass-through YT account owned by the market */
259
+ get tokenYtEscrow() {
260
+ return this.state.tokenYtEscrow;
261
+ }
262
+ /** SY account that holds treasury SY fees from PT trading */
263
+ get tokenFeeTreasurySy() {
264
+ return this.state.tokenFeeTreasurySy;
265
+ }
266
+ /** PT account that holds treasury PT fees from PT trading */
267
+ get tokenFeeTreasuryPt() {
268
+ return this.state.tokenFeeTreasuryPt;
269
+ }
270
+ /** Market liquidity for PT */
271
+ get tokenPtEscrow() {
272
+ return this.state.tokenPtEscrow;
273
+ }
274
+ get currentSyExchangeRate() {
275
+ return this.flavor.currentSyExchangeRate;
276
+ }
277
+ /** Special account for event emit self-cpi */
278
+ get eventAuthority() {
279
+ return (0, utils_1.emitEventAuthority)(exponentClmm.EXPONENTCLMM_PROGRAM_ID);
280
+ }
281
+ get secondsRemaining() {
282
+ const timeNow = Date.now() / 1000;
283
+ return Math.max(0, Math.round(Number(this.state.financials.expirationTs) - timeNow));
284
+ }
285
+ /** Annualize a rate given the number of seconds remaining until maturity */
286
+ static annualize(rate, secondsRemaining) {
287
+ return (rate * SECONDS_PER_YEAR) / secondsRemaining;
288
+ }
289
+ static annualizeApy(rate, secondsRemaining) {
290
+ return (1 + rate) ** (SECONDS_PER_YEAR / secondsRemaining) - 1;
291
+ }
292
+ /** The fee rate taken off of trade fees (typically around 20%) expressed as a BPS number */
293
+ get feeTreasuryBps() {
294
+ return this.state.configurationOptions.treasuryFeeBps;
295
+ }
296
+ /** The fee rate taken off of trade fees (typically around 20%) expressed as a rational number */
297
+ get feeTreasuryRate() {
298
+ return this.feeTreasuryBps / 10_000;
299
+ }
300
+ /** Get the owner of the treasury fee accounts: tokenFeeTreasuryPt & tokenFeeTreasurySy */
301
+ static async fetchTreasuryFeeOwner(tokenFeeTreasury, connection) {
302
+ const { owner } = await (0, spl_token_1.getAccount)(connection, tokenFeeTreasury);
303
+ return owner;
304
+ }
305
+ /** Deposit a pair of tokens as liquidity to the market
306
+ * Adds PT & SY from the `depositor` to the market
307
+ *
308
+ * Due to unforeseeable slippage, the PT & SY amounts intended are effectively the maximum amounts
309
+ * The minimum LP tokens to receive is specified by `minLpOut`
310
+ *
311
+ * The token accounts themselves are optional, and will be derived from the depositor's wallet if not provided
312
+ */
313
+ ixDepositLiquidity({ ptInIntent, syInIntent, depositor, lowerTickKey, upperTickKey, ptSrc: ptSrcParam, sySrc: sySrcParam, lpPosition: lpPositionParam, }) {
314
+ const sySrc = sySrcParam || (0, spl_token_1.getAssociatedTokenAddressSync)(this.mintSy, depositor, true, spl_token_1.TOKEN_PROGRAM_ID);
315
+ const ptSrc = ptSrcParam || (0, spl_token_1.getAssociatedTokenAddressSync)(this.mintPt, depositor, true, spl_token_1.TOKEN_PROGRAM_ID);
316
+ const lpPosition = lpPositionParam || web3_js_1.Keypair.generate();
317
+ const remainingAccounts = (0, utils_1.uniqueRemainingAccounts)([
318
+ ...this.cpiSyAccounts.depositSy,
319
+ ...this.cpiSyAccounts.getPositionState,
320
+ ]);
321
+ const ix = exponentClmm.createDepositLiquidityInstruction({
322
+ depositor,
323
+ market: this.selfAddress,
324
+ ticks: this.ticksKey,
325
+ lpPosition: lpPosition.publicKey,
326
+ tokenPtSrc: ptSrc,
327
+ tokenSySrc: sySrc,
328
+ tokenPtEscrow: this.tokenPtEscrow,
329
+ tokenSyEscrow: this.tokenSyEscrow,
330
+ addressLookupTable: this.addressLookupTable,
331
+ tokenProgram: spl_token_1.TOKEN_PROGRAM_ID,
332
+ syProgram: this.syProgram,
333
+ instructionsSysvar: web3_js_1.SYSVAR_INSTRUCTIONS_PUBKEY,
334
+ systemProgram: web3_js_1.SystemProgram.programId,
335
+ eventAuthority: this.eventAuthority,
336
+ program: exponentClmm.EXPONENTCLMM_PROGRAM_ID,
337
+ }, {
338
+ lowerTickKey: convertApyToApyBp(lowerTickKey),
339
+ upperTickKey: convertApyToApyBp(upperTickKey),
340
+ maxPtIn: ptInIntent,
341
+ maxSyIn: syInIntent,
342
+ });
343
+ ix.keys.push(...remainingAccounts);
344
+ return {
345
+ ix,
346
+ signers: lpPosition,
347
+ };
348
+ }
349
+ /**
350
+ * Redeem LP tokens for PT & SY (liquidity removal)
351
+ *
352
+ * The lpIn is exactly the amount of LP tokens to burn
353
+ * The minimum PT & SY out are specified by minPtOut & minSyOut
354
+ * The transaction may fail due to unforeseeable slippage on the redemption rate
355
+ *
356
+ * The token accounts themselves are optional, and will be derived from the withdrawer's wallet if not provided
357
+ */
358
+ ixWithdrawLiquidity({ lpIn, withdrawer, lpPosition, minPtOut, minSyOut, ptDst: ptDstParam, syDst: syDstParam, }) {
359
+ const ptDst = ptDstParam || (0, spl_token_1.getAssociatedTokenAddressSync)(this.mintPt, withdrawer, true, spl_token_1.TOKEN_PROGRAM_ID);
360
+ const syDst = syDstParam || (0, spl_token_1.getAssociatedTokenAddressSync)(this.mintSy, withdrawer, true, spl_token_1.TOKEN_PROGRAM_ID);
361
+ const ptDstAtaIx = (0, spl_token_1.createAssociatedTokenAccountIdempotentInstruction)(withdrawer, ptDst, withdrawer, this.mintPt);
362
+ const syDstAtaIx = (0, spl_token_1.createAssociatedTokenAccountIdempotentInstruction)(withdrawer, syDst, withdrawer, this.mintSy);
363
+ const remainingAccounts = (0, utils_1.uniqueRemainingAccounts)([
364
+ ...this.cpiSyAccounts.withdrawSy,
365
+ ...this.cpiSyAccounts.getPositionState,
366
+ ]);
367
+ const ix = exponentClmm.createWithdrawLiquidityInstruction({
368
+ owner: withdrawer,
369
+ market: this.selfAddress,
370
+ lpPosition,
371
+ ticks: this.ticksKey,
372
+ tokenPtDst: ptDst,
373
+ tokenSyDst: syDst,
374
+ tokenPtEscrow: this.tokenPtEscrow,
375
+ tokenSyEscrow: this.tokenSyEscrow,
376
+ addressLookupTable: this.addressLookupTable,
377
+ tokenProgram: spl_token_1.TOKEN_PROGRAM_ID,
378
+ syProgram: this.syProgram,
379
+ systemProgram: web3_js_1.SystemProgram.programId,
380
+ eventAuthority: this.eventAuthority,
381
+ program: exponentClmm.EXPONENTCLMM_PROGRAM_ID,
382
+ }, {
383
+ liquidityToRemove: lpIn,
384
+ minPtOut,
385
+ minSyOut,
386
+ });
387
+ ix.keys.push(...remainingAccounts);
388
+ return { ixs: [ix], setupIxs: [ptDstAtaIx, syDstAtaIx] };
389
+ }
390
+ /**
391
+ * Swap PT <-> SY on the CLMM.
392
+ *
393
+ * Low-level instruction — prefer {@link ixBuyPt} / {@link ixSellPt} for directional trades.
394
+ *
395
+ * @param trader - Wallet signing the transaction
396
+ * @param traderAmount - Amount of the input token
397
+ * @param outConstraint - Minimum output amount (slippage protection)
398
+ * @param swapDirection - `SwapDirection.SyToPt` or `SwapDirection.PtToSy`
399
+ * @param lnImpliedApyLimit - Optional price limit (ln implied APY)
400
+ */
401
+ ixTradePt({ trader, traderAmount, outConstraint, swapDirection, tokenPt: tokenPtParam, tokenSy: tokenSyParam, lnImpliedApyLimit, }) {
402
+ const tokenPt = tokenPtParam || (0, spl_token_1.getAssociatedTokenAddressSync)(this.mintPt, trader, true, spl_token_1.TOKEN_PROGRAM_ID);
403
+ const tokenSy = tokenSyParam || (0, spl_token_1.getAssociatedTokenAddressSync)(this.mintSy, trader, true, spl_token_1.TOKEN_PROGRAM_ID);
404
+ const tokenSyAtaIx = (0, spl_token_1.createAssociatedTokenAccountIdempotentInstruction)(trader, tokenSy, trader, this.mintSy);
405
+ const tokenPtAtaIx = (0, spl_token_1.createAssociatedTokenAccountIdempotentInstruction)(trader, tokenPt, trader, this.mintPt);
406
+ const remainingAccounts = (0, utils_1.uniqueRemainingAccounts)([
407
+ ...this.cpiSyAccounts.getSyState,
408
+ ...this.cpiSyAccounts.getPositionState,
409
+ ...this.cpiSyAccounts.depositSy,
410
+ ...this.cpiSyAccounts.withdrawSy,
411
+ ]);
412
+ const ix = exponentClmm.createTradePtInstruction({
413
+ trader,
414
+ market: this.selfAddress,
415
+ ticks: this.ticksKey,
416
+ tokenSyTrader: tokenSy,
417
+ tokenPtTrader: tokenPt,
418
+ tokenSyEscrow: this.tokenSyEscrow,
419
+ tokenPtEscrow: this.tokenPtEscrow,
420
+ addressLookupTable: this.addressLookupTable,
421
+ tokenProgram: spl_token_1.TOKEN_PROGRAM_ID,
422
+ syProgram: this.syProgram,
423
+ tokenFeeTreasurySy: this.tokenFeeTreasurySy,
424
+ tokenFeeTreasuryPt: this.tokenFeeTreasuryPt,
425
+ eventAuthority: this.eventAuthority,
426
+ program: exponentClmm.EXPONENTCLMM_PROGRAM_ID,
427
+ }, {
428
+ amountIn: traderAmount,
429
+ swapDirection,
430
+ amountOutConstraint: outConstraint || null,
431
+ priceSpotLimit: lnImpliedApyLimit ?? null,
432
+ });
433
+ ix.keys.push(...remainingAccounts);
434
+ return { ixs: [ix], setupIxs: [tokenPtAtaIx, tokenSyAtaIx] };
435
+ }
436
+ /**
437
+ * Swap PT <-> SY specifying the exact output amount.
438
+ *
439
+ * Inverse of {@link ixTradePt} — the caller specifies how much they want to *receive*
440
+ * rather than how much they want to *spend*.
441
+ *
442
+ * @param trader - Wallet signing the transaction
443
+ * @param amountOut - Exact amount of the output token to receive
444
+ * @param swapDirection - `SwapDirection.SyToPt` or `SwapDirection.PtToSy`
445
+ * @param amountInConstraint - Maximum input amount (slippage protection)
446
+ * @param lnImpliedApyLimit - Optional price limit (ln implied APY)
447
+ */
448
+ ixTradePtExactOut({ trader, amountOut, swapDirection, amountInConstraint, tokenPt: tokenPtParam, tokenSy: tokenSyParam, lnImpliedApyLimit, }) {
449
+ const tokenPt = tokenPtParam || (0, spl_token_1.getAssociatedTokenAddressSync)(this.mintPt, trader, true, spl_token_1.TOKEN_PROGRAM_ID);
450
+ const tokenSy = tokenSyParam || (0, spl_token_1.getAssociatedTokenAddressSync)(this.mintSy, trader, true, spl_token_1.TOKEN_PROGRAM_ID);
451
+ const tokenSyAtaIx = (0, spl_token_1.createAssociatedTokenAccountIdempotentInstruction)(trader, tokenSy, trader, this.mintSy);
452
+ const tokenPtAtaIx = (0, spl_token_1.createAssociatedTokenAccountIdempotentInstruction)(trader, tokenPt, trader, this.mintPt);
453
+ const remainingAccounts = (0, utils_1.uniqueRemainingAccounts)([
454
+ ...this.cpiSyAccounts.getSyState,
455
+ ...this.cpiSyAccounts.getPositionState,
456
+ ...this.cpiSyAccounts.depositSy,
457
+ ...this.cpiSyAccounts.withdrawSy,
458
+ ]);
459
+ const ix = exponentClmm.createTradePtExactOutInstruction({
460
+ trader,
461
+ market: this.selfAddress,
462
+ ticks: this.ticksKey,
463
+ tokenSyTrader: tokenSy,
464
+ tokenPtTrader: tokenPt,
465
+ tokenSyEscrow: this.tokenSyEscrow,
466
+ tokenPtEscrow: this.tokenPtEscrow,
467
+ addressLookupTable: this.addressLookupTable,
468
+ tokenProgram: spl_token_1.TOKEN_PROGRAM_ID,
469
+ syProgram: this.syProgram,
470
+ tokenFeeTreasurySy: this.tokenFeeTreasurySy,
471
+ tokenFeeTreasuryPt: this.tokenFeeTreasuryPt,
472
+ eventAuthority: this.eventAuthority,
473
+ program: exponentClmm.EXPONENTCLMM_PROGRAM_ID,
474
+ }, {
475
+ amountOut,
476
+ swapDirection,
477
+ amountInConstraint: amountInConstraint ?? null,
478
+ priceSpotLimit: lnImpliedApyLimit ?? null,
479
+ });
480
+ ix.keys.push(...remainingAccounts);
481
+ return { ixs: [ix], setupIxs: [tokenPtAtaIx, tokenSyAtaIx] };
482
+ }
483
+ /** Buy PT with SY
484
+ *
485
+ * The trader is the account that sends the SY
486
+ * The amountPt is the exact amount of PT the trader intends to buy
487
+ * The syConstraint is the maximum amount of SY the trader is willing to spend
488
+ *
489
+ * The token accounts themselves are optional, and will be derived from the trader's wallet if not provided
490
+ */
491
+ ixBuyPt({ trader, amountSy, outConstraint, tokenPt, tokenSy, lnImpliedApyLimit, }) {
492
+ return this.ixTradePt({
493
+ trader,
494
+ traderAmount: amountSy,
495
+ outConstraint: outConstraint,
496
+ swapDirection: clmm_1.SwapDirection.SyToPt,
497
+ tokenPt,
498
+ tokenSy,
499
+ lnImpliedApyLimit,
500
+ });
501
+ }
502
+ /**
503
+ * Sell PT for SY
504
+ * The trader is the account that sends the PT
505
+ * The amountPt is the exact amount of PT the trader intends to sell
506
+ * The minSyReceive is the minimum amount of SY the trader is willing to receive
507
+ *
508
+ * The token accounts themselves are optional, and will be derived from the trader's wallet if not provided
509
+ */
510
+ ixSellPt({ trader, amountPt, outConstraint, tokenPt, tokenSy, lnImpliedApyLimit, }) {
511
+ return this.ixTradePt({
512
+ trader,
513
+ traderAmount: amountPt,
514
+ outConstraint: outConstraint,
515
+ swapDirection: clmm_1.SwapDirection.PtToSy,
516
+ tokenPt,
517
+ tokenSy,
518
+ lnImpliedApyLimit,
519
+ });
520
+ }
521
+ /**
522
+ * Buy exact amount of PT with SY
523
+ *
524
+ * The trader specifies the exact amount of PT they want to receive
525
+ * The maxSyIn is the maximum amount of SY the trader is willing to spend
526
+ */
527
+ ixBuyPtExactOut({ trader, amountPt, maxSyIn, tokenPt, tokenSy, lnImpliedApyLimit, }) {
528
+ return this.ixTradePtExactOut({
529
+ trader,
530
+ amountOut: amountPt,
531
+ amountInConstraint: maxSyIn,
532
+ swapDirection: clmm_1.SwapDirection.SyToPt,
533
+ tokenPt,
534
+ tokenSy,
535
+ lnImpliedApyLimit,
536
+ });
537
+ }
538
+ /**
539
+ * Sell PT for exact amount of SY
540
+ *
541
+ * The trader specifies the exact amount of SY they want to receive
542
+ * The maxPtIn is the maximum amount of PT the trader is willing to spend
543
+ */
544
+ ixSellPtExactOut({ trader, amountSy, maxPtIn, tokenPt, tokenSy, lnImpliedApyLimit, }) {
545
+ return this.ixTradePtExactOut({
546
+ trader,
547
+ amountOut: amountSy,
548
+ amountInConstraint: maxPtIn,
549
+ swapDirection: clmm_1.SwapDirection.PtToSy,
550
+ tokenPt,
551
+ tokenSy,
552
+ lnImpliedApyLimit,
553
+ });
554
+ }
555
+ /** Buy YT with SY
556
+ *
557
+ * The trader is the account that sends the SY
558
+ *
559
+ * The ytOut is the exact amount of YT the trader intends to buy
560
+ *
561
+ * The maxSyIn is the maximum amount of SY the trader is willing to spend
562
+ *
563
+ * The token accounts themselves are optional, and will be derived from the trader's wallet if not provided
564
+ */
565
+ ixBuyYt({ trader, ytOut, maxSyIn, ytTrader: ytTraderParam, ptTrader: ptTraderParam, syTrader: syTraderParam, lnImpliedApyLimit, }) {
566
+ const syTrader = syTraderParam || (0, spl_token_1.getAssociatedTokenAddressSync)(this.mintSy, trader, true, spl_token_1.TOKEN_PROGRAM_ID);
567
+ const ptTrader = ptTraderParam || (0, spl_token_1.getAssociatedTokenAddressSync)(this.mintPt, trader, true, spl_token_1.TOKEN_PROGRAM_ID);
568
+ const ytTrader = ytTraderParam || (0, spl_token_1.getAssociatedTokenAddressSync)(this.mintYt, trader, true, spl_token_1.TOKEN_PROGRAM_ID);
569
+ const syTraderAtaIx = (0, spl_token_1.createAssociatedTokenAccountIdempotentInstruction)(trader, syTrader, trader, this.mintSy);
570
+ const ptTraderAtaIx = (0, spl_token_1.createAssociatedTokenAccountIdempotentInstruction)(trader, ptTrader, trader, this.mintPt);
571
+ const ytTraderAtaIx = (0, spl_token_1.createAssociatedTokenAccountIdempotentInstruction)(trader, ytTrader, trader, this.mintYt);
572
+ const stripAccounts = this.cpiCoreAccounts.stripSy;
573
+ const remainingAccounts = (0, utils_1.uniqueRemainingAccounts)([
574
+ ...this.cpiSyAccounts.getSyState,
575
+ ...this.cpiSyAccounts.withdrawSy,
576
+ ...this.cpiSyAccounts.depositSy,
577
+ ...stripAccounts,
578
+ ]);
579
+ const ix = exponentClmm.createBuyYtInstruction({
580
+ trader,
581
+ market: this.selfAddress,
582
+ ticks: this.ticksKey,
583
+ tokenSyTrader: syTrader,
584
+ tokenYtTrader: ytTrader,
585
+ tokenPtTrader: ptTrader,
586
+ tokenSyEscrow: this.tokenSyEscrow,
587
+ tokenPtEscrow: this.tokenPtEscrow,
588
+ tokenYtEscrow: this.tokenYtEscrow,
589
+ tokenFeeTreasurySy: this.tokenFeeTreasurySy,
590
+ tokenFeeTreasuryPt: this.tokenFeeTreasuryPt,
591
+ tokenProgram: spl_token_1.TOKEN_PROGRAM_ID,
592
+ addressLookupTable: this.addressLookupTable,
593
+ syProgram: this.syProgram,
594
+ exponentCoreProgram: exponentCore.EXPONENTCORE_PROGRAM_ID,
595
+ eventAuthority: this.eventAuthority,
596
+ program: exponentClmm.EXPONENTCLMM_PROGRAM_ID,
597
+ }, {
598
+ syIn: maxSyIn,
599
+ minYtOut: ytOut,
600
+ priceSpotLimit: lnImpliedApyLimit ?? null,
601
+ });
602
+ ix.keys.push(...remainingAccounts);
603
+ return { ixs: [ix], setupIxs: [syTraderAtaIx, ptTraderAtaIx, ytTraderAtaIx] };
604
+ }
605
+ /** Sell YT for SY
606
+ *
607
+ * The trader is the account that sends the YT
608
+ *
609
+ * The amountYt is the exact amount of YT the trader intends to sell
610
+ *
611
+ * The minSyOut is the minimum amount of SY the trader is willing to receive
612
+ *
613
+ * The token accounts themselves are optional, and will be derived from the trader's wallet if not provided
614
+ */
615
+ ixSellYt({ trader, ytIn, minSyOut, ytSrc: ytSrcParam, ptSrc: ptSrcParam, syDst: syDstParam, lnImpliedApyLimit, }) {
616
+ const syDst = syDstParam || (0, spl_token_1.getAssociatedTokenAddressSync)(this.mintSy, trader, true, spl_token_1.TOKEN_PROGRAM_ID);
617
+ const ptSrc = ptSrcParam || (0, spl_token_1.getAssociatedTokenAddressSync)(this.mintPt, trader, true, spl_token_1.TOKEN_PROGRAM_ID);
618
+ const ytSrc = ytSrcParam || (0, spl_token_1.getAssociatedTokenAddressSync)(this.mintYt, trader, true, spl_token_1.TOKEN_PROGRAM_ID);
619
+ const syDstAtaIxs = (0, spl_token_1.createAssociatedTokenAccountIdempotentInstruction)(trader, syDst, trader, this.mintSy);
620
+ const ptSrcAtaIxs = (0, spl_token_1.createAssociatedTokenAccountIdempotentInstruction)(trader, ptSrc, trader, this.mintPt);
621
+ const ytSrcAtaIxs = (0, spl_token_1.createAssociatedTokenAccountIdempotentInstruction)(trader, ytSrc, trader, this.mintYt);
622
+ const mergeAccounts = this.cpiCoreAccounts.mergeSy;
623
+ const remainingAccounts = (0, utils_1.uniqueRemainingAccounts)([
624
+ ...this.cpiSyAccounts.getSyState,
625
+ ...this.cpiSyAccounts.getPositionState,
626
+ ...this.cpiSyAccounts.depositSy,
627
+ ...mergeAccounts,
628
+ ]);
629
+ const ix = exponentClmm.createSellYtInstruction({
630
+ trader,
631
+ market: this.selfAddress,
632
+ ticks: this.ticksKey,
633
+ tokenYtTrader: ytSrc,
634
+ tokenPtTrader: ptSrc,
635
+ tokenSyTrader: syDst,
636
+ tokenSyEscrow: this.tokenSyEscrow,
637
+ tokenPtEscrow: this.tokenPtEscrow,
638
+ tokenYtEscrow: this.tokenYtEscrow,
639
+ addressLookupTable: this.addressLookupTable,
640
+ tokenFeeTreasurySy: this.tokenFeeTreasurySy,
641
+ tokenFeeTreasuryPt: this.tokenFeeTreasuryPt,
642
+ tokenProgram: spl_token_1.TOKEN_PROGRAM_ID,
643
+ syProgram: this.syProgram,
644
+ exponentCoreProgram: exponentCore.EXPONENTCORE_PROGRAM_ID,
645
+ eventAuthority: this.eventAuthority,
646
+ program: exponentClmm.EXPONENTCLMM_PROGRAM_ID,
647
+ }, {
648
+ ytIn,
649
+ minSyOut,
650
+ priceSpotLimit: lnImpliedApyLimit ?? null,
651
+ });
652
+ ix.keys.push(...remainingAccounts);
653
+ return { ixs: [ix], setupIxs: [syDstAtaIxs, ptSrcAtaIxs, ytSrcAtaIxs] };
654
+ }
655
+ /** Apply an admin action to the market (e.g. change status, fees, tick spacing). */
656
+ ixModifyMarketSetting({ signer, adminAction }) {
657
+ return exponentClmm.createModifyMarketSettingInstruction({
658
+ market: this.selfAddress,
659
+ signer,
660
+ systemProgram: web3_js_1.SystemProgram.programId,
661
+ }, { action: adminAction });
662
+ }
663
+ /**
664
+ * Add a new farm to the market to distribute rewards to LP holders
665
+ *
666
+ * @param signer - The admin address that signs the transaction
667
+ * @param farmMint - The mint address of the farm reward token
668
+ * @param farmTokenProgram - The token program for the farm reward token
669
+ * @param emissionsRate - The rate of emissions per second (in token smallest units)
670
+ * @param untilTimestamp - Unix timestamp when the farm emissions should end
671
+ * @param farmTokenSrc - Optional source token account for the farm rewards (derived from signer if not provided)
672
+ * @param feePayer - Optional fee payer for account reallocation (defaults to signer)
673
+ */
674
+ ixAddFarm({ signer, farmMint, farmTokenProgram, emissionsRate, untilTimestamp, farmTokenSrc: farmTokenSrcParam, feePayer: feePayerParam, }) {
675
+ const feePayer = feePayerParam || signer;
676
+ const farmTokenEscrow = (0, spl_token_1.getAssociatedTokenAddressSync)(farmMint, this.selfAddress, true, farmTokenProgram);
677
+ const farmTokenSrc = farmTokenSrcParam || (0, spl_token_1.getAssociatedTokenAddressSync)(farmMint, signer, true, farmTokenProgram);
678
+ const farmTokenEscrowAtaIx = (0, spl_token_1.createAssociatedTokenAccountIdempotentInstruction)(feePayer, farmTokenEscrow, this.selfAddress, farmMint, farmTokenProgram);
679
+ const ix = exponentClmm.createAddFarmInstruction({
680
+ market: this.selfAddress,
681
+ ticks: this.ticksKey,
682
+ signer,
683
+ feePayer,
684
+ mintNew: farmMint,
685
+ tokenSource: farmTokenSrc,
686
+ tokenFarm: farmTokenEscrow,
687
+ tokenProgram: farmTokenProgram,
688
+ systemProgram: web3_js_1.SystemProgram.programId,
689
+ eventAuthority: this.eventAuthority,
690
+ program: exponentClmm.EXPONENTCLMM_PROGRAM_ID,
691
+ }, {
692
+ tokenRate: emissionsRate,
693
+ untilTimestamp,
694
+ });
695
+ return {
696
+ ixs: [ix],
697
+ setupIxs: [farmTokenEscrowAtaIx],
698
+ };
699
+ }
700
+ /**
701
+ * Modify an existing farm's emissions rate and/or expiration timestamp
702
+ *
703
+ * If the new parameters require more tokens than previously undistributed,
704
+ * additional tokens will be transferred from the signer's token account.
705
+ * If fewer tokens are needed, the surplus will be returned to the signer.
706
+ *
707
+ * @param signer - The admin address that signs the transaction
708
+ * @param farmMint - The mint address of the farm reward token
709
+ * @param farmTokenProgram - The token program for the farm reward token
710
+ * @param newRate - The new rate of emissions per second (in token smallest units)
711
+ * @param untilTimestamp - New unix timestamp when the farm emissions should end
712
+ * @param farmTokenSrc - Optional source/destination token account (derived from signer if not provided)
713
+ */
714
+ ixModifyFarm({ signer, farmMint, farmTokenProgram, newRate, untilTimestamp, farmTokenSrc: farmTokenSrcParam, }) {
715
+ const farmTokenEscrow = (0, spl_token_1.getAssociatedTokenAddressSync)(farmMint, this.selfAddress, true, farmTokenProgram);
716
+ const farmTokenSrc = farmTokenSrcParam || (0, spl_token_1.getAssociatedTokenAddressSync)(farmMint, signer, true, farmTokenProgram);
717
+ const ix = exponentClmm.createModifyFarmInstruction({
718
+ market: this.selfAddress,
719
+ ticks: this.ticksKey,
720
+ signer,
721
+ mint: farmMint,
722
+ tokenSource: farmTokenSrc,
723
+ tokenFarm: farmTokenEscrow,
724
+ tokenProgram: farmTokenProgram,
725
+ eventAuthority: this.eventAuthority,
726
+ program: exponentClmm.EXPONENTCLMM_PROGRAM_ID,
727
+ }, {
728
+ newExpirationTimestamp: untilTimestamp,
729
+ newRate,
730
+ });
731
+ return {
732
+ ixs: [ix],
733
+ };
734
+ }
735
+ /**
736
+ * Buy PT directly from the base asset (e.g. SOL, USDC).
737
+ *
738
+ * Wraps a mint-SY step (via the flavor) with a buy-PT swap in a single instruction.
739
+ * The program mints SY from the base asset, then swaps SY -> PT on the CLMM.
740
+ *
741
+ * @param owner - Wallet signing the transaction
742
+ * @param baseIn - Amount of base asset to spend
743
+ * @param minPtOut - Minimum PT to receive (slippage protection)
744
+ * @param lnImpliedApyLimit - Optional price limit (ln implied APY)
745
+ */
746
+ async ixWrapperBuyPt({ owner, minPtOut, baseIn, tokenSyTrader: tokenSyTraderParam, tokenPtTrader: tokenPtTraderParam, tokenBaseTrader: tokenBaseTraderParam, lnImpliedApyLimit, }) {
747
+ const tokenSyTrader = tokenSyTraderParam || (0, spl_token_1.getAssociatedTokenAddressSync)(this.mintSy, owner, true, spl_token_1.TOKEN_PROGRAM_ID);
748
+ const tokenPtTrader = tokenPtTraderParam || (0, spl_token_1.getAssociatedTokenAddressSync)(this.mintPt, owner, true, spl_token_1.TOKEN_PROGRAM_ID);
749
+ const tokenBaseTrader = tokenBaseTraderParam ||
750
+ (0, spl_token_1.getAssociatedTokenAddressSync)(this.flavor.mintBase, owner, true, this.flavor.baseTokenProgram);
751
+ const tokenSyTraderAtaIx = (0, spl_token_1.createAssociatedTokenAccountIdempotentInstruction)(owner, tokenSyTrader, owner, this.mintSy);
752
+ const tokenPtTraderAtaIx = (0, spl_token_1.createAssociatedTokenAccountIdempotentInstruction)(owner, tokenPtTrader, owner, this.mintPt);
753
+ const tokenBaseTraderAtaIx = (0, spl_token_1.createAssociatedTokenAccountIdempotentInstruction)(owner, tokenBaseTrader, owner, this.flavor.mintBase);
754
+ const mintSyIx = await this.flavor.ixMintSy({
755
+ amountBase: "0",
756
+ depositor: owner,
757
+ depositorBaseTokenAccount: tokenBaseTrader,
758
+ depositorSyTokenAccount: tokenSyTrader,
759
+ });
760
+ const mintSyRemAccounts = mintSyIx.keys;
761
+ const remainingAccounts = (0, utils_1.uniqueRemainingAccounts)([
762
+ ...this.cpiSyAccounts.getSyState,
763
+ ...this.cpiSyAccounts.depositSy,
764
+ ...this.cpiSyAccounts.getPositionState,
765
+ ]);
766
+ const ix = exponentClmm.createBuyPtInstruction({
767
+ buyer: owner,
768
+ market: this.selfAddress,
769
+ tokenSyTrader,
770
+ tokenPtTrader,
771
+ tokenSyEscrow: this.tokenSyEscrow,
772
+ tokenPtEscrow: this.tokenPtEscrow,
773
+ addressLookupTable: this.addressLookupTable,
774
+ tokenProgram: spl_token_1.TOKEN_PROGRAM_ID,
775
+ syProgram: this.syProgram,
776
+ ticks: this.ticksKey,
777
+ tokenFeeTreasurySy: this.state.tokenFeeTreasurySy,
778
+ tokenFeeTreasuryPt: this.state.tokenFeeTreasuryPt,
779
+ eventAuthority: this.eventAuthority,
780
+ program: exponentClmm.EXPONENTCLMM_PROGRAM_ID,
781
+ }, {
782
+ minPtAmount: minPtOut,
783
+ baseAmount: baseIn,
784
+ priceSpotLimit: lnImpliedApyLimit ?? null,
785
+ mintSyRemAccountsUntil: mintSyRemAccounts.length,
786
+ });
787
+ ix.keys.push(...mintSyRemAccounts, ...remainingAccounts);
788
+ return {
789
+ ixs: [...(await this.flavor.preIxs({ signer: owner })), ix, ...(await this.flavor.postIxs({ signer: owner }))],
790
+ setupIxs: [tokenSyTraderAtaIx, tokenPtTraderAtaIx, tokenBaseTraderAtaIx],
791
+ };
792
+ }
793
+ /**
794
+ * Sell PT and receive the base asset (e.g. SOL, USDC).
795
+ *
796
+ * Wraps a PT -> SY swap with a redeem-SY step (via the flavor) in a single instruction.
797
+ * The program swaps PT -> SY on the CLMM, then redeems SY for the base asset.
798
+ *
799
+ * @param owner - Wallet signing the transaction
800
+ * @param amount - Amount of PT to sell
801
+ * @param minBaseOut - Minimum base asset to receive (slippage protection)
802
+ * @param lnImpliedApyLimit - Optional price limit (ln implied APY)
803
+ */
804
+ async ixWrapperSellPt({ owner, amount, minBaseOut, tokenSyTrader: tokenSyTraderParam, tokenPtTrader: tokenPtTraderParam, tokenBaseTrader: tokenBaseTraderParam, lnImpliedApyLimit, }) {
805
+ const tokenSyTrader = tokenSyTraderParam || (0, spl_token_1.getAssociatedTokenAddressSync)(this.mintSy, owner, true, spl_token_1.TOKEN_PROGRAM_ID);
806
+ const tokenPtTrader = tokenPtTraderParam || (0, spl_token_1.getAssociatedTokenAddressSync)(this.mintPt, owner, true, spl_token_1.TOKEN_PROGRAM_ID);
807
+ const tokenBaseTrader = tokenBaseTraderParam ||
808
+ (0, spl_token_1.getAssociatedTokenAddressSync)(this.flavor.mintBase, owner, true, this.flavor.baseTokenProgram);
809
+ const tokenSyTraderAtaIx = (0, spl_token_1.createAssociatedTokenAccountIdempotentInstruction)(owner, tokenSyTrader, owner, this.mintSy);
810
+ const tokenPtTraderAtaIx = (0, spl_token_1.createAssociatedTokenAccountIdempotentInstruction)(owner, tokenPtTrader, owner, this.mintPt);
811
+ const tokenBaseTraderAtaIx = (0, spl_token_1.createAssociatedTokenAccountIdempotentInstruction)(owner, tokenBaseTrader, owner, this.flavor.mintBase);
812
+ const redeemSyIx = await this.flavor.ixRedeemSy({
813
+ amountSy: "0",
814
+ redeemer: owner,
815
+ redeemerBaseTokenAccount: tokenBaseTrader,
816
+ redeemerSyTokenAccount: tokenSyTrader,
817
+ });
818
+ const redeemSyRemAccounts = redeemSyIx.keys;
819
+ const remainingAccounts = (0, utils_1.uniqueRemainingAccounts)([
820
+ ...this.cpiSyAccounts.getSyState,
821
+ ...this.cpiSyAccounts.getPositionState,
822
+ ...this.cpiSyAccounts.withdrawSy,
823
+ ]);
824
+ const ix = exponentClmm.createSellPtInstruction({
825
+ seller: owner,
826
+ market: this.selfAddress,
827
+ tokenSyTrader,
828
+ tokenPtTrader,
829
+ tokenSyEscrow: this.tokenSyEscrow,
830
+ tokenPtEscrow: this.tokenPtEscrow,
831
+ addressLookupTable: this.addressLookupTable,
832
+ tokenProgram: spl_token_1.TOKEN_PROGRAM_ID,
833
+ syProgram: this.syProgram,
834
+ tokenFeeTreasurySy: this.state.tokenFeeTreasurySy,
835
+ tokenFeeTreasuryPt: this.tokenFeeTreasuryPt,
836
+ ticks: this.ticksKey,
837
+ eventAuthority: this.eventAuthority,
838
+ program: exponentClmm.EXPONENTCLMM_PROGRAM_ID,
839
+ }, {
840
+ amountPt: amount,
841
+ minBaseAmount: minBaseOut,
842
+ priceSpotLimit: lnImpliedApyLimit ?? null,
843
+ redeemSyRemAccountsUntil: redeemSyRemAccounts.length,
844
+ });
845
+ ix.keys.push(...redeemSyRemAccounts, ...remainingAccounts);
846
+ return {
847
+ ixs: [...(await this.flavor.preIxs({ signer: owner })), ix, ...(await this.flavor.postIxs({ signer: owner }))],
848
+ setupIxs: [tokenSyTraderAtaIx, tokenPtTraderAtaIx, tokenBaseTraderAtaIx],
849
+ };
850
+ }
851
+ /**
852
+ * Buy YT directly from the base asset.
853
+ *
854
+ * Wraps a mint-SY step with a buy-YT swap. The program mints SY from the base asset,
855
+ * then strips SY into PT+YT and executes the trade.
856
+ *
857
+ * @param owner - Wallet signing the transaction
858
+ * @param ytOut - Amount of YT to buy
859
+ * @param maxBaseIn - Maximum base asset to spend (slippage protection)
860
+ */
861
+ async ixWrapperBuyYt({ owner, ytOut, maxBaseIn, tokenSyTrader: tokenSyTraderParam, tokenPtTrader: tokenPtTraderParam, tokenYtTrader: tokenYtTraderParam, tokenBaseTrader: tokenBaseTraderParam, }) {
862
+ const tokenSyTrader = tokenSyTraderParam || (0, spl_token_1.getAssociatedTokenAddressSync)(this.mintSy, owner, true, spl_token_1.TOKEN_PROGRAM_ID);
863
+ const tokenPtTrader = tokenPtTraderParam || (0, spl_token_1.getAssociatedTokenAddressSync)(this.mintPt, owner, true, spl_token_1.TOKEN_PROGRAM_ID);
864
+ const tokenYtTrader = tokenYtTraderParam || (0, spl_token_1.getAssociatedTokenAddressSync)(this.mintYt, owner, true, spl_token_1.TOKEN_PROGRAM_ID);
865
+ const tokenBaseTrader = tokenBaseTraderParam ||
866
+ (0, spl_token_1.getAssociatedTokenAddressSync)(this.flavor.mintBase, owner, true, this.flavor.baseTokenProgram);
867
+ const tokenSyTraderAtaIx = (0, spl_token_1.createAssociatedTokenAccountIdempotentInstruction)(owner, tokenSyTrader, owner, this.mintSy);
868
+ const tokenPtTraderAtaIx = (0, spl_token_1.createAssociatedTokenAccountIdempotentInstruction)(owner, tokenPtTrader, owner, this.mintPt);
869
+ const tokenYtTraderAtaIx = (0, spl_token_1.createAssociatedTokenAccountIdempotentInstruction)(owner, tokenYtTrader, owner, this.mintYt);
870
+ const mintSyIx = await this.flavor.ixMintSy({
871
+ amountBase: "0",
872
+ depositor: owner,
873
+ depositorBaseTokenAccount: tokenBaseTrader,
874
+ depositorSyTokenAccount: tokenSyTrader,
875
+ });
876
+ const depositYtAccounts = this.depositYtAccounts({
877
+ owner,
878
+ ytSrc: tokenYtTrader,
879
+ });
880
+ const mintSyRemAccounts = mintSyIx.keys;
881
+ const remainingAccounts = (0, utils_1.uniqueRemainingAccounts)([
882
+ ...this.cpiSyAccounts.getSyState,
883
+ ...this.cpiSyAccounts.getPositionState,
884
+ ...this.cpiSyAccounts.withdrawSy,
885
+ ...this.cpiCoreAccounts.stripSy,
886
+ ...this.cpiSyAccounts.getPositionState,
887
+ ]);
888
+ const depositYtAccounts_until = mintSyRemAccounts.length + depositYtAccounts.keys.length;
889
+ const allRemainingAccounts = mintSyRemAccounts.concat(depositYtAccounts.keys).concat(remainingAccounts);
890
+ const ix1 = exponentClmm.createWrapperBuyYtInstruction({
891
+ buyer: owner,
892
+ market: this.selfAddress,
893
+ tokenSyTrader,
894
+ tokenYtTrader,
895
+ tokenPtTrader,
896
+ tokenSyEscrow: this.tokenSyEscrow,
897
+ tokenPtEscrow: this.tokenPtEscrow,
898
+ tokenYtEscrow: this.tokenYtEscrow,
899
+ marketAddressLookupTable: this.addressLookupTable,
900
+ tokenProgram: spl_token_1.TOKEN_PROGRAM_ID,
901
+ syProgram: this.syProgram,
902
+ systemProgram: web3_js_1.SystemProgram.programId,
903
+ tokenFeeTreasurySy: this.state.tokenFeeTreasurySy,
904
+ tokenFeeTreasuryPt: this.tokenFeeTreasuryPt,
905
+ ticks: this.ticksKey,
906
+ exponentCoreProgram: exponentCore.EXPONENTCORE_PROGRAM_ID,
907
+ eventAuthority: this.eventAuthority,
908
+ program: exponentClmm.EXPONENTCLMM_PROGRAM_ID,
909
+ }, {
910
+ ytOut,
911
+ maxBaseAmount: maxBaseIn,
912
+ mintSyAccountsLength: mintSyRemAccounts.length,
913
+ depositYtAccountsUntil: depositYtAccounts_until,
914
+ });
915
+ ix1.keys.push(...allRemainingAccounts);
916
+ return {
917
+ ixs: [...(await this.flavor.preIxs({ signer: owner })), ix1],
918
+ setupIxs: [tokenSyTraderAtaIx, tokenPtTraderAtaIx, tokenYtTraderAtaIx],
919
+ };
920
+ }
921
+ /**
922
+ * Sell YT and receive the base asset.
923
+ *
924
+ * Wraps a YT -> SY swap with a redeem-SY step. The program merges YT+PT back into SY,
925
+ * executes the trade, then redeems SY for the base asset.
926
+ *
927
+ * @param owner - Wallet signing the transaction
928
+ * @param amount - Amount of YT to sell
929
+ * @param minBaseOut - Minimum base asset to receive (slippage protection)
930
+ */
931
+ async ixWrapperSellYt({ owner, amount, minBaseOut, tokenBaseTrader: tokenBaseTraderParam, tokenSyTrader: tokenSyTraderParam, tokenYtTrader: tokenYtTraderParam, tokenPtTrader: tokenPtTraderParam, }) {
932
+ const tokenBaseTrader = tokenBaseTraderParam ||
933
+ (0, spl_token_1.getAssociatedTokenAddressSync)(this.flavor.mintBase, owner, true, this.flavor.baseTokenProgram);
934
+ const tokenSyTrader = tokenSyTraderParam || (0, spl_token_1.getAssociatedTokenAddressSync)(this.mintSy, owner, true, spl_token_1.TOKEN_PROGRAM_ID);
935
+ const tokenYtTrader = tokenYtTraderParam || (0, spl_token_1.getAssociatedTokenAddressSync)(this.mintYt, owner, true, spl_token_1.TOKEN_PROGRAM_ID);
936
+ const tokenPtTrader = tokenPtTraderParam || (0, spl_token_1.getAssociatedTokenAddressSync)(this.mintPt, owner, true, spl_token_1.TOKEN_PROGRAM_ID);
937
+ const tokenSyTraderAtaIx = (0, spl_token_1.createAssociatedTokenAccountIdempotentInstruction)(owner, tokenSyTrader, owner, this.mintSy);
938
+ const tokenPtTraderAtaIx = (0, spl_token_1.createAssociatedTokenAccountIdempotentInstruction)(owner, tokenPtTrader, owner, this.mintPt);
939
+ const tokenYtTraderAtaIx = (0, spl_token_1.createAssociatedTokenAccountIdempotentInstruction)(owner, tokenYtTrader, owner, this.mintYt);
940
+ const tokenBaseTraderAtaIx = (0, spl_token_1.createAssociatedTokenAccountIdempotentInstruction)(owner, tokenBaseTrader, owner, this.flavor.mintBase);
941
+ const redeemSyIx = await this.flavor.ixRedeemSy({
942
+ amountSy: "0",
943
+ redeemer: owner,
944
+ redeemerBaseTokenAccount: tokenBaseTrader,
945
+ redeemerSyTokenAccount: tokenSyTrader,
946
+ });
947
+ const redeemSyRemAccounts = redeemSyIx.keys;
948
+ const withdrawYtAccounts = this.withdrawYtAccounts({
949
+ owner,
950
+ ytDst: tokenYtTrader,
951
+ });
952
+ const remainingAccounts = (0, utils_1.uniqueRemainingAccounts)([
953
+ ...this.cpiSyAccounts.getSyState,
954
+ ...this.cpiSyAccounts.getPositionState,
955
+ ...this.cpiCoreAccounts.mergeSy,
956
+ ...this.cpiSyAccounts.withdrawSy,
957
+ ...this.cpiSyAccounts.depositSy,
958
+ ]);
959
+ const withdrawYtAccountsUntil = redeemSyRemAccounts.length + withdrawYtAccounts.keys.length;
960
+ const ix1 = exponentClmm.createWrapperSellYtInstruction({
961
+ seller: owner,
962
+ market: this.selfAddress,
963
+ tokenSyTrader,
964
+ tokenYtTrader,
965
+ tokenPtTrader,
966
+ tokenSyEscrow: this.tokenSyEscrow,
967
+ tokenYtEscrow: this.tokenYtEscrow,
968
+ tokenPtEscrow: this.tokenPtEscrow,
969
+ marketAddressLookupTable: this.addressLookupTable,
970
+ tokenProgram: spl_token_1.TOKEN_PROGRAM_ID,
971
+ syProgram: this.syProgram,
972
+ tokenFeeTreasurySy: this.state.tokenFeeTreasurySy,
973
+ tokenFeeTreasuryPt: this.tokenFeeTreasuryPt,
974
+ ticks: this.ticksKey,
975
+ exponentCoreProgram: exponentCore.EXPONENTCORE_PROGRAM_ID,
976
+ eventAuthority: this.eventAuthority,
977
+ program: exponentClmm.EXPONENTCLMM_PROGRAM_ID,
978
+ }, {
979
+ ytAmount: amount,
980
+ minBaseAmount: minBaseOut,
981
+ redeemSyAccountsUntil: redeemSyRemAccounts.length,
982
+ withdrawYtAccountsUntil,
983
+ });
984
+ ix1.keys.push(...redeemSyRemAccounts, ...withdrawYtAccounts.keys, ...remainingAccounts);
985
+ return {
986
+ ixs: [ix1, ...(await this.flavor.preIxs({ signer: owner }))],
987
+ setupIxs: [tokenSyTraderAtaIx, tokenPtTraderAtaIx, tokenYtTraderAtaIx, tokenBaseTraderAtaIx],
988
+ };
989
+ }
990
+ /**
991
+ * Provide concentrated liquidity from the base asset, receiving LP and YT tokens.
992
+ *
993
+ * Wraps a mint-SY step with a deposit-liquidity operation. The program mints SY from the
994
+ * base asset, strips some into PT, deposits PT+SY as liquidity in the specified tick range,
995
+ * and returns the leftover YT to the depositor.
996
+ *
997
+ * @param depositor - Wallet signing the transaction
998
+ * @param amountBase - Amount of base asset to deposit
999
+ * @param minLpOut - Minimum LP tokens to receive (slippage protection)
1000
+ * @param lowerTickApy - Lower APY bound for the liquidity range
1001
+ * @param upperTickApy - Upper APY bound for the liquidity range
1002
+ * @param lpPosition - Optional existing LP position keypair/address (new one generated if omitted)
1003
+ */
1004
+ async ixWrapperProvideLiquidity({ depositor, amountBase, minLpOut, lowerTickApy, upperTickApy, tokenSyDepositor: tokenSyDepositorParam, tokenYtDepositor: tokenYtDepositorParam, tokenPtDepositor: tokenPtDepositorParam, tokenBaseDepositor: tokenBaseDepositorParam, lpPosition: lpPositionParam, }) {
1005
+ const tokenSyDepositor = tokenSyDepositorParam || (0, spl_token_1.getAssociatedTokenAddressSync)(this.mintSy, depositor, true, spl_token_1.TOKEN_PROGRAM_ID);
1006
+ const tokenYtDepositor = tokenYtDepositorParam || (0, spl_token_1.getAssociatedTokenAddressSync)(this.mintYt, depositor, true, spl_token_1.TOKEN_PROGRAM_ID);
1007
+ const tokenPtDepositor = tokenPtDepositorParam || (0, spl_token_1.getAssociatedTokenAddressSync)(this.mintPt, depositor, true, spl_token_1.TOKEN_PROGRAM_ID);
1008
+ const tokenBaseDepositor = tokenBaseDepositorParam ||
1009
+ (0, spl_token_1.getAssociatedTokenAddressSync)(this.flavor.mintBase, depositor, true, this.flavor.baseTokenProgram);
1010
+ const lpPosition = lpPositionParam || web3_js_1.Keypair.generate();
1011
+ const tokenSyDepositorAtaIx = (0, spl_token_1.createAssociatedTokenAccountIdempotentInstruction)(depositor, tokenSyDepositor, depositor, this.mintSy);
1012
+ const tokenYtDepositorAtaIx = (0, spl_token_1.createAssociatedTokenAccountIdempotentInstruction)(depositor, tokenYtDepositor, depositor, this.mintYt);
1013
+ const tokenPtDepositorAtaIx = (0, spl_token_1.createAssociatedTokenAccountIdempotentInstruction)(depositor, tokenPtDepositor, depositor, this.mintPt);
1014
+ const mintSyIx = await this.flavor.ixMintSy({
1015
+ // argument does not matter - since we are just getting the keys
1016
+ amountBase: "0",
1017
+ depositor,
1018
+ depositorBaseTokenAccount: tokenBaseDepositor,
1019
+ depositorSyTokenAccount: tokenSyDepositor,
1020
+ });
1021
+ const mintSyRemAccounts = mintSyIx.keys;
1022
+ const unorderedRemainingAccounts = (0, utils_1.uniqueRemainingAccounts)([
1023
+ ...this.cpiSyAccounts.getSyState,
1024
+ ...this.cpiSyAccounts.getPositionState,
1025
+ ...this.cpiCoreAccounts.stripSy,
1026
+ ...this.cpiSyAccounts.depositSy,
1027
+ ]);
1028
+ const depositYtAccounts = this.depositYtAccounts({
1029
+ owner: depositor,
1030
+ ytSrc: tokenYtDepositor,
1031
+ });
1032
+ const depositAccountsUntil = mintSyRemAccounts.length + depositYtAccounts.keys.length;
1033
+ const allRemainingAccounts = [...mintSyRemAccounts, ...depositYtAccounts.keys, ...unorderedRemainingAccounts];
1034
+ const ix = exponentClmm.createWrapperProvideLiquidityInstruction({
1035
+ depositor,
1036
+ market: this.selfAddress,
1037
+ ticks: this.ticksKey,
1038
+ tokenPtEscrow: this.tokenPtEscrow,
1039
+ tokenYtEscrow: this.tokenYtEscrow,
1040
+ tokenSyEscrow: this.tokenSyEscrow,
1041
+ tokenSyDepositor,
1042
+ tokenYtDepositor,
1043
+ tokenPtDepositor,
1044
+ mintYt: this.vault.mintYt,
1045
+ mintPt: this.vault.mintPt,
1046
+ tokenProgram: spl_token_1.TOKEN_PROGRAM_ID,
1047
+ marketAddressLookupTable: this.addressLookupTable,
1048
+ syProgram: this.syProgram,
1049
+ exponentCoreProgram: exponentCore.EXPONENTCORE_PROGRAM_ID,
1050
+ lpPosition: lpPosition instanceof web3_js_1.Keypair ? lpPosition.publicKey : lpPosition,
1051
+ instructionsSysvar: web3_js_1.SYSVAR_INSTRUCTIONS_PUBKEY,
1052
+ systemProgram: web3_js_1.SystemProgram.programId,
1053
+ rent: web3_js_1.SYSVAR_RENT_PUBKEY,
1054
+ eventAuthority: this.eventAuthority,
1055
+ program: exponentClmm.EXPONENTCLMM_PROGRAM_ID,
1056
+ }, {
1057
+ lowerTick: convertApyToApyBp(lowerTickApy),
1058
+ upperTick: convertApyToApyBp(upperTickApy),
1059
+ amountBase,
1060
+ minLpOut,
1061
+ mintSyRemAccountsUntil: mintSyRemAccounts.length,
1062
+ depositYtAccountsUntil: depositAccountsUntil,
1063
+ });
1064
+ ix.keys.push(...allRemainingAccounts);
1065
+ if (lpPosition instanceof web3_js_1.Keypair) {
1066
+ ix.keys.find((k) => k.pubkey.equals(lpPosition.publicKey)).isSigner = true;
1067
+ }
1068
+ return {
1069
+ ixs: [
1070
+ ...(await this.flavor.preIxs({ signer: depositor })),
1071
+ ix,
1072
+ ...(await this.flavor.postIxs({ signer: depositor })),
1073
+ ],
1074
+ signers: lpPosition instanceof web3_js_1.Keypair ? [lpPosition] : [],
1075
+ setupIxs: [tokenSyDepositorAtaIx, tokenYtDepositorAtaIx, tokenPtDepositorAtaIx],
1076
+ };
1077
+ }
1078
+ /**
1079
+ * Provide concentrated liquidity from a base asset plus existing PT tokens ("classic" mode).
1080
+ *
1081
+ * Unlike {@link ixWrapperProvideLiquidity}, this allows the depositor to supply PT they already
1082
+ * hold instead of having the program strip SY into PT+YT. Useful when the depositor has leftover
1083
+ * PT from a previous trade or wants finer control over token composition.
1084
+ *
1085
+ * @param depositor - Wallet signing the transaction
1086
+ * @param amountBase - Amount of base asset to deposit (converted to SY internally)
1087
+ * @param amountPt - Amount of PT to deposit alongside the base asset
1088
+ * @param minLpOut - Minimum LP tokens to receive (slippage protection)
1089
+ * @param lowerTickApy - Lower APY bound for the liquidity range
1090
+ * @param upperTickApy - Upper APY bound for the liquidity range
1091
+ */
1092
+ async ixProvideLiquidityClassic({ depositor, amountBase, amountPt, minLpOut, lowerTickApy, upperTickApy, tokenSyDepositor: tokenSyDepositorParam, tokenYtDepositor: tokenYtDepositorParam, tokenPtDepositor: tokenPtDepositorParam, tokenBaseDepositor: tokenBaseDepositorParam, lpPositionParam, }) {
1093
+ const tokenSyDepositor = tokenSyDepositorParam || (0, spl_token_1.getAssociatedTokenAddressSync)(this.mintSy, depositor, true, spl_token_1.TOKEN_PROGRAM_ID);
1094
+ const tokenYtDepositor = tokenYtDepositorParam || (0, spl_token_1.getAssociatedTokenAddressSync)(this.mintYt, depositor, true, spl_token_1.TOKEN_PROGRAM_ID);
1095
+ const tokenPtDepositor = tokenPtDepositorParam || (0, spl_token_1.getAssociatedTokenAddressSync)(this.mintPt, depositor, true, spl_token_1.TOKEN_PROGRAM_ID);
1096
+ const tokenBaseDepositor = tokenBaseDepositorParam ||
1097
+ (0, spl_token_1.getAssociatedTokenAddressSync)(this.flavor.mintBase, depositor, true, this.flavor.baseTokenProgram);
1098
+ const lpPosition = lpPositionParam || web3_js_1.Keypair.generate();
1099
+ const tokenSyAtaIx = (0, spl_token_1.createAssociatedTokenAccountIdempotentInstruction)(depositor, tokenSyDepositor, depositor, this.mintSy);
1100
+ const tokenYtAtaIx = (0, spl_token_1.createAssociatedTokenAccountIdempotentInstruction)(depositor, tokenYtDepositor, depositor, this.mintYt);
1101
+ const tokenPtAtaIx = (0, spl_token_1.createAssociatedTokenAccountIdempotentInstruction)(depositor, tokenPtDepositor, depositor, this.mintPt);
1102
+ const tokenBaseAtaIx = (0, spl_token_1.createAssociatedTokenAccountIdempotentInstruction)(depositor, tokenBaseDepositor, depositor, this.flavor.mintBase, this.flavor.baseTokenProgram);
1103
+ const remainingAccounts = (0, utils_1.uniqueRemainingAccounts)([
1104
+ ...this.cpiSyAccounts.depositSy,
1105
+ ...this.cpiSyAccounts.withdrawSy,
1106
+ ...this.cpiCoreAccounts.stripSy,
1107
+ ...this.cpiSyAccounts.getPositionState,
1108
+ ]);
1109
+ const mintSyIx = await this.flavor.ixMintSy({
1110
+ amountBase: "0",
1111
+ depositor,
1112
+ depositorBaseTokenAccount: tokenBaseDepositor,
1113
+ depositorSyTokenAccount: tokenSyDepositor,
1114
+ });
1115
+ const mintSyRemAccounts = mintSyIx.keys;
1116
+ const ix = exponentClmm.createWrapperProvideLiquidityClassicInstruction({
1117
+ depositor,
1118
+ market: this.selfAddress,
1119
+ ticks: this.ticksKey,
1120
+ tokenPtEscrow: this.tokenPtEscrow,
1121
+ tokenSyEscrow: this.tokenSyEscrow,
1122
+ tokenSyDepositor,
1123
+ tokenPtDepositor,
1124
+ tokenProgram: spl_token_1.TOKEN_PROGRAM_ID,
1125
+ marketAddressLookupTable: this.addressLookupTable,
1126
+ syProgram: this.syProgram,
1127
+ lpPosition: lpPosition instanceof web3_js_1.Keypair ? lpPosition.publicKey : lpPosition,
1128
+ instructionsSysvar: web3_js_1.SYSVAR_INSTRUCTIONS_PUBKEY,
1129
+ systemProgram: web3_js_1.SystemProgram.programId,
1130
+ rent: web3_js_1.SYSVAR_RENT_PUBKEY,
1131
+ eventAuthority: this.eventAuthority,
1132
+ program: exponentClmm.EXPONENTCLMM_PROGRAM_ID,
1133
+ }, {
1134
+ lowerTick: convertApyToApyBp(lowerTickApy),
1135
+ upperTick: convertApyToApyBp(upperTickApy),
1136
+ amountBase,
1137
+ amountPt,
1138
+ minLpOut,
1139
+ mintSyAccountsUntil: mintSyRemAccounts.length,
1140
+ });
1141
+ ix.keys.push(...mintSyRemAccounts, ...remainingAccounts);
1142
+ if (lpPosition instanceof web3_js_1.Keypair) {
1143
+ ix.keys.find((k) => k.pubkey.equals(lpPosition.publicKey)).isSigner = true;
1144
+ }
1145
+ return {
1146
+ ixs: [
1147
+ ...(await this.flavor.preIxs({ signer: depositor })),
1148
+ ix,
1149
+ ...(await this.flavor.postIxs({ signer: depositor })),
1150
+ ],
1151
+ signers: lpPosition instanceof web3_js_1.Keypair ? [lpPosition] : [],
1152
+ setupIxs: [tokenSyAtaIx, tokenYtAtaIx, tokenPtAtaIx, tokenBaseAtaIx],
1153
+ };
1154
+ }
1155
+ async ixProvideLiquidityBase({ depositor, externalPtToBuy, externalSyConstraint, minLpOut, lowerTickApy, upperTickApy, tokenSyDepositor: tokenSyDepositorParam, tokenYtDepositor: tokenYtDepositorParam, tokenPtDepositor: tokenPtDepositorParam, tokenBaseDepositor: tokenBaseDepositorParam, lpPositionParam, }) {
1156
+ const tokenSyDepositor = tokenSyDepositorParam || (0, spl_token_1.getAssociatedTokenAddressSync)(this.mintSy, depositor, true, spl_token_1.TOKEN_PROGRAM_ID);
1157
+ const tokenYtDepositor = tokenYtDepositorParam || (0, spl_token_1.getAssociatedTokenAddressSync)(this.mintYt, depositor, true, spl_token_1.TOKEN_PROGRAM_ID);
1158
+ const tokenPtDepositor = tokenPtDepositorParam || (0, spl_token_1.getAssociatedTokenAddressSync)(this.mintPt, depositor, true, spl_token_1.TOKEN_PROGRAM_ID);
1159
+ const tokenBaseDepositor = tokenBaseDepositorParam ||
1160
+ (0, spl_token_1.getAssociatedTokenAddressSync)(this.flavor.mintBase, depositor, true, this.flavor.baseTokenProgram);
1161
+ const lpPosition = lpPositionParam || web3_js_1.Keypair.generate();
1162
+ const tokenSyAtaIx = (0, spl_token_1.createAssociatedTokenAccountIdempotentInstruction)(depositor, tokenSyDepositor, depositor, this.mintSy);
1163
+ const tokenYtAtaIx = (0, spl_token_1.createAssociatedTokenAccountIdempotentInstruction)(depositor, tokenYtDepositor, depositor, this.mintYt);
1164
+ const tokenPtAtaIx = (0, spl_token_1.createAssociatedTokenAccountIdempotentInstruction)(depositor, tokenPtDepositor, depositor, this.mintPt);
1165
+ const tokenBaseAtaIx = (0, spl_token_1.createAssociatedTokenAccountIdempotentInstruction)(depositor, tokenBaseDepositor, depositor, this.flavor.mintBase, this.flavor.baseTokenProgram);
1166
+ const remainingAccounts = (0, utils_1.uniqueRemainingAccounts)([
1167
+ ...this.cpiSyAccounts.depositSy,
1168
+ ...this.cpiSyAccounts.withdrawSy,
1169
+ ...this.cpiCoreAccounts.stripSy,
1170
+ ...this.cpiSyAccounts.getPositionState,
1171
+ ]);
1172
+ const mintSyIx = await this.flavor.ixMintSy({
1173
+ amountBase: "0",
1174
+ depositor,
1175
+ depositorBaseTokenAccount: tokenBaseDepositor,
1176
+ depositorSyTokenAccount: tokenSyDepositor,
1177
+ });
1178
+ const mintSyRemAccounts = mintSyIx.keys;
1179
+ const ix = exponentClmm.createWrapperProvideLiquidityBaseInstruction({
1180
+ depositor,
1181
+ market: this.selfAddress,
1182
+ ticks: this.ticksKey,
1183
+ tokenPtEscrow: this.tokenPtEscrow,
1184
+ tokenSyEscrow: this.tokenSyEscrow,
1185
+ tokenSyDepositor,
1186
+ tokenPtDepositor,
1187
+ tokenFeeTreasurySy: this.tokenFeeTreasurySy,
1188
+ tokenFeeTreasuryPt: this.tokenFeeTreasuryPt,
1189
+ mintPt: this.mintPt,
1190
+ tokenProgram: spl_token_1.TOKEN_PROGRAM_ID,
1191
+ marketAddressLookupTable: this.addressLookupTable,
1192
+ syProgram: this.syProgram,
1193
+ exponentCoreProgram: exponentCore.EXPONENTCORE_PROGRAM_ID,
1194
+ lpPosition: lpPosition instanceof web3_js_1.Keypair ? lpPosition.publicKey : lpPosition,
1195
+ instructionsSysvar: web3_js_1.SYSVAR_INSTRUCTIONS_PUBKEY,
1196
+ systemProgram: web3_js_1.SystemProgram.programId,
1197
+ rent: web3_js_1.SYSVAR_RENT_PUBKEY,
1198
+ eventAuthority: this.eventAuthority,
1199
+ program: exponentClmm.EXPONENTCLMM_PROGRAM_ID,
1200
+ }, {
1201
+ lowerTickKey: convertApyToApyBp(lowerTickApy),
1202
+ upperTickKey: convertApyToApyBp(upperTickApy),
1203
+ minLpOut,
1204
+ mintSyAccountsUntil: mintSyRemAccounts.length,
1205
+ externalPtToBuy,
1206
+ externalSyConstraint,
1207
+ });
1208
+ ix.keys.push(...mintSyRemAccounts, ...remainingAccounts);
1209
+ if (lpPosition instanceof web3_js_1.Keypair) {
1210
+ ix.keys.find((k) => k.pubkey.equals(lpPosition.publicKey)).isSigner = true;
1211
+ }
1212
+ return {
1213
+ ixs: [
1214
+ ...(await this.flavor.preIxs({ signer: depositor })),
1215
+ ix,
1216
+ ...(await this.flavor.postIxs({ signer: depositor })),
1217
+ ],
1218
+ signers: lpPosition instanceof web3_js_1.Keypair ? [lpPosition] : [],
1219
+ setupIxs: [tokenSyAtaIx, tokenYtAtaIx, tokenPtAtaIx, tokenBaseAtaIx],
1220
+ };
1221
+ }
1222
+ async ixWithdrawLiquidityToBase({ owner, amountLp, minBaseOut, lpPosition, tokenSyWithdrawer: tokenSyWithdrawerParam, tokenYtWithdrawer: tokenYtWithdrawerParam, tokenPtWithdrawer: tokenPtWithdrawerParam, tokenBaseWithdrawer: tokenBaseWithdrawerParam, }) {
1223
+ const tokenSyWithdrawer = tokenSyWithdrawerParam || (0, spl_token_1.getAssociatedTokenAddressSync)(this.mintSy, owner, true, spl_token_1.TOKEN_PROGRAM_ID);
1224
+ const tokenYtWithdrawer = tokenYtWithdrawerParam || (0, spl_token_1.getAssociatedTokenAddressSync)(this.mintYt, owner, true, spl_token_1.TOKEN_PROGRAM_ID);
1225
+ const tokenPtWithdrawer = tokenPtWithdrawerParam || (0, spl_token_1.getAssociatedTokenAddressSync)(this.mintPt, owner, true, spl_token_1.TOKEN_PROGRAM_ID);
1226
+ const tokenBaseWithdrawer = tokenBaseWithdrawerParam ||
1227
+ (0, spl_token_1.getAssociatedTokenAddressSync)(this.flavor.mintBase, owner, true, this.flavor.baseTokenProgram);
1228
+ const tokenSyAtaIx = (0, spl_token_1.createAssociatedTokenAccountIdempotentInstruction)(owner, tokenSyWithdrawer, owner, this.mintSy);
1229
+ const tokenYtAtaIx = (0, spl_token_1.createAssociatedTokenAccountIdempotentInstruction)(owner, tokenYtWithdrawer, owner, this.mintYt);
1230
+ const tokenPtAtaIx = (0, spl_token_1.createAssociatedTokenAccountIdempotentInstruction)(owner, tokenPtWithdrawer, owner, this.mintPt);
1231
+ const tokenBaseAtaIx = (0, spl_token_1.createAssociatedTokenAccountIdempotentInstruction)(owner, tokenBaseWithdrawer, owner, this.flavor.mintBase, this.flavor.baseTokenProgram);
1232
+ const remainingAccounts = (0, utils_1.uniqueRemainingAccounts)([
1233
+ ...this.cpiSyAccounts.withdrawSy,
1234
+ ...this.cpiSyAccounts.getPositionState,
1235
+ ]);
1236
+ const redeemSyIx = await this.flavor.ixRedeemSy({
1237
+ amountSy: "0",
1238
+ redeemer: owner,
1239
+ redeemerBaseTokenAccount: tokenBaseWithdrawer,
1240
+ redeemerSyTokenAccount: tokenSyWithdrawer,
1241
+ });
1242
+ const redeemSyRemAccounts = redeemSyIx.keys;
1243
+ const minSyOut = Number(minBaseOut) / this.currentSyExchangeRate;
1244
+ const ix = exponentClmm.createWrapperWithdrawLiquidityInstruction({
1245
+ withdrawer: owner,
1246
+ market: this.selfAddress,
1247
+ ticks: this.ticksKey,
1248
+ tokenPtEscrow: this.tokenPtEscrow,
1249
+ tokenSyEscrow: this.tokenSyEscrow,
1250
+ tokenSyWithdrawer,
1251
+ tokenPtWithdrawer,
1252
+ tokenProgram: spl_token_1.TOKEN_PROGRAM_ID,
1253
+ marketAddressLookupTable: this.addressLookupTable,
1254
+ syProgram: this.syProgram,
1255
+ tokenFeeTreasurySy: this.state.tokenFeeTreasurySy,
1256
+ tokenFeeTreasuryPt: this.tokenFeeTreasuryPt,
1257
+ lpPosition,
1258
+ systemProgram: web3_js_1.SystemProgram.programId,
1259
+ eventAuthority: this.eventAuthority,
1260
+ program: exponentClmm.EXPONENTCLMM_PROGRAM_ID,
1261
+ }, {
1262
+ amountLp,
1263
+ syConstraint: BigInt(minSyOut.toFixed(0)),
1264
+ redeemSyAccountsLength: redeemSyRemAccounts.length,
1265
+ });
1266
+ ix.keys.push(...redeemSyRemAccounts, ...remainingAccounts);
1267
+ return {
1268
+ ixs: [...(await this.flavor.preIxs({ signer: owner })), ix, ...(await this.flavor.postIxs({ signer: owner }))],
1269
+ setupIxs: [tokenSyAtaIx, tokenYtAtaIx, tokenPtAtaIx, tokenBaseAtaIx],
1270
+ };
1271
+ }
1272
+ async ixWithdrawLiquidityClassic({ owner, amountLp, lpPosition, tokenSyWithdrawer: tokenSyWithdrawerParam, tokenYtWithdrawer: tokenYtWithdrawerParam, tokenPtWithdrawer: tokenPtWithdrawerParam, tokenBaseWithdrawer: tokenBaseWithdrawerParam, }) {
1273
+ const tokenSyWithdrawer = tokenSyWithdrawerParam || (0, spl_token_1.getAssociatedTokenAddressSync)(this.mintSy, owner, true, spl_token_1.TOKEN_PROGRAM_ID);
1274
+ const tokenYtWithdrawer = tokenYtWithdrawerParam || (0, spl_token_1.getAssociatedTokenAddressSync)(this.mintYt, owner, true, spl_token_1.TOKEN_PROGRAM_ID);
1275
+ const tokenPtWithdrawer = tokenPtWithdrawerParam || (0, spl_token_1.getAssociatedTokenAddressSync)(this.mintPt, owner, true, spl_token_1.TOKEN_PROGRAM_ID);
1276
+ const tokenBaseWithdrawer = tokenBaseWithdrawerParam ||
1277
+ (0, spl_token_1.getAssociatedTokenAddressSync)(this.flavor.mintBase, owner, true, this.flavor.baseTokenProgram);
1278
+ const tokenSyAtaIx = (0, spl_token_1.createAssociatedTokenAccountIdempotentInstruction)(owner, tokenSyWithdrawer, owner, this.mintSy);
1279
+ const tokenYtAtaIx = (0, spl_token_1.createAssociatedTokenAccountIdempotentInstruction)(owner, tokenYtWithdrawer, owner, this.mintYt);
1280
+ const tokenPtAtaIx = (0, spl_token_1.createAssociatedTokenAccountIdempotentInstruction)(owner, tokenPtWithdrawer, owner, this.mintPt);
1281
+ const tokenBaseAtaIx = (0, spl_token_1.createAssociatedTokenAccountIdempotentInstruction)(owner, tokenBaseWithdrawer, owner, this.flavor.mintBase, this.flavor.baseTokenProgram);
1282
+ const remainingAccounts = (0, utils_1.uniqueRemainingAccounts)([
1283
+ ...this.cpiSyAccounts.withdrawSy,
1284
+ ...this.cpiSyAccounts.getPositionState,
1285
+ ]);
1286
+ const redeemSyIx = await this.flavor.ixRedeemSy({
1287
+ amountSy: "0",
1288
+ redeemer: owner,
1289
+ redeemerBaseTokenAccount: tokenBaseWithdrawer,
1290
+ redeemerSyTokenAccount: tokenSyWithdrawer,
1291
+ });
1292
+ const redeemSyRemAccounts = redeemSyIx.keys;
1293
+ const ixn = exponentClmm.createWrapperWithdrawLiquidityClassicInstruction({
1294
+ withdrawer: owner,
1295
+ market: this.selfAddress,
1296
+ ticks: this.ticksKey,
1297
+ tokenPtEscrow: this.tokenPtEscrow,
1298
+ tokenSyEscrow: this.tokenSyEscrow,
1299
+ tokenSyWithdrawer,
1300
+ tokenPtWithdrawer,
1301
+ tokenProgram: spl_token_1.TOKEN_PROGRAM_ID,
1302
+ marketAddressLookupTable: this.addressLookupTable,
1303
+ syProgram: this.syProgram,
1304
+ lpPosition,
1305
+ systemProgram: web3_js_1.SystemProgram.programId,
1306
+ eventAuthority: this.eventAuthority,
1307
+ program: exponentClmm.EXPONENTCLMM_PROGRAM_ID,
1308
+ }, {
1309
+ amountLp,
1310
+ redeemSyAccountsLength: redeemSyRemAccounts.length,
1311
+ });
1312
+ ixn.keys.push(...redeemSyRemAccounts, ...remainingAccounts);
1313
+ return {
1314
+ ixs: [...(await this.flavor.preIxs({ signer: owner })), ixn, ...(await this.flavor.postIxs({ signer: owner }))],
1315
+ setupIxs: [tokenSyAtaIx, tokenYtAtaIx, tokenPtAtaIx, tokenBaseAtaIx],
1316
+ };
1317
+ }
1318
+ async ixAddLiquidity({ owner, ptInIntent, syInIntent, tokenSyDepositor: tokenSyDepositorParam, tokenYtDepositor: tokenYtDepositorParam, tokenPtDepositor: tokenPtDepositorParam, tokenBaseDepositor: tokenBaseDepositorParam, lpPosition, }) {
1319
+ const tokenSyDepositor = tokenSyDepositorParam || (0, spl_token_1.getAssociatedTokenAddressSync)(this.mintSy, owner, true, spl_token_1.TOKEN_PROGRAM_ID);
1320
+ const tokenYtDepositor = tokenYtDepositorParam || (0, spl_token_1.getAssociatedTokenAddressSync)(this.mintYt, owner, true, spl_token_1.TOKEN_PROGRAM_ID);
1321
+ const tokenPtDepositor = tokenPtDepositorParam || (0, spl_token_1.getAssociatedTokenAddressSync)(this.mintPt, owner, true, spl_token_1.TOKEN_PROGRAM_ID);
1322
+ const tokenBaseDepositor = tokenBaseDepositorParam ||
1323
+ (0, spl_token_1.getAssociatedTokenAddressSync)(this.flavor.mintBase, owner, true, this.flavor.baseTokenProgram);
1324
+ const tokenSyAtaIx = (0, spl_token_1.createAssociatedTokenAccountIdempotentInstruction)(owner, tokenSyDepositor, owner, this.mintSy);
1325
+ const tokenYtAtaIx = (0, spl_token_1.createAssociatedTokenAccountIdempotentInstruction)(owner, tokenYtDepositor, owner, this.mintYt);
1326
+ const tokenPtAtaIx = (0, spl_token_1.createAssociatedTokenAccountIdempotentInstruction)(owner, tokenPtDepositor, owner, this.mintPt);
1327
+ const tokenBaseAtaIx = (0, spl_token_1.createAssociatedTokenAccountIdempotentInstruction)(owner, tokenBaseDepositor, owner, this.flavor.mintBase, this.flavor.baseTokenProgram);
1328
+ const remainingAccounts = (0, utils_1.uniqueRemainingAccounts)([
1329
+ ...this.cpiSyAccounts.depositSy,
1330
+ ...this.cpiSyAccounts.withdrawSy,
1331
+ ...this.cpiCoreAccounts.stripSy,
1332
+ ...this.cpiSyAccounts.getPositionState,
1333
+ ]);
1334
+ const ix = exponentClmm.createAddLiquidityInstruction({
1335
+ owner,
1336
+ market: this.selfAddress,
1337
+ ticks: this.ticksKey,
1338
+ lpPosition: lpPosition instanceof web3_js_1.Keypair ? lpPosition.publicKey : lpPosition,
1339
+ tokenPtSrc: tokenPtDepositor,
1340
+ tokenSySrc: tokenSyDepositor,
1341
+ tokenPtEscrow: this.tokenPtEscrow,
1342
+ tokenSyEscrow: this.tokenSyEscrow,
1343
+ addressLookupTable: this.addressLookupTable,
1344
+ tokenProgram: spl_token_1.TOKEN_PROGRAM_ID,
1345
+ syProgram: this.syProgram,
1346
+ instructionsSysvar: web3_js_1.SYSVAR_INSTRUCTIONS_PUBKEY,
1347
+ systemProgram: web3_js_1.SystemProgram.programId,
1348
+ rent: web3_js_1.SYSVAR_RENT_PUBKEY,
1349
+ eventAuthority: this.eventAuthority,
1350
+ program: exponentClmm.EXPONENTCLMM_PROGRAM_ID,
1351
+ }, {
1352
+ maxSyInToAdd: syInIntent,
1353
+ maxPtInToAdd: ptInIntent,
1354
+ lowerTickKeyOptional: null,
1355
+ upperTickKeyOptional: null,
1356
+ });
1357
+ ix.keys.push(...remainingAccounts);
1358
+ return {
1359
+ ixs: [...(await this.flavor.preIxs({ signer: owner })), ix, ...(await this.flavor.postIxs({ signer: owner }))],
1360
+ signers: lpPosition instanceof web3_js_1.Keypair ? [lpPosition] : [],
1361
+ setupIxs: [tokenSyAtaIx, tokenYtAtaIx, tokenPtAtaIx, tokenBaseAtaIx],
1362
+ };
1363
+ }
1364
+ async getUserLpPositions(owner, market) {
1365
+ const LP_POSITION_DISCRIMINATOR = Buffer.from([105, 241, 37, 200, 224, 2, 252, 90]);
1366
+ const accounts = await this.connection.getProgramAccounts(exponentClmm.EXPONENTCLMM_PROGRAM_ID, {
1367
+ filters: [
1368
+ { memcmp: { offset: 0, bytes: bs58_1.default.encode(LP_POSITION_DISCRIMINATOR) } },
1369
+ { memcmp: { offset: 8, bytes: owner.toBase58() } },
1370
+ { memcmp: { offset: 40, bytes: market.toBase58() } },
1371
+ ],
1372
+ });
1373
+ const lpPositions = accounts.map(({ pubkey, account }) => ({
1374
+ publicKey: pubkey,
1375
+ account: exponentClmm.deserializeLpPositionAccount(account.data),
1376
+ }));
1377
+ return {
1378
+ lpPositions: [lpPositions],
1379
+ };
1380
+ }
1381
+ ixMarketAccureEmissions({ owner, lpPosition }) {
1382
+ const remainingAccounts = (0, utils_1.uniqueRemainingAccounts)([...this.cpiSyAccounts.getPositionState]);
1383
+ const ixn = exponentClmm.createMarketAccrueEmissionInstruction({
1384
+ owner,
1385
+ market: this.selfAddress,
1386
+ ticks: this.ticksKey,
1387
+ lpPosition,
1388
+ addressLookupTable: this.addressLookupTable,
1389
+ syProgram: this.syProgram,
1390
+ systemProgram: web3_js_1.SystemProgram.programId,
1391
+ eventAuthority: this.eventAuthority,
1392
+ program: exponentClmm.EXPONENTCLMM_PROGRAM_ID,
1393
+ });
1394
+ ixn.keys.push(...remainingAccounts);
1395
+ return {
1396
+ ixs: [ixn],
1397
+ };
1398
+ }
1399
+ /**
1400
+ * Calculate the current price per unit of liquidity (principal only) for a tick range.
1401
+ * Mirrors the on-chain `liquidity_unit_price_in_asset` helper but performs the
1402
+ * principal aggregation client-side using the fetched ticks account.
1403
+ *
1404
+ * @param lowerTickKey - Inclusive tick key (APY in parts-per-million) for the left boundary
1405
+ * @param upperTickKey - Exclusive tick key for the right boundary
1406
+ * @param ticksOverride - Optional ticks account (defaults to the instance state)
1407
+ * @param syExchangeRateOverride - Optional SY exchange rate (defaults to current flavor rate)
1408
+ * @returns Price per unit of liquidity in underlying asset terms (principal only)
1409
+ */
1410
+ liquidityUnitPriceInAsset({ lowerTickKey, upperTickKey, ticksOverride, syExchangeRateOverride, }) {
1411
+ if (lowerTickKey >= upperTickKey) {
1412
+ throw new Error("lowerTickKey must be less than upperTickKey");
1413
+ }
1414
+ const ticksAccount = ticksOverride ?? this.state.ticks;
1415
+ if (!ticksAccount) {
1416
+ throw new Error("Ticks account data is unavailable");
1417
+ }
1418
+ const relevantIntervals = ticksAccount.ticksTree.filter((tick) => tick.apyBasePoints >= lowerTickKey && tick.apyBasePoints < upperTickKey);
1419
+ if (relevantIntervals.length === 0) {
1420
+ return 0;
1421
+ }
1422
+ let totalPrincipalPt = 0n;
1423
+ let totalPrincipalSy = 0n;
1424
+ let totalShareSupply = 0n;
1425
+ for (const interval of relevantIntervals) {
1426
+ totalPrincipalPt += interval.principalPt;
1427
+ totalPrincipalSy += interval.principalSy;
1428
+ totalShareSupply += interval.principalShareSupply;
1429
+ }
1430
+ if (totalShareSupply === 0n) {
1431
+ return 0;
1432
+ }
1433
+ const timeFactor = this.secondsRemaining / SECONDS_PER_YEAR;
1434
+ const ptAssetValuePerToken = Math.exp(-timeFactor * ticksAccount.currentSpotPrice);
1435
+ const syExchangeRate = syExchangeRateOverride ?? this.currentSyExchangeRate;
1436
+ const principalPtValue = new decimal_js_1.default(totalPrincipalPt.toString()).mul(ptAssetValuePerToken);
1437
+ const principalSyValue = new decimal_js_1.default(totalPrincipalSy.toString()).mul(syExchangeRate);
1438
+ const principalValue = principalPtValue.plus(principalSyValue);
1439
+ return principalValue.div(new decimal_js_1.default(totalShareSupply.toString())).toNumber();
1440
+ }
1441
+ /**
1442
+ * Compute fee growth inside a tick range using Uniswap V3 formula
1443
+ *
1444
+ * @param lowerTick - Lower tick boundary
1445
+ * @param upperTick - Upper tick boundary
1446
+ * @param feeGlobalPt - Optional: Override global PT fees (for historical calculations)
1447
+ * @param feeGlobalSy - Optional: Override global SY fees (for historical calculations)
1448
+ * @returns Object with inside_sy and inside_pt fee growth values
1449
+ */
1450
+ static computeFeeInsideForRange({ currentTickPrice, lowerTickPrice, upperTickPrice, feeGrowthIndexGlobalPt, feeGrowthIndexGlobalSy, lowerTickOutsidePt, lowerTickOutsideSy, upperTickOutsidePt, upperTickOutsideSy, }) {
1451
+ // Uniswap V3 formula for computing fee inside a range
1452
+ let insideSy;
1453
+ let insidePt;
1454
+ if (currentTickPrice < lowerTickPrice) {
1455
+ // Price below range: inside = outside(lower) - outside(upper)
1456
+ insideSy = lowerTickOutsideSy - upperTickOutsideSy;
1457
+ insidePt = lowerTickOutsidePt - upperTickOutsidePt;
1458
+ }
1459
+ else if (currentTickPrice >= upperTickPrice) {
1460
+ // Price above range: inside = outside(upper) - outside(lower)
1461
+ insideSy = upperTickOutsideSy - lowerTickOutsideSy;
1462
+ insidePt = upperTickOutsidePt - lowerTickOutsidePt;
1463
+ }
1464
+ else {
1465
+ // Price in range: inside = global - outside(lower) - outside(upper)
1466
+ insideSy = feeGrowthIndexGlobalSy - lowerTickOutsideSy - upperTickOutsideSy;
1467
+ insidePt = feeGrowthIndexGlobalPt - lowerTickOutsidePt - upperTickOutsidePt;
1468
+ }
1469
+ return { insideSy, insidePt };
1470
+ }
1471
+ /**
1472
+ * Calculate claimable fees for a position
1473
+ * Uses Q64.64 fixed-point math: tokens = floor((L * Δindex) >> 64)
1474
+ *
1475
+ * @param lpBalance - Position's liquidity balance
1476
+ * @param feeInsideLastSy - Last snapshot of inside SY fee growth
1477
+ * @param feeInsideLastPt - Last snapshot of inside PT fee growth
1478
+ * @param currentInsideSy - Current inside SY fee growth
1479
+ * @param currentInsidePt - Current inside PT fee growth
1480
+ * @param tokensOwedSy - Previously owed SY fees
1481
+ * @param tokensOwedPt - Previously owed PT fees
1482
+ * @returns Object with claimable and total fees
1483
+ */
1484
+ static calculateClaimableFees({ lpBalance, feeInsideLastSy, feeInsideLastPt, currentInsideSy, currentInsidePt, tokensOwedSy, tokensOwedPt, }) {
1485
+ // Calculate delta (growth since last snapshot)
1486
+ const deltaSy = currentInsideSy > feeInsideLastSy ? currentInsideSy - feeInsideLastSy : 0n;
1487
+ const deltaPt = currentInsidePt > feeInsideLastPt ? currentInsidePt - feeInsideLastPt : 0n;
1488
+ // Calculate claimable fees using Q64.64 math: tokens = floor((L * Δindex) >> 64)
1489
+ const claimableSy = (lpBalance * deltaSy) >> 64n;
1490
+ const claimablePt = (lpBalance * deltaPt) >> 64n;
1491
+ //? TotalPt and TotalSy don't make sense here because tokensOwedSy and tokensOwedPt are always 0
1492
+ // Calculate totals
1493
+ const totalSy = claimableSy + tokensOwedSy;
1494
+ const totalPt = claimablePt + tokensOwedPt;
1495
+ return {
1496
+ claimableSy,
1497
+ claimablePt,
1498
+ tokensOwedSy,
1499
+ tokensOwedPt,
1500
+ totalSy,
1501
+ totalPt,
1502
+ };
1503
+ }
1504
+ /**
1505
+ * Calculate historical fee APY for a tick range
1506
+ *
1507
+ * @param feeGrowthDeltaSy - Change in global SY fee growth over period
1508
+ * @param feeGrowthDeltaPt - Change in global PT fee growth over period
1509
+ * @param avgLiquidity - Average liquidity in the range during period
1510
+ * @param hoursElapsed - Number of hours in the period
1511
+ * @returns Object with fee APY metrics
1512
+ */
1513
+ static calculateHistoricalFeeApy({ feeGrowthDeltaSy, feeGrowthDeltaPt, avgLiquidity, hoursElapsed, }) {
1514
+ if (avgLiquidity === 0n || hoursElapsed === 0) {
1515
+ return {
1516
+ feeApySy: 0,
1517
+ feeApyPt: 0,
1518
+ feeApyTotal: 0,
1519
+ totalFeesSy: 0n,
1520
+ totalFeesPt: 0n,
1521
+ };
1522
+ }
1523
+ // Calculate total fees earned in the period using Q64.64 math
1524
+ const totalFeesSy = (feeGrowthDeltaSy * avgLiquidity) >> 64n;
1525
+ const totalFeesPt = (feeGrowthDeltaPt * avgLiquidity) >> 64n;
1526
+ // Annualization factor (hours in a year / hours elapsed)
1527
+ const hoursPerYear = 8760;
1528
+ const annualizationFactor = hoursPerYear / hoursElapsed;
1529
+ // Calculate APY as: (fees / avg_liquidity) * annualization_factor * 100
1530
+ const feeApySy = (Number((totalFeesSy * 10000n) / avgLiquidity) / 100) * annualizationFactor;
1531
+ const feeApyPt = (Number((totalFeesPt * 10000n) / avgLiquidity) / 100) * annualizationFactor;
1532
+ const feeApyTotal = feeApySy + feeApyPt;
1533
+ return {
1534
+ feeApySy,
1535
+ feeApyPt,
1536
+ feeApyTotal,
1537
+ totalFeesSy,
1538
+ totalFeesPt,
1539
+ };
1540
+ }
1541
+ depositYtAccounts({ owner, ytSrc: ytSrcParam, }) {
1542
+ const ytSrc = ytSrcParam || (0, spl_token_1.getAssociatedTokenAddressSync)(this.mintYt, owner, true, spl_token_1.TOKEN_PROGRAM_ID);
1543
+ const userYieldPosition = this.corePda.yieldPosition({ vault: this.state.vault.selfAddress, owner });
1544
+ const yieldPosition = this.corePda.vaultYieldPosition({ vault: this.state.vault.selfAddress });
1545
+ const escrowYt = this.corePda.escrowYt({ vault: this.state.vault.selfAddress });
1546
+ const mainAccounts = {
1547
+ depositor: owner,
1548
+ ytSrc,
1549
+ vault: this.state.vault.selfAddress,
1550
+ userYieldPosition,
1551
+ escrowYt,
1552
+ tokenProgram: spl_token_1.TOKEN_PROGRAM_ID,
1553
+ syProgram: this.state.syProgram,
1554
+ addressLookupTable: this.vault.addressLookupTable,
1555
+ yieldPosition,
1556
+ systemProgram: web3_js_1.SystemProgram.programId,
1557
+ eventAuthority: this.coreEventAuthority,
1558
+ program: exponentCore.EXPONENTCORE_PROGRAM_ID,
1559
+ };
1560
+ const remainingAccounts = this.cpiSyAccounts.getSyState;
1561
+ const depositIx = exponentCore.createDepositYtInstruction(mainAccounts, { amount: 0n });
1562
+ depositIx.keys.push(...remainingAccounts);
1563
+ return depositIx;
1564
+ }
1565
+ withdrawYtAccounts({ owner, ytDst: ytDstParam, }) {
1566
+ const ytDst = ytDstParam || (0, spl_token_1.getAssociatedTokenAddressSync)(this.mintYt, owner, true, spl_token_1.TOKEN_PROGRAM_ID);
1567
+ const userYieldPosition = this.corePda.yieldPosition({ vault: this.state.vault.selfAddress, owner });
1568
+ const yieldPosition = this.corePda.vaultYieldPosition({ vault: this.state.vault.selfAddress });
1569
+ const escrowYt = this.corePda.escrowYt({ vault: this.state.vault.selfAddress });
1570
+ const mainAccounts = {
1571
+ owner,
1572
+ vault: this.state.vault.selfAddress,
1573
+ userYieldPosition,
1574
+ ytDst,
1575
+ escrowYt,
1576
+ tokenProgram: spl_token_1.TOKEN_PROGRAM_ID,
1577
+ authority: this.vault.authority,
1578
+ syProgram: this.state.syProgram,
1579
+ addressLookupTable: this.vault.addressLookupTable,
1580
+ yieldPosition,
1581
+ systemProgram: web3_js_1.SystemProgram.programId,
1582
+ eventAuthority: this.coreEventAuthority,
1583
+ program: exponentCore.EXPONENTCORE_PROGRAM_ID,
1584
+ };
1585
+ const remainingAccounts = this.cpiSyAccounts.getSyState;
1586
+ const withdrawIx = exponentCore.createWithdrawYtInstruction(mainAccounts, { amount: 0n });
1587
+ withdrawIx.keys.push(...remainingAccounts);
1588
+ return withdrawIx;
1589
+ }
1590
+ /**
1591
+ * Estimate the yield (fees + emissions) a hypothetical LP position would have earned
1592
+ * between two market snapshots.
1593
+ *
1594
+ * @param marketSnapshotDataCurrent - The more recent market snapshot
1595
+ * @param marketSnapshotDataHistory - The older market snapshot (defines the look-back window)
1596
+ * @param lowerPricePercentage - Lower price bound as a percentage (e.g. 5 for 5%)
1597
+ * @param upperPricePercentage - Upper price bound as a percentage
1598
+ * @param baseTokenAmount - Amount of base tokens in the hypothetical position
1599
+ */
1600
+ static calcEstimatedYieldForPosition(marketSnapshotDataCurrent, marketSnapshotDataHistory, lowerPricePercentage, upperPricePercentage, baseTokenAmount) {
1601
+ //? Prices in format of 1 + percentage / 100
1602
+ const lowerPrice = 1 + lowerPricePercentage / 100;
1603
+ //? Prices in format of 1 + percentage / 100
1604
+ const upperPrice = 1 + upperPricePercentage / 100;
1605
+ const { syNeeded: userSyProvided, ptNeeded: userPtProvided } = (0, market_three_math_1.calcDepositSyAndPtFromBaseAmount)({
1606
+ expirationTs: Number(marketSnapshotDataCurrent.financials.expirationTs) - marketSnapshotDataCurrent.snapshotTimeUnix,
1607
+ currentSpotPrice: marketSnapshotDataCurrent.currentSpotPrice,
1608
+ syExchangeRate: marketSnapshotDataCurrent.syExchangeRate,
1609
+ lowerPrice,
1610
+ upperPrice,
1611
+ baseTokenAmount: baseTokenAmount,
1612
+ });
1613
+ const [lowerFeeGrowthOutsidePtHistory, lowerFeeGrowthOutsideSyHistory] = lowerPrice <= marketSnapshotDataHistory.currentSpotPrice
1614
+ ? [marketSnapshotDataHistory.feeGrowthIndexGlobalPt, marketSnapshotDataHistory.feeGrowthIndexGlobalSy]
1615
+ : [0n, 0n];
1616
+ const [upperFeeGrowthOutsidePtHistory, upperFeeGrowthOutsideSyHistory] = upperPrice <= marketSnapshotDataHistory.currentSpotPrice
1617
+ ? [marketSnapshotDataHistory.feeGrowthIndexGlobalPt, marketSnapshotDataHistory.feeGrowthIndexGlobalSy]
1618
+ : [0n, 0n];
1619
+ const { insideSy: insideSyHistory, insidePt: insidePtHistory } = MarketThree.computeFeeInsideForRange({
1620
+ currentTickPrice: marketSnapshotDataHistory.currentSpotPrice,
1621
+ lowerTickPrice: lowerPrice,
1622
+ upperTickPrice: upperPrice,
1623
+ feeGrowthIndexGlobalPt: marketSnapshotDataHistory.feeGrowthIndexGlobalPt,
1624
+ feeGrowthIndexGlobalSy: marketSnapshotDataHistory.feeGrowthIndexGlobalSy,
1625
+ lowerTickOutsidePt: lowerFeeGrowthOutsidePtHistory,
1626
+ lowerTickOutsideSy: lowerFeeGrowthOutsideSyHistory,
1627
+ upperTickOutsidePt: upperFeeGrowthOutsidePtHistory,
1628
+ upperTickOutsideSy: upperFeeGrowthOutsideSyHistory,
1629
+ });
1630
+ const { liquidityTarget: liquidityTargetCurrent, syNeeded, ptNeeded, } = computeLiquidityTargetAndTokenNeedsForSnapshot(marketSnapshotDataCurrent, {
1631
+ lowerPrice,
1632
+ upperPrice,
1633
+ maxSy: userSyProvided,
1634
+ maxPt: userPtProvided,
1635
+ });
1636
+ const { insideSy: insideSyCurrent, insidePt: insidePtCurrent } = MarketThree.computeFeeInsideForRange({
1637
+ currentTickPrice: marketSnapshotDataCurrent.currentSpotPrice,
1638
+ lowerTickPrice: lowerPrice,
1639
+ upperTickPrice: upperPrice,
1640
+ feeGrowthIndexGlobalPt: BigInt(marketSnapshotDataCurrent.feeGrowthIndexGlobalPt),
1641
+ feeGrowthIndexGlobalSy: BigInt(marketSnapshotDataCurrent.feeGrowthIndexGlobalSy),
1642
+ lowerTickOutsidePt: BigInt(lowerFeeGrowthOutsidePtHistory),
1643
+ lowerTickOutsideSy: BigInt(lowerFeeGrowthOutsideSyHistory),
1644
+ upperTickOutsidePt: BigInt(upperFeeGrowthOutsidePtHistory),
1645
+ upperTickOutsideSy: BigInt(upperFeeGrowthOutsideSyHistory),
1646
+ });
1647
+ //? Single invocation
1648
+ const { claimablePt: ptExpectedFees, claimableSy: syExpectedFees } = MarketThree.calculateClaimableFees({
1649
+ lpBalance: BigInt(liquidityTargetCurrent),
1650
+ feeInsideLastSy: insideSyHistory,
1651
+ feeInsideLastPt: insidePtHistory,
1652
+ currentInsideSy: insideSyCurrent,
1653
+ currentInsidePt: insidePtCurrent,
1654
+ tokensOwedSy: 0n,
1655
+ tokensOwedPt: 0n,
1656
+ });
1657
+ //? As we don't have autocompounding, use 1 as annualization factor
1658
+ const ANNUALIZATION_FACTOR = 1;
1659
+ //? Convert SY amounts to baseToken: baseToken = syAmount / syExchangeRate
1660
+ const syNeededBaseToken = syNeeded > 0 ? syNeeded * marketSnapshotDataCurrent.syExchangeRate : 0;
1661
+ const syExpectedFeesBaseToken = syExpectedFees > 0n ? Number(syExpectedFees) * marketSnapshotDataCurrent.syExchangeRate : 0;
1662
+ const ptPriceInBaseToken = (0, market_three_math_1.calcPtPriceInAsset)(marketSnapshotDataCurrent.currentSpotPrice, Number(marketSnapshotDataCurrent.financials.expirationTs) - marketSnapshotDataCurrent.snapshotTimeUnix);
1663
+ const ptNeededBaseToken = ptNeeded * ptPriceInBaseToken;
1664
+ const ptExpectedFeesBaseToken = Number(ptExpectedFees) * ptPriceInBaseToken;
1665
+ //? Calculate total baseToken value of the position
1666
+ const totalPositionValueBaseToken = syNeededBaseToken + ptNeededBaseToken;
1667
+ //? Calculate total fees earned in baseToken
1668
+ const totalFeesBaseToken = syExpectedFeesBaseToken + ptExpectedFeesBaseToken;
1669
+ //? Calculate unified fee rate: total fees / total position value
1670
+ const totalFeeRate = totalPositionValueBaseToken > 0 ? totalFeesBaseToken / totalPositionValueBaseToken : 0;
1671
+ //? Annualize the fee rate
1672
+ const totalFeeRateAnnualized = totalFeeRate * ANNUALIZATION_FACTOR;
1673
+ return {
1674
+ totalFeeRate: totalFeeRateAnnualized,
1675
+ ptExpectedFees,
1676
+ syExpectedFees,
1677
+ expectedFeesBaseToken: totalFeesBaseToken,
1678
+ };
1679
+ }
1680
+ /**
1681
+ * Calculate TVL (Total Value Locked) in baseToken for a market
1682
+ *
1683
+ * @param currentSpotPrice - Current spot price in format of 1 + percentage / 100
1684
+ * @param financials - Market financials containing balances and expiration timestamp
1685
+ * @param syExchangeRate - SY exchange rate
1686
+ * @param timestampUnix - Timestamp in seconds (defaults to current time)
1687
+ * @returns Object with TVL breakdown: total TVL, PT liquidity, and SY liquidity in baseToken
1688
+ */
1689
+ static calcTvlInBaseToken(params) {
1690
+ const { financials, currentSpotPrice, syExchangeRate, timestampUnix = Date.now() / 1000 } = params;
1691
+ const secondsRemaining = Math.max(0, Number(financials.expirationTs) - timestampUnix);
1692
+ const ptPriceInBaseToken = (0, market_three_math_1.calcPtPriceInAsset)(currentSpotPrice, secondsRemaining);
1693
+ const ptLiquidityInBaseToken = Number(financials.ptBalance) * ptPriceInBaseToken;
1694
+ const syLiquidityInBaseToken = Number(financials.syBalance) * syExchangeRate;
1695
+ const tvlInBaseToken = ptLiquidityInBaseToken + syLiquidityInBaseToken;
1696
+ return {
1697
+ tvlInBaseToken: Math.round(tvlInBaseToken),
1698
+ ptLiquidityInBaseToken: Math.round(ptLiquidityInBaseToken),
1699
+ syLiquidityInBaseToken: Math.round(syLiquidityInBaseToken),
1700
+ };
1701
+ }
1702
+ static calcGlobalFeeRate(marketSnapshotDataCurrent, marketSnapshotDataHistory) {
1703
+ const { financials: financialsCurrent, feeGrowthIndexGlobalPt: feeGrowthIndexGlobalPtCurrent, feeGrowthIndexGlobalSy: feeGrowthIndexGlobalSyCurrent, currentSpotPrice, currentPrefixSum, syExchangeRate, } = marketSnapshotDataCurrent;
1704
+ const { feeGrowthIndexGlobalPt: feeGrowthIndexGlobalPtHistory, feeGrowthIndexGlobalSy: feeGrowthIndexGlobalSyHistory, } = marketSnapshotDataHistory;
1705
+ const ptPriceInBaseToken = (0, market_three_math_1.calcPtPriceInAsset)(currentSpotPrice, Number(financialsCurrent.expirationTs) - marketSnapshotDataCurrent.snapshotTimeUnix);
1706
+ const feePt = Number(feeGrowthIndexGlobalPtCurrent - feeGrowthIndexGlobalPtHistory) / Number(currentPrefixSum);
1707
+ const feePtInBaseToken = feePt * ptPriceInBaseToken;
1708
+ const feeSy = Number(feeGrowthIndexGlobalSyCurrent - feeGrowthIndexGlobalSyHistory) / Number(currentPrefixSum);
1709
+ const feeSyInBaseToken = feeSy * syExchangeRate;
1710
+ const totalFeesInBaseToken = feePtInBaseToken + feeSyInBaseToken;
1711
+ const ptLiquidityInBaseToken = Number(financialsCurrent.ptBalance) * ptPriceInBaseToken;
1712
+ const syLiquidityInBaseToken = Number(financialsCurrent.syBalance) * syExchangeRate;
1713
+ const tvlInBaseToken = ptLiquidityInBaseToken + syLiquidityInBaseToken;
1714
+ const totalFeeRate = totalFeesInBaseToken / tvlInBaseToken;
1715
+ return {
1716
+ totalFeeRate,
1717
+ totalFeesInBaseToken,
1718
+ tvlInBaseToken,
1719
+ };
1720
+ }
1721
+ /**
1722
+ * Returns PT and SY amounts that will be received on liquidity removal from a position
1723
+ * If liquidityToRemove is not provided, assume that the full position balance will be removed
1724
+ */
1725
+ getPtAndSyOnWithdrawLiquidity(position, liquidityToRemove) {
1726
+ const { ticks, emissions } = this.state;
1727
+ return (0, market_three_math_1.getPtAndSyOnWithdrawLiquidity)(emissions, ticks, position, liquidityToRemove ?? position.lpBalance);
1728
+ }
1729
+ }
1730
+ exports.MarketThree = MarketThree;
1731
+ /**
1732
+ * Convert apy percents to input format
1733
+ */
1734
+ function convertApyToApyBp(price) {
1735
+ return price * 1e4;
1736
+ }
1737
+ /** Wrapper for computeLiquidityTargetAndTokenNeeds that takes a MarketSnapshotData as input */
1738
+ function computeLiquidityTargetAndTokenNeedsForSnapshot(marketSnapshotData, params) {
1739
+ const EPSILON_CLAMP = 1e-18;
1740
+ const { lowerPrice, upperPrice, maxSy, maxPt } = params;
1741
+ const { financials, currentSpotPrice, syExchangeRate, snapshotTimeUnix } = marketSnapshotData;
1742
+ const expirationTsNumber = Number(financials.expirationTs);
1743
+ const secondsRemaining = Math.max(0, expirationTsNumber - snapshotTimeUnix);
1744
+ const effSnap = new market_three_math_1.EffSnap((0, market_three_math_1.normalizedTimeRemaining)(secondsRemaining), syExchangeRate);
1745
+ const priceEffLower = effSnap.getEffectivePrice(lowerPrice);
1746
+ const priceEffUpper = effSnap.getEffectivePrice(upperPrice);
1747
+ return (0, market_three_math_1.computeLiquidityTargetAndTokenNeeds)(effSnap, currentSpotPrice, priceEffLower, priceEffUpper, lowerPrice, upperPrice, 0, 0, 0, maxSy, maxPt, EPSILON_CLAMP);
1748
+ }
1749
+ //# sourceMappingURL=marketThree.js.map