@kestrelfi/lyc-sdk 1.0.1 → 1.0.3

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 (738) hide show
  1. package/README.md +32 -0
  2. package/dist/carry-XU3WUD22.mjs +20 -0
  3. package/dist/carry-XU3WUD22.mjs.map +1 -0
  4. package/dist/chunk-2T23QQCX.mjs +3707 -0
  5. package/dist/chunk-2T23QQCX.mjs.map +1 -0
  6. package/dist/chunk-GOW6CARW.mjs +3969 -0
  7. package/dist/chunk-GOW6CARW.mjs.map +1 -0
  8. package/dist/chunk-ZPXXY3QV.mjs +9330 -0
  9. package/dist/chunk-ZPXXY3QV.mjs.map +1 -0
  10. package/dist/{sdks/long-yield-carry/src/idl/long_yield_carry.d.ts → core-DP6wfpME.d.mts} +3242 -84
  11. package/dist/core-DP6wfpME.d.ts +10485 -0
  12. package/dist/core.d.mts +8 -0
  13. package/dist/core.d.ts +8 -0
  14. package/dist/core.js +12348 -0
  15. package/dist/core.js.map +1 -0
  16. package/dist/core.mjs +72 -0
  17. package/dist/core.mjs.map +1 -0
  18. package/dist/index.d.mts +2537 -0
  19. package/dist/index.d.ts +2537 -0
  20. package/dist/index.js +23884 -0
  21. package/dist/index.js.map +1 -0
  22. package/dist/index.mjs +5898 -0
  23. package/dist/index.mjs.map +1 -0
  24. package/package.json +56 -10
  25. package/.env.example +0 -11
  26. package/dist/sdks/long-yield-carry/scripts/asyncBurn.d.ts +0 -1
  27. package/dist/sdks/long-yield-carry/scripts/asyncBurn.js +0 -117
  28. package/dist/sdks/long-yield-carry/scripts/burnToken.d.ts +0 -1
  29. package/dist/sdks/long-yield-carry/scripts/burnToken.js +0 -98
  30. package/dist/sdks/long-yield-carry/scripts/claimIncentives.d.ts +0 -1
  31. package/dist/sdks/long-yield-carry/scripts/claimIncentives.js +0 -108
  32. package/dist/sdks/long-yield-carry/scripts/closeCpiPlans.d.ts +0 -1
  33. package/dist/sdks/long-yield-carry/scripts/closeCpiPlans.js +0 -93
  34. package/dist/sdks/long-yield-carry/scripts/collectInterest.d.ts +0 -1
  35. package/dist/sdks/long-yield-carry/scripts/collectInterest.js +0 -164
  36. package/dist/sdks/long-yield-carry/scripts/collectProtocolFees.d.ts +0 -1
  37. package/dist/sdks/long-yield-carry/scripts/collectProtocolFees.js +0 -120
  38. package/dist/sdks/long-yield-carry/scripts/computeOptimalAllocations.d.ts +0 -1
  39. package/dist/sdks/long-yield-carry/scripts/computeOptimalAllocations.js +0 -84
  40. package/dist/sdks/long-yield-carry/scripts/createToken.d.ts +0 -1
  41. package/dist/sdks/long-yield-carry/scripts/createToken.js +0 -76
  42. package/dist/sdks/long-yield-carry/scripts/createTokenLendingPosition.d.ts +0 -1
  43. package/dist/sdks/long-yield-carry/scripts/createTokenLendingPosition.js +0 -157
  44. package/dist/sdks/long-yield-carry/scripts/createYieldingBank.d.ts +0 -1
  45. package/dist/sdks/long-yield-carry/scripts/createYieldingBank.js +0 -69
  46. package/dist/sdks/long-yield-carry/scripts/decreaseCarryPositions.d.ts +0 -1
  47. package/dist/sdks/long-yield-carry/scripts/decreaseCarryPositions.js +0 -247
  48. package/dist/sdks/long-yield-carry/scripts/depositUnlentCollateral.d.ts +0 -1
  49. package/dist/sdks/long-yield-carry/scripts/depositUnlentCollateral.js +0 -90
  50. package/dist/sdks/long-yield-carry/scripts/emergency/deleverageAll.d.ts +0 -1
  51. package/dist/sdks/long-yield-carry/scripts/emergency/deleverageAll.js +0 -202
  52. package/dist/sdks/long-yield-carry/scripts/emergency/triggerCircuitBreaker.d.ts +0 -1
  53. package/dist/sdks/long-yield-carry/scripts/emergency/triggerCircuitBreaker.js +0 -68
  54. package/dist/sdks/long-yield-carry/scripts/env.d.ts +0 -1
  55. package/dist/sdks/long-yield-carry/scripts/env.js +0 -8
  56. package/dist/sdks/long-yield-carry/scripts/findTxs.d.ts +0 -1
  57. package/dist/sdks/long-yield-carry/scripts/findTxs.js +0 -143
  58. package/dist/sdks/long-yield-carry/scripts/increaseCarryPositions.d.ts +0 -1
  59. package/dist/sdks/long-yield-carry/scripts/increaseCarryPositions.js +0 -112
  60. package/dist/sdks/long-yield-carry/scripts/inspect/format.d.ts +0 -13
  61. package/dist/sdks/long-yield-carry/scripts/inspect/format.js +0 -363
  62. package/dist/sdks/long-yield-carry/scripts/inspect.d.ts +0 -1
  63. package/dist/sdks/long-yield-carry/scripts/inspect.js +0 -108
  64. package/dist/sdks/long-yield-carry/scripts/localUtils.d.ts +0 -53
  65. package/dist/sdks/long-yield-carry/scripts/localUtils.js +0 -191
  66. package/dist/sdks/long-yield-carry/scripts/mintToken.d.ts +0 -1
  67. package/dist/sdks/long-yield-carry/scripts/mintToken.js +0 -103
  68. package/dist/sdks/long-yield-carry/scripts/processAsyncBurns.d.ts +0 -1
  69. package/dist/sdks/long-yield-carry/scripts/processAsyncBurns.js +0 -76
  70. package/dist/sdks/long-yield-carry/scripts/rebalanceToken.d.ts +0 -1
  71. package/dist/sdks/long-yield-carry/scripts/rebalanceToken.js +0 -210
  72. package/dist/sdks/long-yield-carry/scripts/rebalanceYieldingBank.d.ts +0 -1
  73. package/dist/sdks/long-yield-carry/scripts/rebalanceYieldingBank.js +0 -149
  74. package/dist/sdks/long-yield-carry/scripts/recollateralizeLoss.d.ts +0 -1
  75. package/dist/sdks/long-yield-carry/scripts/recollateralizeLoss.js +0 -64
  76. package/dist/sdks/long-yield-carry/scripts/refresh.d.ts +0 -1
  77. package/dist/sdks/long-yield-carry/scripts/refresh.js +0 -101
  78. package/dist/sdks/long-yield-carry/scripts/updateFees.d.ts +0 -1
  79. package/dist/sdks/long-yield-carry/scripts/updateFees.js +0 -369
  80. package/dist/sdks/long-yield-carry/scripts/updateGeneralLut.d.ts +0 -1
  81. package/dist/sdks/long-yield-carry/scripts/updateGeneralLut.js +0 -27
  82. package/dist/sdks/long-yield-carry/scripts/updateLendingPositionConfig.d.ts +0 -1
  83. package/dist/sdks/long-yield-carry/scripts/updateLendingPositionConfig.js +0 -127
  84. package/dist/sdks/long-yield-carry/scripts/updateTokenLuts.d.ts +0 -1
  85. package/dist/sdks/long-yield-carry/scripts/updateTokenLuts.js +0 -27
  86. package/dist/sdks/long-yield-carry/scripts/updateTokenMetadata.d.ts +0 -1
  87. package/dist/sdks/long-yield-carry/scripts/updateTokenMetadata.js +0 -194
  88. package/dist/sdks/long-yield-carry/scripts/updateYieldingBankConfig.d.ts +0 -1
  89. package/dist/sdks/long-yield-carry/scripts/updateYieldingBankConfig.js +0 -84
  90. package/dist/sdks/long-yield-carry/scripts/withdrawUnlentCollateral.d.ts +0 -1
  91. package/dist/sdks/long-yield-carry/scripts/withdrawUnlentCollateral.js +0 -140
  92. package/dist/sdks/long-yield-carry/src/client/account.d.ts +0 -152
  93. package/dist/sdks/long-yield-carry/src/client/account.js +0 -349
  94. package/dist/sdks/long-yield-carry/src/client/builders/args.d.ts +0 -299
  95. package/dist/sdks/long-yield-carry/src/client/builders/args.js +0 -2
  96. package/dist/sdks/long-yield-carry/src/client/builders/asyncBurnBuilder.d.ts +0 -20
  97. package/dist/sdks/long-yield-carry/src/client/builders/asyncBurnBuilder.js +0 -212
  98. package/dist/sdks/long-yield-carry/src/client/builders/base.d.ts +0 -77
  99. package/dist/sdks/long-yield-carry/src/client/builders/base.js +0 -191
  100. package/dist/sdks/long-yield-carry/src/client/builders/burnTokenBuilder.d.ts +0 -18
  101. package/dist/sdks/long-yield-carry/src/client/builders/burnTokenBuilder.js +0 -165
  102. package/dist/sdks/long-yield-carry/src/client/builders/claimIncentivesBuilder.d.ts +0 -9
  103. package/dist/sdks/long-yield-carry/src/client/builders/claimIncentivesBuilder.js +0 -135
  104. package/dist/sdks/long-yield-carry/src/client/builders/collectFeesBuilder.d.ts +0 -14
  105. package/dist/sdks/long-yield-carry/src/client/builders/collectFeesBuilder.js +0 -50
  106. package/dist/sdks/long-yield-carry/src/client/builders/collectInterestBuilder.d.ts +0 -8
  107. package/dist/sdks/long-yield-carry/src/client/builders/collectInterestBuilder.js +0 -86
  108. package/dist/sdks/long-yield-carry/src/client/builders/createCpiPlanBuilder.d.ts +0 -6
  109. package/dist/sdks/long-yield-carry/src/client/builders/createCpiPlanBuilder.js +0 -22
  110. package/dist/sdks/long-yield-carry/src/client/builders/createTokenBuilder.d.ts +0 -7
  111. package/dist/sdks/long-yield-carry/src/client/builders/createTokenBuilder.js +0 -64
  112. package/dist/sdks/long-yield-carry/src/client/builders/createTokenLendingPositionBuilder.d.ts +0 -10
  113. package/dist/sdks/long-yield-carry/src/client/builders/createTokenLendingPositionBuilder.js +0 -138
  114. package/dist/sdks/long-yield-carry/src/client/builders/createYieldingBankAllocationBuilder.d.ts +0 -7
  115. package/dist/sdks/long-yield-carry/src/client/builders/createYieldingBankAllocationBuilder.js +0 -29
  116. package/dist/sdks/long-yield-carry/src/client/builders/createYieldingBankBuilder.d.ts +0 -7
  117. package/dist/sdks/long-yield-carry/src/client/builders/createYieldingBankBuilder.js +0 -39
  118. package/dist/sdks/long-yield-carry/src/client/builders/decreaseCarryPositionBuilder.d.ts +0 -30
  119. package/dist/sdks/long-yield-carry/src/client/builders/decreaseCarryPositionBuilder.js +0 -99
  120. package/dist/sdks/long-yield-carry/src/client/builders/depositUnlentCollateralBuilder.d.ts +0 -8
  121. package/dist/sdks/long-yield-carry/src/client/builders/depositUnlentCollateralBuilder.js +0 -64
  122. package/dist/sdks/long-yield-carry/src/client/builders/increaseCarryPositionBuilder.d.ts +0 -8
  123. package/dist/sdks/long-yield-carry/src/client/builders/increaseCarryPositionBuilder.js +0 -73
  124. package/dist/sdks/long-yield-carry/src/client/builders/index.d.ts +0 -28
  125. package/dist/sdks/long-yield-carry/src/client/builders/index.js +0 -62
  126. package/dist/sdks/long-yield-carry/src/client/builders/mintTokenBuilder.d.ts +0 -8
  127. package/dist/sdks/long-yield-carry/src/client/builders/mintTokenBuilder.js +0 -95
  128. package/dist/sdks/long-yield-carry/src/client/builders/rebalanceTokenBuilder.d.ts +0 -11
  129. package/dist/sdks/long-yield-carry/src/client/builders/rebalanceTokenBuilder.js +0 -255
  130. package/dist/sdks/long-yield-carry/src/client/builders/rebalanceYieldingBankBuilder.d.ts +0 -8
  131. package/dist/sdks/long-yield-carry/src/client/builders/rebalanceYieldingBankBuilder.js +0 -75
  132. package/dist/sdks/long-yield-carry/src/client/builders/recollateralizeLossBuilder.d.ts +0 -12
  133. package/dist/sdks/long-yield-carry/src/client/builders/recollateralizeLossBuilder.js +0 -220
  134. package/dist/sdks/long-yield-carry/src/client/builders/refreshTokenStateBuilder.d.ts +0 -9
  135. package/dist/sdks/long-yield-carry/src/client/builders/refreshTokenStateBuilder.js +0 -112
  136. package/dist/sdks/long-yield-carry/src/client/builders/refreshTokensBuilder.d.ts +0 -9
  137. package/dist/sdks/long-yield-carry/src/client/builders/refreshTokensBuilder.js +0 -59
  138. package/dist/sdks/long-yield-carry/src/client/builders/refreshYieldingBankBuilder.d.ts +0 -8
  139. package/dist/sdks/long-yield-carry/src/client/builders/refreshYieldingBankBuilder.js +0 -29
  140. package/dist/sdks/long-yield-carry/src/client/builders/resetTokenBurnRateLimitBuilder.d.ts +0 -7
  141. package/dist/sdks/long-yield-carry/src/client/builders/resetTokenBurnRateLimitBuilder.js +0 -19
  142. package/dist/sdks/long-yield-carry/src/client/builders/setTokenCircuitBreakerBuilder.d.ts +0 -11
  143. package/dist/sdks/long-yield-carry/src/client/builders/setTokenCircuitBreakerBuilder.js +0 -31
  144. package/dist/sdks/long-yield-carry/src/client/builders/setYieldingBankCircuitBreakerBuilder.d.ts +0 -8
  145. package/dist/sdks/long-yield-carry/src/client/builders/setYieldingBankCircuitBreakerBuilder.js +0 -28
  146. package/dist/sdks/long-yield-carry/src/client/builders/updateLendingPositionConfigBuilder.d.ts +0 -10
  147. package/dist/sdks/long-yield-carry/src/client/builders/updateLendingPositionConfigBuilder.js +0 -30
  148. package/dist/sdks/long-yield-carry/src/client/builders/updateTokenConfigurationBuilder.d.ts +0 -11
  149. package/dist/sdks/long-yield-carry/src/client/builders/updateTokenConfigurationBuilder.js +0 -47
  150. package/dist/sdks/long-yield-carry/src/client/builders/updateTokenMetadataBuilder.d.ts +0 -7
  151. package/dist/sdks/long-yield-carry/src/client/builders/updateTokenMetadataBuilder.js +0 -24
  152. package/dist/sdks/long-yield-carry/src/client/builders/updateYieldingBankConfigBuilder.d.ts +0 -10
  153. package/dist/sdks/long-yield-carry/src/client/builders/updateYieldingBankConfigBuilder.js +0 -31
  154. package/dist/sdks/long-yield-carry/src/client/builders/utils.d.ts +0 -4
  155. package/dist/sdks/long-yield-carry/src/client/builders/utils.js +0 -20
  156. package/dist/sdks/long-yield-carry/src/client/client.d.ts +0 -115
  157. package/dist/sdks/long-yield-carry/src/client/client.js +0 -166
  158. package/dist/sdks/long-yield-carry/src/client/externalLiquidityResolver.d.ts +0 -13
  159. package/dist/sdks/long-yield-carry/src/client/externalLiquidityResolver.js +0 -34
  160. package/dist/sdks/long-yield-carry/src/client/index.d.ts +0 -10
  161. package/dist/sdks/long-yield-carry/src/client/index.js +0 -33
  162. package/dist/sdks/long-yield-carry/src/client/lendingPlatformClients.d.ts +0 -19
  163. package/dist/sdks/long-yield-carry/src/client/lendingPlatformClients.js +0 -33
  164. package/dist/sdks/long-yield-carry/src/client/pda.d.ts +0 -33
  165. package/dist/sdks/long-yield-carry/src/client/pda.js +0 -79
  166. package/dist/sdks/long-yield-carry/src/client/plans/collectInterest.d.ts +0 -24
  167. package/dist/sdks/long-yield-carry/src/client/plans/collectInterest.js +0 -150
  168. package/dist/sdks/long-yield-carry/src/client/plans/decreaseCarryPosition.d.ts +0 -12
  169. package/dist/sdks/long-yield-carry/src/client/plans/decreaseCarryPosition.js +0 -140
  170. package/dist/sdks/long-yield-carry/src/client/routes/collectInterest.d.ts +0 -13
  171. package/dist/sdks/long-yield-carry/src/client/routes/collectInterest.js +0 -39
  172. package/dist/sdks/long-yield-carry/src/client/transaction.d.ts +0 -41
  173. package/dist/sdks/long-yield-carry/src/client/transaction.js +0 -55
  174. package/dist/sdks/long-yield-carry/src/client/types/builders.d.ts +0 -18
  175. package/dist/sdks/long-yield-carry/src/client/types/builders.js +0 -2
  176. package/dist/sdks/long-yield-carry/src/client/types/enums.d.ts +0 -22
  177. package/dist/sdks/long-yield-carry/src/client/types/enums.js +0 -48
  178. package/dist/sdks/long-yield-carry/src/client/types/general.d.ts +0 -98
  179. package/dist/sdks/long-yield-carry/src/client/types/general.js +0 -2
  180. package/dist/sdks/long-yield-carry/src/client/types/index.d.ts +0 -6
  181. package/dist/sdks/long-yield-carry/src/client/types/index.js +0 -22
  182. package/dist/sdks/long-yield-carry/src/client/types/ix.d.ts +0 -352
  183. package/dist/sdks/long-yield-carry/src/client/types/ix.js +0 -2
  184. package/dist/sdks/long-yield-carry/src/client/types/planTypes/collectInterest.d.ts +0 -91
  185. package/dist/sdks/long-yield-carry/src/client/types/planTypes/collectInterest.js +0 -2
  186. package/dist/sdks/long-yield-carry/src/client/types/planTypes/common.d.ts +0 -28
  187. package/dist/sdks/long-yield-carry/src/client/types/planTypes/common.js +0 -2
  188. package/dist/sdks/long-yield-carry/src/client/types/planTypes/decreaseCarryPosition.d.ts +0 -128
  189. package/dist/sdks/long-yield-carry/src/client/types/planTypes/decreaseCarryPosition.js +0 -2
  190. package/dist/sdks/long-yield-carry/src/client/types/planTypes/index.d.ts +0 -3
  191. package/dist/sdks/long-yield-carry/src/client/types/planTypes/index.js +0 -19
  192. package/dist/sdks/long-yield-carry/src/client/types/tx.d.ts +0 -339
  193. package/dist/sdks/long-yield-carry/src/client/types/tx.js +0 -2
  194. package/dist/sdks/long-yield-carry/src/constants/configs/allocations.d.ts +0 -3
  195. package/dist/sdks/long-yield-carry/src/constants/configs/allocations.js +0 -23
  196. package/dist/sdks/long-yield-carry/src/constants/configs/carryTradePresets.d.ts +0 -58
  197. package/dist/sdks/long-yield-carry/src/constants/configs/carryTradePresets.js +0 -116
  198. package/dist/sdks/long-yield-carry/src/constants/configs/index.d.ts +0 -2
  199. package/dist/sdks/long-yield-carry/src/constants/configs/index.js +0 -18
  200. package/dist/sdks/long-yield-carry/src/constants/general.d.ts +0 -70
  201. package/dist/sdks/long-yield-carry/src/constants/general.js +0 -107
  202. package/dist/sdks/long-yield-carry/src/constants/index.d.ts +0 -3
  203. package/dist/sdks/long-yield-carry/src/constants/index.js +0 -19
  204. package/dist/sdks/long-yield-carry/src/constants/lycTokenMetadata.d.ts +0 -36
  205. package/dist/sdks/long-yield-carry/src/constants/lycTokenMetadata.js +0 -41
  206. package/dist/sdks/long-yield-carry/src/decoders/decodeTransaction.d.ts +0 -86
  207. package/dist/sdks/long-yield-carry/src/decoders/decodeTransaction.js +0 -230
  208. package/dist/sdks/long-yield-carry/src/decoders/discriminators.d.ts +0 -8
  209. package/dist/sdks/long-yield-carry/src/decoders/discriminators.js +0 -11
  210. package/dist/sdks/long-yield-carry/src/decoders/idlAccounts.d.ts +0 -29
  211. package/dist/sdks/long-yield-carry/src/decoders/idlAccounts.js +0 -57
  212. package/dist/sdks/long-yield-carry/src/decoders/index.d.ts +0 -6
  213. package/dist/sdks/long-yield-carry/src/decoders/index.js +0 -14
  214. package/dist/sdks/long-yield-carry/src/decoders/innerCpis.d.ts +0 -68
  215. package/dist/sdks/long-yield-carry/src/decoders/innerCpis.js +0 -225
  216. package/dist/sdks/long-yield-carry/src/decoders/lycInstructionNames.d.ts +0 -6
  217. package/dist/sdks/long-yield-carry/src/decoders/lycInstructionNames.js +0 -73
  218. package/dist/sdks/long-yield-carry/src/decoders/programIds.d.ts +0 -4
  219. package/dist/sdks/long-yield-carry/src/decoders/programIds.js +0 -11
  220. package/dist/sdks/long-yield-carry/src/decoders/solana.d.ts +0 -7
  221. package/dist/sdks/long-yield-carry/src/decoders/solana.js +0 -30
  222. package/dist/sdks/long-yield-carry/src/decoders/transactionPayload.d.ts +0 -41
  223. package/dist/sdks/long-yield-carry/src/decoders/transactionPayload.js +0 -6
  224. package/dist/sdks/long-yield-carry/src/decoders/types.d.ts +0 -58
  225. package/dist/sdks/long-yield-carry/src/decoders/types.js +0 -2
  226. package/dist/sdks/long-yield-carry/src/errors.d.ts +0 -69
  227. package/dist/sdks/long-yield-carry/src/errors.js +0 -183
  228. package/dist/sdks/long-yield-carry/src/idl/long_yield_carry.js +0 -7323
  229. package/dist/sdks/long-yield-carry/src/index.d.ts +0 -10
  230. package/dist/sdks/long-yield-carry/src/index.js +0 -25
  231. package/dist/sdks/long-yield-carry/src/metrics/index.d.ts +0 -1
  232. package/dist/sdks/long-yield-carry/src/metrics/index.js +0 -17
  233. package/dist/sdks/long-yield-carry/src/metrics/protocolMetrics.d.ts +0 -276
  234. package/dist/sdks/long-yield-carry/src/metrics/protocolMetrics.js +0 -547
  235. package/dist/sdks/long-yield-carry/src/models/index.d.ts +0 -3
  236. package/dist/sdks/long-yield-carry/src/models/index.js +0 -7
  237. package/dist/sdks/long-yield-carry/src/models/lycToken.d.ts +0 -156
  238. package/dist/sdks/long-yield-carry/src/models/lycToken.js +0 -288
  239. package/dist/sdks/long-yield-carry/src/models/yieldingBank.d.ts +0 -52
  240. package/dist/sdks/long-yield-carry/src/models/yieldingBank.js +0 -109
  241. package/dist/sdks/long-yield-carry/src/services/allocation/allocationService.d.ts +0 -106
  242. package/dist/sdks/long-yield-carry/src/services/allocation/allocationService.js +0 -589
  243. package/dist/sdks/long-yield-carry/src/services/allocation/index.d.ts +0 -2
  244. package/dist/sdks/long-yield-carry/src/services/allocation/index.js +0 -18
  245. package/dist/sdks/long-yield-carry/src/services/allocation/types.d.ts +0 -25
  246. package/dist/sdks/long-yield-carry/src/services/allocation/types.js +0 -2
  247. package/dist/sdks/long-yield-carry/src/services/carry/carryAllocationConfig.d.ts +0 -103
  248. package/dist/sdks/long-yield-carry/src/services/carry/carryAllocationConfig.js +0 -146
  249. package/dist/sdks/long-yield-carry/src/services/carry/index.d.ts +0 -2
  250. package/dist/sdks/long-yield-carry/src/services/carry/index.js +0 -18
  251. package/dist/sdks/long-yield-carry/src/services/carry/lycLendingPositionManager.d.ts +0 -39
  252. package/dist/sdks/long-yield-carry/src/services/carry/lycLendingPositionManager.js +0 -100
  253. package/dist/sdks/long-yield-carry/src/services/index.d.ts +0 -5
  254. package/dist/sdks/long-yield-carry/src/services/index.js +0 -21
  255. package/dist/sdks/long-yield-carry/src/services/lendingPosition/index.d.ts +0 -2
  256. package/dist/sdks/long-yield-carry/src/services/lendingPosition/index.js +0 -5
  257. package/dist/sdks/long-yield-carry/src/services/lendingPosition/lendingPositionService.d.ts +0 -88
  258. package/dist/sdks/long-yield-carry/src/services/lendingPosition/lendingPositionService.js +0 -229
  259. package/dist/sdks/long-yield-carry/src/services/rebalance/index.d.ts +0 -2
  260. package/dist/sdks/long-yield-carry/src/services/rebalance/index.js +0 -18
  261. package/dist/sdks/long-yield-carry/src/services/rebalance/token/index.d.ts +0 -1
  262. package/dist/sdks/long-yield-carry/src/services/rebalance/token/index.js +0 -17
  263. package/dist/sdks/long-yield-carry/src/services/rebalance/token/tokenRebalanceService.d.ts +0 -51
  264. package/dist/sdks/long-yield-carry/src/services/rebalance/token/tokenRebalanceService.js +0 -99
  265. package/dist/sdks/long-yield-carry/src/services/rebalance/yieldingBank/index.d.ts +0 -3
  266. package/dist/sdks/long-yield-carry/src/services/rebalance/yieldingBank/index.js +0 -21
  267. package/dist/sdks/long-yield-carry/src/services/rebalance/yieldingBank/planner.d.ts +0 -68
  268. package/dist/sdks/long-yield-carry/src/services/rebalance/yieldingBank/planner.js +0 -181
  269. package/dist/sdks/long-yield-carry/src/services/rebalance/yieldingBank/strategy.d.ts +0 -26
  270. package/dist/sdks/long-yield-carry/src/services/rebalance/yieldingBank/strategy.js +0 -26
  271. package/dist/sdks/long-yield-carry/src/services/rebalance/yieldingBank/types.d.ts +0 -40
  272. package/dist/sdks/long-yield-carry/src/services/rebalance/yieldingBank/types.js +0 -2
  273. package/dist/sdks/long-yield-carry/src/services/redemption/index.d.ts +0 -2
  274. package/dist/sdks/long-yield-carry/src/services/redemption/index.js +0 -5
  275. package/dist/sdks/long-yield-carry/src/services/redemption/redemptionService.d.ts +0 -139
  276. package/dist/sdks/long-yield-carry/src/services/redemption/redemptionService.js +0 -532
  277. package/dist/sdks/long-yield-carry/src/types/enriched.d.ts +0 -168
  278. package/dist/sdks/long-yield-carry/src/types/enriched.js +0 -2
  279. package/dist/sdks/long-yield-carry/src/types/index.d.ts +0 -1
  280. package/dist/sdks/long-yield-carry/src/types/index.js +0 -17
  281. package/dist/sdks/long-yield-carry/src/utils/cache.d.ts +0 -4
  282. package/dist/sdks/long-yield-carry/src/utils/cache.js +0 -10
  283. package/dist/sdks/long-yield-carry/src/utils/data.d.ts +0 -12
  284. package/dist/sdks/long-yield-carry/src/utils/data.js +0 -59
  285. package/dist/sdks/long-yield-carry/src/utils/enrichment.d.ts +0 -5
  286. package/dist/sdks/long-yield-carry/src/utils/enrichment.js +0 -244
  287. package/dist/sdks/long-yield-carry/src/utils/feeDripMetrics.d.ts +0 -36
  288. package/dist/sdks/long-yield-carry/src/utils/feeDripMetrics.js +0 -93
  289. package/dist/sdks/long-yield-carry/src/utils/general.d.ts +0 -28
  290. package/dist/sdks/long-yield-carry/src/utils/general.js +0 -47
  291. package/dist/sdks/long-yield-carry/src/utils/index.d.ts +0 -13
  292. package/dist/sdks/long-yield-carry/src/utils/index.js +0 -29
  293. package/dist/sdks/long-yield-carry/src/utils/ix.d.ts +0 -83
  294. package/dist/sdks/long-yield-carry/src/utils/ix.js +0 -165
  295. package/dist/sdks/long-yield-carry/src/utils/lendingPosition.d.ts +0 -68
  296. package/dist/sdks/long-yield-carry/src/utils/lendingPosition.js +0 -105
  297. package/dist/sdks/long-yield-carry/src/utils/lookupTables.d.ts +0 -55
  298. package/dist/sdks/long-yield-carry/src/utils/lookupTables.js +0 -216
  299. package/dist/sdks/long-yield-carry/src/utils/lycData.d.ts +0 -66
  300. package/dist/sdks/long-yield-carry/src/utils/lycData.js +0 -211
  301. package/dist/sdks/long-yield-carry/src/utils/timelock.d.ts +0 -19
  302. package/dist/sdks/long-yield-carry/src/utils/timelock.js +0 -37
  303. package/dist/sdks/long-yield-carry/src/utils/tokenFeeMath.d.ts +0 -11
  304. package/dist/sdks/long-yield-carry/src/utils/tokenFeeMath.js +0 -24
  305. package/dist/sdks/long-yield-carry/src/utils/transactions.d.ts +0 -20
  306. package/dist/sdks/long-yield-carry/src/utils/transactions.js +0 -72
  307. package/dist/sdks/long-yield-carry/src/utils/yieldingBank.d.ts +0 -24
  308. package/dist/sdks/long-yield-carry/src/utils/yieldingBank.js +0 -36
  309. package/dist/shared/common/src/constants/accountMetas.d.ts +0 -3
  310. package/dist/shared/common/src/constants/accountMetas.js +0 -9
  311. package/dist/shared/common/src/constants/general.d.ts +0 -21
  312. package/dist/shared/common/src/constants/general.js +0 -30
  313. package/dist/shared/common/src/constants/generated/cpi.d.ts +0 -23
  314. package/dist/shared/common/src/constants/generated/cpi.js +0 -28
  315. package/dist/shared/common/src/constants/generated/index.d.ts +0 -1
  316. package/dist/shared/common/src/constants/generated/index.js +0 -17
  317. package/dist/shared/common/src/constants/index.d.ts +0 -3
  318. package/dist/shared/common/src/constants/index.js +0 -19
  319. package/dist/shared/common/src/index.d.ts +0 -4
  320. package/dist/shared/common/src/index.js +0 -20
  321. package/dist/shared/common/src/services/baseAccountClient.d.ts +0 -22
  322. package/dist/shared/common/src/services/baseAccountClient.js +0 -38
  323. package/dist/shared/common/src/services/baseIxBuilderService.d.ts +0 -27
  324. package/dist/shared/common/src/services/baseIxBuilderService.js +0 -48
  325. package/dist/shared/common/src/services/dataCache.d.ts +0 -41
  326. package/dist/shared/common/src/services/dataCache.js +0 -130
  327. package/dist/shared/common/src/services/index.d.ts +0 -8
  328. package/dist/shared/common/src/services/index.js +0 -24
  329. package/dist/shared/common/src/services/lutManager.d.ts +0 -31
  330. package/dist/shared/common/src/services/lutManager.js +0 -133
  331. package/dist/shared/common/src/services/mints/defaults.d.ts +0 -2
  332. package/dist/shared/common/src/services/mints/defaults.js +0 -152
  333. package/dist/shared/common/src/services/mints/index.d.ts +0 -4
  334. package/dist/shared/common/src/services/mints/index.js +0 -20
  335. package/dist/shared/common/src/services/mints/registry.d.ts +0 -70
  336. package/dist/shared/common/src/services/mints/registry.js +0 -117
  337. package/dist/shared/common/src/services/mints/symbols.d.ts +0 -6
  338. package/dist/shared/common/src/services/mints/symbols.js +0 -13
  339. package/dist/shared/common/src/services/mints/types.d.ts +0 -30
  340. package/dist/shared/common/src/services/mints/types.js +0 -2
  341. package/dist/shared/common/src/services/swap/index.d.ts +0 -4
  342. package/dist/shared/common/src/services/swap/index.js +0 -20
  343. package/dist/shared/common/src/services/swap/routableSwapClient.d.ts +0 -36
  344. package/dist/shared/common/src/services/swap/routableSwapClient.js +0 -2
  345. package/dist/shared/common/src/services/swap/swapClientBase.d.ts +0 -45
  346. package/dist/shared/common/src/services/swap/swapClientBase.js +0 -2
  347. package/dist/shared/common/src/services/swap/swapRouting.d.ts +0 -13
  348. package/dist/shared/common/src/services/swap/swapRouting.js +0 -28
  349. package/dist/shared/common/src/services/swap/types.d.ts +0 -77
  350. package/dist/shared/common/src/services/swap/types.js +0 -2
  351. package/dist/shared/common/src/services/token/index.d.ts +0 -2
  352. package/dist/shared/common/src/services/token/index.js +0 -18
  353. package/dist/shared/common/src/services/token/tokenProtocolClientBase.d.ts +0 -51
  354. package/dist/shared/common/src/services/token/tokenProtocolClientBase.js +0 -2
  355. package/dist/shared/common/src/services/token/types.d.ts +0 -19
  356. package/dist/shared/common/src/services/token/types.js +0 -2
  357. package/dist/shared/common/src/services/transactionSender.d.ts +0 -24
  358. package/dist/shared/common/src/services/transactionSender.js +0 -30
  359. package/dist/shared/common/src/types/cpi.d.ts +0 -34
  360. package/dist/shared/common/src/types/cpi.js +0 -8
  361. package/dist/shared/common/src/types/enums.d.ts +0 -59
  362. package/dist/shared/common/src/types/enums.js +0 -122
  363. package/dist/shared/common/src/types/general.d.ts +0 -38
  364. package/dist/shared/common/src/types/general.js +0 -2
  365. package/dist/shared/common/src/types/index.d.ts +0 -4
  366. package/dist/shared/common/src/types/index.js +0 -20
  367. package/dist/shared/common/src/types/solana.d.ts +0 -24
  368. package/dist/shared/common/src/types/solana.js +0 -2
  369. package/dist/shared/common/src/utils/accounts/index.d.ts +0 -5
  370. package/dist/shared/common/src/utils/accounts/index.js +0 -21
  371. package/dist/shared/common/src/utils/accounts/meta.d.ts +0 -21
  372. package/dist/shared/common/src/utils/accounts/meta.js +0 -27
  373. package/dist/shared/common/src/utils/accounts/pda.d.ts +0 -2
  374. package/dist/shared/common/src/utils/accounts/pda.js +0 -17
  375. package/dist/shared/common/src/utils/accounts/roles.d.ts +0 -26
  376. package/dist/shared/common/src/utils/accounts/roles.js +0 -54
  377. package/dist/shared/common/src/utils/accounts/rpc.d.ts +0 -8
  378. package/dist/shared/common/src/utils/accounts/rpc.js +0 -30
  379. package/dist/shared/common/src/utils/accounts/splBalances.d.ts +0 -15
  380. package/dist/shared/common/src/utils/accounts/splBalances.js +0 -52
  381. package/dist/shared/common/src/utils/anchor.d.ts +0 -17
  382. package/dist/shared/common/src/utils/anchor.js +0 -29
  383. package/dist/shared/common/src/utils/asyncConcurrency.d.ts +0 -5
  384. package/dist/shared/common/src/utils/asyncConcurrency.js +0 -28
  385. package/dist/shared/common/src/utils/compat.d.ts +0 -46
  386. package/dist/shared/common/src/utils/compat.js +0 -72
  387. package/dist/shared/common/src/utils/cpi/args.d.ts +0 -69
  388. package/dist/shared/common/src/utils/cpi/args.js +0 -100
  389. package/dist/shared/common/src/utils/cpi/index.d.ts +0 -2
  390. package/dist/shared/common/src/utils/cpi/index.js +0 -18
  391. package/dist/shared/common/src/utils/cpi/refs.d.ts +0 -122
  392. package/dist/shared/common/src/utils/cpi/refs.js +0 -234
  393. package/dist/shared/common/src/utils/data.d.ts +0 -20
  394. package/dist/shared/common/src/utils/data.js +0 -27
  395. package/dist/shared/common/src/utils/general.d.ts +0 -24
  396. package/dist/shared/common/src/utils/general.js +0 -95
  397. package/dist/shared/common/src/utils/index.d.ts +0 -22
  398. package/dist/shared/common/src/utils/index.js +0 -38
  399. package/dist/shared/common/src/utils/instruction.d.ts +0 -74
  400. package/dist/shared/common/src/utils/instruction.js +0 -147
  401. package/dist/shared/common/src/utils/jito.d.ts +0 -113
  402. package/dist/shared/common/src/utils/jito.js +0 -178
  403. package/dist/shared/common/src/utils/json.d.ts +0 -5
  404. package/dist/shared/common/src/utils/json.js +0 -25
  405. package/dist/shared/common/src/utils/jsonRpcFetch.d.ts +0 -21
  406. package/dist/shared/common/src/utils/jsonRpcFetch.js +0 -134
  407. package/dist/shared/common/src/utils/metadata.d.ts +0 -107
  408. package/dist/shared/common/src/utils/metadata.js +0 -194
  409. package/dist/shared/common/src/utils/numbers.d.ts +0 -72
  410. package/dist/shared/common/src/utils/numbers.js +0 -193
  411. package/dist/shared/common/src/utils/priorityFee.d.ts +0 -18
  412. package/dist/shared/common/src/utils/priorityFee.js +0 -63
  413. package/dist/shared/common/src/utils/retry.d.ts +0 -20
  414. package/dist/shared/common/src/utils/retry.js +0 -69
  415. package/dist/shared/common/src/utils/rpc.d.ts +0 -40
  416. package/dist/shared/common/src/utils/rpc.js +0 -130
  417. package/dist/shared/common/src/utils/solana.d.ts +0 -23
  418. package/dist/shared/common/src/utils/solana.js +0 -61
  419. package/dist/shared/common/src/utils/timeSeries.d.ts +0 -18
  420. package/dist/shared/common/src/utils/timeSeries.js +0 -40
  421. package/dist/shared/common/src/utils/token.d.ts +0 -33
  422. package/dist/shared/common/src/utils/token.js +0 -82
  423. package/dist/shared/common/src/utils/transaction.d.ts +0 -154
  424. package/dist/shared/common/src/utils/transaction.js +0 -585
  425. package/dist/shared/common/src/utils/transactionSplitter.d.ts +0 -85
  426. package/dist/shared/common/src/utils/transactionSplitter.js +0 -127
  427. package/dist/shared/common/src/utils/txAccountCoverage.d.ts +0 -49
  428. package/dist/shared/common/src/utils/txAccountCoverage.js +0 -122
  429. package/dist/shared/jupiter-helpers/src/api.d.ts +0 -59
  430. package/dist/shared/jupiter-helpers/src/api.js +0 -130
  431. package/dist/shared/jupiter-helpers/src/client.d.ts +0 -79
  432. package/dist/shared/jupiter-helpers/src/client.js +0 -173
  433. package/dist/shared/jupiter-helpers/src/constants.d.ts +0 -35
  434. package/dist/shared/jupiter-helpers/src/constants.js +0 -38
  435. package/dist/shared/jupiter-helpers/src/extract.d.ts +0 -30
  436. package/dist/shared/jupiter-helpers/src/extract.js +0 -57
  437. package/dist/shared/jupiter-helpers/src/index.d.ts +0 -5
  438. package/dist/shared/jupiter-helpers/src/index.js +0 -21
  439. package/dist/shared/jupiter-helpers/src/routePreInstructions.d.ts +0 -19
  440. package/dist/shared/jupiter-helpers/src/routePreInstructions.js +0 -61
  441. package/dist/shared/jupiter-helpers/src/sizeExactInForMinOutput.d.ts +0 -70
  442. package/dist/shared/jupiter-helpers/src/sizeExactInForMinOutput.js +0 -95
  443. package/dist/shared/jupiter-helpers/src/types.d.ts +0 -66
  444. package/dist/shared/jupiter-helpers/src/types.js +0 -2
  445. package/dist/shared/lending-platforms/src/constants/cache.d.ts +0 -8
  446. package/dist/shared/lending-platforms/src/constants/cache.js +0 -11
  447. package/dist/shared/lending-platforms/src/constants/index.d.ts +0 -3
  448. package/dist/shared/lending-platforms/src/constants/index.js +0 -19
  449. package/dist/shared/lending-platforms/src/constants/kamino.d.ts +0 -7
  450. package/dist/shared/lending-platforms/src/constants/kamino.js +0 -83
  451. package/dist/shared/lending-platforms/src/constants/lendingPosition.d.ts +0 -7
  452. package/dist/shared/lending-platforms/src/constants/lendingPosition.js +0 -10
  453. package/dist/shared/lending-platforms/src/data/accounts/index.d.ts +0 -2
  454. package/dist/shared/lending-platforms/src/data/accounts/index.js +0 -18
  455. package/dist/shared/lending-platforms/src/data/accounts/kamino.d.ts +0 -42
  456. package/dist/shared/lending-platforms/src/data/accounts/kamino.js +0 -104
  457. package/dist/shared/lending-platforms/src/data/accounts/lpAccountsBase.d.ts +0 -7
  458. package/dist/shared/lending-platforms/src/data/accounts/lpAccountsBase.js +0 -9
  459. package/dist/shared/lending-platforms/src/data/incentive/incentiveBase.d.ts +0 -35
  460. package/dist/shared/lending-platforms/src/data/incentive/incentiveBase.js +0 -26
  461. package/dist/shared/lending-platforms/src/data/incentive/index.d.ts +0 -2
  462. package/dist/shared/lending-platforms/src/data/incentive/index.js +0 -18
  463. package/dist/shared/lending-platforms/src/data/incentive/kamino.d.ts +0 -55
  464. package/dist/shared/lending-platforms/src/data/incentive/kamino.js +0 -101
  465. package/dist/shared/lending-platforms/src/data/index.d.ts +0 -6
  466. package/dist/shared/lending-platforms/src/data/index.js +0 -22
  467. package/dist/shared/lending-platforms/src/data/instructions/index.d.ts +0 -3
  468. package/dist/shared/lending-platforms/src/data/instructions/index.js +0 -19
  469. package/dist/shared/lending-platforms/src/data/instructions/kamino.d.ts +0 -55
  470. package/dist/shared/lending-platforms/src/data/instructions/kamino.js +0 -630
  471. package/dist/shared/lending-platforms/src/data/instructions/lpInstructionsBase.d.ts +0 -175
  472. package/dist/shared/lending-platforms/src/data/instructions/lpInstructionsBase.js +0 -192
  473. package/dist/shared/lending-platforms/src/data/instructions/types.d.ts +0 -7
  474. package/dist/shared/lending-platforms/src/data/instructions/types.js +0 -2
  475. package/dist/shared/lending-platforms/src/data/platform/index.d.ts +0 -2
  476. package/dist/shared/lending-platforms/src/data/platform/index.js +0 -18
  477. package/dist/shared/lending-platforms/src/data/platform/kamino.d.ts +0 -59
  478. package/dist/shared/lending-platforms/src/data/platform/kamino.js +0 -206
  479. package/dist/shared/lending-platforms/src/data/platform/lpDataBase.d.ts +0 -35
  480. package/dist/shared/lending-platforms/src/data/platform/lpDataBase.js +0 -31
  481. package/dist/shared/lending-platforms/src/data/reserve/index.d.ts +0 -2
  482. package/dist/shared/lending-platforms/src/data/reserve/index.js +0 -18
  483. package/dist/shared/lending-platforms/src/data/reserve/kamino.d.ts +0 -45
  484. package/dist/shared/lending-platforms/src/data/reserve/kamino.js +0 -141
  485. package/dist/shared/lending-platforms/src/data/reserve/reserveBase.d.ts +0 -114
  486. package/dist/shared/lending-platforms/src/data/reserve/reserveBase.js +0 -125
  487. package/dist/shared/lending-platforms/src/data/userPosition/index.d.ts +0 -2
  488. package/dist/shared/lending-platforms/src/data/userPosition/index.js +0 -18
  489. package/dist/shared/lending-platforms/src/data/userPosition/kamino.d.ts +0 -15
  490. package/dist/shared/lending-platforms/src/data/userPosition/kamino.js +0 -45
  491. package/dist/shared/lending-platforms/src/data/userPosition/userPositionBase.d.ts +0 -50
  492. package/dist/shared/lending-platforms/src/data/userPosition/userPositionBase.js +0 -63
  493. package/dist/shared/lending-platforms/src/index.d.ts +0 -5
  494. package/dist/shared/lending-platforms/src/index.js +0 -21
  495. package/dist/shared/lending-platforms/src/services/client/index.d.ts +0 -2
  496. package/dist/shared/lending-platforms/src/services/client/index.js +0 -18
  497. package/dist/shared/lending-platforms/src/services/client/kamino.d.ts +0 -53
  498. package/dist/shared/lending-platforms/src/services/client/kamino.js +0 -142
  499. package/dist/shared/lending-platforms/src/services/client/lpClientBase.d.ts +0 -66
  500. package/dist/shared/lending-platforms/src/services/client/lpClientBase.js +0 -19
  501. package/dist/shared/lending-platforms/src/services/flashLoan/flashLoanBase.d.ts +0 -49
  502. package/dist/shared/lending-platforms/src/services/flashLoan/flashLoanBase.js +0 -16
  503. package/dist/shared/lending-platforms/src/services/flashLoan/index.d.ts +0 -2
  504. package/dist/shared/lending-platforms/src/services/flashLoan/index.js +0 -18
  505. package/dist/shared/lending-platforms/src/services/flashLoan/kamino.d.ts +0 -11
  506. package/dist/shared/lending-platforms/src/services/flashLoan/kamino.js +0 -85
  507. package/dist/shared/lending-platforms/src/services/index.d.ts +0 -5
  508. package/dist/shared/lending-platforms/src/services/index.js +0 -21
  509. package/dist/shared/lending-platforms/src/services/lendingPosition/index.d.ts +0 -2
  510. package/dist/shared/lending-platforms/src/services/lendingPosition/index.js +0 -18
  511. package/dist/shared/lending-platforms/src/services/lendingPosition/lendingPositionManager.d.ts +0 -117
  512. package/dist/shared/lending-platforms/src/services/lendingPosition/lendingPositionManager.js +0 -342
  513. package/dist/shared/lending-platforms/src/services/lendingPosition/types.d.ts +0 -40
  514. package/dist/shared/lending-platforms/src/services/lendingPosition/types.js +0 -2
  515. package/dist/shared/lending-platforms/src/services/leverage/index.d.ts +0 -2
  516. package/dist/shared/lending-platforms/src/services/leverage/index.js +0 -18
  517. package/dist/shared/lending-platforms/src/services/leverage/leverageService.d.ts +0 -104
  518. package/dist/shared/lending-platforms/src/services/leverage/leverageService.js +0 -437
  519. package/dist/shared/lending-platforms/src/services/leverage/types.d.ts +0 -261
  520. package/dist/shared/lending-platforms/src/services/leverage/types.js +0 -2
  521. package/dist/shared/lending-platforms/src/services/reservesManager.d.ts +0 -53
  522. package/dist/shared/lending-platforms/src/services/reservesManager.js +0 -112
  523. package/dist/shared/lending-platforms/src/types/general.d.ts +0 -37
  524. package/dist/shared/lending-platforms/src/types/general.js +0 -8
  525. package/dist/shared/lending-platforms/src/types/index.d.ts +0 -2
  526. package/dist/shared/lending-platforms/src/types/index.js +0 -18
  527. package/dist/shared/lending-platforms/src/types/kamino.d.ts +0 -10
  528. package/dist/shared/lending-platforms/src/types/kamino.js +0 -2
  529. package/dist/shared/lending-platforms/src/utils/accounts.d.ts +0 -16
  530. package/dist/shared/lending-platforms/src/utils/accounts.js +0 -36
  531. package/dist/shared/lending-platforms/src/utils/cache.d.ts +0 -3
  532. package/dist/shared/lending-platforms/src/utils/cache.js +0 -11
  533. package/dist/shared/lending-platforms/src/utils/index.d.ts +0 -6
  534. package/dist/shared/lending-platforms/src/utils/index.js +0 -22
  535. package/dist/shared/lending-platforms/src/utils/kamino.d.ts +0 -87
  536. package/dist/shared/lending-platforms/src/utils/kamino.js +0 -190
  537. package/dist/shared/lending-platforms/src/utils/lendingPlatform.d.ts +0 -6
  538. package/dist/shared/lending-platforms/src/utils/lendingPlatform.js +0 -16
  539. package/dist/shared/lending-platforms/src/utils/math.d.ts +0 -47
  540. package/dist/shared/lending-platforms/src/utils/math.js +0 -123
  541. package/dist/shared/lending-platforms/src/utils/scope.d.ts +0 -38
  542. package/dist/shared/lending-platforms/src/utils/scope.js +0 -144
  543. package/dist/shared/oracle-service/src/constants/index.d.ts +0 -3
  544. package/dist/shared/oracle-service/src/constants/index.js +0 -19
  545. package/dist/shared/oracle-service/src/constants/pyth.d.ts +0 -7
  546. package/dist/shared/oracle-service/src/constants/pyth.js +0 -71
  547. package/dist/shared/oracle-service/src/constants/splStake.d.ts +0 -2
  548. package/dist/shared/oracle-service/src/constants/splStake.js +0 -6
  549. package/dist/shared/oracle-service/src/constants/switchboard.d.ts +0 -7
  550. package/dist/shared/oracle-service/src/constants/switchboard.js +0 -10
  551. package/dist/shared/oracle-service/src/feeds/custom.d.ts +0 -30
  552. package/dist/shared/oracle-service/src/feeds/custom.js +0 -56
  553. package/dist/shared/oracle-service/src/feeds/jupiter.d.ts +0 -7
  554. package/dist/shared/oracle-service/src/feeds/jupiter.js +0 -43
  555. package/dist/shared/oracle-service/src/feeds/priceBase.d.ts +0 -13
  556. package/dist/shared/oracle-service/src/feeds/priceBase.js +0 -25
  557. package/dist/shared/oracle-service/src/feeds/pyth.d.ts +0 -8
  558. package/dist/shared/oracle-service/src/feeds/pyth.js +0 -59
  559. package/dist/shared/oracle-service/src/feeds/splStake.d.ts +0 -26
  560. package/dist/shared/oracle-service/src/feeds/splStake.js +0 -99
  561. package/dist/shared/oracle-service/src/feeds/switchboard.d.ts +0 -6
  562. package/dist/shared/oracle-service/src/feeds/switchboard.js +0 -11
  563. package/dist/shared/oracle-service/src/index.d.ts +0 -5
  564. package/dist/shared/oracle-service/src/index.js +0 -26
  565. package/dist/shared/oracle-service/src/oracle.d.ts +0 -22
  566. package/dist/shared/oracle-service/src/oracle.js +0 -104
  567. package/dist/shared/oracle-service/src/types.d.ts +0 -4
  568. package/dist/shared/oracle-service/src/types.js +0 -2
  569. package/dist/shared/oracle-service/src/utils/general.d.ts +0 -20
  570. package/dist/shared/oracle-service/src/utils/general.js +0 -65
  571. package/dist/shared/oracle-service/src/utils/index.d.ts +0 -1
  572. package/dist/shared/oracle-service/src/utils/index.js +0 -17
  573. package/dist/shared/perena-helpers/src/accounts.d.ts +0 -7
  574. package/dist/shared/perena-helpers/src/accounts.js +0 -12
  575. package/dist/shared/perena-helpers/src/client.d.ts +0 -299
  576. package/dist/shared/perena-helpers/src/client.js +0 -680
  577. package/dist/shared/perena-helpers/src/constants.d.ts +0 -5
  578. package/dist/shared/perena-helpers/src/constants.js +0 -8
  579. package/dist/shared/perena-helpers/src/cpi/burn.d.ts +0 -27
  580. package/dist/shared/perena-helpers/src/cpi/burn.js +0 -22
  581. package/dist/shared/perena-helpers/src/cpi/index.d.ts +0 -3
  582. package/dist/shared/perena-helpers/src/cpi/index.js +0 -19
  583. package/dist/shared/perena-helpers/src/cpi/mint.d.ts +0 -27
  584. package/dist/shared/perena-helpers/src/cpi/mint.js +0 -22
  585. package/dist/shared/perena-helpers/src/cpi/requestUnstake.d.ts +0 -19
  586. package/dist/shared/perena-helpers/src/cpi/requestUnstake.js +0 -16
  587. package/dist/shared/perena-helpers/src/index.d.ts +0 -5
  588. package/dist/shared/perena-helpers/src/index.js +0 -21
  589. package/dist/shared/perena-helpers/src/utils.d.ts +0 -9
  590. package/dist/shared/perena-helpers/src/utils.js +0 -54
  591. package/dist/shared/swap-aggregator/src/aggSwapClient.d.ts +0 -71
  592. package/dist/shared/swap-aggregator/src/aggSwapClient.js +0 -103
  593. package/dist/shared/swap-aggregator/src/index.d.ts +0 -1
  594. package/dist/shared/swap-aggregator/src/index.js +0 -17
  595. package/docs/launchingToken.md +0 -57
  596. package/scripts/asyncBurn.ts +0 -155
  597. package/scripts/burnToken.ts +0 -120
  598. package/scripts/claimIncentives.ts +0 -125
  599. package/scripts/closeCpiPlans.ts +0 -113
  600. package/scripts/collectInterest.ts +0 -194
  601. package/scripts/collectProtocolFees.ts +0 -144
  602. package/scripts/computeOptimalAllocations.ts +0 -117
  603. package/scripts/createToken.ts +0 -100
  604. package/scripts/createTokenLendingPosition.ts +0 -204
  605. package/scripts/createYieldingBank.ts +0 -91
  606. package/scripts/decreaseCarryPositions.ts +0 -359
  607. package/scripts/depositUnlentCollateral.ts +0 -106
  608. package/scripts/emergency/deleverageAll.ts +0 -287
  609. package/scripts/emergency/triggerCircuitBreaker.ts +0 -87
  610. package/scripts/env.ts +0 -4
  611. package/scripts/findTxs.ts +0 -169
  612. package/scripts/increaseCarryPositions.ts +0 -134
  613. package/scripts/inspect/format.ts +0 -576
  614. package/scripts/inspect.ts +0 -147
  615. package/scripts/localUtils.ts +0 -249
  616. package/scripts/mintToken.ts +0 -126
  617. package/scripts/processAsyncBurns.ts +0 -89
  618. package/scripts/rebalanceToken.ts +0 -269
  619. package/scripts/rebalanceYieldingBank.ts +0 -183
  620. package/scripts/recollateralizeLoss.ts +0 -79
  621. package/scripts/refresh.ts +0 -156
  622. package/scripts/updateFees.ts +0 -486
  623. package/scripts/updateGeneralLut.ts +0 -36
  624. package/scripts/updateLendingPositionConfig.ts +0 -172
  625. package/scripts/updateTokenLuts.ts +0 -36
  626. package/scripts/updateTokenMetadata.ts +0 -199
  627. package/scripts/updateYieldingBankConfig.ts +0 -100
  628. package/scripts/withdrawUnlentCollateral.ts +0 -178
  629. package/src/client/account.ts +0 -503
  630. package/src/client/builders/args.ts +0 -381
  631. package/src/client/builders/asyncBurnBuilder.ts +0 -305
  632. package/src/client/builders/base.ts +0 -303
  633. package/src/client/builders/burnTokenBuilder.ts +0 -258
  634. package/src/client/builders/claimIncentivesBuilder.ts +0 -211
  635. package/src/client/builders/collectFeesBuilder.ts +0 -52
  636. package/src/client/builders/collectInterestBuilder.ts +0 -165
  637. package/src/client/builders/createCpiPlanBuilder.ts +0 -21
  638. package/src/client/builders/createTokenBuilder.ts +0 -73
  639. package/src/client/builders/createTokenLendingPositionBuilder.ts +0 -219
  640. package/src/client/builders/createYieldingBankAllocationBuilder.ts +0 -32
  641. package/src/client/builders/createYieldingBankBuilder.ts +0 -39
  642. package/src/client/builders/decreaseCarryPositionBuilder.ts +0 -162
  643. package/src/client/builders/depositUnlentCollateralBuilder.ts +0 -95
  644. package/src/client/builders/increaseCarryPositionBuilder.ts +0 -105
  645. package/src/client/builders/index.ts +0 -37
  646. package/src/client/builders/mintTokenBuilder.ts +0 -137
  647. package/src/client/builders/rebalanceTokenBuilder.ts +0 -356
  648. package/src/client/builders/rebalanceYieldingBankBuilder.ts +0 -109
  649. package/src/client/builders/recollateralizeLossBuilder.ts +0 -367
  650. package/src/client/builders/refreshTokenStateBuilder.ts +0 -153
  651. package/src/client/builders/refreshTokensBuilder.ts +0 -82
  652. package/src/client/builders/refreshYieldingBankBuilder.ts +0 -42
  653. package/src/client/builders/resetTokenBurnRateLimitBuilder.ts +0 -21
  654. package/src/client/builders/setTokenCircuitBreakerBuilder.ts +0 -40
  655. package/src/client/builders/setYieldingBankCircuitBreakerBuilder.ts +0 -37
  656. package/src/client/builders/updateLendingPositionConfigBuilder.ts +0 -33
  657. package/src/client/builders/updateTokenConfigurationBuilder.ts +0 -50
  658. package/src/client/builders/updateTokenMetadataBuilder.ts +0 -24
  659. package/src/client/builders/updateYieldingBankConfigBuilder.ts +0 -32
  660. package/src/client/builders/utils.ts +0 -26
  661. package/src/client/client.ts +0 -264
  662. package/src/client/externalLiquidityResolver.ts +0 -54
  663. package/src/client/index.ts +0 -20
  664. package/src/client/lendingPlatformClients.ts +0 -50
  665. package/src/client/pda.ts +0 -102
  666. package/src/client/plans/collectInterest.ts +0 -207
  667. package/src/client/plans/decreaseCarryPosition.ts +0 -226
  668. package/src/client/routes/collectInterest.ts +0 -56
  669. package/src/client/transaction.ts +0 -106
  670. package/src/client/types/builders.ts +0 -19
  671. package/src/client/types/enums.ts +0 -47
  672. package/src/client/types/general.ts +0 -117
  673. package/src/client/types/index.ts +0 -6
  674. package/src/client/types/ix.ts +0 -452
  675. package/src/client/types/planTypes/collectInterest.ts +0 -97
  676. package/src/client/types/planTypes/common.ts +0 -31
  677. package/src/client/types/planTypes/decreaseCarryPosition.ts +0 -134
  678. package/src/client/types/planTypes/index.ts +0 -3
  679. package/src/client/types/tx.ts +0 -409
  680. package/src/constants/configs/allocations.ts +0 -30
  681. package/src/constants/configs/carryTradePresets.ts +0 -164
  682. package/src/constants/configs/index.ts +0 -2
  683. package/src/constants/general.ts +0 -141
  684. package/src/constants/index.ts +0 -3
  685. package/src/constants/lycTokenMetadata.ts +0 -52
  686. package/src/decoders/decodeTransaction.ts +0 -319
  687. package/src/decoders/discriminators.ts +0 -10
  688. package/src/decoders/idlAccounts.ts +0 -75
  689. package/src/decoders/index.ts +0 -15
  690. package/src/decoders/innerCpis.ts +0 -262
  691. package/src/decoders/lycInstructionNames.ts +0 -73
  692. package/src/decoders/programIds.ts +0 -12
  693. package/src/decoders/solana.ts +0 -25
  694. package/src/decoders/transactionPayload.ts +0 -41
  695. package/src/decoders/types.ts +0 -60
  696. package/src/errors.ts +0 -195
  697. package/src/idl/long_yield_carry.ts +0 -14648
  698. package/src/index.ts +0 -10
  699. package/src/metrics/index.ts +0 -1
  700. package/src/metrics/protocolMetrics.ts +0 -976
  701. package/src/models/index.ts +0 -9
  702. package/src/models/lycToken.ts +0 -380
  703. package/src/models/yieldingBank.ts +0 -127
  704. package/src/services/allocation/allocationService.ts +0 -823
  705. package/src/services/allocation/index.ts +0 -2
  706. package/src/services/allocation/types.ts +0 -27
  707. package/src/services/carry/carryAllocationConfig.ts +0 -266
  708. package/src/services/carry/index.ts +0 -2
  709. package/src/services/carry/lycLendingPositionManager.ts +0 -167
  710. package/src/services/index.ts +0 -5
  711. package/src/services/lendingPosition/index.ts +0 -5
  712. package/src/services/lendingPosition/lendingPositionService.ts +0 -328
  713. package/src/services/rebalance/index.ts +0 -2
  714. package/src/services/rebalance/token/index.ts +0 -1
  715. package/src/services/rebalance/token/tokenRebalanceService.ts +0 -142
  716. package/src/services/rebalance/yieldingBank/index.ts +0 -3
  717. package/src/services/rebalance/yieldingBank/planner.ts +0 -215
  718. package/src/services/rebalance/yieldingBank/strategy.ts +0 -41
  719. package/src/services/rebalance/yieldingBank/types.ts +0 -41
  720. package/src/services/redemption/index.ts +0 -9
  721. package/src/services/redemption/redemptionService.ts +0 -758
  722. package/src/types/enriched.ts +0 -187
  723. package/src/types/index.ts +0 -1
  724. package/src/utils/cache.ts +0 -12
  725. package/src/utils/data.ts +0 -65
  726. package/src/utils/enrichment.ts +0 -330
  727. package/src/utils/feeDripMetrics.ts +0 -146
  728. package/src/utils/general.ts +0 -54
  729. package/src/utils/index.ts +0 -13
  730. package/src/utils/ix.ts +0 -227
  731. package/src/utils/lendingPosition.ts +0 -221
  732. package/src/utils/lookupTables.ts +0 -309
  733. package/src/utils/lycData.ts +0 -321
  734. package/src/utils/timelock.ts +0 -63
  735. package/src/utils/tokenFeeMath.ts +0 -25
  736. package/src/utils/transactions.ts +0 -109
  737. package/src/utils/yieldingBank.ts +0 -38
  738. package/tsconfig.json +0 -11
@@ -1,10 +1,20 @@
1
+ import * as _solana_kit from '@solana/kit';
2
+ import { Address, ProgramDerivedAddressBump, AccountRole, Instruction, Rpc, SolanaRpcApi, TransactionSigner, Signature } from '@solana/kit';
3
+ import * as _anchor_lang_core from '@anchor-lang/core';
4
+ import { IdlAccounts, BN, Program } from '@anchor-lang/core';
5
+ import { AssociatedTokenSeeds } from '@solana-program/token';
6
+ import BN$1 from 'bn.js';
7
+ import { KaminoMarket, KlendPrices, KaminoObligation, KaminoReserve } from '@kamino-finance/klend-sdk';
8
+ import { Farms, FarmState, UserFarm, FarmAndKey } from '@kamino-finance/farms-sdk';
9
+ import { OraclePrices } from '@kamino-finance/scope-sdk/dist/@codegen/scope/accounts';
10
+
1
11
  /**
2
12
  * Program IDL in camelCase format in order to be used in JS/TS.
3
13
  *
4
14
  * Note that this is only a type helper and is not the actual IDL. The original
5
15
  * IDL can be found at `target/idl/long_yield_carry.json`.
6
16
  */
7
- export type LongYieldCarry = {
17
+ type LongYieldCarry = {
8
18
  "address": "7YPAKESPJ7zJAvBuk45ZVziu6tXGKoNzg3p9YpvrH6pX";
9
19
  "metadata": {
10
20
  "name": "longYieldCarry";
@@ -1179,9 +1189,7 @@ export type LongYieldCarry = {
1179
1189
  {
1180
1190
  "name": "adminRole";
1181
1191
  "docs": [
1182
- "Token admin multisig. Pass `None` to use the feature-gated default",
1183
- "the stored role will be left as `Pubkey::default()` and",
1184
- "`TokenRoles::admin()` will return the constant fallback."
1192
+ "Admin multisig. `None` means \"use the feature-gated default\"."
1185
1193
  ];
1186
1194
  "optional": true;
1187
1195
  },
@@ -1193,7 +1201,7 @@ export type LongYieldCarry = {
1193
1201
  "optional": true;
1194
1202
  },
1195
1203
  {
1196
- "name": "feesRole";
1204
+ "name": "curatorFeeWallet";
1197
1205
  "docs": [
1198
1206
  "Curator fee wallet. `None` means \"use default\"."
1199
1207
  ];
@@ -3201,7 +3209,8 @@ export type LongYieldCarry = {
3201
3209
  {
3202
3210
  "name": "admin";
3203
3211
  "docs": [
3204
- "Token admin for full configuration updates, or manager for fee-only updates."
3212
+ "Token admin for full configuration updates, manager for",
3213
+ "`fee_drip_max_apy_bps` only, or curator for curator-fee-wallet updates."
3205
3214
  ];
3206
3215
  "signer": true;
3207
3216
  },
@@ -3217,9 +3226,10 @@ export type LongYieldCarry = {
3217
3226
  "optional": true;
3218
3227
  },
3219
3228
  {
3220
- "name": "feesRole";
3229
+ "name": "curatorFeeWallet";
3221
3230
  "docs": [
3222
- "Optional new fee wallet. `None` means \"no change\"."
3231
+ "Optional new curator fee wallet. `None` means \"no change\".",
3232
+ "Rotatable by the token admin or the token curator."
3223
3233
  ];
3224
3234
  "optional": true;
3225
3235
  },
@@ -3229,6 +3239,21 @@ export type LongYieldCarry = {
3229
3239
  "Optional new circuit-breaker activator. `None` means \"no change\"."
3230
3240
  ];
3231
3241
  "optional": true;
3242
+ },
3243
+ {
3244
+ "name": "curatorRole";
3245
+ "docs": [
3246
+ "Optional new curator. Must be in `WHITELISTED_CURATORS`.",
3247
+ "`None` means \"no change\"."
3248
+ ];
3249
+ "optional": true;
3250
+ },
3251
+ {
3252
+ "name": "adminRole";
3253
+ "docs": [
3254
+ "Optional new admin. `None` means \"no change\"."
3255
+ ];
3256
+ "optional": true;
3232
3257
  }
3233
3258
  ];
3234
3259
  "args": [
@@ -3323,6 +3348,21 @@ export type LongYieldCarry = {
3323
3348
  "Optional new circuit-breaker activator. `None` means \"no change\"."
3324
3349
  ];
3325
3350
  "optional": true;
3351
+ },
3352
+ {
3353
+ "name": "curatorRole";
3354
+ "docs": [
3355
+ "Optional new curator. Must be in `WHITELISTED_CURATORS`.",
3356
+ "`None` means \"no change\"."
3357
+ ];
3358
+ "optional": true;
3359
+ },
3360
+ {
3361
+ "name": "adminRole";
3362
+ "docs": [
3363
+ "Optional new admin. `None` means \"no change\"."
3364
+ ];
3365
+ "optional": true;
3326
3366
  }
3327
3367
  ];
3328
3368
  "args": [
@@ -3843,7 +3883,7 @@ export type LongYieldCarry = {
3843
3883
  {
3844
3884
  "code": 8087;
3845
3885
  "name": "feeDripConfigRequired";
3846
- "msg": "A positive fee-drip duration requires a max APY when holder fees can accrue or a buffer exists";
3886
+ "msg": "Reserved fee-drip configuration error";
3847
3887
  },
3848
3888
  {
3849
3889
  "code": 8088;
@@ -5323,18 +5363,10 @@ export type LongYieldCarry = {
5323
5363
  {
5324
5364
  "name": "feeDripMaxApyBps";
5325
5365
  "docs": [
5326
- "Cap (bps) on the annualized token-price growth contributed by the fee",
5327
- "drip. `0` disables the cap. See `TokenFees::fee_drip_max_apy_bps`."
5366
+ "Target and hard cap (bps) for annualized token-price growth during fee",
5367
+ "release. `0` parks absorbed fees."
5328
5368
  ];
5329
5369
  "type": "u16";
5330
- },
5331
- {
5332
- "name": "feeDripDurationSecs";
5333
- "docs": [
5334
- "Duration (seconds) over which absorbed mint/burn fees release into the",
5335
- "price. `0` parks fees until `recollateralize_loss` consumes them."
5336
- ];
5337
- "type": "u64";
5338
5370
  }
5339
5371
  ];
5340
5372
  };
@@ -5357,12 +5389,10 @@ export type LongYieldCarry = {
5357
5389
  "absorbed fee a fixed nominal amount: it does not ride the token's appreciation",
5358
5390
  "while parked, and ongoing yield flows fully to holders during the drip window.",
5359
5391
  "",
5360
- "The release is strictly linear toward `drip_end_ts`: between top-ups the",
5361
- "buffer drains to zero at `drip_end_ts`. Each top-up blends the deadline",
5362
- "(amount-weighted) so a steady stream of mints keeps releasing rather than",
5363
- "perpetually resetting the clock. A configurable APY cap",
5364
- "(`TokenFees::fee_drip_max_apy_bps`) can throttle the release below the",
5365
- "linear rate; throttled amounts simply release on later refreshes.",
5392
+ "A configurable APY target and hard cap",
5393
+ "(`TokenFees::fee_drip_max_apy_bps`) releases enough of the buffer on each",
5394
+ "refresh to bring annualized price growth up to the target without exceeding",
5395
+ "it. A zero target parks the buffer.",
5366
5396
  "`recollateralize_loss` may consume this buffer after exhausting any pending",
5367
5397
  "unwind residual, before the deficit reaches ordinary collateral backing."
5368
5398
  ];
@@ -5382,20 +5412,13 @@ export type LongYieldCarry = {
5382
5412
  "type": "u64";
5383
5413
  },
5384
5414
  {
5385
- "name": "dripEndTs";
5386
- "docs": [
5387
- "Timestamp at which the current buffer fully vests. The buffer drains",
5388
- "linearly toward zero at this instant; re-blended on every top-up."
5389
- ];
5390
- "type": "u64";
5391
- },
5392
- {
5393
- "name": "lastDripTs";
5394
- "docs": [
5395
- "Start of the current release interval. Kept separate from the token's",
5396
- "refresh timestamp so time spent parked cannot create drip headroom."
5397
- ];
5398
- "type": "u64";
5415
+ "name": "padding0";
5416
+ "type": {
5417
+ "array": [
5418
+ "u64",
5419
+ 2
5420
+ ];
5421
+ };
5399
5422
  },
5400
5423
  {
5401
5424
  "name": "apyReferencePrice";
@@ -5413,7 +5436,7 @@ export type LongYieldCarry = {
5413
5436
  "type": "u64";
5414
5437
  },
5415
5438
  {
5416
- "name": "padding";
5439
+ "name": "padding1";
5417
5440
  "type": {
5418
5441
  "array": [
5419
5442
  "u64",
@@ -6350,9 +6373,9 @@ export type LongYieldCarry = {
6350
6373
  {
6351
6374
  "name": "feeDrip";
6352
6375
  "docs": [
6353
- "Mint/burn fee-drip buffer and its linear-release schedule. Appended after",
6354
- "`roles` (consuming reserved padding) so all preceding field offsets stay",
6355
- "stable for already-deployed accounts."
6376
+ "Mint/burn fee-drip buffer and APY reference. Appended after `roles`",
6377
+ "(consuming reserved padding) so all preceding field offsets stay stable",
6378
+ "for already-deployed accounts."
6356
6379
  ];
6357
6380
  "type": {
6358
6381
  "defined": {
@@ -6642,11 +6665,10 @@ export type LongYieldCarry = {
6642
6665
  {
6643
6666
  "name": "feeDripMaxApyBps";
6644
6667
  "docs": [
6645
- "Cap (in bps) on the annualized token-price growth contributed by the",
6646
- "fee drip. On refresh, the buffer release is throttled so it never lifts",
6647
- "the price faster than this APY. This only bounds the drip's contribution",
6648
- " natural yield can push the realized APY higher (it cannot be clawed",
6649
- "back). `0` disables the cap (release is limited only by the linear rate)."
6668
+ "Target and hard cap (in bps) for annualized token-price growth during fee",
6669
+ "release. Refreshes release enough buffered collateral to approach this",
6670
+ "target without exceeding it. Natural yield can exceed the target and",
6671
+ "cannot be clawed back. `0` parks the buffer."
6650
6672
  ];
6651
6673
  "type": "u16";
6652
6674
  },
@@ -6659,21 +6681,12 @@ export type LongYieldCarry = {
6659
6681
  ];
6660
6682
  };
6661
6683
  },
6662
- {
6663
- "name": "feeDripDurationSecs";
6664
- "docs": [
6665
- "Duration (seconds) over which an absorbed mint/burn fee releases into the",
6666
- "price. `0` parks the buffer indefinitely: refreshes do not release it,",
6667
- "but `recollateralize_loss` can consume it to cover a carry deficit."
6668
- ];
6669
- "type": "u64";
6670
- },
6671
6684
  {
6672
6685
  "name": "padding2";
6673
6686
  "type": {
6674
6687
  "array": [
6675
6688
  "u64",
6676
- 4
6689
+ 5
6677
6690
  ];
6678
6691
  };
6679
6692
  }
@@ -6753,8 +6766,9 @@ export type LongYieldCarry = {
6753
6766
  "docs": [
6754
6767
  "The whitelisted curator that created this token. Treated as the \"creator\"",
6755
6768
  "and used for cross-state curator-match checks (e.g. increase_carry_position",
6756
- "requires token.curator == yielding_bank.curator). Set at creation from the",
6757
- "signer and never rotated."
6769
+ "requires token.curator == yielding_bank.curator). Rotatable by the token",
6770
+ "admin to another `WHITELISTED_CURATORS` entry via",
6771
+ "`update_token_configuration`."
6758
6772
  ];
6759
6773
  "type": "pubkey";
6760
6774
  },
@@ -6763,7 +6777,7 @@ export type LongYieldCarry = {
6763
6777
  "docs": [
6764
6778
  "Authority for token-level config updates, metadata changes, fee edits, and",
6765
6779
  "circuit-breaker deactivation. Intended to be a multisig in production.",
6766
- "Cannot be rotated after creation."
6780
+ "Rotatable by the current admin via `update_token_configuration`."
6767
6781
  ];
6768
6782
  "type": "pubkey";
6769
6783
  },
@@ -6780,7 +6794,8 @@ export type LongYieldCarry = {
6780
6794
  "name": "fees";
6781
6795
  "docs": [
6782
6796
  "Curator's fee wallet — receives the curator's share of mint/burn fees and",
6783
- "performance fees. Rotatable via `update_token_configuration`."
6797
+ "performance fees. Rotatable by the token admin or the token curator via",
6798
+ "`update_token_configuration`."
6784
6799
  ];
6785
6800
  "type": "pubkey";
6786
6801
  },
@@ -6865,60 +6880,67 @@ export type LongYieldCarry = {
6865
6880
  "docs": [
6866
6881
  "Parameters for updating a token's mutable configuration.",
6867
6882
  "",
6868
- "Oracle configuration is immutable after creation use `create_token` to set",
6869
- "the oracle, and deploy a new token if it needs to change."
6883
+ "Every field is optional: `None` means \"no change\". Oracle configuration is",
6884
+ "immutable after creation use `create_token` to set the oracle, and deploy a",
6885
+ "new token if it needs to change."
6870
6886
  ];
6871
6887
  "type": {
6872
6888
  "kind": "struct";
6873
6889
  "fields": [
6874
6890
  {
6875
6891
  "name": "performanceFeeBps";
6876
- "type": "u16";
6892
+ "type": {
6893
+ "option": "u16";
6894
+ };
6877
6895
  },
6878
6896
  {
6879
6897
  "name": "mintingFeeBps";
6880
- "type": "u16";
6898
+ "type": {
6899
+ "option": "u16";
6900
+ };
6881
6901
  },
6882
6902
  {
6883
6903
  "name": "burningFeeBps";
6884
- "type": "u16";
6904
+ "type": {
6905
+ "option": "u16";
6906
+ };
6885
6907
  },
6886
6908
  {
6887
6909
  "name": "protocolMintBurnPctBps";
6888
6910
  "docs": [
6889
6911
  "Percentage of mint/burn fees that go to the protocol (in bps)"
6890
6912
  ];
6891
- "type": "u16";
6913
+ "type": {
6914
+ "option": "u16";
6915
+ };
6892
6916
  },
6893
6917
  {
6894
6918
  "name": "curatorMintBurnPctBps";
6895
6919
  "docs": [
6896
6920
  "Percentage of mint/burn fees that go to the curator (in bps)"
6897
6921
  ];
6898
- "type": "u16";
6922
+ "type": {
6923
+ "option": "u16";
6924
+ };
6899
6925
  },
6900
6926
  {
6901
6927
  "name": "curatorPerfPctBps";
6902
6928
  "docs": [
6903
6929
  "Curator's share of performance fees (in bps); protocol implicitly gets the rest."
6904
6930
  ];
6905
- "type": "u16";
6931
+ "type": {
6932
+ "option": "u16";
6933
+ };
6906
6934
  },
6907
6935
  {
6908
6936
  "name": "feeDripMaxApyBps";
6909
6937
  "docs": [
6910
- "Cap (bps) on the annualized price growth contributed by the fee drip.",
6911
- "`0` disables the cap. See `TokenFees::fee_drip_max_apy_bps`."
6912
- ];
6913
- "type": "u16";
6914
- },
6915
- {
6916
- "name": "feeDripDurationSecs";
6917
- "docs": [
6918
- "Duration (seconds) over which absorbed mint/burn fees release into the",
6919
- "price. `0` parks fees until `recollateralize_loss` consumes them."
6938
+ "Target and hard cap (bps) for annualized price growth during fee release.",
6939
+ "`Some(0)` parks absorbed fees."
6920
6940
  ];
6921
- "type": "u64";
6941
+ "type": {
6942
+ "option": "u16";
6943
+ };
6922
6944
  },
6923
6945
  {
6924
6946
  "name": "burnRateLimit";
@@ -7155,7 +7177,8 @@ export type LongYieldCarry = {
7155
7177
  "docs": [
7156
7178
  "The whitelisted curator that created this yielding bank. Must match the",
7157
7179
  "token's curator when attaching a carry position via `increase_carry_position`.",
7158
- "Set at creation from the signer and never rotated."
7180
+ "Rotatable by the bank admin to another `WHITELISTED_CURATORS` entry via",
7181
+ "`update_yielding_bank_config`."
7159
7182
  ];
7160
7183
  "type": "pubkey";
7161
7184
  },
@@ -7163,7 +7186,8 @@ export type LongYieldCarry = {
7163
7186
  "name": "admin";
7164
7187
  "docs": [
7165
7188
  "Authority for yielding-bank config updates and circuit-breaker deactivation.",
7166
- "Intended to be a multisig in production. Cannot be rotated after creation."
7189
+ "Intended to be a multisig in production. Rotatable by the current admin via",
7190
+ "`update_yielding_bank_config`."
7167
7191
  ];
7168
7192
  "type": "pubkey";
7169
7193
  },
@@ -7324,4 +7348,3138 @@ export type LongYieldCarry = {
7324
7348
  }
7325
7349
  ];
7326
7350
  };
7327
- export declare const IDL: LongYieldCarry;
7351
+ declare const IDL: LongYieldCarry;
7352
+
7353
+ /**
7354
+ * PDA derivation for the long_yield_carry program.
7355
+ *
7356
+ * The program ID is injected via constructor — no global state.
7357
+ */
7358
+ declare class PdaClient {
7359
+ private readonly programAddress;
7360
+ constructor(programAddress: Address);
7361
+ /**
7362
+ * Derives the Token PDA for a given mint and ID.
7363
+ *
7364
+ * Seeds: ["TOKEN", mint_pubkey, id]
7365
+ *
7366
+ * @param mintAddress - The yToken mint address
7367
+ * @param id - The token ID (u8)
7368
+ * @returns Tuple of [PDA address, bump seed]
7369
+ */
7370
+ deriveTokenPda(mintAddress: Address, id: number): Promise<readonly [Address, ProgramDerivedAddressBump]>;
7371
+ /**
7372
+ * Derives the YieldingBank PDA for a given base mint and yielding ID.
7373
+ *
7374
+ * Seeds: ["YIELDING_BANK", base_mint_pubkey, id_le_bytes]
7375
+ *
7376
+ * @param baseMint - The base mint address
7377
+ * @param yieldingId - The yielding bank ID (u8)
7378
+ * @returns Tuple of [PDA address, bump seed]
7379
+ */
7380
+ deriveYieldingBankPda(baseMint: Address, yieldingId: number): Promise<readonly [Address, ProgramDerivedAddressBump]>;
7381
+ deriveRedemptionEpochPda(token: Address, epochId: bigint | number): Promise<readonly [Address, ProgramDerivedAddressBump]>;
7382
+ deriveAsyncBurnRequestPda(token: Address, epochId: bigint | number, sequence: bigint | number): Promise<readonly [Address, ProgramDerivedAddressBump]>;
7383
+ deriveCpiPlanPda(uniqueId: Address, createdTs: bigint | number): Promise<readonly [Address, ProgramDerivedAddressBump]>;
7384
+ }
7385
+
7386
+ interface CacheEntry<T> {
7387
+ data: T;
7388
+ timestamp: number;
7389
+ }
7390
+ interface CacheTtlConfig {
7391
+ defaultTtlMs?: number;
7392
+ categoryTtlMs?: Record<string, number>;
7393
+ }
7394
+ declare class DataCache {
7395
+ protected cache: Map<string, Map<string, CacheEntry<any>>>;
7396
+ protected ttlConfig: CacheTtlConfig;
7397
+ constructor(ttlConfig?: CacheTtlConfig);
7398
+ getData<T>(fetchFn: () => Promise<T | null>, category: string, id: string, options?: {
7399
+ cacheNull?: boolean;
7400
+ }): Promise<{
7401
+ data: T | null;
7402
+ fromCache: boolean;
7403
+ }>;
7404
+ getDataOrThrow<T>(fetchFn: () => Promise<T | null>, category: string, id: string, options?: {
7405
+ cacheNull?: boolean;
7406
+ }): Promise<{
7407
+ data: T;
7408
+ fromCache: boolean;
7409
+ }>;
7410
+ getDataBatch<T>(fetchFn: () => Promise<(T | null)[]>, category: string, ids: string[]): Promise<{
7411
+ data: T[];
7412
+ fromCache: boolean;
7413
+ }>;
7414
+ private getTtlForCategory;
7415
+ protected isStale(entry: CacheEntry<any>, category: string): boolean;
7416
+ /** Returns null if not found or stale */
7417
+ protected tryFromCache<T>(category: string, id: string): T | null;
7418
+ protected getCacheAge(category: string, id: string): number | null;
7419
+ setCache(category: string, id: string, data: any): void;
7420
+ refreshCategory(category: string): void;
7421
+ clearCacheEntry(category: string, id: string): boolean;
7422
+ clearStaleEntries(category: string): number;
7423
+ clearAllStaleEntries(): number;
7424
+ clearAllCache(): void;
7425
+ }
7426
+
7427
+ type Environment = "local" | "test" | "prod";
7428
+ /**
7429
+ * Remote deployment tiers only (`test` | `prod`). `local` is dev/Surfpool and is excluded from
7430
+ * types that describe on-chain deployed program tiers (e.g. operator keypair paths per cluster).
7431
+ */
7432
+ type DeployedEnv = Exclude<Environment, "local">;
7433
+ /** A mint address or token symbol (case-insensitive) */
7434
+ type MintIdentifier = string | Address;
7435
+ /**
7436
+ * Cache entries to clear after a successful transaction.
7437
+ *
7438
+ * Kamino entries target lending SDK caches; `lycToken` / `lycYieldingBank` clear
7439
+ * long-yield-carry program DataCache entries; `splAta` clears the SPL ATA existence
7440
+ * cache for one address (must match `SPL_ATA_CACHE_CATEGORY` in
7441
+ * `services/baseAccountClient.ts`); `perena` clears one entry from a Perena client
7442
+ * DataCache after the transaction confirms.
7443
+ */
7444
+ type TransactionCacheInvalidation = {
7445
+ client: "kamino";
7446
+ category: string;
7447
+ id: Address;
7448
+ } | {
7449
+ client: "lycToken";
7450
+ tokenPda: Address;
7451
+ } | {
7452
+ client: "lycYieldingBank";
7453
+ yieldingBankPda: Address;
7454
+ } | {
7455
+ client: "splAta";
7456
+ ata: Address;
7457
+ } | {
7458
+ client: "perena";
7459
+ dataCache: DataCache;
7460
+ category: string;
7461
+ id: Address;
7462
+ };
7463
+
7464
+ type CustomAccountMeta = {
7465
+ address: Address;
7466
+ role: AccountRole;
7467
+ isRequiredAta?: AssociatedTokenSeeds;
7468
+ };
7469
+ interface CpiData {
7470
+ cpiType: number;
7471
+ programId: Address;
7472
+ accounts: CustomAccountMeta[];
7473
+ /** Instruction data for the given CPI. if not provided, it implies the program should provide it internally. Can pass new UInt8Array() if no data is expected */
7474
+ data?: Uint8Array;
7475
+ lookupTables?: Address[];
7476
+ postSuccessCacheInvalidations?: TransactionCacheInvalidation[];
7477
+ /**
7478
+ * Top-level instructions that must run before the host transaction's CPI
7479
+ * dispatcher (e.g. createATA for intermediate-mint accounts a multi-hop
7480
+ * Jupiter route will write into). The host bundler is responsible for
7481
+ * placing these before the CPI but after lending-platform pre-instructions.
7482
+ */
7483
+ preInstructions?: Instruction[];
7484
+ }
7485
+
7486
+ /**
7487
+ * CPI account mapping utilities for multi-CPI transactions.
7488
+ */
7489
+
7490
+ /**
7491
+ * Mapping for extracting accounts from `remainingAccounts` across multiple CPIs.
7492
+ *
7493
+ * @example
7494
+ * For 2 CPIs where CPI 0 needs 10 accounts and CPI 1 needs 8 accounts:
7495
+ * ```
7496
+ * indices: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 2, 5, 7, 10, 11, 12, 13, 14]
7497
+ * lengths: [10, 8]
7498
+ *
7499
+ * CPI 0 uses indices[0..10]
7500
+ * CPI 1 uses indices[10..18]
7501
+ * ```
7502
+ *
7503
+ * Matches Rust `CpiMapping` struct.
7504
+ */
7505
+ interface CpiMapping {
7506
+ /** All indices into the account pool, flattened across all CPIs */
7507
+ indices: Buffer;
7508
+ /** Number of accounts per CPI - used to slice indices */
7509
+ lengths: Buffer;
7510
+ }
7511
+
7512
+ /**
7513
+ * Generic CPI-related types for instruction building.
7514
+ *
7515
+ * Protocol-specific args types belong in their respective packages
7516
+ * (e.g., perena-helpers, jupiter-helpers).
7517
+ */
7518
+
7519
+ /**
7520
+ * References for CPI invocations.
7521
+ *
7522
+ * Matches Rust `CpiRefs` struct in common/src/cpi/refs.rs.
7523
+ */
7524
+ interface CpiRefs {
7525
+ /** Account indices per CPI (first account of each CPI = program) */
7526
+ accounts: CpiMapping;
7527
+ /** Index into CPI_REGISTRY for each CPI slot */
7528
+ types: Buffer;
7529
+ /** Packed CPI args buffer built by CpiArgsBuilder */
7530
+ args: Buffer;
7531
+ }
7532
+ /**
7533
+ * Top-level references for an instruction.
7534
+ *
7535
+ * Matches Rust `InstructionRefs` struct in common/src/accounts/refs.rs.
7536
+ *
7537
+ * @property cpi - CPI refs (accounts, types, args)
7538
+ * @property tracked - Indices of accounts to access directly
7539
+ */
7540
+ interface InstructionRefs {
7541
+ /** CPI account mapping, type indices, and packed args */
7542
+ cpi: CpiRefs;
7543
+ /** Indices of accounts to access directly */
7544
+ tracked: Buffer;
7545
+ }
7546
+
7547
+ type AnchorOracleType = {
7548
+ pyth: {};
7549
+ } | {
7550
+ switchboard: {};
7551
+ } | {
7552
+ perenaBank: {};
7553
+ } | {
7554
+ perenaTranche: {};
7555
+ } | {
7556
+ tpConsensusOracle: {};
7557
+ } | {
7558
+ pythSplStake: {};
7559
+ };
7560
+ type AnchorExternalLiquidityType = {
7561
+ none: {};
7562
+ } | {
7563
+ perenaWithdrawalQueue: {};
7564
+ };
7565
+ type AnchorTokenProgram = {
7566
+ spl: {};
7567
+ } | {
7568
+ token2022: {};
7569
+ };
7570
+ type AnchorLendingPlatform = {
7571
+ none: {};
7572
+ } | {
7573
+ marginfi: {};
7574
+ } | {
7575
+ kamino: {};
7576
+ };
7577
+ declare enum LendingPlatform$1 {
7578
+ None = 0,
7579
+ Marginfi = 1,
7580
+ Kamino = 2
7581
+ }
7582
+
7583
+ /**
7584
+ * Program-agnostic account helpers: shared {@link DataCache} wiring and SPL ATA existence
7585
+ * checks for instruction builders (e.g. `getCreateAtaIxIfNeeded`). Extend this in per-program
7586
+ * SDKs for typed account fetchers and domain-specific cache categories.
7587
+ */
7588
+ declare class BaseAccountClient {
7589
+ protected readonly rpc: Rpc<SolanaRpcApi>;
7590
+ readonly dataCache: DataCache;
7591
+ protected constructor(rpc: Rpc<SolanaRpcApi>, options?: Pick<CacheTtlConfig, "defaultTtlMs" | "categoryTtlMs">);
7592
+ /**
7593
+ * Whether an SPL token account exists at `ata`. Cached under {@link SPL_ATA_CACHE_CATEGORY};
7594
+ * clear via post-success `splAta` transaction cache invalidations after successful creates.
7595
+ */
7596
+ splAtaExists(ata: Address): Promise<boolean>;
7597
+ }
7598
+
7599
+ interface CreateAtaIxIfNeededResult {
7600
+ instruction: Instruction | null;
7601
+ postSuccessCacheInvalidations: TransactionCacheInvalidation[];
7602
+ }
7603
+
7604
+ /** Helius priority levels accepted by `getPriorityFeeEstimate`. */
7605
+ declare enum PriorityFeeSetting {
7606
+ Min = "Min",
7607
+ Low = "Low",
7608
+ Medium = "Medium",
7609
+ High = "High",
7610
+ VeryHigh = "VeryHigh"
7611
+ }
7612
+
7613
+ /**
7614
+ * Options for signSendAndConfirmTransaction.
7615
+ */
7616
+ interface SendTransactionOptions {
7617
+ /** Address lookup tables for transaction compression */
7618
+ lookupTables?: Address[];
7619
+ /** Additional signers beyond the fee payer (e.g., mint authority) */
7620
+ additionalSigners?: TransactionSigner[];
7621
+ /** Whether or not to print transaction logs after a simulation or transaction failure */
7622
+ hideFailureInfo?: boolean;
7623
+ /**
7624
+ * Jito tip in lamports for bundle submissions. Default: 10,000.
7625
+ * Set to 0 to disable bundle fallback (throws on oversize instead).
7626
+ */
7627
+ jitoTipLamports?: number;
7628
+ /**
7629
+ * Force the Jito bundle path even when the transaction fits in a single tx.
7630
+ * Useful for smoke-testing bundle submission on mainnet. Requires
7631
+ * `jitoTipLamports` > 0 unless {@link sendOversizedAsSequentialTransactions}
7632
+ * is set.
7633
+ */
7634
+ forceJitoBundle?: boolean;
7635
+ /**
7636
+ * When the oversize path runs, send each split transaction with normal
7637
+ * `sendTransaction` + confirmation instead of a Jito bundle. For Surfpool,
7638
+ * local validators, and other RPCs that do not implement `sendBundle`.
7639
+ *
7640
+ * Not atomic: ledger state may change between sub-transactions. Does not
7641
+ * add a Jito tip (`jitoTipLamports` is ignored). Uses a fresh blockhash per
7642
+ * sub-transaction so earlier confirmations cannot expire the next send.
7643
+ */
7644
+ sendOversizedAsSequentialTransactions?: boolean;
7645
+ /**
7646
+ * Override the estimated compute-unit price (in micro-lamports). When set,
7647
+ * skips priority-fee estimation and uses this value directly.
7648
+ */
7649
+ computeUnitPriceMicroLamports?: number;
7650
+ /**
7651
+ * Helius-compatible priority level requested through the configured RPC.
7652
+ * Explicit `computeUnitPriceMicroLamports` takes precedence. When both
7653
+ * options are omitted, no compute-unit-price instruction is added.
7654
+ */
7655
+ priorityFeeSetting?: PriorityFeeSetting;
7656
+ /**
7657
+ * Multiplier applied to simulated `unitsConsumed` when setting the compute
7658
+ * unit limit. Defaults to {@link DEFAULT_COMPUTE_UNIT_LIMIT_MULTIPLIER}.
7659
+ */
7660
+ computeUnitLimitMultiplier?: number;
7661
+ }
7662
+ interface TransactionPlan {
7663
+ instructions: Instruction[];
7664
+ lookupTables?: Address[];
7665
+ /**
7666
+ * Partition of `instructions` into indivisible segments when splitting for
7667
+ * wire size (Jito bundle or sequential oversize). Lengths must be positive
7668
+ * and sum to `instructions.length`. Omitted or undefined: each instruction
7669
+ * is its own segment (legacy `Instruction[]` behavior).
7670
+ *
7671
+ * Example: [1, 2, 3] means the first 1 instruction is in the first bin, the
7672
+ * next 2 are in the second bin, and the last 3 are in the third bin.
7673
+ *
7674
+ * Use this to keep an atomic group together — e.g. a Kamino flash
7675
+ * borrow/rebalance/repay triple, where the borrow's `flash_ixs.rs` check
7676
+ * introspects its own tx's instructions sysvar to find the matching repay.
7677
+ */
7678
+ segmentLengths?: number[];
7679
+ /**
7680
+ * Indices into the segments produced by `segmentLengths` that must
7681
+ * always start a fresh bin. The current bin (if any) is flushed before
7682
+ * the segment is appended, regardless of whether it would have fit.
7683
+ *
7684
+ * Use this when a CPI in the segment encodes a position-relative index at
7685
+ * build time (e.g. Kamino's flash-borrow records the position of the
7686
+ * matching repay in its data) — forcing the segment to start a new bin
7687
+ * keeps that index stable across runs.
7688
+ */
7689
+ freshBinSegments?: number[];
7690
+ }
7691
+ type SendTransactionOptionsWithPostSuccess = SendTransactionOptions & {
7692
+ onSuccess?: () => void;
7693
+ };
7694
+ /**
7695
+ * Build, sign, send, and confirm a transaction using embedded signers.
7696
+ *
7697
+ * Use this with instructions that have TransactionSigner objects embedded
7698
+ * in their accounts.
7699
+ *
7700
+ * @param rpc - Solana RPC client
7701
+ * @param payer - Fee payer with TransactionSigner
7702
+ * @param instructionsOrPlan - Kit Instructions or a composed transaction plan
7703
+ * (with embedded signers)
7704
+ * @param options - Optional configuration
7705
+ * @returns Transaction signature
7706
+ *
7707
+ * @example
7708
+ * ```typescript
7709
+ * const sig = await signSendAndConfirmTransaction(rpc, payer, [
7710
+ * computeBudgetIx,
7711
+ * transferIx,
7712
+ * ]);
7713
+ * ```
7714
+ */
7715
+ declare function signSendAndConfirmTransaction(rpc: Rpc<SolanaRpcApi>, payer: TransactionSigner, instructionsOrPlan: Instruction[] | TransactionPlan, options?: SendTransactionOptionsWithPostSuccess): Promise<Signature>;
7716
+
7717
+ /**
7718
+ * Program-level admin pubkey shared across deployed programs (LYC protocol admin,
7719
+ * consensus oracle admin seed, etc.). Matches Rust `PROTOCOL_ADMIN`.
7720
+ */
7721
+ declare const PROTOCOL_ADMIN: Record<Environment, Address>;
7722
+
7723
+ /**
7724
+ * Shared base for SDK instruction/transaction builders.
7725
+ *
7726
+ * `getIx(args)` is intentionally explicit: callers must provide the fully
7727
+ * resolved instruction inputs. Higher-level `getTx()` paths should derive those
7728
+ * inputs locally, then call `getIx(args)` without persisting them on the
7729
+ * builder instance.
7730
+ */
7731
+ declare abstract class BaseIXBuilderService<TContext, TIxArgs, TTxArgs = TIxArgs, TTxResult = TransactionPlan> {
7732
+ protected readonly context: TContext;
7733
+ constructor(context: TContext);
7734
+ abstract getIx(args: TIxArgs): Promise<Instruction>;
7735
+ abstract getTx(args: TTxArgs): Promise<TTxResult>;
7736
+ }
7737
+
7738
+ /**
7739
+ * Parameters for requesting a swap quote.
7740
+ */
7741
+ interface SwapQuoteParams {
7742
+ /** Input token mint address */
7743
+ inputMint: Address;
7744
+ /** Output token mint address */
7745
+ outputMint: Address;
7746
+ /** Amount to swap in smallest units (e.g., lamports, not SOL) */
7747
+ amount: number;
7748
+ /** Slippage tolerance in basis points (e.g., 500 = 5%) */
7749
+ slippageBps?: number;
7750
+ /**
7751
+ * If true, restrict the quote to direct routes (no intermediate hops).
7752
+ * Useful for CPI flows where intermediate-mint ATAs (e.g. WSOL) wouldn't
7753
+ * exist for a PDA caller. Backends that don't multi-hop ignore this.
7754
+ */
7755
+ onlyDirectRoutes?: boolean;
7756
+ /**
7757
+ * Optional backend-specific route account budget. Jupiter uses this to
7758
+ * decide whether larger multi-hop routes are eligible.
7759
+ */
7760
+ maxAccounts?: number;
7761
+ /**
7762
+ * DEX labels to exclude from routing, merged with any client-level default
7763
+ * exclusions. Backends without venue routing (Perena) ignore this.
7764
+ */
7765
+ excludeDexes?: string[];
7766
+ }
7767
+ /**
7768
+ * Parameters for sizing a swap so realized output is at least a target, without
7769
+ * exceeding a maximum input spend (base units). Backends may use oracle math
7770
+ * (Perena) or exact-out routing (Jupiter), etc.
7771
+ */
7772
+ interface SwapQuoteCoveringMinOutputParams {
7773
+ inputMint: Address;
7774
+ outputMint: Address;
7775
+ /** Minimum output amount required (smallest units of `outputMint`). */
7776
+ minOutputAmount: bigint;
7777
+ /** Maximum input amount allowed (smallest units of `inputMint`). */
7778
+ maxInputAmount: bigint;
7779
+ slippageBps?: number;
7780
+ }
7781
+ /**
7782
+ * Normalized swap quote returned by any swap client.
7783
+ *
7784
+ * @typeParam TRawQuote - Platform-specific quote type (e.g., Jupiter's QuoteResponse)
7785
+ */
7786
+ interface SwapQuote<TRawQuote = unknown> {
7787
+ /** Input token mint address */
7788
+ inputMint: Address;
7789
+ /** Output token mint address */
7790
+ outputMint: Address;
7791
+ /** Input amount in smallest units */
7792
+ inputAmount: bigint;
7793
+ /** Expected output amount in smallest units */
7794
+ outputAmount: bigint;
7795
+ /** Price impact as a percentage (e.g., 0.5 = 0.5%) */
7796
+ priceImpactPct: number;
7797
+ /** Platform-specific quote data (e.g., Jupiter's QuoteResponse) */
7798
+ rawQuote: TRawQuote;
7799
+ }
7800
+ /**
7801
+ * Options for building a swap instruction.
7802
+ */
7803
+ interface SwapInstructionOptions {
7804
+ /** Whether to automatically wrap/unwrap SOL (default: false for CPI) */
7805
+ wrapAndUnwrapSol?: boolean;
7806
+ /**
7807
+ * Real signer that pays for any pre-instructions the swap client needs
7808
+ * (e.g. createATA for intermediate-mint accounts on a multi-hop route).
7809
+ * The swap authority (`userPublicKey`) is typically a PDA and cannot pay.
7810
+ * When omitted, the swap client skips emitting pre-instructions.
7811
+ */
7812
+ payer?: Address;
7813
+ }
7814
+
7815
+ /**
7816
+ * Base interface for swap clients.
7817
+ *
7818
+ * Implementations of this interface provide a unified API for interacting
7819
+ * with different DEX aggregators (Jupiter, Raydium, etc.) for CPI swaps
7820
+ * in addition to direct integration with other swap-like programs, like USD* mint/burn.
7821
+ *
7822
+ * @typeParam TRawQuote - Platform-specific quote type
7823
+ *
7824
+ * @example
7825
+ * ```typescript
7826
+ * const client: SwapClient = new JupiterSwapClient(rpc);
7827
+ * const quote = await client.getQuote({ inputMint, outputMint, amount });
7828
+ * const { data, accounts, programId } = await client.getSwapCpiData(quote, userPda);
7829
+ * ```
7830
+ */
7831
+ interface SwapClient<TRawQuote = unknown> {
7832
+ /**
7833
+ * Get a swap quote for the given parameters.
7834
+ *
7835
+ * @param params - Quote parameters (mints, amount, slippage)
7836
+ * @returns Normalized swap quote with expected output amount
7837
+ */
7838
+ getQuote(params: SwapQuoteParams): Promise<SwapQuote<TRawQuote>>;
7839
+ /**
7840
+ * Size a swap so expected output is at least {@link SwapQuoteCoveringMinOutputParams.minOutputAmount}
7841
+ * while spending no more than {@link SwapQuoteCoveringMinOutputParams.maxInputAmount} input.
7842
+ *
7843
+ * Implementations use backend-specific mechanics (e.g. Perena oracle linearization,
7844
+ * Jupiter `ExactOut` quotes).
7845
+ */
7846
+ getQuoteCoveringMinOutput(params: SwapQuoteCoveringMinOutputParams): Promise<SwapQuote<TRawQuote>>;
7847
+ /**
7848
+ * Build the swap instruction for CPI.
7849
+ *
7850
+ * @param quote - Quote from getQuote()
7851
+ * @param userPublicKey - Address that will execute the swap (can be a PDA)
7852
+ * @param options - Optional settings (e.g., wrapAndUnwrapSol)
7853
+ * @returns Instruction data and accounts for CPI
7854
+ */
7855
+ getSwapCpiData(quote: SwapQuote<TRawQuote>, userPublicKey: Address, options?: SwapInstructionOptions): Promise<CpiData>;
7856
+ }
7857
+
7858
+ /** Lightweight read-only snapshot of a `RedemptionEpoch` account. */
7859
+ interface RedemptionEpochSnapshot {
7860
+ pda: Address;
7861
+ tokenPda: Address;
7862
+ epochId: bigint;
7863
+ /** SOL rent payer recorded when the epoch PDA was first funded (`Pubkey.default` on legacy accounts). */
7864
+ payer: Address;
7865
+ status: number;
7866
+ requestCount: number;
7867
+ processedRequestCount: number;
7868
+ grossCollateralClaim: bigint;
7869
+ realizedUnwindLoss: bigint;
7870
+ fundedCollateral: bigint;
7871
+ }
7872
+ interface OracleConfigDetails {
7873
+ /** Oracle account address */
7874
+ oracle: Address;
7875
+ /** Oracle type */
7876
+ oracleType: AnchorOracleType;
7877
+ /** Optional secondary oracle account for composite oracle types (e.g. the
7878
+ * SPL stake pool account for `PythSplStake`). Omit for single-account types. */
7879
+ secondaryOracle?: Address;
7880
+ }
7881
+ /**
7882
+ * Accounts required to reference a priced SPL mint: the mint itself, the
7883
+ * SPL token program that governs it, and the oracle that prices it.
7884
+ */
7885
+ interface PricedMint {
7886
+ mint: Address;
7887
+ tokenProgram: Address;
7888
+ oracle: Address;
7889
+ }
7890
+ interface FeeConfig {
7891
+ /** Management fee in basis points */
7892
+ performanceFeeBps: number;
7893
+ /** Minting fee in basis points */
7894
+ mintingFeeBps: number;
7895
+ /** Burning fee in basis points */
7896
+ burningFeeBps: number;
7897
+ /** Percentage of mint/burn fees that go to the protocol (in bps) */
7898
+ protocolMintBurnPctBps: number;
7899
+ /** Percentage of mint/burn fees that go to the curator (in bps) */
7900
+ curatorMintBurnPctBps: number;
7901
+ /** Curator's share of performance fees (in bps); protocol implicitly gets the rest. */
7902
+ curatorPerfPctBps: number;
7903
+ /**
7904
+ * Target and hard cap (in bps) for annualized token-price growth during fee
7905
+ * release. `0` parks absorbed fees.
7906
+ * Omit to default to 200 bps on test/prod or `0` on local.
7907
+ */
7908
+ feeDripMaxApyBps?: number;
7909
+ }
7910
+ /** Base-unit breakdown of the accounting effects of a mint. */
7911
+ interface MintAmounts {
7912
+ tokensToUser: bigint;
7913
+ protocolFee: bigint;
7914
+ curatorFee: bigint;
7915
+ }
7916
+ /** Base-unit breakdown of the accounting effects of a burn. */
7917
+ interface BurnAmounts {
7918
+ collateralToUser: bigint;
7919
+ protocolFee: bigint;
7920
+ curatorFee: bigint;
7921
+ supplyReduction: bigint;
7922
+ }
7923
+ /**
7924
+ * A single LYC yToken position held by a wallet.
7925
+ *
7926
+ * Returned by `AccountClient.fetchUserHoldings`. `token` is the full
7927
+ * {@link LYCToken} model so callers can access price, label, decimals, and all
7928
+ * on-chain accounting without a second fetch.
7929
+ */
7930
+ interface UserHolding {
7931
+ /** The LYC Token domain object (price, label, decimals, TVL, etc.). */
7932
+ token: LYCToken;
7933
+ /** User's ATA address for this yToken mint. */
7934
+ tokenAccount: Address;
7935
+ /** Raw balance in the yToken's smallest unit. */
7936
+ balance: bigint;
7937
+ /** Decimal-adjusted balance (e.g. `1.5` for 1.5 yTokens). */
7938
+ uiBalance: number;
7939
+ /**
7940
+ * Wallet USD notional when the caller supplies a collateral USD price
7941
+ * (`uiBalance × token.price × priceMap[collateralMint]`). Omitted if no
7942
+ * usable collateral price was available.
7943
+ */
7944
+ valueUsd?: number;
7945
+ }
7946
+
7947
+ /** Decoded on-chain data for a Token account, derived from the IDL. */
7948
+ type TokenAccountData = IdlAccounts<LongYieldCarry>["token"];
7949
+ type TokenLendingPositionData = TokenAccountData["lendingPositions"][number];
7950
+ type TokenCarryPositionData = TokenAccountData["debtCarry"][number];
7951
+ /** A carry position paired with its index in the `debtCarry` array. */
7952
+ interface IndexedCarryPosition {
7953
+ index: number;
7954
+ data: TokenCarryPositionData;
7955
+ }
7956
+ /** A lending position paired with its index in the `lendingPositions` array. */
7957
+ interface IndexedLendingPosition {
7958
+ index: number;
7959
+ data: TokenLendingPositionData;
7960
+ }
7961
+ /**
7962
+ * Wrapper around the raw Token account data from the program.
7963
+ *
7964
+ * Provides typed access to on-chain state and a home for
7965
+ * derived/computed helpers as the SDK grows.
7966
+ */
7967
+ declare class LYCToken {
7968
+ /** The Token PDA address this data was fetched from */
7969
+ readonly address: Address;
7970
+ /** Deserialized account data */
7971
+ readonly data: TokenAccountData;
7972
+ constructor(
7973
+ /** The Token PDA address this data was fetched from */
7974
+ address: Address,
7975
+ /** Deserialized account data */
7976
+ data: TokenAccountData);
7977
+ get circuitBreaker(): number;
7978
+ /** Whether the token is operational (circuit breaker is off). */
7979
+ get isActive(): boolean;
7980
+ /**
7981
+ * Returns carry positions that have a non-default yielding base mint and
7982
+ * positive shares — i.e. positions with actual yield exposure. Includes the
7983
+ * original array index so callers can reference `debtCarry[index]` on-chain.
7984
+ */
7985
+ get activeCarryPositions(): IndexedCarryPosition[];
7986
+ /**
7987
+ * Returns lending positions that have a non-None platform — i.e. positions
7988
+ * with an active lending protocol. Includes the original array index so
7989
+ * callers can reference `lendingPositions[index]` on-chain.
7990
+ */
7991
+ get activeLendingPositions(): IndexedLendingPosition[];
7992
+ /**
7993
+ * Subset of {@link activeLendingPositions} that currently has supplied
7994
+ * collateral on-chain. Filters out slots whose platform is set but whose
7995
+ * collateral has been fully withdrawn — those slots can still report
7996
+ * non-zero protocol-level state via a shared obligation, which makes them
7997
+ * unsafe targets for borrow/withdraw flows.
7998
+ */
7999
+ get usedLendingPositions(): IndexedLendingPosition[];
8000
+ get config(): TokenAccountData["config"];
8001
+ get collateral(): TokenAccountData["collateral"];
8002
+ get fees(): TokenAccountData["fees"];
8003
+ get accounting(): TokenAccountData["accounting"];
8004
+ get id(): number;
8005
+ get mint(): Address;
8006
+ get collateralMint(): Address;
8007
+ get label(): string;
8008
+ get decimals(): number;
8009
+ /**
8010
+ * On-chain token price: **collateral per yToken** in UI units (same decimals as
8011
+ * the yToken), not USD. At genesis this is 1:1 with the collateral asset; it
8012
+ * moves with NAV. For USD notional use `tvlUsd` / `totalSupply`, or
8013
+ * `client.account.fetchUserHoldings` (pro-rata TVL).
8014
+ */
8015
+ get price(): number;
8016
+ get totalSupply(): number;
8017
+ /**
8018
+ * Total protocol TVL in USD (on-chain `accounting.tvlUsd` is 8-decimal
8019
+ * fixed-point USD, $1 = 10^8).
8020
+ */
8021
+ get tvlUsd(): number;
8022
+ get depositLimitUi(): number;
8023
+ /**
8024
+ * Sum of active `debtCarry[*].tvlUsd` (8-decimal normalized USD stored on-chain).
8025
+ * Mirrors the on-chain `Token::total_carry_tvl_usd` helper.
8026
+ */
8027
+ get totalCarryTvlUsd(): bigint;
8028
+ /**
8029
+ * Sum of active `lendingPositions[*].accounting.debt.tvlUsd` (8-decimal normalized USD).
8030
+ * Mirrors the on-chain `Token::total_lp_debt_usd` helper.
8031
+ */
8032
+ get totalLendingDebtTvlUsd(): bigint;
8033
+ /**
8034
+ * Collectable net yield (8-dec USD): any carry surplus above debt. Zero when
8035
+ * carry TVL does not exceed debt TVL.
8036
+ */
8037
+ get collectableNetYieldUsd(): bigint;
8038
+ /**
8039
+ * True when the token is active and carry TVL exceeds debt by at most 1 bp.
8040
+ */
8041
+ hasInterestToCollect(): boolean;
8042
+ /**
8043
+ * Returns every active lending position whose debt mint matches `debtMint`,
8044
+ * in on-chain slot order. A token may hold more than one position on the same
8045
+ * debt mint, so callers should loop over all of them. Empty when none match.
8046
+ */
8047
+ findLendingPositionsByDebtMint(debtMint: Address): IndexedLendingPosition[];
8048
+ /**
8049
+ * Mirror the on-chain `Token::compute_mint_amounts` formula.
8050
+ *
8051
+ * The holder price-fee (the residual after protocol/curator take their split)
8052
+ * is a gift to the pre-mint supply `S`. To stop the minter clawing back their
8053
+ * own gift, all minted tokens are sized at the post-gift price — i.e. scaled by
8054
+ * `S / (S + priceFee)`. The fee is not applied to the price on-chain at mint
8055
+ * time; it is buffered and released gradually by `refreshTokenState`, so this
8056
+ * quote returns the same base-unit amounts the program mints.
8057
+ *
8058
+ * When `totalSupply === 0`, the user is priced at the current price, protocol
8059
+ * and curator receive their configured base shares, and the residual is
8060
+ * buffered without post-gift scaling.
8061
+ */
8062
+ computeMintAmounts(depositAmount: BN | number): MintAmounts;
8063
+ /**
8064
+ * Mirror the on-chain `Token::compute_burn_amounts` formula.
8065
+ *
8066
+ * Returns exact base-unit values for the three accounting effects of a burn:
8067
+ * - `collateralToUser`: collateral returned to the burner
8068
+ * - `protocolFee`: yTokens accrued as pending protocol fees
8069
+ * - `supplyReduction`: net decrease in total supply
8070
+ *
8071
+ * The holder price-fee (residual after protocol/curator take their split) is
8072
+ * not paid out as collateral; on-chain it is buffered and dripped into the
8073
+ * price for the remaining holders. The burner is leaving, so there is no
8074
+ * self-dealing to guard against and no post-gift scaling is applied. The same
8075
+ * configured split applies when all circulating supply is burned; the residual
8076
+ * remains buffered until it can be released gradually.
8077
+ */
8078
+ computeBurnAmounts(burnAmount: BN | number): BurnAmounts;
8079
+ /**
8080
+ * Convenience wrapper around {@link computeBurnAmounts} that returns only
8081
+ * the collateral owed to the user, converted to a UI amount
8082
+ * (divided by 10^collateral.decimals).
8083
+ */
8084
+ computeBurnWithdrawUiAmount(burnAmount: BN | number): number;
8085
+ /**
8086
+ * Derives the YieldingBank PDA for the `debtCarry` entry at `debtCarryIndex`.
8087
+ *
8088
+ * @param debtCarryIndex - Index into `data.debtCarry`
8089
+ * @param pda - Program PDA client (`YIELDING_BANK` seeds match on-chain).
8090
+ */
8091
+ deriveYieldingBankAddressForDebtCarryIndex(debtCarryIndex: number, pda: PdaClient): Promise<Address>;
8092
+ /**
8093
+ * Resolves the YieldingBank PDA for the token's first active `debtCarry`
8094
+ * entry. Used as a default when callers haven't picked a specific bank.
8095
+ */
8096
+ resolveFirstYieldingBankAddress(pda: PdaClient): Promise<Address>;
8097
+ }
8098
+
8099
+ /** Decoded on-chain data for a YieldingBank account, derived from the IDL. */
8100
+ type YieldingBankAccountData = IdlAccounts<LongYieldCarry>["yieldingBank"];
8101
+ /**
8102
+ * Wrapper around the raw YieldingBank account data from the program.
8103
+ *
8104
+ * Provides typed access to on-chain state and a home for
8105
+ * derived/computed helpers as the SDK grows.
8106
+ */
8107
+ declare class LYCYieldingBank {
8108
+ /** The YieldingBank PDA address this data was fetched from */
8109
+ readonly address: Address;
8110
+ /** Deserialized account data */
8111
+ readonly data: YieldingBankAccountData;
8112
+ constructor(
8113
+ /** The YieldingBank PDA address this data was fetched from */
8114
+ address: Address,
8115
+ /** Deserialized account data */
8116
+ data: YieldingBankAccountData);
8117
+ get circuitBreaker(): number;
8118
+ get isActive(): boolean;
8119
+ get config(): YieldingBankAccountData["config"];
8120
+ get accounting(): YieldingBankAccountData["accounting"];
8121
+ get baseMint(): Address;
8122
+ get defaultRedemptionMint(): Address;
8123
+ get id(): number;
8124
+ get decimals(): number;
8125
+ get timeCreatedTs(): bigint;
8126
+ get sharePrice(): number;
8127
+ get totalShares(): number;
8128
+ /**
8129
+ * `true` when the bank's cached `lastRefreshedTs` is older than the
8130
+ * client-side staleness threshold and a `refresh_yielding_bank` ix should
8131
+ * be prepended before any handler that calls `verify_price_is_fresh`.
8132
+ */
8133
+ get isStale(): boolean;
8134
+ get baseAsset(): YieldingBankAccountData["baseAsset"];
8135
+ get assets(): YieldingBankAccountData["assets"];
8136
+ get externalYieldingPositions(): YieldingBankAccountData["externalYieldingPositions"];
8137
+ /**
8138
+ * Find the asset holding entry for a given mint across the bank's
8139
+ * base asset and additional assets. Returns null if not held.
8140
+ */
8141
+ findAssetHolding(mint: Address): YieldingBankAccountData["baseAsset"] | null;
8142
+ /**
8143
+ * Returns the flat index for the asset holding matching the given mint
8144
+ * (0 = base_asset, 1–12 = assets[0–11]), or null if not found.
8145
+ */
8146
+ findAssetHoldingIndex(mint: Address): number | null;
8147
+ }
8148
+
8149
+ interface YieldingBankRefreshExternalLiquidity {
8150
+ externalLiquiditySources: YieldingBankExternalLiquiditySource[];
8151
+ postSuccessCacheInvalidations: TransactionCacheInvalidation[];
8152
+ }
8153
+ declare class LongYieldCarryExternalLiquidityResolver {
8154
+ private readonly perena;
8155
+ constructor(rpcUrl: string);
8156
+ resolveYieldingBankRefreshExternalLiquidity(accountClient: AccountClient, yieldingBank: Address, cpiData?: readonly CpiData[]): Promise<YieldingBankRefreshExternalLiquidity>;
8157
+ }
8158
+
8159
+ /** Supported lending platforms */
8160
+ declare enum LendingPlatform {
8161
+ Kamino = 0
8162
+ }
8163
+ interface OutstandingIncentiveClaimAccounts {
8164
+ farm: Address;
8165
+ userFarm: Address;
8166
+ }
8167
+ /**
8168
+ * Represents a hypothetical change to a user's position.
8169
+ * Used for simulating APY changes before executing transactions.
8170
+ * Values are in UI units (token amounts, not raw).
8171
+ */
8172
+ interface PositionBalanceChange {
8173
+ /** Change in collateral amount (positive = deposit, negative = withdraw) */
8174
+ collateralChange?: number;
8175
+ /** Change in debt amount (positive = borrow, negative = repay) */
8176
+ debtChange?: number;
8177
+ }
8178
+ /** A claimable lending-platform incentive balance for a specific claim path. */
8179
+ interface OutstandingIncentive {
8180
+ mint: Address;
8181
+ /** Claimable balance in the reward token's raw base units. */
8182
+ amount: number;
8183
+ /** Decimals of the reward token mint (0 if unknown). */
8184
+ decimals: number;
8185
+ /** Claimable balance in UI units (`amount / 10 ** decimals`). */
8186
+ uiAmount: number;
8187
+ claimAccounts?: OutstandingIncentiveClaimAccounts;
8188
+ }
8189
+
8190
+ /**
8191
+ * Abstract base class for fetching and caching lending platform data.
8192
+ * Provides a unified interface for accessing markets, reserves, and user positions
8193
+ * across different lending protocols with built-in TTL-based caching.
8194
+ */
8195
+ declare abstract class LendingPlatformData {
8196
+ protected rpc: Rpc<SolanaRpcApi>;
8197
+ protected cache: DataCache;
8198
+ poolCatKey: string;
8199
+ reserveCatKey: string;
8200
+ userAccountCatKey: string;
8201
+ constructor(rpcUrl: string, cacheTtlConfig?: CacheTtlConfig, rpcUrls?: string[]);
8202
+ /** Returns the platform identifier for this data provider */
8203
+ abstract platform(): LendingPlatform;
8204
+ /** Loads and caches data for the specified lending pools/markets */
8205
+ abstract load(pools: Address[]): Promise<void>;
8206
+ clearCache(): void;
8207
+ clearCacheEntry(category: string, id: string): void;
8208
+ /** Returns the current slot, cached to reduce RPC calls */
8209
+ getSlot(): Promise<bigint>;
8210
+ /** Fetches a single user position by address if it exists */
8211
+ abstract maybeFetchUserPositionInPool(pool: Address, userPosition: Address): Promise<UserPositionBase | null>;
8212
+ /** Fetches multiple user positions by their addresses */
8213
+ abstract fetchUserPositionsInPool(pool: Address, userPositions: Address[]): Promise<UserPositionBase[]>;
8214
+ /** Fetches all positions owned by a user in a specific pool */
8215
+ abstract fetchAllUserPositionsForUserInPool(pool: Address, user: Address): Promise<UserPositionBase[]>;
8216
+ /** Fetches reserve data by reserve address */
8217
+ abstract fetchReserve(pool: Address, reserve: Address): Promise<ReserveBase | null>;
8218
+ /** Fetches reserve data by the underlying token mint */
8219
+ abstract fetchReserveByMint(pool: Address, mint: Address): Promise<ReserveBase | null>;
8220
+ }
8221
+
8222
+ /** Cache configuration for Kamino data with optional market-specific TTL */
8223
+ interface KaminoCacheConfig extends CacheTtlConfig {
8224
+ marketsTtlMs?: number;
8225
+ }
8226
+ /**
8227
+ * Data provider for Kamino Lend protocol.
8228
+ * Handles fetching and caching of markets, reserves, obligations, farms, and prices.
8229
+ * Supports both standard reserve farms and "extra" farms (paired collateral/debt incentives).
8230
+ */
8231
+ declare class KaminoData extends LendingPlatformData {
8232
+ farms: Farms;
8233
+ private scope;
8234
+ constructor(rpcUrl: string, cacheConfig?: KaminoCacheConfig, rpcUrls?: string[]);
8235
+ platform(): LendingPlatform;
8236
+ /**
8237
+ * Warms the market cache for the requested pools. Single-pool calls reuse the
8238
+ * normal lazy fetch path; multi-pool calls use Kamino's batched loader.
8239
+ */
8240
+ load(pools: Address[]): Promise<void>;
8241
+ /** Fetches a market by address, loading from cache if available */
8242
+ fetchMarket(market: Address): Promise<KaminoMarket>;
8243
+ /** Fetches all oracle prices for assets in the specified market */
8244
+ fetchPrices(pool: Address): Promise<KlendPrices>;
8245
+ /** Fetches an obligation (user position) by address */
8246
+ fetchObligation(market: KaminoMarket, obligation: Address): Promise<KaminoObligation | null>;
8247
+ /** Batch fetches farm states by their addresses */
8248
+ fetchFarms(farms: Address[]): Promise<FarmState[]>;
8249
+ private fetchExtraFarms;
8250
+ /**
8251
+ * Collects all farm incentives for a reserve, including both standard
8252
+ * collateral/debt farms and extra paired farms from Kamino CDN config.
8253
+ */
8254
+ private fetchFarmsForReserve;
8255
+ fetchUserActiveIncentives(user: Address, specificFarm?: Address): Promise<UserFarm[]>;
8256
+ maybeFetchUserPositionInPool(pool: Address, userPosition: Address): Promise<KaminoUserPositionData | null>;
8257
+ fetchUserPositionsInPool(pool: Address, userPositions: Address[]): Promise<KaminoUserPositionData[]>;
8258
+ fetchAllUserPositionsForUserInPool(pool: Address, user: Address): Promise<KaminoUserPositionData[]>;
8259
+ fetchReserve(pool: Address, reserve: Address): Promise<KaminoReserveData>;
8260
+ fetchReserveByMint(pool: Address, mint: Address): Promise<KaminoReserveData>;
8261
+ private mapReserve;
8262
+ /**
8263
+ * Fetches and caches the Scope OraclePrices account for a given price feed.
8264
+ * @returns The deserialized OraclePrices, or null if the account doesn't exist
8265
+ */
8266
+ fetchScopeOraclePrices(priceFeed: Address): Promise<OraclePrices | null>;
8267
+ /**
8268
+ * Resolves and caches the Scope Configuration account address for a given OraclePrices account.
8269
+ * The first call per price feed does a getProgramAccounts lookup; subsequent calls use cache.
8270
+ */
8271
+ fetchScopeConfigAddress(priceFeed: Address): Promise<Address>;
8272
+ }
8273
+
8274
+ /**
8275
+ * Categorizes when an incentive reward applies:
8276
+ * - LendingOnly: Only for lending
8277
+ * - BorrowingOnly: Only for borroweing
8278
+ * - Pair: Requires both collateral and debt in specific reserves
8279
+ */
8280
+ declare enum IncentiveType {
8281
+ LendingOnly = "Lending",
8282
+ BorrowingOnly = "Borrowing",
8283
+ Pair = "Pair"
8284
+ }
8285
+ interface IncentiveConfig {
8286
+ rewardMint: Address;
8287
+ incentiveType: IncentiveType;
8288
+ /** If set, this incentive only applies when paired with this reserve */
8289
+ requiresPairReserve?: Address;
8290
+ }
8291
+ /**
8292
+ * Abstract base class for token reward incentives on lending reserves.
8293
+ * Incentives can apply to deposits, borrows, or paired positions.
8294
+ */
8295
+ declare abstract class TokenIncentiveBase {
8296
+ address: Address;
8297
+ config: IncentiveConfig;
8298
+ constructor(address: Address, config: IncentiveConfig);
8299
+ /** Returns true if the incentive is currently active and emitting rewards */
8300
+ abstract active(): boolean;
8301
+ /** Returns the current APY from this incentive */
8302
+ abstract apy(): number;
8303
+ /** Simulates the APY after a hypothetical position change after changing total collateral deposits or debt borrows */
8304
+ abstract simulateNewAPY(args: PositionBalanceChange): number;
8305
+ }
8306
+
8307
+ /** Arguments for constructing a KaminoIncentiveData instance */
8308
+ interface KaminoIncentiveDataArgs {
8309
+ data: FarmAndKey;
8310
+ /** Index of the reward within the farm's rewardInfos array */
8311
+ rewardIndex: number;
8312
+ /** If set, this incentive requires a paired position with this reserve */
8313
+ requiresPairReserve?: Address;
8314
+ /** True if this is a debt farm (rewards borrowers), false for collateral farm */
8315
+ isDebtFarm: boolean;
8316
+ }
8317
+
8318
+ type IncentiveSide = "supply" | "borrow";
8319
+ /** Token mint information for a reserve's underlying asset */
8320
+ interface ReserveMint {
8321
+ mint: Address;
8322
+ mintDecimals: number;
8323
+ mintTokenProgram: Address;
8324
+ price?: number;
8325
+ emaPrice?: number;
8326
+ }
8327
+ /** Risk and fee parameters for a reserve */
8328
+ interface ReserveConfig {
8329
+ ltvPct: number;
8330
+ liquidationThresholdPct: number;
8331
+ borrowFeePct: number;
8332
+ flashLoanFeePct: number;
8333
+ /** E-mode configurations for enhanced LTV with specific debt reserves */
8334
+ emodes?: EmodeConfig[];
8335
+ }
8336
+ /** Aggregated metrics for deposit/borrow activity */
8337
+ interface ReserveInteractionInfo {
8338
+ /** In UI amounts, e.g. 1.234 */
8339
+ totalAmount: number;
8340
+ /** In UI amounts, e.g. 1.234 */
8341
+ limit: number;
8342
+ apy: number;
8343
+ }
8344
+ interface ReserveState {
8345
+ utilizationRatePct: number;
8346
+ availableLiquidity: number;
8347
+ }
8348
+ /** E-mode (efficiency mode) configuration for enhanced collateral ratios */
8349
+ interface EmodeConfig {
8350
+ id?: number;
8351
+ debtReserve?: Address;
8352
+ ltvPct: number;
8353
+ liquidationThresholdPct: number;
8354
+ }
8355
+ /**
8356
+ * Abstract base class representing a lending reserve (asset pool).
8357
+ * Contains normalized data about deposits, borrows, rates, and incentives.
8358
+ */
8359
+ declare abstract class ReserveBase {
8360
+ address: Address;
8361
+ mint: ReserveMint;
8362
+ config: ReserveConfig;
8363
+ deposits: ReserveInteractionInfo;
8364
+ borrows: ReserveInteractionInfo;
8365
+ private state;
8366
+ incentives?: TokenIncentiveBase[] | undefined;
8367
+ private createdAt;
8368
+ constructor(address: Address, mint: ReserveMint, config: ReserveConfig, deposits: ReserveInteractionInfo, borrows: ReserveInteractionInfo, state: ReserveState, incentives?: TokenIncentiveBase[] | undefined);
8369
+ private normalizeLtvPct;
8370
+ /** Returns the cached price, or undefined if stale */
8371
+ get mintPrice(): number | undefined;
8372
+ /** Returns the cached EMA price, or undefined if stale/missing */
8373
+ get mintEmaPrice(): number | undefined;
8374
+ /** Returns oracle account addresses used for price feeds */
8375
+ abstract getOracleAccounts(): Record<string, Address | undefined>;
8376
+ /**
8377
+ * Returns the reserve LTV in decimal form, where `0.5 = 50%`.
8378
+ */
8379
+ get ltvPct(): number;
8380
+ /**
8381
+ * Returns e-mode configs with `ltvPct` normalized to decimal form, where
8382
+ * `0.5 = 50%`.
8383
+ */
8384
+ get emodes(): EmodeConfig[] | undefined;
8385
+ utilizationRatePct(): number;
8386
+ /** Returns borrowable liquidity, accounting for both available balance and borrow limits, in UI amount (e.g. 1.234) */
8387
+ liquidityAvailable(): number;
8388
+ /**
8389
+ * Returns the total supply APY including base rate and eligible supply-side
8390
+ * incentives (types `LendingOnly` and `Pair`). Borrow-side incentives are
8391
+ * excluded here — they reward borrowers, not lenders.
8392
+ * @param usingDebtReserve - When specified, includes paired incentives requiring this debt reserve
8393
+ */
8394
+ supplyAPY(usingDebtReserve?: Address): number;
8395
+ /** Simulates supply APY after a position change */
8396
+ abstract simulateNewSupplyAPY(args: PositionBalanceChange, usingDebtReserve?: Address): number;
8397
+ /**
8398
+ * Returns the effective borrow APY (base rate minus eligible borrow-side
8399
+ * incentive rebates, i.e. `BorrowingOnly`). Lender-side incentives are
8400
+ * excluded — they are paid to lenders and do not offset borrower cost.
8401
+ * @param usingSupplyReserve - When specified, includes paired incentives requiring this collateral
8402
+ */
8403
+ borrowAPY(usingSupplyReserve?: Address): number;
8404
+ /** Simulates borrow APY after a position change */
8405
+ abstract simulateNewBorrowAPY(args: PositionBalanceChange, usingSupplyReserve?: Address): number;
8406
+ /** Sums APY from incentives eligible for the given side and paired reserve */
8407
+ protected sumEligibleIncentivesAPY(side: IncentiveSide, usingPairReserve?: Address): number;
8408
+ /** Sums the new simulated APY from incentives eligible for the given side and paired reserve */
8409
+ protected simulateNewEligbleIncentivesAPY(args: PositionBalanceChange, side: IncentiveSide, usingPairReserve?: Address): number;
8410
+ /**
8411
+ * Filters incentives eligible for the given side (supply vs borrow) and
8412
+ * paired reserve.
8413
+ *
8414
+ * Side filter:
8415
+ * - `supply`: `LendingOnly` and `Pair` (collateral-farm incentives,
8416
+ * optionally gated on a specific debt reserve).
8417
+ * - `borrow`: `BorrowingOnly` (debt-farm incentives, optionally gated on a
8418
+ * specific collateral reserve via `requiresPairReserve`).
8419
+ *
8420
+ * Pair filter: incentives with `requiresPairReserve` only apply when that
8421
+ * reserve matches the caller's pair.
8422
+ */
8423
+ protected getEligibleIncentives(side: IncentiveSide, usingPairReserve?: Address): TokenIncentiveBase[];
8424
+ canDeposit(amount: number): boolean;
8425
+ abstract canWithdraw(amount: number): boolean;
8426
+ canBorrow(amount: number): boolean;
8427
+ }
8428
+
8429
+ /** Supported oracle types for Kamino price feeds */
8430
+ type OracleType = "pythPrice" | "switchboardPrice" | "switchboardTwap" | "scope";
8431
+ type ReserveOracleAccounts = Record<OracleType, Address | undefined>;
8432
+ /**
8433
+ * Kamino-specific reserve data implementation.
8434
+ * Wraps KaminoReserve with normalized accessors and oracle account resolution.
8435
+ */
8436
+ declare class KaminoReserveData extends ReserveBase {
8437
+ rawData: KaminoReserve;
8438
+ slot: bigint;
8439
+ /**
8440
+ * Creates a KaminoReserveData instance from raw SDK types.
8441
+ * Extracts and normalizes configuration, rates, limits, and incentives.
8442
+ */
8443
+ static loadData(market: KaminoMarket, reserve: KaminoReserve, reserveFarms: KaminoIncentiveDataArgs[], prices: KlendPrices, slot: bigint): KaminoReserveData;
8444
+ /** Checks if TWAP price validation is enabled for this reserve */
8445
+ protected isTwapEnabled(): boolean;
8446
+ /**
8447
+ * Determines if the reserve's on-chain price data is stale and needs refreshing.
8448
+ */
8449
+ requiresRefresh(): boolean;
8450
+ /**
8451
+ * Returns all configured oracle account addresses for this reserve.
8452
+ * Only includes accounts that are actually enabled.
8453
+ */
8454
+ getOracleAccounts(): ReserveOracleAccounts;
8455
+ /**
8456
+ * Simulates the supply APY after a position balance change.
8457
+ * Uses the SDK's calcSimulatedSupplyAPR which accounts for utilization changes.
8458
+ */
8459
+ simulateNewSupplyAPY(args: PositionBalanceChange, usingDebtReserve?: Address): number;
8460
+ /**
8461
+ * Simulates the borrow APY after a position balance change.
8462
+ * Uses the SDK's calcSimulatedBorrowAPR which accounts for utilization changes.
8463
+ */
8464
+ simulateNewBorrowAPY(args: PositionBalanceChange, usingSupplyReserve?: Address): number;
8465
+ canWithdraw(amount: number): boolean;
8466
+ canBorrow(amount: number): boolean;
8467
+ private hasCapacity;
8468
+ }
8469
+
8470
+ /** Represents a single asset position (deposit or borrow) within an obligation */
8471
+ interface PositionInfo {
8472
+ reserve: Address;
8473
+ mint: Address;
8474
+ amount: BN;
8475
+ valueUsd: number;
8476
+ }
8477
+ /**
8478
+ * Base class representing a user's lending position.
8479
+ * Contains aggregated data about deposits, borrows, and health metrics.
8480
+ */
8481
+ declare class UserPositionBase {
8482
+ address: Address;
8483
+ /** Current utilization as a ratio of borrowed value to borrow limit (0-1) */
8484
+ utilizationRate: number;
8485
+ deposits: PositionInfo[];
8486
+ borrows: PositionInfo[];
8487
+ /** Loan-to-value ratio (if applicable based on elevation group) */
8488
+ ltv?: number | undefined;
8489
+ /** Liquidation threshold percentage (if applicable) */
8490
+ liquidationThreshold?: number | undefined;
8491
+ /**
8492
+ * Obligation-level max borrow capacity in USD (`borrowedUsd / utilizationRate`).
8493
+ * Each platform loader must set this from that protocol's position health model.
8494
+ */
8495
+ borrowLimitUsd?: number | undefined;
8496
+ constructor(address: Address,
8497
+ /** Current utilization as a ratio of borrowed value to borrow limit (0-1) */
8498
+ utilizationRate: number, deposits: PositionInfo[], borrows: PositionInfo[],
8499
+ /** Loan-to-value ratio (if applicable based on elevation group) */
8500
+ ltv?: number | undefined,
8501
+ /** Liquidation threshold percentage (if applicable) */
8502
+ liquidationThreshold?: number | undefined,
8503
+ /**
8504
+ * Obligation-level max borrow capacity in USD (`borrowedUsd / utilizationRate`).
8505
+ * Each platform loader must set this from that protocol's position health model.
8506
+ */
8507
+ borrowLimitUsd?: number | undefined);
8508
+ /** Aggregate borrowed USD for headroom; prefers per-borrow breakdown when present. */
8509
+ private userPositionBorrowedValueUsd;
8510
+ /**
8511
+ * Max additional debt UI amount before the platform rejects the borrow.
8512
+ * Uses obligation `borrowLimitUsd − borrowedUsd`, floored to base units with a
8513
+ * one-unit buffer so simulation-time refresh cannot overshoot. Returns `undefined`
8514
+ * when `borrowLimitUsd` was not set by the platform loader.
8515
+ */
8516
+ getMaxAdditionalBorrowUiAmount(debtPriceUsd: number, debtDecimals: number): number | undefined;
8517
+ }
8518
+
8519
+ /**
8520
+ * Kamino-specific user position data.
8521
+ * Extracts deposit/borrow positions and health metrics from a KaminoObligation.
8522
+ */
8523
+ declare class KaminoUserPositionData extends UserPositionBase {
8524
+ rawData: KaminoObligation;
8525
+ /** Creates a KaminoUserPositionData from a raw KaminoObligation */
8526
+ static loadData(obligation: KaminoObligation): KaminoUserPositionData;
8527
+ /**
8528
+ * Determines if the obligation needs a refresh_obligation instruction.
8529
+ */
8530
+ requiresRefresh(): boolean;
8531
+ }
8532
+
8533
+ declare abstract class LpAccountsBase<T extends LendingPlatformData> {
8534
+ data: T;
8535
+ constructor(data: T);
8536
+ abstract getUserAccountAddress(pool: Address, user: Address, id: number): Promise<Address>;
8537
+ }
8538
+
8539
+ declare class KaminoAccounts extends LpAccountsBase<KaminoData> {
8540
+ getUserAccountAddress(pool: Address, user: Address, id: number): Promise<Address>;
8541
+ getUserMetadataAddress(user: Address): Promise<Address<string>>;
8542
+ /**
8543
+ * Gets the obligation farm accounts for a reserve.
8544
+ */
8545
+ getFarmAccounts(pool: Address, reserve: Address, obligation: Address, farmMode: "collateral" | "debt"): Promise<{
8546
+ userFarm: CustomAccountMeta;
8547
+ farm: CustomAccountMeta;
8548
+ }>;
8549
+ /**
8550
+ * Returns the obligationFarmUserState PDA addresses for all active farms
8551
+ * (collateral and debt) on a reserve. The farm addresses themselves live on
8552
+ * the Kamino LUTs; only the user-specific state needs the per-token LUT.
8553
+ */
8554
+ getUserFarmAddresses(pool: Address, reserve: Address, obligation: Address): Promise<Address[]>;
8555
+ /**
8556
+ * Get all relevant account metas needed for interacting with the Kamino lending market.
8557
+ */
8558
+ reserveInteractionDetails(user: Address, pool: Address, reserve: Address, obligation?: Address, amount?: number, baseUnitAmountOverride?: BN): Promise<{
8559
+ baseUnitAmount: BN | undefined;
8560
+ signer: CustomAccountMeta;
8561
+ obligation: CustomAccountMeta | undefined;
8562
+ reserve: CustomAccountMeta;
8563
+ reserveFeeVault: CustomAccountMeta;
8564
+ reserveLiquidityMint: CustomAccountMeta;
8565
+ reserveLiquiditySupply: CustomAccountMeta;
8566
+ reserveCollateralMint: CustomAccountMeta;
8567
+ reserveCollateralSupply: CustomAccountMeta;
8568
+ lendingMarket: CustomAccountMeta;
8569
+ lendingMarketAuthority: CustomAccountMeta;
8570
+ userLiquidityTa: CustomAccountMeta;
8571
+ userCollateralTa: CustomAccountMeta;
8572
+ liquidityMintTokenProgram: CustomAccountMeta;
8573
+ collateralMintTokenProgram: CustomAccountMeta;
8574
+ farmsProgram: CustomAccountMeta;
8575
+ }>;
8576
+ }
8577
+
8578
+ interface RefreshPrerequisiteTarget {
8579
+ pool: Address;
8580
+ userAccount: Address;
8581
+ collateralReserves: Address[];
8582
+ debtReserves: Address[];
8583
+ }
8584
+
8585
+ /** Parameters for deposit, withdraw, and borrow operations */
8586
+ interface LendingOperationParams {
8587
+ user: Address;
8588
+ payer: Address;
8589
+ pool: Address;
8590
+ reserve: Address;
8591
+ userAccount: Address;
8592
+ /**
8593
+ * UI-unit amount, or `"all"` (withdraw-only) to encode the platform's
8594
+ * "withdraw all" sentinel (Kamino: `u64::MAX` collateral amount) so the
8595
+ * obligation's deposit is fully drained on-chain — no dust left behind
8596
+ * from off-chain cToken/liquidity rate drift.
8597
+ *
8598
+ * If neither this nor {@link baseUnitAmount} is provided, the amount is
8599
+ * implied to be derived in the program.
8600
+ */
8601
+ uiAmount?: number | "all";
8602
+ /**
8603
+ * Exact liquidity base units for the operation (e.g. lamports for SOL). Prefer over
8604
+ * {@link uiAmount} when float round-trips would undershoot on-chain requirements.
8605
+ * Pass `"all"` (withdraw-only) for the same sentinel semantics as {@link uiAmount}.
8606
+ */
8607
+ baseUnitAmount?: BN | "all";
8608
+ txId: string;
8609
+ }
8610
+ /** Parameters for repay operations, with option for full repayment */
8611
+ interface RepayOperationParams extends LendingOperationParams {
8612
+ /** Repay amount in UI units. The withdraw-only `"all"` sentinel is not valid here. */
8613
+ uiAmount?: number;
8614
+ /** Exact repay amount in liquidity base units. */
8615
+ baseUnitAmount?: BN;
8616
+ /** When true, repays the entire debt balance regardless of `amount` */
8617
+ full?: boolean;
8618
+ }
8619
+ /** CPI data split into instruction-level prerequisite CPIs and main operation CPIs. */
8620
+ interface SplitLpOperationCpiData {
8621
+ prerequisiteCpis: CpiData[];
8622
+ cpis: CpiData[];
8623
+ allCpis: CpiData[];
8624
+ }
8625
+ /** Split CPI data plus flattened post-success cache invalidations from all nested CPIs. */
8626
+ interface LendingOperationCpiBundle extends SplitLpOperationCpiData {
8627
+ postSuccessCacheInvalidations: TransactionCacheInvalidation[];
8628
+ }
8629
+ /** Whether a reserve is used as collateral or debt for a user account */
8630
+ type ReserveRole = "collateral" | "debt";
8631
+ /** Tracks a reserve's pool and which user accounts reference it (with roles) */
8632
+ interface TxReserveInfo {
8633
+ pool: Address;
8634
+ userAccounts: Map<string, Set<ReserveRole>>;
8635
+ }
8636
+ /**
8637
+ * Abstract base class for lending platform instruction builders.
8638
+ * Provides a unified interface for building CPI data for different lending protocols.
8639
+ * Each platform implementation provides the account metas needed to construct CPI calls.
8640
+ *
8641
+ * @typeParam T - The platform-specific data class extending LendingPlatformData
8642
+ */
8643
+ declare abstract class LpInstructionsBase<T extends LendingPlatformData> {
8644
+ rpc: Rpc<SolanaRpcApi>;
8645
+ rpcUrl: string;
8646
+ data: T;
8647
+ abstract programId: Address;
8648
+ abstract lookupTable: Address;
8649
+ accounts: LpAccountsBase<T>;
8650
+ /** Tracks which reserves (and their pools/roles) are involved in each transaction */
8651
+ protected txReserves: Map<string, Map<string, TxReserveInfo>>;
8652
+ /**
8653
+ * Per-txId per-obligation set of debt reserves that the caller has flagged
8654
+ * as being fully repaid earlier in the same transaction. Subsequent
8655
+ * `RefreshObligation` builds for that obligation must NOT include these
8656
+ * reserves in the borrow accounts list — by execution time the borrow row
8657
+ * has been removed from the obligation, and Kamino's `handler_refresh_obligation`
8658
+ * checks the passed account count against the live obligation state and
8659
+ * fails with `InvalidAccountInput` (klend error 6006) on a mismatch.
8660
+ *
8661
+ * Set via {@link markObligationDebtCleared}, read via {@link getTxObligationClearedDebt}.
8662
+ */
8663
+ protected txClearedDebt: Map<string, Map<string, Set<string>>>;
8664
+ constructor(rpc: Rpc<SolanaRpcApi>, rpcUrl: string, data: T, accounts: LpAccountsBase<T>);
8665
+ emptyAccountMeta(): CustomAccountMeta;
8666
+ clearCacheEntry(category: string, id: string): void;
8667
+ protected getCacheInvalidation(invalidation: {
8668
+ category: string;
8669
+ id: Address;
8670
+ }): TransactionCacheInvalidation;
8671
+ applyPostSuccessCacheInvalidations(invalidations: TransactionCacheInvalidation[]): void;
8672
+ protected getCpiData(cpiType: number, accounts: CustomAccountMeta[], data?: Uint8Array, programId?: Address, postSuccessCacheInvalidations?: TransactionCacheInvalidation[]): CpiData;
8673
+ protected createSplitOperationCpiData(prerequisiteCpis: CpiData[], cpis: CpiData[]): SplitLpOperationCpiData;
8674
+ protected buildLendingOperationCpiBundle(cpiData: SplitLpOperationCpiData): LendingOperationCpiBundle;
8675
+ getInitAndDepositCpiBundle(params: LendingOperationParams, userAccountId: number): Promise<LendingOperationCpiBundle>;
8676
+ getInitBorrowPositionCpiBundle(params: LendingOperationParams, collReserve: Address): Promise<LendingOperationCpiBundle>;
8677
+ getDepositCpiBundle(params: LendingOperationParams): Promise<LendingOperationCpiBundle>;
8678
+ getWithdrawCpiBundle(params: LendingOperationParams): Promise<LendingOperationCpiBundle>;
8679
+ getBorrowCpiBundle(params: LendingOperationParams): Promise<LendingOperationCpiBundle>;
8680
+ getRepayCpiBundle(params: RepayOperationParams): Promise<LendingOperationCpiBundle>;
8681
+ /**
8682
+ * Registers a reserve as being used in a transaction.
8683
+ * When userAccount and role are provided, also tracks the collateral/debt role
8684
+ * for that specific user account.
8685
+ */
8686
+ protected registerTxReserve(txId: string, pool: Address, reserve: Address, userAccount?: Address, role?: ReserveRole): void;
8687
+ /**
8688
+ * Returns the collateral and debt reserves registered in the tx cache
8689
+ * for a specific user account (obligation).
8690
+ */
8691
+ protected getTxUserAccountReserves(txId: string, userAccount: Address): {
8692
+ collateral: Address[];
8693
+ debt: Address[];
8694
+ };
8695
+ /**
8696
+ * Mark that `reserve` will be fully repaid for `userAccount` earlier in the
8697
+ * `txId` flow, so subsequent obligation-refresh builders drop it from the
8698
+ * borrow accounts they emit. Call after building a "repay all" CPI; it has
8699
+ * no effect on the repay itself.
8700
+ */
8701
+ markObligationDebtCleared(txId: string, userAccount: Address, reserve: Address): void;
8702
+ /** Returns the set of debt reserves marked cleared for `(txId, userAccount)`. */
8703
+ protected getTxObligationClearedDebt(txId: string, userAccount: Address): Set<Address>;
8704
+ /**
8705
+ * Clears the transaction cache for a given transaction or all transactions.
8706
+ * Call after finishing building a transaction to free memory.
8707
+ */
8708
+ clearTransactionCache(txId?: string): void;
8709
+ /**
8710
+ * Returns standalone instructions that must be executed at the top level
8711
+ * BEFORE the the main CPIs. Should be called after all CPI methods for this
8712
+ * txId have been invoked.
8713
+ */
8714
+ abstract getPreInstructions(txId: string): Promise<Instruction[]>;
8715
+ /**
8716
+ * Returns prerequisite CPIs needed before reading refreshed account state for
8717
+ * a batch of lending positions outside a normal deposit/withdraw/borrow/repay
8718
+ * flow.
8719
+ */
8720
+ getPrerequisiteCpisForRefresh(_targets: RefreshPrerequisiteTarget[]): Promise<CpiData[]>;
8721
+ /** Returns CPI data for initializing a user's lending account */
8722
+ abstract getInitUserAccountCpiData(pool: Address, user: Address, feePayer: Address, id: number): Promise<SplitLpOperationCpiData>;
8723
+ /**
8724
+ * Returns CPI data for initializing a lending position end-to-end: the user
8725
+ * account itself plus any per-reserve accessory accounts (e.g. Kamino
8726
+ * obligation farm user states for the collateral and debt reserves). Called
8727
+ * at position-creation time so subsequent deposit/borrow flows don't need
8728
+ * to init these inline.
8729
+ *
8730
+ * Default: delegates to {@link getInitUserAccountCpiData}. Platforms with
8731
+ * per-reserve accessory accounts override this to add their inits.
8732
+ */
8733
+ getInitLendingPositionCpiData(params: {
8734
+ pool: Address;
8735
+ user: Address;
8736
+ payer: Address;
8737
+ userAccountId: number;
8738
+ collateralReserve: Address;
8739
+ debtReserve: Address;
8740
+ }): Promise<SplitLpOperationCpiData>;
8741
+ /** Returns CPI data for initializing user account, incentive account (if necessary) and depositing */
8742
+ abstract getInitAndDepositCpiData(params: LendingOperationParams, userAccountId: number): Promise<SplitLpOperationCpiData>;
8743
+ /** Returns CPI data for initializing a new borrow position */
8744
+ abstract getInitBorrowPositionCpiData(params: LendingOperationParams, collReserve: Address): Promise<SplitLpOperationCpiData>;
8745
+ /** Returns deposit CPI data split into optional prerequisite CPIs and main CPIs. */
8746
+ abstract getDepositCpiData(params: LendingOperationParams): Promise<SplitLpOperationCpiData>;
8747
+ /** Returns withdraw CPI data split into optional prerequisite CPIs and main CPIs. */
8748
+ abstract getWithdrawCpiData(params: LendingOperationParams): Promise<SplitLpOperationCpiData>;
8749
+ /** Returns borrow CPI data split into optional prerequisite CPIs and main CPIs. */
8750
+ abstract getBorrowCpiData(params: LendingOperationParams): Promise<SplitLpOperationCpiData>;
8751
+ /** Returns repay CPI data split into optional prerequisite CPIs and main CPIs. */
8752
+ abstract getRepayCpiData(params: RepayOperationParams): Promise<SplitLpOperationCpiData>;
8753
+ }
8754
+
8755
+ /**
8756
+ * Instruction builder for Kamino Lend protocol.
8757
+ * Provides methods to build CPI account metas for lending operations.
8758
+ */
8759
+ declare class KaminoInstructions extends LpInstructionsBase<KaminoData> {
8760
+ accounts: KaminoAccounts;
8761
+ programId: Address;
8762
+ lookupTable: Address<"bzdjSeDDPEdsGpK73oevQ87x4Sm6QRsnzupPLQEaFFN">;
8763
+ constructor(rpc: Rpc<SolanaRpcApi>, rpcUrl: string, data: KaminoData, accounts: KaminoAccounts);
8764
+ clearTransactionCache(txId?: string): void;
8765
+ private getUserAccountCacheInvalidations;
8766
+ private getInitUserMetadataCpiData;
8767
+ getInitLendingPositionCpiData(params: {
8768
+ pool: Address;
8769
+ user: Address;
8770
+ payer: Address;
8771
+ userAccountId: number;
8772
+ collateralReserve: Address;
8773
+ debtReserve: Address;
8774
+ }): Promise<SplitLpOperationCpiData>;
8775
+ getInitUserAccountCpiData(pool: Address, user: Address, payer: Address, id: number, userLookupTable?: Address): Promise<SplitLpOperationCpiData>;
8776
+ private getInitObligationFarmsForReserveCpiData;
8777
+ /**
8778
+ * Returns CPI accounts for refreshing a reserve's state.
8779
+ * Includes the market, reserve, and all configured oracle accounts.
8780
+ */
8781
+ private getRefreshReserveCpiData;
8782
+ private getRefreshObligationCpiData;
8783
+ private getRefreshObligationCpiDataFromReserves;
8784
+ getPrerequisiteCpisForRefresh(targets: RefreshPrerequisiteTarget[]): Promise<CpiData[]>;
8785
+ private getRefreshUserFarmCpiData;
8786
+ /**
8787
+ * Checks if refresh CPIs are needed for the given reserve and obligation.
8788
+ * Also registers all involved reserves in the txReserves cache for getPreInstructions.
8789
+ *
8790
+ * The instruction `reserve` (collateral vs debt) is also listed on the obligation;
8791
+ * `dedupeOrderedAddresses` ensures one RefreshReserve CPI per reserve pubkey.
8792
+ */
8793
+ private getRefreshCpisIfNeeded;
8794
+ getPreInstructions(txId: string): Promise<Instruction[]>;
8795
+ getClaimIncentiveCpiData(user: Address, payer: Address, pool: Address, reserve: Address, obligation: Address, farm: Address, userFarm: Address, mint: Address): Promise<CpiData[]>;
8796
+ getRequestElevationGroupCpiData(elevationGroup: number, user: Address, obligation: Address, pool: Address, txId: string): Promise<CpiData>;
8797
+ getInitAndDepositCpiData(params: LendingOperationParams, userAccountId: number): Promise<SplitLpOperationCpiData>;
8798
+ getInitBorrowPositionCpiData(params: LendingOperationParams, collReserve: Address): Promise<SplitLpOperationCpiData>;
8799
+ getDepositCpiData(params: LendingOperationParams): Promise<SplitLpOperationCpiData>;
8800
+ getWithdrawCpiData(params: LendingOperationParams): Promise<SplitLpOperationCpiData>;
8801
+ getBorrowCpiData(params: LendingOperationParams): Promise<SplitLpOperationCpiData>;
8802
+ getRepayCpiData(params: RepayOperationParams): Promise<SplitLpOperationCpiData>;
8803
+ }
8804
+
8805
+ /** Parameters for building a flash-borrow instruction. */
8806
+ interface FlashBorrowParams {
8807
+ /** Authority that signs the transfer of the borrowed liquidity. */
8808
+ user: Address;
8809
+ pool: Address;
8810
+ reserve: Address;
8811
+ /** Amount to borrow, in the reserve liquidity mint's base units. */
8812
+ amountBaseUnits: BN;
8813
+ /** Destination ATA for the borrowed liquidity. Defaults to `user`'s ATA for the mint. */
8814
+ destinationAta?: Address;
8815
+ }
8816
+ /** Parameters for building a flash-repay instruction, paired with a prior flash-borrow. */
8817
+ interface FlashRepayParams extends FlashBorrowParams {
8818
+ /** Top-level transaction index of the matching flash-borrow instruction. */
8819
+ borrowIxIndex: number;
8820
+ /** Source ATA for the repay. Defaults to the destination ATA used on the flash-borrow. */
8821
+ userSourceLiquidity?: Address;
8822
+ }
8823
+ /**
8824
+ * Abstract base for lending-platform flash-loan instruction builders.
8825
+ * Flash loans are composed of a top-level borrow and repay pair that must live
8826
+ * in the same transaction; the repay references the borrow by instruction index.
8827
+ *
8828
+ * @typeParam T - The platform-specific data class extending LendingPlatformData
8829
+ */
8830
+ declare abstract class FlashLoanBase<T extends LendingPlatformData> {
8831
+ data: T;
8832
+ constructor(data: T);
8833
+ /** Builds the top-level flash-borrow instruction. */
8834
+ abstract getFlashBorrowIx(params: FlashBorrowParams): Promise<Instruction>;
8835
+ /**
8836
+ * Builds the top-level flash-repay instruction. Must be paired with a
8837
+ * flash-borrow at `borrowIxIndex` in the same transaction.
8838
+ */
8839
+ abstract getFlashRepayIx(params: FlashRepayParams): Promise<Instruction>;
8840
+ /**
8841
+ * Returns the maximum amount that can be flash-borrowed from `reserve`, in
8842
+ * the reserve liquidity mint's base units.
8843
+ */
8844
+ abstract getAvailableFlashBorrowAmount(pool: Address, reserve: Address): Promise<BN>;
8845
+ /**
8846
+ * Returns `reserve`'s flash-loan fee rate as a fraction of the borrowed
8847
+ * amount (e.g. `0.003` for 0.3%).
8848
+ */
8849
+ abstract getFlashLoanFeeRate(pool: Address, reserve: Address): Promise<number>;
8850
+ }
8851
+
8852
+ /**
8853
+ * Abstract base class for lending platform clients.
8854
+ * Provides a unified interface for interacting with different lending protocols.
8855
+ *
8856
+ * @typeParam T - The platform-specific data class extending LendingPlatformData
8857
+ */
8858
+ declare abstract class LendingPlatformClientBase<T extends LendingPlatformData> {
8859
+ rpc: Rpc<SolanaRpcApi>;
8860
+ data: T;
8861
+ abstract accounts: LpAccountsBase<T>;
8862
+ abstract ix: LpInstructionsBase<T>;
8863
+ constructor(rpcUrl: string, rpcUrls?: string[]);
8864
+ applyPostSuccessCacheInvalidations(invalidations: TransactionCacheInvalidation[]): void;
8865
+ /** Refreshes cached platform data for the specified pools */
8866
+ abstract refreshData(pools: Address[]): Promise<void>;
8867
+ /**
8868
+ * Returns this platform's flash-loan client. Implementations should throw
8869
+ * if the platform doesn't expose a flash-loan facility.
8870
+ */
8871
+ abstract getFlashLoan(): FlashLoanBase<T>;
8872
+ /**
8873
+ * Returns the platform-specific "repay full obligation debt" sentinel for
8874
+ * the repay CPI's amount field, or `null` if the platform has no such
8875
+ * sentinel and callers must compute the exact debt amount themselves.
8876
+ * Used by `rebalance_token` on full-position moves to clear obligation
8877
+ * debt exactly without leaving interest-accrual dust.
8878
+ */
8879
+ abstract getRepayAllSentinel(): BN | null;
8880
+ /**
8881
+ * Returns the first user-account ID that can be used in `pool` for `user`.
8882
+ *
8883
+ * Implementations may reuse an existing inactive account or return the first
8884
+ * never-before-used ID, depending on the platform's account model.
8885
+ *
8886
+ * `excludeUserAccounts`, when provided, lists protocol user-account
8887
+ * addresses that must NOT be returned even if they look reusable on-chain
8888
+ * (e.g. zero deposits + zero borrows). Callers managing multiple
8889
+ * higher-level positions over the same `(pool, user)` pair use this to
8890
+ * ensure each position gets its own distinct user account, even when
8891
+ * sibling positions are temporarily inactive on-chain.
8892
+ */
8893
+ abstract getAvailableUserAccountId(pool: Address, user: Address, excludeUserAccounts?: readonly Address[]): Promise<number>;
8894
+ /**
8895
+ * Returns the protocol user account's currently claimable rewards, excluding
8896
+ * zero balances. Entries may include claim metadata required by the platform
8897
+ * to harvest that specific reward.
8898
+ *
8899
+ * `minUiAmount` filters out dust: rewards whose UI-denominated balance is
8900
+ * below this threshold are omitted, so callers don't pay transaction fees to
8901
+ * harvest economically negligible amounts. Defaults to `0` (no filtering).
8902
+ */
8903
+ abstract getOutstandingIncentives(userAccount: Address, minUiAmount?: number, log?: (msg: string) => void): Promise<OutstandingIncentive[]>;
8904
+ }
8905
+
8906
+ declare class KaminoFlashLoan extends FlashLoanBase<KaminoData> {
8907
+ getFlashBorrowIx(params: FlashBorrowParams): Promise<Instruction>;
8908
+ getAvailableFlashBorrowAmount(pool: Address, reserve: Address): Promise<BN>;
8909
+ getFlashLoanFeeRate(pool: Address, reserve: Address): Promise<number>;
8910
+ getFlashRepayIx(params: FlashRepayParams): Promise<Instruction>;
8911
+ private resolveSharedAccounts;
8912
+ }
8913
+
8914
+ /**
8915
+ * Client for interacting with Kamino Lend protocol.
8916
+ * Provides access to data, accounts, and instruction builders for lending operations.
8917
+ */
8918
+ declare class KaminoClient extends LendingPlatformClientBase<KaminoData> {
8919
+ accounts: KaminoAccounts;
8920
+ ix: KaminoInstructions;
8921
+ constructor(rpcUrl?: string, rpcUrls?: string[]);
8922
+ refreshData(pools: Address[]): Promise<void>;
8923
+ getFlashLoan(): KaminoFlashLoan;
8924
+ /**
8925
+ * Kamino's `RepayObligationLiquidityV2` interprets `u64::MAX` as "repay
8926
+ * the obligation's full debt for this reserve" — letting the on-chain
8927
+ * handler clear interest-accrual dust between the off-chain quote and
8928
+ * settlement. The flash-borrow over-borrows by a slippage buffer to fund
8929
+ * this; the post-repay surplus is swept into the yielding bank.
8930
+ */
8931
+ getRepayAllSentinel(): BN;
8932
+ getAvailableUserAccountId(pool: Address, user: Address, excludeUserAccounts?: readonly Address[]): Promise<number>;
8933
+ /**
8934
+ * Returns claimable rewards across all kamino farms tied to this obligation:
8935
+ *
8936
+ * - **Obligation farms** (klend reserve `farmCollateral`/`farmDebt`):
8937
+ * UserState.owner = obligation owner (the lyc-token PDA),
8938
+ * UserState.delegatee = the obligation itself.
8939
+ * - **Direct/extra farms** (e.g. paired-reserve incentives): the lyc-token
8940
+ * PDA stakes directly in the farms program.
8941
+ * UserState.owner = UserState.delegatee = lyc-token PDA.
8942
+ *
8943
+ * The farms SDK filters UserStates by memcmp against `owner` (offset 48),
8944
+ * so we query by the obligation's owner and then accept any UserState whose
8945
+ * `delegatee` is either the obligation or the owner itself. In both cases
8946
+ * `userFarm.userStateAddress` is the correct UserState account for the
8947
+ * `HarvestReward` CPI; deriving via `obligationFarmStatePda` would be wrong
8948
+ * for direct farms (different seed scheme).
8949
+ */
8950
+ getOutstandingIncentives(userAccount: Address, minUiAmount?: number, log?: (msg: string) => void): Promise<OutstandingIncentive[]>;
8951
+ /**
8952
+ * Reads the klend obligation account and returns its `owner` field (the
8953
+ * authority that opened the obligation — for LYC this is the lyc-token PDA).
8954
+ * Returns null when the account doesn't exist on-chain (stale protocolUserAcc).
8955
+ */
8956
+ private fetchObligationOwner;
8957
+ private isInactiveUserAccount;
8958
+ }
8959
+
8960
+ interface SupportedLendingPlatformClients {
8961
+ kamino: KaminoClient;
8962
+ }
8963
+ /**
8964
+ * Central registry for protocol-specific lending clients used throughout the
8965
+ * long-yield-carry SDK.
8966
+ */
8967
+ declare class LendingPlatformClientRegistry {
8968
+ private readonly kaminoClient;
8969
+ constructor(clients: SupportedLendingPlatformClients);
8970
+ getAll(): LendingPlatformClientBase<LendingPlatformData>[];
8971
+ getPlatformForPosition(position: TokenLendingPositionData): LendingPlatform$1;
8972
+ getForPosition(position: TokenLendingPositionData): LendingPlatformClientBase<LendingPlatformData>;
8973
+ getByPlatform(platform: LendingPlatform$1.Kamino): KaminoClient;
8974
+ getByPlatform(platform: LendingPlatform$1): LendingPlatformClientBase<LendingPlatformData>;
8975
+ }
8976
+
8977
+ interface LongYieldCarryBuilderContext {
8978
+ rpc: Rpc<SolanaRpcApi>;
8979
+ environment: Environment;
8980
+ program: Program<LongYieldCarry>;
8981
+ account: AccountClient;
8982
+ pda: PdaClient;
8983
+ swap: SwapClient;
8984
+ externalLiquidityResolver: LongYieldCarryExternalLiquidityResolver;
8985
+ lendingPlatformClients: LendingPlatformClientRegistry;
8986
+ }
8987
+
8988
+ type AnchorInterestDistribution = {
8989
+ intoTokenPrice: {};
8990
+ } | {
8991
+ intoWallets: {};
8992
+ };
8993
+ declare enum InterestDistribution {
8994
+ IntoTokenPrice = 0,
8995
+ IntoWallets = 1
8996
+ }
8997
+ declare function interestDistributionToEnum(v: AnchorInterestDistribution): InterestDistribution;
8998
+ declare function enumToInterestDistribution(t: InterestDistribution): AnchorInterestDistribution;
8999
+ type AnchorLendingType = {
9000
+ lendingMarket: {};
9001
+ } | {
9002
+ vault: {};
9003
+ };
9004
+ declare enum LendingType {
9005
+ LendingMarket = 0,
9006
+ Vault = 1
9007
+ }
9008
+ declare function lendingTypeToEnum(v: AnchorLendingType): LendingType;
9009
+ declare function enumToLendingType(t: LendingType): AnchorLendingType;
9010
+
9011
+ interface CreateCpiPlanParams {
9012
+ /** Unique ID used in PDA derivation. For rebalance_token this is the Token PDA. */
9013
+ uniqueId: Address;
9014
+ /** Unix timestamp seconds used in PDA derivation. */
9015
+ createdTs: BN;
9016
+ /** Up to 10 instruction refs packed into the zero-copy CPI plan account. */
9017
+ refs: InstructionRefs[];
9018
+ }
9019
+ interface CreateYieldingBankParams {
9020
+ /** Unique ID for this yielding bank (u8), used in PDA derivation */
9021
+ id: number;
9022
+ /** Oracle configuration for pricing the base asset */
9023
+ oracleConfig: OracleConfigDetails;
9024
+ /** The mint used as the default source when redeeming from the bank */
9025
+ defaultRedemptionMint: Address;
9026
+ }
9027
+ interface UpdateYieldingBankConfigParams {
9028
+ /** New default redemption mint (passed as a named account, not a param) */
9029
+ defaultRedemptionMint: Address;
9030
+ }
9031
+ interface UpdateTokenConfigurationParams {
9032
+ /** Omit to leave unchanged. */
9033
+ performanceFeeBps?: number;
9034
+ /** Omit to leave unchanged. */
9035
+ mintingFeeBps?: number;
9036
+ /** Omit to leave unchanged. */
9037
+ burningFeeBps?: number;
9038
+ /** Omit to leave unchanged. */
9039
+ protocolMintBurnPctBps?: number;
9040
+ /** Omit to leave unchanged. */
9041
+ curatorMintBurnPctBps?: number;
9042
+ /** Omit to leave unchanged. */
9043
+ curatorPerfPctBps?: number;
9044
+ /**
9045
+ * Target and hard cap (bps) for annualized price growth during fee release;
9046
+ * `0` parks absorbed fees.
9047
+ * Omit to leave unchanged.
9048
+ */
9049
+ feeDripMaxApyBps?: number;
9050
+ burnRateLimit?: {
9051
+ maxAmount: BN;
9052
+ windowDurationSecs: BN;
9053
+ };
9054
+ /**
9055
+ * When set, updates the deposit cap in raw collateral base units. Omit to leave unchanged.
9056
+ * Pass `new BN(0)` to disable the cap (same semantics as `mint_token`).
9057
+ */
9058
+ depositLimit?: BN;
9059
+ }
9060
+ interface CreateTokenParams {
9061
+ /** Unique ID for this token (u8), used in PDA derivation */
9062
+ id: number;
9063
+ /** How interest is distributed */
9064
+ interestDistribution: AnchorInterestDistribution;
9065
+ /** Oracle configuration for pricing the collateral asset */
9066
+ oracleConfig: OracleConfigDetails;
9067
+ /** Fee configuration */
9068
+ feeConfig: FeeConfig;
9069
+ }
9070
+ /** Configuration for the collateral or debt side of an external position */
9071
+ interface AssetAllocationConfig {
9072
+ mint: Address;
9073
+ decimals: number;
9074
+ tokenProgram: AnchorTokenProgram;
9075
+ }
9076
+ /**
9077
+ * Configuration for adding a new asset holding.
9078
+ *
9079
+ * `mint` resolves the `allocation_mint` account — it is not serialized as an
9080
+ * instruction param. Decimals and token program are read from the mint
9081
+ * account on-chain.
9082
+ */
9083
+ interface AssetConfig {
9084
+ mint: Address;
9085
+ oracle: Address;
9086
+ oracleType: AnchorOracleType;
9087
+ externalLiquidityType: AnchorExternalLiquidityType;
9088
+ }
9089
+ /** Configuration for adding a new external yielding position */
9090
+ interface ExternalPositionConfig {
9091
+ lendingPlatform: AnchorLendingPlatform;
9092
+ lendingType: AnchorLendingType;
9093
+ pool: Address;
9094
+ collateralReserve: Address;
9095
+ debtReserve: Address;
9096
+ protocolUserAcc: Address;
9097
+ collateral: AssetAllocationConfig;
9098
+ debt: AssetAllocationConfig;
9099
+ }
9100
+ /**
9101
+ * Registers one new holding or external position before a rebalance.
9102
+ * At most one of `assetHolding` or `externalPosition` may be set per call.
9103
+ */
9104
+ interface YieldingBankAllocationConfig {
9105
+ assetHolding?: AssetConfig;
9106
+ externalPosition?: ExternalPositionConfig;
9107
+ }
9108
+ interface RebalanceYieldingBankParams {
9109
+ /**
9110
+ * Pre-built instruction refs containing deduplicated CPI account indices,
9111
+ * CPI type registry indices, and packed args.
9112
+ *
9113
+ * Build with `createCpiRefs(cpis, { initialAccounts: oracleAccounts })` so
9114
+ * that oracle and CPI accounts are deduplicated into a single pool and the
9115
+ * indices in `ixRefs` already account for the oracle account positions.
9116
+ */
9117
+ ixRefs: InstructionRefs;
9118
+ /**
9119
+ * The fully deduplicated remaining-accounts pool for this instruction —
9120
+ * oracle accounts at the front followed by any CPI-only accounts.
9121
+ *
9122
+ * This is the `accounts` array returned by `createCpiRefs` when called with
9123
+ * `initialAccounts: oracleAccounts`.
9124
+ */
9125
+ remainingAccounts: CustomAccountMeta[];
9126
+ }
9127
+ /**
9128
+ * Parameters for `createTokenLendingPosition`. Account-backed values (protocol
9129
+ * user account, collateral reserve, debt oracle) are passed as accounts via
9130
+ * `CreateTokenLendingPositionIxArgs.lpPosition`, not duplicated here.
9131
+ */
9132
+ interface CreateTokenLendingPositionParams {
9133
+ lendingPlatform: AnchorLendingPlatform;
9134
+ pool: Address;
9135
+ debtReserve: Address;
9136
+ targetUtilizationRateBps: number;
9137
+ maxDeviationAboveTargetUtilBps: number;
9138
+ maxDeviationBelowTargetUtilBps: number;
9139
+ debtMint: Address;
9140
+ debtDecimals: number;
9141
+ debtTokenProgram: AnchorTokenProgram;
9142
+ debtOracleType: AnchorOracleType;
9143
+ /**
9144
+ * Optional setup CPIs (e.g. Kamino init_user_metadata, init_obligation,
9145
+ * refresh_reserve, refresh_obligation) signed by the Token PDA and executed
9146
+ * before the final refresh. When provided, the on-chain refresh reads the
9147
+ * freshly-initialized protocol user account; otherwise the refresh is a
9148
+ * no-op over an empty account.
9149
+ */
9150
+ tokenCpis?: InstructionRefs;
9151
+ /** Fully deduplicated remaining-accounts pool for `tokenCpis`. */
9152
+ remainingAccounts?: CustomAccountMeta[];
9153
+ }
9154
+ /**
9155
+ * Accounts that describe and back a new lending position. Their pubkeys are
9156
+ * stored on the position; their on-chain state is read by the final refresh.
9157
+ */
9158
+ interface CreateTokenLendingPositionAccounts {
9159
+ /** The program's user/authority account on the lending protocol. */
9160
+ protocolUserAcc: Address;
9161
+ /** The lending protocol's reserve/bank for the collateral asset. */
9162
+ collateralReserve: Address;
9163
+ /** Oracle for the debt asset's price. */
9164
+ debtOracle: Address;
9165
+ }
9166
+ interface UpdateLendingPositionConfigParams {
9167
+ lendingPositionIndex: number;
9168
+ targetUtilizationRateBps: number;
9169
+ maxDeviationAboveTargetUtilBps: number;
9170
+ maxDeviationBelowTargetUtilBps: number;
9171
+ }
9172
+ interface DepositUnlentCollateralParams {
9173
+ /** Pre-built deposit CPI refs (must contain exactly one Deposit CPI). */
9174
+ ixRefs: InstructionRefs;
9175
+ /** Index into the token's lending_positions array for the target position. */
9176
+ lendingPositionIndex: number;
9177
+ /** Fully deduplicated remaining-accounts pool for the deposit CPI. */
9178
+ remainingAccounts: CustomAccountMeta[];
9179
+ }
9180
+ interface IncreaseCarryPositionParams {
9181
+ /** Optional prerequisite CPIs executed before any lending-position refresh. */
9182
+ prerequisiteCpis?: InstructionRefs;
9183
+ /** Pre-built borrow CPI refs (must contain exactly one Borrow CPI). */
9184
+ ixRefs: InstructionRefs;
9185
+ /** Index into the token's lending_positions array for the position to borrow against. */
9186
+ lendingPositionIndex: number;
9187
+ /**
9188
+ * The fully deduplicated remaining-accounts pool for the borrow CPI.
9189
+ * Carry-trade accounts (token, yieldingBank, tokenLpDebtTa, yieldingBankTa,
9190
+ * lendingPositionUserAccount, lendingPositionCollateralReserve, debtOracle,
9191
+ * debtTokenProgram) are prepended automatically.
9192
+ */
9193
+ remainingAccounts: CustomAccountMeta[];
9194
+ }
9195
+ interface ClaimIncentivesParams {
9196
+ /** Optional prerequisite CPIs (reserve / obligation refresh) executed before the claim CPI. */
9197
+ prerequisiteCpis?: InstructionRefs;
9198
+ /** Pre-built Kamino claim-incentive CPI refs. */
9199
+ tokenIxRefs: InstructionRefs;
9200
+ /** Index into the token's lending_positions array. */
9201
+ lendingPositionIndex: number;
9202
+ /** Incentive reward mint expected to be claimed. */
9203
+ expectedIncentiveMint: Address;
9204
+ /** Token program for the incentive mint. */
9205
+ incentiveTokenProgram: Address;
9206
+ /** Oracle type for `incentiveOracle`. Required on debt and collateral branches. */
9207
+ incentiveOracleType: AnchorOracleType;
9208
+ /**
9209
+ * Yielding bank that receives the claimed rewards and mints carry shares.
9210
+ * Required on the debt branch; null otherwise.
9211
+ */
9212
+ yieldingBank: Address | null;
9213
+ /**
9214
+ * Oracle pricing `expectedIncentiveMint`. Required on the debt and
9215
+ * collateral branches; null on the fee branch.
9216
+ */
9217
+ incentiveOracle: Address | null;
9218
+ /**
9219
+ * Optional curator fee wallet override. When null/omitted, builders resolve
9220
+ * `token.roles.curator_fee_wallet()` and still pass the fee wallet accounts.
9221
+ */
9222
+ feeWallet?: Address | null;
9223
+ /** Fully deduplicated remaining-accounts pool for the claim CPI. */
9224
+ remainingAccounts: CustomAccountMeta[];
9225
+ }
9226
+ interface TokenLpPositionAccountOverrides {
9227
+ /** Override for the lending position protocol user account. */
9228
+ userAccount?: Address;
9229
+ /** Override for the lending position collateral reserve. */
9230
+ collateralReserve?: Address;
9231
+ /** Override for the lending position debt oracle. */
9232
+ debtOracle?: Address;
9233
+ }
9234
+ interface RebalanceTokenParams {
9235
+ /** Index into the token's lending_positions array for the position to rebalance in place. */
9236
+ lpIndex: number;
9237
+ /** Oracle type for the destination debt mint. Used to update the stored oracle_type after swapping debt in place. */
9238
+ destinationDebtOracleType: AnchorOracleType;
9239
+ /**
9240
+ * Flash-loan fee in source-debt base units. The on-chain handler derives
9241
+ * the total flash-repay amount from this plus the source-debt ATA balance
9242
+ * observed at handler entry (= what Kamino actually flash-borrowed),
9243
+ * caps it at 5 bps of the principal as a sanity check, and uses it as
9244
+ * the post-swap balance threshold + dust-sweep cutoff + SPL Approve
9245
+ * delegation amount.
9246
+ */
9247
+ flashFeeAmount: BN;
9248
+ /**
9249
+ * Source LP repay amount in the flash-borrowed mint's base units. The on-chain
9250
+ * handler injects this into the repay CPI loaded from the CPI plan.
9251
+ */
9252
+ repayAmount: BN;
9253
+ /** CPI plan PDA holding refs in order: repay, borrow, swap. */
9254
+ cpiPlan: Address;
9255
+ /**
9256
+ * Fully deduplicated remaining-accounts pool. The first 7 slots must hold
9257
+ * the rebalance-token initial accounts (see `buildRebalanceTokenInitialAccounts`),
9258
+ * followed by any CPI accounts referenced by the CPI plan's refs.
9259
+ */
9260
+ remainingAccounts: CustomAccountMeta[];
9261
+ }
9262
+ interface DecreaseCarryPositionParams {
9263
+ /** Optional prerequisite CPIs executed before any lending-position refresh. */
9264
+ prerequisiteCpis?: InstructionRefs;
9265
+ /**
9266
+ * Optional manager-only target utilization override used for the post-repay
9267
+ * utilization check.
9268
+ */
9269
+ targetUtilizationRateBps?: number;
9270
+ /**
9271
+ * Optional CPI refs for yielding-bank operations (withdraw from external
9272
+ * positions, swap yield-bearing asset into debt token). Omit this when the
9273
+ * yielding bank already holds the debt tokens.
9274
+ */
9275
+ ybIxRefs?: InstructionRefs;
9276
+ /** Pre-built repay CPI refs (must contain exactly one Repay CPI). */
9277
+ tokenIxRefs: InstructionRefs;
9278
+ /** Index into the token's lending_positions array for the position to repay. */
9279
+ lendingPositionIndex: number;
9280
+ /**
9281
+ * Amount of debt tokens to repay. When omitted, `ybIxRefs` must be provided
9282
+ * and the amount is derived from the yielding bank TA balance change.
9283
+ * `AMOUNT_ALL_SENTINEL` repays the maximum available amount, capped by
9284
+ * current debt. When set with `ybIxRefs`, the on-chain instruction only swaps
9285
+ * if the yielding bank is short and caps non-manager swap over-output.
9286
+ */
9287
+ repayAmount?: BN;
9288
+ /**
9289
+ * Index of the asset holding used as the swap source (0 = base_asset,
9290
+ * 1–12 = assets[0–11]). Required when `ybIxRefs` is provided.
9291
+ * Non-manager signers may only specify a holding whose mint matches the
9292
+ * bank's `default_redemption_mint`.
9293
+ */
9294
+ sourceAssetHoldingIndex?: number;
9295
+ /** Optional redemption epoch that absorbs DCP unwind loss for async burns. */
9296
+ redemptionEpoch?: Address;
9297
+ /**
9298
+ * The fully deduplicated remaining-accounts pool for the CPIs.
9299
+ * Carry-trade accounts (token, yieldingBank, tokenLpDebtTa, yieldingBankTa,
9300
+ * lendingPositionUserAccount, lendingPositionCollateralReserve, debtOracle,
9301
+ * debtTokenProgram) are prepended automatically.
9302
+ */
9303
+ remainingAccounts: CustomAccountMeta[];
9304
+ }
9305
+ /**
9306
+ * Low-level params for `ix.burnToken`. Pre-built refs and accounts must be
9307
+ * assembled by the caller (typically `tx.getBurnTokenTx`).
9308
+ */
9309
+ interface BurnTokenIxParams {
9310
+ burnAmount: BN | number;
9311
+ asyncFallback?: {
9312
+ epochId: BN | number;
9313
+ requestSequence: BN | number;
9314
+ redemptionEpoch?: Address;
9315
+ request?: Address;
9316
+ };
9317
+ }
9318
+ interface SetRedemptionEpochStatusParams {
9319
+ status: number;
9320
+ }
9321
+ interface TopUpUnlentReservesParams {
9322
+ prerequisiteCpis: InstructionRefs;
9323
+ ixRefs: InstructionRefs;
9324
+ lendingPositionIndex: number;
9325
+ remainingAccounts: CustomAccountMeta[];
9326
+ redemptionEpoch?: Address;
9327
+ }
9328
+ interface UpdateTokenMetadataParams {
9329
+ /** Pre-built Metaplex UpdateMetadataAccountV2 CPI refs (exactly one CPI). */
9330
+ ixRefs: InstructionRefs;
9331
+ /** Fully deduplicated remaining-accounts pool for the metadata CPI. */
9332
+ remainingAccounts: CustomAccountMeta[];
9333
+ }
9334
+ interface RecollateralizeLossParams {
9335
+ /** Optional prerequisite CPIs executed before any lending-position refresh. */
9336
+ prerequisiteCpis?: InstructionRefs;
9337
+ /**
9338
+ * CPI refs for the Withdraw -> Swap -> Repay sequence (exactly 1 of each,
9339
+ * in that order). All three CPIs share one deduplicated account pool.
9340
+ */
9341
+ ixRefs: InstructionRefs;
9342
+ /** Index into the token's lending_positions array. */
9343
+ lendingPositionIndex: number;
9344
+ /** Fully deduplicated remaining-accounts pool for the withdraw/swap/repay CPIs. */
9345
+ remainingAccounts: CustomAccountMeta[];
9346
+ /** Yielding bank to deposit any excess debt tokens after repay. Required for execution; may be omitted when testing pre-condition failures. */
9347
+ yieldingBank?: Address;
9348
+ /** Optional explicit overrides for LP refresh accounts. */
9349
+ lpPosition?: TokenLpPositionAccountOverrides;
9350
+ }
9351
+ interface CollectInterestParams {
9352
+ /** Default redemption asset being sold in the swap. */
9353
+ redemption: PricedMint;
9354
+ /** Pre-built swap CPI refs (yielding bank assets -> collateral). */
9355
+ refs: InstructionRefs;
9356
+ /** Fully deduplicated remaining-accounts pool for the swap CPIs. */
9357
+ remainingAccounts: CustomAccountMeta[];
9358
+ }
9359
+
9360
+ /**
9361
+ * Shared fields carried by normalized execution plans.
9362
+ *
9363
+ * These values are produced before the transaction layer resolves remaining
9364
+ * account refs and ATA creation instructions.
9365
+ */
9366
+ interface PlannedInstructionBase {
9367
+ /** Pre-instructions that must run before ATA creation or the main instruction. */
9368
+ preInstructions: Instruction[];
9369
+ /** Accounts that must lead the remaining-accounts pool before CPI accounts are appended. */
9370
+ initialAccounts: CustomAccountMeta[];
9371
+ }
9372
+ /**
9373
+ * Execution-plan shape for instructions that use a single CPI ref group.
9374
+ */
9375
+ interface SingleCpiExecutionPlan extends PlannedInstructionBase {
9376
+ /** Ordered CPI descriptors consumed by one instruction-level refs input. */
9377
+ cpiData: CpiData[];
9378
+ }
9379
+ /**
9380
+ * Execution-plan shape for instructions that use multiple CPI ref groups.
9381
+ */
9382
+ interface GroupedCpiExecutionPlan extends PlannedInstructionBase {
9383
+ /** Ordered CPI groups where each group maps to a distinct refs input. */
9384
+ cpiDataGroups: CpiData[][];
9385
+ }
9386
+
9387
+ /**
9388
+ * Mutually exclusive ways to steer repay sizing. Omit to use default obligation-relative
9389
+ * sizing (`LycLendingPositionManager.calcDebtChangeAmount` with no utilization target).
9390
+ *
9391
+ * `DecreaseCarryPositionPlan.targetUtilizationRateBps` is set when the on-chain instruction
9392
+ * must validate post-repay utilization against an explicit bps value (manager signer):
9393
+ * - `explicitTargetUtilization` — caller supplies bps for both sizing and the instruction.
9394
+ * - `collateralWithdrawal` with `allowBelowTargetOnChain` — sizing uses
9395
+ * `calcPreWithdrawalTargetUtilizationRateBps`; set the flag when this DCP must pass derived
9396
+ * utilization bps on-chain because post-repay utilization will sit **below** the position's
9397
+ * configured `targetUtilizationRateBps` (e.g. pre-rebalance unwind).
9398
+ */
9399
+ type DecreaseCarryRepaySteering = {
9400
+ mode: "collateralWithdrawal";
9401
+ /** Collateral (UI units) removed after this repay. */
9402
+ collateralWithdrawalUiAmount: number;
9403
+ /**
9404
+ * Desired utilization after the later collateral withdrawal. Defaults to the
9405
+ * position's configured target.
9406
+ */
9407
+ postWithdrawalTargetUtilizationRateBps?: number;
9408
+ /**
9409
+ * When true, allow passing derived utilization bps on-chain (same bps as sizing) so a
9410
+ * manager `decrease_carry_position` can validate when post-repay utilization sits **below**
9411
+ * the position's configured `targetUtilizationRateBps` (e.g. pre-rebalance unwind).
9412
+ */
9413
+ allowBelowTargetOnChain?: boolean;
9414
+ } | {
9415
+ mode: "explicitTargetUtilization";
9416
+ /**
9417
+ * Caller supplies utilization (bps) for repay sizing and on-chain post-repay check (manager signer).
9418
+ * Often equals or is derived from the position's configured target; this mode passes bps through
9419
+ * explicitly, unlike `collateralWithdrawal`, which derives a target from UI collateral out.
9420
+ */
9421
+ targetUtilizationRateBps: number;
9422
+ };
9423
+ /**
9424
+ * Deterministic inputs for deriving a `decrease_carry_position` plan.
9425
+ *
9426
+ * Pass this to `client.planner.buildDecreaseCarryPositionPlan()` when you want
9427
+ * the SDK to compute repay math, swap requirements, and grouped CPI inputs.
9428
+ */
9429
+ interface DecreaseCarryPositionBuilderParams {
9430
+ /** Index into the token's `lendingPositions` array for the position to repay. */
9431
+ lendingPositionIndex: number;
9432
+ /** Yielding bank PDA holding the funds that will be redeemed or swapped for repayment. */
9433
+ yieldingBank: Address;
9434
+ /** Lending-platform instruction client used to build the repay CPI sequence. */
9435
+ lendingIx: LpInstructionsBase<LendingPlatformData>;
9436
+ /** Deployment environment used for off-chain price fetches during repay sizing. */
9437
+ environment?: Environment;
9438
+ /** Slippage tolerance for any required DCP swap, in basis points. Defaults to `40`. */
9439
+ swapSlippageBps?: number;
9440
+ /** DEX labels to exclude from any required DCP swap (e.g. venues that failed a prior attempt). */
9441
+ swapExcludeDexes?: string[];
9442
+ /**
9443
+ * Optional override for the asset redeemed from the yielding bank.
9444
+ *
9445
+ * Defaults to the bank's `defaultRedemptionMint`. On-chain permission checks
9446
+ * may reject non-manager callers that override this away from the configured
9447
+ * default redemption mint.
9448
+ */
9449
+ sourceMint?: Address;
9450
+ /**
9451
+ * Optional transaction identifier shared with the lending client.
9452
+ *
9453
+ * Reuse a parent transaction ID when composing this flow into a larger
9454
+ * transaction so lending pre-instructions are not duplicated.
9455
+ */
9456
+ txId?: string;
9457
+ /**
9458
+ * Steers how the planner picks the obligation / repay size. At most one variant;
9459
+ * omit for default sizing.
9460
+ */
9461
+ repaySteering?: DecreaseCarryRepaySteering;
9462
+ /**
9463
+ * When true (e.g. burn-token liquidity management), non-manager callers may execute
9464
+ * the resulting plan subject to the instruction's post-repay validation.
9465
+ */
9466
+ permissionlessOperation?: boolean;
9467
+ }
9468
+ /**
9469
+ * Precomputed plan wrapper accepted by `client.tx.decreaseCarryPosition.getTx({...})`.
9470
+ */
9471
+ interface DecreaseCarryPositionTxPlanParams {
9472
+ /** Planner result previously returned by `client.planner.buildDecreaseCarryPositionPlan()`. */
9473
+ plan: DecreaseCarryPositionPlan;
9474
+ }
9475
+ /**
9476
+ * Deterministic execution plan for `decrease_carry_position`.
9477
+ *
9478
+ * Produced by `client.planner.buildDecreaseCarryPositionPlan()` and later
9479
+ * consumed by `client.tx.decreaseCarryPosition.getTx({...})`. This keeps repay math,
9480
+ * swap decisions, and grouped CPI assembly out of the transaction composer.
9481
+ */
9482
+ interface DecreaseCarryPositionPlan extends GroupedCpiExecutionPlan {
9483
+ /** Optional prerequisite CPIs executed before any lending-position refresh. */
9484
+ tokenPrerequisiteCpis?: CpiData[];
9485
+ /**
9486
+ * When set, passed through to `decrease_carry_position` for manager-only
9487
+ * post-repay validation. Populated from explicit steering or from
9488
+ * `collateralWithdrawal` + `allowBelowTargetOnChain` (derived bps = sizing target).
9489
+ */
9490
+ targetUtilizationRateBps?: number;
9491
+ /** Index into the token account's `lendingPositions` array. */
9492
+ lendingPositionIndex: number;
9493
+ /** Raw debt repayment amount in base units. */
9494
+ repayAmount: BN$1;
9495
+ /**
9496
+ * Yielding-bank holding index redeemed as the swap source.
9497
+ *
9498
+ * Omitted when no preliminary swap is needed because the debt asset is
9499
+ * already held directly by the yielding bank.
9500
+ */
9501
+ sourceAssetHoldingIndex?: number;
9502
+ /** Yielding bank refreshed immediately before the instruction executes. */
9503
+ yieldingBank: Address;
9504
+ /**
9505
+ * When set, `decrease_carry_position` / burn unwind must encode `repay_amount` as null.
9506
+ * This is only needed for flows where the exact repay amount must be derived on-chain.
9507
+ */
9508
+ omitOnChainRepayAmount?: boolean;
9509
+ }
9510
+
9511
+ /**
9512
+ * Fully composed transaction output ready to pass to `sendTransaction`.
9513
+ */
9514
+ interface LongYieldCarryTransactionPlan extends TransactionPlan {
9515
+ /**
9516
+ * Cache entries that should be cleared only after the transaction confirms.
9517
+ *
9518
+ * This keeps transaction builders pure while still letting callers invalidate
9519
+ * stale off-chain snapshots when a successful on-chain write changes account
9520
+ * topology (for example first-time lending account setup).
9521
+ */
9522
+ postSuccessCacheInvalidations?: TransactionCacheInvalidation[];
9523
+ /** Optional lending-client transaction id reused across composed plans. */
9524
+ txId?: string;
9525
+ /** Optional diagnostics for operator-facing scripts and services. */
9526
+ debug?: LongYieldCarryTransactionPlanDebug;
9527
+ }
9528
+ interface LongYieldCarryTransactionPlanDebug {
9529
+ processAsyncBurn?: {
9530
+ epochId: bigint;
9531
+ sequence: bigint;
9532
+ request: Address;
9533
+ user: Address;
9534
+ /** How collateral is delivered when the request is processed. */
9535
+ collateralDelivery: "nativeSol" | "tokenAta";
9536
+ /** Populated for non-native collateral mints. */
9537
+ userCollateralAccount?: Address;
9538
+ /** Populated for wrapped SOL collateral (request-scoped WSOL escrow). */
9539
+ requestCollateralAccount?: Address;
9540
+ };
9541
+ }
9542
+ interface MintTokenTxParams {
9543
+ /**
9544
+ * Collateral amount to deposit in base units (e.g. lamports).
9545
+ *
9546
+ * Pass `"all"` to deposit the entire collateral ATA balance. The on-chain
9547
+ * instruction resolves `u64::MAX` to the ATA's live balance at execution time.
9548
+ */
9549
+ depositAmount: BN | "all";
9550
+ }
9551
+ interface BurnTokenTxParams {
9552
+ /**
9553
+ * yToken amount to burn in base units (e.g. lamports for a 9-decimal token).
9554
+ *
9555
+ * Pass `"all"` to burn every yToken in the user's ATA. The on-chain
9556
+ * instruction resolves `u64::MAX` to the ATA's live balance at execution time.
9557
+ */
9558
+ burnAmount: BN | number | "all";
9559
+ /**
9560
+ * Override the auto-derived redemption epoch ID. Defaults to
9561
+ * {@link currentEpochId} (floored to the nearest minute).
9562
+ */
9563
+ epochId?: BN | number;
9564
+ /**
9565
+ * Override the auto-derived request sequence within the epoch. Defaults to
9566
+ * the next available sequence read from on-chain epoch state (or 0 for a
9567
+ * fresh epoch).
9568
+ */
9569
+ requestSequence?: BN | number;
9570
+ }
9571
+ interface RebalanceSwapSpec {
9572
+ /**
9573
+ * Swap client used to quote and build CPI data for this rebalance leg.
9574
+ * When omitted, `getRebalanceYieldingBankTx` uses the transaction client's
9575
+ * default aggregate swap client (Perena for USD* ↔ supported stables, Jupiter otherwise).
9576
+ */
9577
+ swapClient?: SwapClient;
9578
+ /** Mint being sold. */
9579
+ inputMint: Address;
9580
+ /** Mint being bought. */
9581
+ outputMint: Address;
9582
+ /** Exact input or requested quote amount, depending on the swap client. */
9583
+ amount: number;
9584
+ /** Slippage tolerance in basis points. Defaults to the caller's chosen swap behavior. */
9585
+ slippageBps?: number;
9586
+ }
9587
+ /**
9588
+ * Extra account that backs an asset holding's off-ATA liquidity during refresh.
9589
+ *
9590
+ * Example: a Perena withdrawal queue that temporarily escrows USD*-J shares after
9591
+ * `request_unstake_junior`, while the YieldingBank still economically owns them.
9592
+ */
9593
+ interface YieldingBankExternalLiquiditySource {
9594
+ /** Asset mint whose refresh should include this external source. */
9595
+ mint: Address;
9596
+ /** Account holding the pending balance for that mint. */
9597
+ account: Address;
9598
+ }
9599
+ /**
9600
+ * Inputs for `client.tx.rebalanceYieldingBank.getTx({...})`.
9601
+ *
9602
+ * The transaction must be signed by the program's manager; ATA setup in the plan uses the
9603
+ * client's environment manager address.
9604
+ */
9605
+ interface RebalanceYieldingBankTxParams {
9606
+ /** Pre-built CPI descriptors (one per swap / deposit step). */
9607
+ cpiData?: CpiData[];
9608
+ /**
9609
+ * High-level swap specifications. Each is resolved into CPI data by calling
9610
+ * `getQuote` + `getSwapCpiData` on the leg's `swapClient`, or the SDK aggregate
9611
+ * swap client when `swapClient` is omitted. Resolved CPI data is appended after
9612
+ * any explicit `cpiData` entries.
9613
+ */
9614
+ swaps?: RebalanceSwapSpec[];
9615
+ /**
9616
+ * Optional new holding or external position to register before the
9617
+ * rebalance executes.
9618
+ */
9619
+ newAllocation?: {
9620
+ config: YieldingBankAllocationConfig;
9621
+ };
9622
+ }
9623
+ interface RefreshTokensTxParams {
9624
+ /** Token PDA addresses to refresh. */
9625
+ tokens: Address[];
9626
+ /**
9627
+ * When true, always prepend `refresh_yielding_bank` for each bank referenced
9628
+ * by the token's active carry positions, even if the bank appears fresh
9629
+ * client-side.
9630
+ *
9631
+ * When false (default), the builder skips yielding-bank refreshes whose
9632
+ * cached `lastRefreshedTs` is still inside the normal freshness window.
9633
+ */
9634
+ alwaysRefreshYieldingBanks?: boolean;
9635
+ }
9636
+ interface TopUpUnlentReservesTxParams {
9637
+ /** Index into the token's lending_positions array for the source position. */
9638
+ lendingPositionIndex: number;
9639
+ /**
9640
+ * Withdrawal amount in UI units (e.g. 1.5 for 1.5 SOL).
9641
+ * Pass `"all"` to withdraw the entire lending position's collateral.
9642
+ */
9643
+ uiAmount: number | "all";
9644
+ /** Optional redemption epoch PDA to credit with the withdrawn amount. */
9645
+ redemptionEpoch?: Address;
9646
+ /** Optional txId reused across composed plans in the same transaction. */
9647
+ txId?: string;
9648
+ }
9649
+ interface ProcessAsyncBurnTxParams {
9650
+ /** Epoch ID (the minute-bucketed timestamp used when the epoch was created). */
9651
+ epochId: bigint | number;
9652
+ /** FIFO sequence number of the request to process within the epoch. */
9653
+ sequence: bigint | number;
9654
+ }
9655
+ interface DepositUnlentCollateralTxParams {
9656
+ /** Index into the token's lending_positions array for the target position. */
9657
+ lendingPositionIndex: number;
9658
+ /**
9659
+ * Deposit amount in UI units (e.g. 1.5 for 1.5 SOL).
9660
+ * Required unless `depositAll` is true.
9661
+ */
9662
+ uiAmount?: number;
9663
+ /**
9664
+ * When true, deposits all remaining unlent collateral. The token account
9665
+ * is fetched to determine the exact amount, so `uiAmount` can be omitted.
9666
+ */
9667
+ depositAll?: boolean;
9668
+ /** Optional txId reused across composed plans in the same transaction. */
9669
+ txId?: string;
9670
+ }
9671
+ interface IncreaseCarryPositionTxParams {
9672
+ /** Index into the token's lending_positions array for the position to borrow against. */
9673
+ lendingPositionIndex: number;
9674
+ /** The YieldingBank PDA receiving the borrow proceeds. */
9675
+ yieldingBank: Address;
9676
+ /** Borrow amount in UI units (e.g. 100 for 100 USDC). */
9677
+ uiAmount: number;
9678
+ /** Optional txId reused across composed plans in the same transaction. */
9679
+ txId?: string;
9680
+ }
9681
+ /**
9682
+ * Inputs for `client.tx.rebalanceToken.getTx({...})`.
9683
+ *
9684
+ * When the source lending position would exceed target utilization after the
9685
+ * collateral withdrawal, the builder automatically constructs the flash-loan-
9686
+ * wrapped variant: flash-borrow source debt mint → repay source → withdraw
9687
+ * collateral → deposit to destination → borrow destination debt mint →
9688
+ * exact-out swap back to source debt mint → flash-repay.
9689
+ */
9690
+ interface RebalanceTokenTxParams {
9691
+ /** Index into the token's lending_positions array for the position to rebalance in-place. */
9692
+ lpIndex: number;
9693
+ /**
9694
+ * Target debt mint. The position's current debt is fully repaid via flash loan and this mint
9695
+ * is borrowed instead on the same lending position. The builder resolves the corresponding
9696
+ * reserve via `fetchReserveByMint` and the oracle via the oracle registry.
9697
+ */
9698
+ destinationDebtMint: Address;
9699
+ /**
9700
+ * Collateral amount used for destination borrow capacity sizing, in UI units. Pass `"all"` to
9701
+ * size based on the full current source debt (uses the platform's repay-all sentinel so
9702
+ * on-chain interest accrual between snapshot and landing cannot leave dust).
9703
+ */
9704
+ uiAmount: number | "all";
9705
+ /** Slippage tolerance for the exact-out flash swap, in basis points. Defaults to 100. */
9706
+ swapSlippageBps?: number;
9707
+ /**
9708
+ * Maximum acceptable execution cost (route fees + price impact) of the
9709
+ * rebalance swap quote vs the oracle-fair cross rate, in bps (see
9710
+ * `FlashRebalanceParams.maxSwapCostBps`). When breached, `getTx` throws
9711
+ * `FlashRebalanceSwapCostExceededError` instead of returning a plan.
9712
+ * Unset = no limit.
9713
+ */
9714
+ maxSwapCostBps?: number;
9715
+ /**
9716
+ * Maximum acceptable market basis between the two debt stables (oracle-fair
9717
+ * cross rate vs 1:1), in bps, either direction (see
9718
+ * `FlashRebalanceParams.maxMarketBasisBps`). Unset = no limit.
9719
+ */
9720
+ maxMarketBasisBps?: number;
9721
+ /** Optional explicit overrides for the LP refresh accounts (user account, collateral reserve, debt oracle). */
9722
+ lpPosition?: TokenLpPositionAccountOverrides;
9723
+ /**
9724
+ * Optional transaction identifier shared with lending clients so composed
9725
+ * flows can hoist top-level pre-instructions.
9726
+ */
9727
+ txId?: string;
9728
+ /**
9729
+ * Yielding bank that absorbs the destination-debt slippage dust after the
9730
+ * exact-out swap. Defaults to the first active yielding bank recorded in the
9731
+ * token's `debtCarry` entries.
9732
+ */
9733
+ yieldingBank?: Address;
9734
+ }
9735
+ interface DecreaseCarryPositionTxBuilderParams {
9736
+ /** Index into the token's `lendingPositions` array for the position to repay. */
9737
+ lendingPositionIndex: number;
9738
+ /** Yielding bank PDA holding the funds that will be redeemed or swapped for repayment. */
9739
+ yieldingBank: Address;
9740
+ /** Slippage tolerance for any required DCP swap, in basis points. Defaults to `40`. */
9741
+ swapSlippageBps?: number;
9742
+ /** DEX labels to exclude from any required DCP swap (e.g. venues that failed a prior attempt). */
9743
+ swapExcludeDexes?: string[];
9744
+ /**
9745
+ * Optional override for the asset redeemed from the yielding bank.
9746
+ *
9747
+ * Defaults to the bank's `defaultRedemptionMint`. On-chain permission checks
9748
+ * may reject non-manager callers that override this away from the configured
9749
+ * default redemption mint.
9750
+ */
9751
+ sourceMint?: Address;
9752
+ /**
9753
+ * Optional transaction identifier shared with the lending client.
9754
+ *
9755
+ * Reuse a parent transaction ID when composing this flow into a larger
9756
+ * transaction so lending pre-instructions are not duplicated.
9757
+ */
9758
+ txId?: string;
9759
+ /** See {@link DecreaseCarryRepaySteering}. */
9760
+ repaySteering?: DecreaseCarryRepaySteering;
9761
+ /**
9762
+ * Same as {@link DecreaseCarryPositionBuilderParams.permissionlessOperation}: when true,
9763
+ * non-manager callers may execute the resulting plan subject to post-repay validation.
9764
+ */
9765
+ permissionlessOperation?: boolean;
9766
+ }
9767
+ /**
9768
+ * Inputs accepted by `client.tx.decreaseCarryPosition.getTx({...})`.
9769
+ *
9770
+ * Pass raw builder params to have the SDK plan the instruction for you, or
9771
+ * pass `{ plan }` when you have pre-built a plan via `buildDecreaseCarryPositionPlan`.
9772
+ */
9773
+ type DecreaseCarryPositionTxParams = DecreaseCarryPositionTxBuilderParams | DecreaseCarryPositionTxPlanParams;
9774
+ /**
9775
+ * Inputs for `client.tx.recollateralizeLoss.getTx({...})`.
9776
+ *
9777
+ * The transaction builder internally:
9778
+ * 1. Computes the debt excess (total_debt − total_carry) from on-chain state.
9779
+ * 2. Quotes a collateral → debt swap to cover that excess.
9780
+ * 3. Checks whether withdrawing the required collateral would push the LP
9781
+ * above its target utilization rate. If so, prepends a
9782
+ * `decrease_carry_position` sized to free the needed headroom.
9783
+ * 4. Builds the Withdraw → Swap → Repay CPI sequence for the main instruction.
9784
+ */
9785
+ interface RecollateralizeLossTxParams {
9786
+ /** Slippage tolerance for swaps (collateral → debt), in basis points. Defaults to 150. */
9787
+ swapSlippageBps?: number;
9788
+ /**
9789
+ * Optional override for the asset redeemed from the yielding bank during DCP.
9790
+ * Defaults to the bank's `defaultRedemptionMint`. Only used when a
9791
+ * `decrease_carry_position` is needed to free collateral for the withdrawal.
9792
+ */
9793
+ sourceMint?: Address;
9794
+ /** Optional txId shared with lending clients for pre-instruction deduplication. */
9795
+ txId?: string;
9796
+ /** Optional explicit overrides for LP refresh accounts. */
9797
+ lpPosition?: TokenLpPositionAccountOverrides;
9798
+ }
9799
+ /**
9800
+ * Inputs accepted by `client.tx.collectInterest.getTx({...})`.
9801
+ */
9802
+ interface CollectInterestTxParams {
9803
+ /** Yielding bank whose carry position should collect accrued interest. */
9804
+ yieldingBank: Address;
9805
+ /** Slippage tolerance applied to all swaps. Defaults to 100 bps. */
9806
+ slippageBps?: number;
9807
+ /** Final output mint. Defaults to the token's collateral mint. */
9808
+ outputMint?: Address;
9809
+ /**
9810
+ * Minimum net yield (in USD) below which collection is skipped.
9811
+ * Prevents wasteful swaps when accrued interest is negligible.
9812
+ * Value is in human-readable USD (e.g. 0.5 = $0.50).
9813
+ */
9814
+ minYieldUsd?: number;
9815
+ }
9816
+ interface ClaimIncentivesTxParams {
9817
+ /** Index into the token's lending_positions array. */
9818
+ lendingPositionIndex: number;
9819
+ /** Incentive reward mint to harvest. */
9820
+ incentiveMint: Address;
9821
+ /**
9822
+ * Pre-resolved farm and user-farm addresses for the claim CPI. When provided
9823
+ * the builder skips the on-chain incentive lookup — required when the same
9824
+ * incentive mint appears from multiple farms (obligation vs. direct).
9825
+ */
9826
+ claimAccounts?: {
9827
+ farm: Address;
9828
+ userFarm: Address;
9829
+ };
9830
+ /**
9831
+ * Yielding bank that receives the claimed rewards. Defaults to the first
9832
+ * active yielding bank recorded in the token's `debtCarry` entries.
9833
+ */
9834
+ yieldingBank?: Address;
9835
+ /**
9836
+ * Oracle pricing `incentiveMint`. Auto-resolved when the mint matches the
9837
+ * debt of an active lending position or is in the shared mints registry;
9838
+ * required otherwise.
9839
+ */
9840
+ incentiveOracle?: Address;
9841
+ /** Oracle type for `incentiveOracle`. Auto-resolved when `incentiveOracle` is. */
9842
+ incentiveOracleType?: AnchorOracleType;
9843
+ }
9844
+
9845
+ /**
9846
+ * Account fetchers for the long_yield_carry program.
9847
+ *
9848
+ * Extends {@link BaseAccountClient} for shared DataCache + `splAtaExists`, then adds LYC-specific
9849
+ * deserialization and helpers (Token, YieldingBank, carry-trade metas).
9850
+ */
9851
+ declare class AccountClient extends BaseAccountClient {
9852
+ private readonly program;
9853
+ readonly pda: PdaClient;
9854
+ constructor(program: Program<LongYieldCarry>, pda: PdaClient, rpc: Rpc<SolanaRpcApi>);
9855
+ /** Fetch and deserialize a Token account by its PDA address. */
9856
+ fetchToken(token: Address, opts?: {
9857
+ fresh?: boolean;
9858
+ }): Promise<LYCToken>;
9859
+ /** Fetch and deserialize multiple Token accounts by their PDA addresses. */
9860
+ fetchTokens(tokens: Address[]): Promise<LYCToken[]>;
9861
+ /**
9862
+ * Fetch all Token accounts owned by the program.
9863
+ *
9864
+ * Pass `{ fresh: true }` to clear the cached `"all"` entry before reading,
9865
+ * forcing a fresh `getProgramAccounts` call. The returned data is
9866
+ * re-cached so subsequent callers benefit from the same refresh.
9867
+ */
9868
+ fetchAllTokens(opts?: {
9869
+ fresh?: boolean;
9870
+ }): Promise<LYCToken[]>;
9871
+ /** Fetch and deserialize a YieldingBank account by its PDA address. */
9872
+ fetchYieldingBank(bank: Address): Promise<LYCYieldingBank>;
9873
+ /** Fetch and deserialize multiple YieldingBank accounts by their PDA addresses. */
9874
+ fetchYieldingBanks(banks: Address[]): Promise<LYCYieldingBank[]>;
9875
+ /** Fetch all YieldingBank accounts owned by the program. */
9876
+ fetchAllYieldingBanks(): Promise<LYCYieldingBank[]>;
9877
+ /** Fetch and deserialize a RedemptionEpoch account by its PDA address. */
9878
+ fetchRedemptionEpoch(epochPda: Address, opts?: {
9879
+ fresh?: boolean;
9880
+ }): Promise<RedemptionEpochSnapshot>;
9881
+ /** Fetch all RedemptionEpoch accounts owned by the program. */
9882
+ fetchAllRedemptionEpochs(opts?: {
9883
+ fresh?: boolean;
9884
+ }): Promise<RedemptionEpochSnapshot[]>;
9885
+ /**
9886
+ * Fetch all LYC yToken holdings for a wallet.
9887
+ *
9888
+ * Reads the user's ATA per LYC token directly via `getMultipleAccounts` —
9889
+ * cost scales with the LYC token count (typically <10), not the wallet's
9890
+ * total token-account count, which can be in the hundreds for active users.
9891
+ *
9892
+ * USD valuation: only when `opts.priceMap` supplies a positive USD price for
9893
+ * the collateral mint and `token.price` (NAV) is positive:
9894
+ * `valueUsd = uiBalance × token.price × priceMap[collateralMint]`.
9895
+ * If the caller does not supply a usable collateral price, `valueUsd` is
9896
+ * omitted — we do not infer USD from on-chain `tvlUsd` / `totalSupply`, since
9897
+ * those can lag risk-asset markets by tens of minutes.
9898
+ *
9899
+ * Tokens with no user ATA or a zero balance are filtered out unless
9900
+ * `opts.includeEmpty` is set.
9901
+ *
9902
+ * Pass `opts.tokens` when the caller already has a list of tokens (e.g. a
9903
+ * backend service with its own shorter-lived tokens cache) to skip the
9904
+ * internal `fetchAllTokens` call and its 5-minute SDK cache.
9905
+ */
9906
+ fetchUserHoldings(owner: Address, opts?: {
9907
+ includeEmpty?: boolean;
9908
+ tokens?: LYCToken[];
9909
+ priceMap?: Partial<Record<Address, number>>;
9910
+ }): Promise<UserHolding[]>;
9911
+ /** Fetch all Token and YieldingBank accounts in parallel. */
9912
+ fetchAllTokensAndYieldingBanks(): Promise<{
9913
+ tokens: LYCToken[];
9914
+ yieldingBanks: LYCYieldingBank[];
9915
+ }>;
9916
+ /**
9917
+ * Build the ordered remaining-accounts list required by refresh_yielding_bank
9918
+ * (and embedded within rebalance_yielding_bank):
9919
+ *
9920
+ * 1. base_asset: [token_account, oracle, external_liquidity...] (if active)
9921
+ * 2. Per active asset holding (in slot order): [token_account, oracle, external_liquidity...]
9922
+ * The token_account is the mint's ATA owned by the bank PDA; the program
9923
+ * reads its raw balance to sync asset.amount on every refresh.
9924
+ * 3. One user account per active external yielding position (in slot order)
9925
+ *
9926
+ * If `newAllocation` is provided, its [token_account, oracle, external_liquidity...]
9927
+ * tuple is injected at the first inactive slot, matching where `apply_allocation`
9928
+ * will register it.
9929
+ */
9930
+ getYieldingBankRefreshAccounts(bank: Address, newAllocation?: YieldingBankAllocationConfig, externalLiquiditySources?: YieldingBankExternalLiquiditySource[]): Promise<CustomAccountMeta[]>;
9931
+ /**
9932
+ * Build the carry-trade remaining accounts for increase/decrease carry
9933
+ * position instructions.
9934
+ *
9935
+ * Fetches the token's lending position at `lendingPositionIndex`, derives
9936
+ * the debt ATAs, and returns the ordered account metas that
9937
+ * `parse_carry_trade_accounts` expects on the Rust side.
9938
+ *
9939
+ * Returns the fixed carry-trade account prefix, including the instructions
9940
+ * sysvar in slot 8 so CPI refs are derived against the on-chain layout.
9941
+ *
9942
+ * @param lendingPositionUserAccount - Override for the protocol user account.
9943
+ * Defaults to the value stored in the on-chain lending position.
9944
+ */
9945
+ getCarryTradeAccounts(token: Address, yieldingBank: Address, lendingPositionIndex: number, lendingPositionUserAccount?: Address): Promise<CustomAccountMeta[]>;
9946
+ /**
9947
+ * Derive the account set needed to refresh a single token lending position.
9948
+ *
9949
+ * This pulls the protocol user account, collateral reserve, and debt oracle
9950
+ * from the selected lending position so callers can pass the exact accounts
9951
+ * required by refresh-oriented instructions. Optional overrides let tests or
9952
+ * advanced callers substitute explicit addresses when needed.
9953
+ */
9954
+ getTokenLendingPositionRefreshAccounts(tokenData: TokenAccountData, lendingPositionIndex: number, overrides?: TokenLpPositionAccountOverrides): {
9955
+ userAccount: Address;
9956
+ collateralReserve: Address;
9957
+ debtOracle: Address;
9958
+ };
9959
+ /**
9960
+ * Build the fixed initial-accounts prefix for `rebalance_token`.
9961
+ *
9962
+ * The Rust handler reads these positionally from the front of
9963
+ * `remaining_accounts` (see `RebalanceTokenAccounts::parse`). Returning the
9964
+ * prefix as `initialAccounts` to `createMultiCpiRefs` lets every CPI in the
9965
+ * flash-rebalance bundle deduplicate against these slots, shrinking the
9966
+ * transaction's account list compared to declaring them as named ix
9967
+ * accounts that would force separate copies in the message header.
9968
+ */
9969
+ getRebalanceTokenInitialAccounts(token: Address, yieldingBank: Address, lpIndex: number, destinationDebtOracle: Address, overrides?: TokenLpPositionAccountOverrides): Promise<CustomAccountMeta[]>;
9970
+ /**
9971
+ * Build the initial account pool seed for refresh_token_state.
9972
+ *
9973
+ * These accounts are placed at the front of the deduplicated remaining_accounts
9974
+ * pool (positions 0..N-1), so the index-based TokenRefreshRefs computed by
9975
+ * the builder remain stable whether or not prereq CPIs introduce additional accounts.
9976
+ *
9977
+ * Order:
9978
+ * 1. Per active lending position (in slot order): protocol_user_acc, collateral_reserve, debt_oracle
9979
+ * 2. One YieldingBank PDA per active carry position (in slot order)
9980
+ */
9981
+ getTokenRefreshAccounts(token: Address): Promise<CustomAccountMeta[]>;
9982
+ private toRedemptionEpochSnapshot;
9983
+ }
9984
+
9985
+ interface CreateTokenIxArgs {
9986
+ mint: Address;
9987
+ collateralMint: Address;
9988
+ params: CreateTokenParams;
9989
+ tokenProgram?: Address;
9990
+ collateralTokenProgram?: Address;
9991
+ /** Curator signer. Must be in the on-chain `WHITELISTED_CURATORS` list.
9992
+ * Defaults to the builder's admin wallet. */
9993
+ curator?: Address;
9994
+ /** Optional per-token admin override. Omit to use the program default. */
9995
+ adminRole?: Address;
9996
+ /** Optional per-token manager override. Omit to use the program default. */
9997
+ managerRole?: Address;
9998
+ /** Optional per-token curator-fees wallet override. Omit to use the program default. */
9999
+ curatorFeeWallet?: Address;
10000
+ /** Optional per-token circuit-breaker controller override. Omit to use the program default. */
10001
+ cbControllerRole?: Address;
10002
+ }
10003
+ interface CreateCpiPlanIxArgs {
10004
+ cpiPlan: Address;
10005
+ manager: Address;
10006
+ params: CreateCpiPlanParams;
10007
+ }
10008
+ interface UpdateTokenMetadataIxArgs {
10009
+ token: Address;
10010
+ mint: Address;
10011
+ params: UpdateTokenMetadataParams;
10012
+ }
10013
+ interface CreateTokenLendingPositionIxArgs {
10014
+ token: Address;
10015
+ params: CreateTokenLendingPositionParams;
10016
+ /**
10017
+ * Accounts that describe the new lending position — their pubkeys are
10018
+ * stored on the position and their on-chain state is read by the final
10019
+ * refresh.
10020
+ */
10021
+ accounts: CreateTokenLendingPositionAccounts;
10022
+ }
10023
+ interface CreateTokenLendingPositionTxArgs {
10024
+ /** Token PDA that will own the new lending position. */
10025
+ token: Address;
10026
+ /**
10027
+ * Debt mint address. Decimals, token program, and oracle metadata are
10028
+ * derived from the mint registry / oracle service.
10029
+ */
10030
+ debtMint: Address;
10031
+ /** Debt reserve address. Looked up by `debtMint` against the pool when omitted. */
10032
+ debtReserve?: Address;
10033
+ /**
10034
+ * Lending-protocol user-account ID used when the obligation must be
10035
+ * created. Ignored when the protocol user account already exists.
10036
+ * Defaults to 0. For Kamino this is the obligation sub-account index.
10037
+ */
10038
+ userAccountId?: number;
10039
+ /**
10040
+ * Lending pool. When omitted, resolved automatically from the token's
10041
+ * collateral mint via {@link resolveDefaultPool}. Throws if the mint
10042
+ * is listed in zero or multiple pools (caller must disambiguate).
10043
+ */
10044
+ pool?: Address;
10045
+ /** @default LendingPlatform.Kamino */
10046
+ lendingPlatform?: LendingPlatform$1;
10047
+ /** @default 9000 */
10048
+ targetUtilizationRateBps?: number;
10049
+ /** @default 150 */
10050
+ maxDeviationAboveTargetUtilBps?: number;
10051
+ /** @default 300 */
10052
+ maxDeviationBelowTargetUtilBps?: number;
10053
+ /** Optional txId reused across composed plans in the same transaction. */
10054
+ txId?: string;
10055
+ }
10056
+ interface CreateYieldingBankIxArgs {
10057
+ baseMint: Address;
10058
+ params: CreateYieldingBankParams;
10059
+ baseMintTokenProgram?: Address;
10060
+ /** Curator signer. Must be in on-chain `WHITELISTED_CURATORS`. Defaults to builder admin. */
10061
+ curator?: Address;
10062
+ /** Optional admin override. Omit to use the program default. */
10063
+ adminRole?: Address;
10064
+ /** Optional manager override. Omit to use the program default. */
10065
+ managerRole?: Address;
10066
+ /** Optional circuit-breaker controller override. Omit to use the program default. */
10067
+ cbControllerRole?: Address;
10068
+ }
10069
+ interface RefreshYieldingBankIxArgs {
10070
+ signer: Address;
10071
+ yieldingBank: Address;
10072
+ externalLiquiditySources?: YieldingBankExternalLiquiditySource[];
10073
+ }
10074
+ interface RefreshYieldingBankTxArgs {
10075
+ signer: Address;
10076
+ yieldingBank: Address;
10077
+ }
10078
+ interface CreateYieldingBankAllocationIxArgs {
10079
+ yieldingBank: Address;
10080
+ config: YieldingBankAllocationConfig;
10081
+ }
10082
+ interface RebalanceYieldingBankIxArgs {
10083
+ yieldingBank: Address;
10084
+ params: RebalanceYieldingBankParams;
10085
+ }
10086
+ interface RebalanceYieldingBankTxArgs {
10087
+ yieldingBank: Address;
10088
+ params: RebalanceYieldingBankTxParams;
10089
+ }
10090
+ interface RefreshTokenStateIxArgs {
10091
+ signer: Address;
10092
+ token: Address;
10093
+ collateralOracle: Address;
10094
+ /** Optional secondary oracle account, required only for composite oracle
10095
+ * types. For `PythSplStake` collateral this is the SPL stake pool account. */
10096
+ secondaryCollateralOracle?: Address;
10097
+ collateralTokenAccount: Address;
10098
+ collateralTokenProgram: Address;
10099
+ }
10100
+ interface RefreshTokensBuilderTxArgs {
10101
+ signer: Address;
10102
+ params: RefreshTokensTxParams;
10103
+ }
10104
+ interface IncreaseCarryPositionIxArgs {
10105
+ token: Address;
10106
+ params: IncreaseCarryPositionParams;
10107
+ }
10108
+ interface IncreaseCarryPositionTxArgs {
10109
+ manager: Address;
10110
+ token: Address;
10111
+ params: IncreaseCarryPositionTxParams;
10112
+ }
10113
+ interface RebalanceTokenIxArgs {
10114
+ token: Address;
10115
+ params: RebalanceTokenParams;
10116
+ }
10117
+ interface RebalanceTokenTxArgs {
10118
+ token: Address;
10119
+ params: RebalanceTokenTxParams;
10120
+ }
10121
+ interface RecollateralizeLossIxArgs {
10122
+ token: Address;
10123
+ params: RecollateralizeLossParams;
10124
+ }
10125
+ interface RecollateralizeLossTxArgs {
10126
+ token: Address;
10127
+ params: RecollateralizeLossTxParams;
10128
+ }
10129
+ interface DecreaseCarryPositionIxArgs {
10130
+ signer: Address;
10131
+ params: DecreaseCarryPositionParams;
10132
+ }
10133
+ interface DecreaseCarryPositionTxArgs {
10134
+ signer: Address;
10135
+ token: Address;
10136
+ params: DecreaseCarryPositionTxParams;
10137
+ /** When set, the DCP loss is attributed to this epoch instead of socialised into the price. */
10138
+ redemptionEpoch?: Address;
10139
+ }
10140
+ interface UpdateLendingPositionConfigIxArgs {
10141
+ token: Address;
10142
+ params: UpdateLendingPositionConfigParams;
10143
+ }
10144
+ interface DepositUnlentCollateralIxArgs {
10145
+ token: Address;
10146
+ params: DepositUnlentCollateralParams;
10147
+ }
10148
+ interface SetTokenCircuitBreakerIxArgs {
10149
+ authority: Address;
10150
+ token: Address;
10151
+ active: boolean;
10152
+ }
10153
+ interface SetTokenCircuitBreakerTxArgs {
10154
+ authority: Address;
10155
+ token: Address;
10156
+ active: boolean;
10157
+ }
10158
+ interface MintTokenIxArgs {
10159
+ signer: Address;
10160
+ token: Address;
10161
+ depositAmount: BN;
10162
+ }
10163
+ interface MintTokenTxArgs {
10164
+ signer: Address;
10165
+ token: Address;
10166
+ params: MintTokenTxParams;
10167
+ }
10168
+ interface BurnTokenIxArgs {
10169
+ signer: Address;
10170
+ token: Address;
10171
+ params: BurnTokenIxParams;
10172
+ /** Pays rent for async-path accounts; must sign the transaction. Defaults to signer. */
10173
+ payer?: Address;
10174
+ }
10175
+ interface BurnTokenTxArgs {
10176
+ signer: Address;
10177
+ token: Address;
10178
+ params: BurnTokenTxParams;
10179
+ /** Pays rent for async-path accounts; must sign the transaction. Defaults to signer. */
10180
+ payer?: Address;
10181
+ }
10182
+ interface SetRedemptionEpochStatusIxArgs {
10183
+ token: Address;
10184
+ redemptionEpoch: Address;
10185
+ params: SetRedemptionEpochStatusParams;
10186
+ }
10187
+ interface TopUpUnlentReservesIxArgs {
10188
+ token: Address;
10189
+ params: TopUpUnlentReservesParams;
10190
+ }
10191
+ interface TopUpUnlentReservesTxArgs {
10192
+ token: Address;
10193
+ params: TopUpUnlentReservesTxParams;
10194
+ }
10195
+ interface CreditUnlentToRedemptionEpochIxArgs {
10196
+ token: Address;
10197
+ redemptionEpoch: Address;
10198
+ }
10199
+ interface ProcessAsyncBurnIxArgs {
10200
+ token: Address;
10201
+ redemptionEpoch: Address;
10202
+ request: Address;
10203
+ }
10204
+ interface ProcessAsyncBurnTxArgs {
10205
+ token: Address;
10206
+ params: ProcessAsyncBurnTxParams;
10207
+ }
10208
+ interface ClaimIncentivesIxArgs {
10209
+ token: Address;
10210
+ params: ClaimIncentivesParams;
10211
+ }
10212
+ interface ClaimIncentivesTxArgs {
10213
+ token: Address;
10214
+ params: ClaimIncentivesTxParams;
10215
+ }
10216
+ interface CollectInterestIxArgs {
10217
+ token: Address;
10218
+ yieldingBank: Address;
10219
+ params: CollectInterestParams;
10220
+ }
10221
+ interface CollectInterestTxArgs {
10222
+ manager: Address;
10223
+ token: Address;
10224
+ params: CollectInterestTxParams;
10225
+ }
10226
+ interface SetYieldingBankCircuitBreakerIxArgs {
10227
+ authority: Address;
10228
+ yieldingBank: Address;
10229
+ active: boolean;
10230
+ }
10231
+ interface SetYieldingBankCircuitBreakerTxArgs {
10232
+ authority: Address;
10233
+ yieldingBank: Address;
10234
+ active: boolean;
10235
+ }
10236
+ interface UpdateYieldingBankConfigIxArgs {
10237
+ yieldingBank: Address;
10238
+ params: UpdateYieldingBankConfigParams;
10239
+ /** Optional admin signer override. */
10240
+ admin?: Address;
10241
+ /** Optional new manager. Omit for no change. */
10242
+ managerRole?: Address;
10243
+ /** Optional new circuit-breaker controller. Omit for no change. */
10244
+ cbControllerRole?: Address;
10245
+ /** Optional new whitelisted curator. Omit for no change. */
10246
+ curatorRole?: Address;
10247
+ /** Optional new admin. Omit for no change. */
10248
+ adminRole?: Address;
10249
+ }
10250
+ interface ResetTokenBurnRateLimitIxArgs {
10251
+ token: Address;
10252
+ }
10253
+ interface UpdateTokenConfigurationIxArgs {
10254
+ token: Address;
10255
+ params: UpdateTokenConfigurationParams;
10256
+ /**
10257
+ * Optional authority signer. The token admin may update all configuration;
10258
+ * the token curator may update the curator fee wallet only; the token manager
10259
+ * may update `feeDripMaxApyBps` only. Defaults to the token admin.
10260
+ */
10261
+ admin?: Address;
10262
+ /** Optional new manager. Omit for no change. */
10263
+ managerRole?: Address;
10264
+ /** Optional new curator-fees wallet. Rotatable by admin or curator. Omit for no change. */
10265
+ curatorFeeWallet?: Address;
10266
+ /** Optional new circuit-breaker controller. Omit for no change. */
10267
+ cbControllerRole?: Address;
10268
+ /** Optional new whitelisted curator. Omit for no change. */
10269
+ curatorRole?: Address;
10270
+ /** Optional new admin. Omit for no change. */
10271
+ adminRole?: Address;
10272
+ }
10273
+ interface CollectFeesIxArgs {
10274
+ token: Address;
10275
+ /**
10276
+ * Signer collecting the fees. Must be either the token's `roles.curator`
10277
+ * (drains `pending_curator_fees` into the curator fee wallet) or the
10278
+ * program-wide `PROTOCOL_ADMIN` (drains `pending_protocol_fees` into the
10279
+ * protocol fee wallet). The fee bucket and destination wallet are both
10280
+ * derived from whichever role this signer matches.
10281
+ */
10282
+ authority: Address;
10283
+ }
10284
+ interface DepositUnlentCollateralTxArgs {
10285
+ manager: Address;
10286
+ token: Address;
10287
+ params: DepositUnlentCollateralTxParams;
10288
+ }
10289
+
10290
+ interface BundledBurnPlan {
10291
+ instructions?: Instruction[];
10292
+ [key: string]: unknown;
10293
+ }
10294
+ declare class BurnTokenBuilder extends LongYieldCarryBuilderBase<BurnTokenIxArgs, BurnTokenTxArgs> {
10295
+ getIx(args: BurnTokenIxArgs): Promise<Instruction>;
10296
+ getTx(args: BurnTokenTxArgs): Promise<LongYieldCarryTransactionPlan>;
10297
+ buildBundledBurnPlan(..._args: unknown[]): Promise<BundledBurnPlan>;
10298
+ private resolveAllSentinel;
10299
+ private resolveAsyncFallbackParams;
10300
+ private resolveNextRequestSequence;
10301
+ private resolveAsyncAccounts;
10302
+ private getUnwrapSolAfterBurnIfCollateralSol;
10303
+ }
10304
+
10305
+ declare class MintTokenBuilder extends LongYieldCarryBuilderBase<MintTokenIxArgs, MintTokenTxArgs> {
10306
+ getIx(args: MintTokenIxArgs): Promise<Instruction>;
10307
+ getTx(args: MintTokenTxArgs): Promise<LongYieldCarryTransactionPlan>;
10308
+ }
10309
+
10310
+ declare abstract class LongYieldCarryBuilderBase<TIxArgs, TTxArgs = TIxArgs, TTxResult = LongYieldCarryTransactionPlan> extends BaseIXBuilderService<LongYieldCarryBuilderContext, TIxArgs, TTxArgs, TTxResult> {
10311
+ protected get rpc(): _solana_kit.Rpc<_solana_kit.RequestAirdropApi & _solana_kit.GetAccountInfoApi & _solana_kit.GetBalanceApi & _solana_kit.GetBlockApi & _solana_kit.GetBlockCommitmentApi & _solana_kit.GetBlockHeightApi & _solana_kit.GetBlockProductionApi & _solana_kit.GetBlocksApi & _solana_kit.GetBlocksWithLimitApi & _solana_kit.GetBlockTimeApi & _solana_kit.GetClusterNodesApi & _solana_kit.GetEpochInfoApi & _solana_kit.GetEpochScheduleApi & _solana_kit.GetFeeForMessageApi & _solana_kit.GetFirstAvailableBlockApi & _solana_kit.GetGenesisHashApi & _solana_kit.GetHealthApi & _solana_kit.GetHighestSnapshotSlotApi & _solana_kit.GetIdentityApi & _solana_kit.GetInflationGovernorApi & _solana_kit.GetInflationRateApi & _solana_kit.GetInflationRewardApi & _solana_kit.GetLargestAccountsApi & _solana_kit.GetLatestBlockhashApi & _solana_kit.GetLeaderScheduleApi & _solana_kit.GetMaxRetransmitSlotApi & _solana_kit.GetMaxShredInsertSlotApi & _solana_kit.GetMinimumBalanceForRentExemptionApi & _solana_kit.GetMultipleAccountsApi & _solana_kit.GetProgramAccountsApi & _solana_kit.GetRecentPerformanceSamplesApi & _solana_kit.GetRecentPrioritizationFeesApi & _solana_kit.GetSignaturesForAddressApi & _solana_kit.GetSignatureStatusesApi & _solana_kit.GetSlotApi & _solana_kit.GetSlotLeaderApi & _solana_kit.GetSlotLeadersApi & _solana_kit.GetStakeMinimumDelegationApi & _solana_kit.GetSupplyApi & _solana_kit.GetTokenAccountBalanceApi & _solana_kit.GetTokenAccountsByDelegateApi & _solana_kit.GetTokenAccountsByOwnerApi & _solana_kit.GetTokenLargestAccountsApi & _solana_kit.GetTokenSupplyApi & _solana_kit.GetTransactionApi & _solana_kit.GetTransactionCountApi & _solana_kit.GetVersionApi & _solana_kit.GetVoteAccountsApi & _solana_kit.IsBlockhashValidApi & _solana_kit.MinimumLedgerSlotApi & _solana_kit.SendTransactionApi & _solana_kit.SimulateTransactionApi>;
10312
+ protected get program(): _anchor_lang_core.Program<LongYieldCarry>;
10313
+ protected get account(): AccountClient;
10314
+ protected get pda(): PdaClient;
10315
+ protected get swap(): SwapClient<unknown>;
10316
+ protected get externalLiquidityResolver(): LongYieldCarryExternalLiquidityResolver;
10317
+ protected get environment(): Environment;
10318
+ protected get lendingPlatformClients(): LendingPlatformClientRegistry;
10319
+ /**
10320
+ * Environment-level manager fallback. Use {@link resolveTokenManager} /
10321
+ * {@link resolveYieldingBankManager} whenever a specific token/bank's role
10322
+ * might override the default.
10323
+ */
10324
+ private get manager();
10325
+ /**
10326
+ * Environment-level circuit-breaker-controller fallback. Use
10327
+ * {@link resolveTokenCbController} / {@link resolveYieldingBankCbController}
10328
+ * whenever a specific token/bank's role might override the default.
10329
+ */
10330
+ private get circuitBreakerController();
10331
+ /**
10332
+ * Program-level admin. Also doubles as the environment-level fallback for
10333
+ * `TokenRoles::admin()` / `YieldingBankRoles::admin()` when their stored role
10334
+ * is unset — both Rust fallbacks resolve to this same pubkey by design.
10335
+ */
10336
+ private get protocolAdmin();
10337
+ /**
10338
+ * Program-level fee wallet. Also doubles as the fallback for
10339
+ * `TokenRoles::curator_fee_wallet()` when a token's `roles.fees` is unset —
10340
+ * the Rust `curator_fee_wallet()` getter delegates to `protocol_fee_wallet()`.
10341
+ */
10342
+ protected get protocolFeeWallet(): Address;
10343
+ /** Program ID for this environment — used as the "no-change"/"use-default" sentinel on role accounts. */
10344
+ protected get programId(): Address;
10345
+ /**
10346
+ * Return the on-chain role key if it's set, otherwise the environment
10347
+ * fallback. Mirrors the Rust role getter pattern (`if self.role != default()
10348
+ * { self.role } else { <env default> }`).
10349
+ */
10350
+ private resolveStoredOrFallback;
10351
+ protected resolveTokenAdmin(tokenData: TokenAccountData): Address;
10352
+ protected resolveTokenManager(tokenData: TokenAccountData): Address;
10353
+ protected resolveTokenCuratorFeeWallet(tokenData: TokenAccountData): Address;
10354
+ protected resolveTokenCbController(tokenData: TokenAccountData): Address;
10355
+ /**
10356
+ * Optional composite collateral oracle (e.g. SPL stake pool for PythSplStake).
10357
+ * Anchor optional accounts must be passed as `null` when unset.
10358
+ */
10359
+ protected resolveOptionalSecondaryCollateralOracle(collateral: TokenAccountData["collateral"]): Address | null;
10360
+ protected resolveYieldingBankAdmin(bankData: YieldingBankAccountData): Address;
10361
+ protected resolveYieldingBankManager(bankData: YieldingBankAccountData): Address;
10362
+ protected resolveYieldingBankCbController(bankData: YieldingBankAccountData): Address;
10363
+ protected getTxLookupTables(tokenPda?: Address | readonly Address[], existingLookupTables?: readonly Address[]): Address[];
10364
+ protected getLendingPlatformClient(position: TokenLendingPositionData): LendingPlatformClientBase<LendingPlatformData>;
10365
+ protected getCreateUserCollateralAtaIxIfNeeded(owner: Address, collateralMint: Address, collateralTokenProgram: Address): Promise<CreateAtaIxIfNeededResult>;
10366
+ protected getWrapSolInstructionsIfMintIsSol(owner: Address, mint: Address, lamports: BN): Promise<{
10367
+ instructions?: Instruction[];
10368
+ postSuccessCacheInvalidations?: LongYieldCarryTransactionPlan["postSuccessCacheInvalidations"];
10369
+ }>;
10370
+ protected getLendingOperationCpiData(token: Address, manager: Address, position: TokenLendingPositionData, txId: string, operation: "deposit" | "withdraw" | "borrow" | "repay", uiAmount?: number | "all"): Promise<LendingOperationCpiBundle>;
10371
+ }
10372
+ declare abstract class LongYieldCarrySingleInstructionBuilderService<TIxArgs, TTxArgs = TIxArgs, TTxPlan extends LongYieldCarryTransactionPlan = LongYieldCarryTransactionPlan> extends LongYieldCarryBuilderBase<TIxArgs, TTxArgs, TTxPlan> {
10373
+ protected deriveIxArgs(txArgs: TTxArgs): Promise<TIxArgs>;
10374
+ protected buildPreambleInstructions(_args: TIxArgs, _txArgs: TTxArgs): Promise<Instruction[]>;
10375
+ protected buildLookupTables(_args: TIxArgs, _txArgs: TTxArgs): Promise<readonly Address[] | undefined>;
10376
+ protected buildPlanExtras(_args: TIxArgs, _txArgs: TTxArgs): Promise<Omit<TTxPlan, "instructions" | "lookupTables"> | undefined>;
10377
+ getTx(txArgs: TTxArgs): Promise<TTxPlan>;
10378
+ }
10379
+
10380
+ /** Program ID per environment */
10381
+ declare const PROGRAM_ID: Record<Environment, Address>;
10382
+ /** Deployed `long_yield_carry` program IDs. */
10383
+ declare const LYC_PROGRAM_IDS: Set<string>;
10384
+ /** Manager authority for manager-gated instruction accounts */
10385
+ declare const MANAGER: Record<Environment, Address>;
10386
+ /** Circuit breaker controller for circuit-breaker-gated instruction accounts */
10387
+ declare const CIRCUIT_BREAKER_CONTROLLER: Record<Environment, Address>;
10388
+
10389
+ /**
10390
+ * Protocol fee wallet — receives the protocol share of mint/burn + perf fees
10391
+ * and serves as the on-chain fallback for a token's `roles.fees` when unset
10392
+ * (`TokenRoles::curator_fee_wallet()` delegates to `protocol_fee_wallet()`).
10393
+ */
10394
+ declare const PROTOCOL_FEE_WALLET: Record<Environment, Address>;
10395
+ /** Redemption epoch status: accepting new async burn requests. */
10396
+ declare const REDEMPTION_EPOCH_STATUS_OPEN = 0;
10397
+ /** Redemption epoch status: closed to new requests, collateral being funded. */
10398
+ declare const REDEMPTION_EPOCH_STATUS_FUNDING = 1;
10399
+ /** Redemption epoch status: funded, individual burn requests being processed. */
10400
+ declare const REDEMPTION_EPOCH_STATUS_PROCESSING = 2;
10401
+ /**
10402
+ * On-chain `TokenAccounting::MAX_FRESHNESS_SECS` = ONE_HOUR (3600s).
10403
+ * We use a 120s buffer so the refresh lands before on-chain staleness kicks in.
10404
+ */
10405
+ declare const TOKEN_STALENESS_THRESHOLD_SECS: number;
10406
+ /** Maximum heap-frame size requested by composed multi-CPI transactions. */
10407
+ declare const MAX_HEAP_FRAME_BYTES: number;
10408
+ /**
10409
+ * Mirror of the on-chain `REBALANCE_TOKEN_RATE_LIMIT_SECS` (24 hours). The
10410
+ * program rejects a `rebalance_token` on a lending position that was already
10411
+ * rebalanced within this window (`RebalanceRateLimited`); the SDK skips such
10412
+ * candidates client-side so we never build a transaction that would revert.
10413
+ */
10414
+ declare const REBALANCE_TOKEN_RATE_LIMIT_SECS: number;
10415
+ /** Default recollateralize-loss swap slippage, capped by the on-chain 150 bps check. */
10416
+ declare const DEFAULT_RECOLLATERALIZE_LOSS_SLIPPAGE_BPS = 150;
10417
+ /**
10418
+ * Minimum claimable reward (in the reward token's UI units) for an incentive to
10419
+ * be worth harvesting. Below this, the on-chain `HarvestReward` moves only dust
10420
+ * while still costing a transaction fee, so `getOutstandingIncentives` omits it.
10421
+ */
10422
+ declare const DEFAULT_MIN_INCENTIVE_UI_AMOUNT = 0.01;
10423
+ /**
10424
+ * Sentinel value (u64::MAX) that callers can pass as an amount to `mint_token`
10425
+ * or `burn_token` to indicate "use the entire balance".
10426
+ * - mint_token: deposits the full collateral ATA balance.
10427
+ * - burn_token: burns the full yToken ATA balance.
10428
+ */
10429
+ declare const AMOUNT_ALL_SENTINEL: BN;
10430
+ /** Re-exported from `common` — see {@link DEPLOYED_ADMIN_KEYPAIR_FP} there. */
10431
+ declare const LYC_ADMIN_KEYPAIR_FP: Record<DeployedEnv, string>;
10432
+ /**
10433
+ * Filesystem paths to the manager keypair for future manager CLI scripts,
10434
+ * fixed per deployment tier (no env overrides).
10435
+ */
10436
+ declare const LYC_MANAGER_KEYPAIR_FP: Record<DeployedEnv, string>;
10437
+ /**
10438
+ * Filesystem paths to the circuit breaker controller keypair.
10439
+ * Used by emergency scripts (trigger circuit breaker, reset burn rate limit).
10440
+ */
10441
+ declare const LYC_CB_KEYPAIR_FP: Record<DeployedEnv, string>;
10442
+ /**
10443
+ * Shared general LUT per remote deployment tier (`test` | `prod`), same split as
10444
+ * {@link LYC_ADMIN_KEYPAIR_FP}. Populate via `pnpm run update-general-lut -- test|prod`.
10445
+ */
10446
+ declare const GENERAL_LOOKUP_TABLES: Record<DeployedEnv, Address>;
10447
+ declare const TOKEN_LOOKUP_TABLES: Record<Address, Address>;
10448
+
10449
+ /**
10450
+ * Display fields used as the fallback when on-chain Metaplex Token-Metadata
10451
+ * is missing or empty. Mirrors {@link OnchainTokenMetadata} on the read path
10452
+ * so the consumer can treat both sources uniformly.
10453
+ */
10454
+ interface LycTokenMetadataEntry {
10455
+ /** Brand-cased symbol shown as the primary label (e.g. "ksBTC", "primeBTC"). */
10456
+ symbol: string;
10457
+ /** Human-readable name (e.g. "Kestrel BTC", "Prime BTC"). */
10458
+ name: string;
10459
+ }
10460
+ /**
10461
+ * Curated fallback registry of LYC token display metadata, keyed by the
10462
+ * token's mint address. Only used when on-chain Metaplex Token-Metadata
10463
+ * isn't set yet — the on-chain value always wins.
10464
+ *
10465
+ * This exists because:
10466
+ * 1. Multiple LYC tokens can share the same underlying collateral
10467
+ * (e.g. ksBTC and primeBTC both built on cbBTC), so the LYC token's
10468
+ * symbol cannot be synthesized from the collateral's symbol alone.
10469
+ * 2. Metaplex `update_token_metadata` requires an admin transaction we
10470
+ * don't always run before a token starts surfacing in the UI.
10471
+ *
10472
+ * Keyed by environment because LYC mints are unique per program deployment.
10473
+ *
10474
+ * To populate, add the LYC token mint address as the key. Once metadata is
10475
+ * set on-chain via:
10476
+ *
10477
+ * pnpm --filter @kestrelfi/lyc-sdk run \
10478
+ * update-token-metadata -- test|prod <TOKEN_PDA|COLLATERAL_SYMBOL> \
10479
+ * --name "<Display Name>" --symbol "<ksXXX>" --uri "<json uri>"
10480
+ *
10481
+ * the entry here can be removed.
10482
+ */
10483
+ declare const LYC_TOKEN_METADATA: Record<Environment, Record<string, LycTokenMetadataEntry>>;
10484
+
10485
+ export { type RebalanceTokenIxArgs as $, AccountClient as A, type BurnAmounts as B, type CpiData as C, type CustomAccountMeta as D, type Environment as E, type DecreaseCarryPositionPlan as F, type LongYieldCarry as G, type YieldingBankExternalLiquiditySource as H, type InstructionRefs as I, type TransactionCacheInvalidation as J, type CreateTokenLendingPositionParams as K, LendingPlatformData as L, type MintIdentifier as M, type CreateTokenLendingPositionAccounts as N, type DecreaseCarryPositionIxArgs as O, type PositionBalanceChange as P, type DecreaseCarryPositionTxArgs as Q, ReserveBase as R, type SingleCpiExecutionPlan as S, type TopUpUnlentReservesIxArgs as T, type DecreaseCarryPositionTxParams as U, type DecreaseCarryPositionTxBuilderParams as V, type DepositUnlentCollateralIxArgs as W, type DepositUnlentCollateralTxArgs as X, type YieldingBankAllocationConfig as Y, type IncreaseCarryPositionIxArgs as Z, type IncreaseCarryPositionTxArgs as _, type PricedMint as a, LYC_ADMIN_KEYPAIR_FP as a$, type RebalanceTokenTxArgs as a0, type RebalanceYieldingBankIxArgs as a1, type RebalanceYieldingBankTxArgs as a2, type RecollateralizeLossIxArgs as a3, type RecollateralizeLossTxArgs as a4, type RefreshTokenStateIxArgs as a5, type RefreshTokensBuilderTxArgs as a6, type RefreshYieldingBankIxArgs as a7, type RefreshYieldingBankTxArgs as a8, type ResetTokenBurnRateLimitIxArgs as a9, type AssetConfig as aA, type BundledBurnPlan as aB, type BurnTokenIxParams as aC, type BurnTokenTxParams as aD, CIRCUIT_BREAKER_CONTROLLER as aE, type ClaimIncentivesParams as aF, type ClaimIncentivesTxParams as aG, type CollectInterestParams as aH, type CollectInterestTxParams as aI, type CreateCpiPlanParams as aJ, type CreateTokenParams as aK, type CreateYieldingBankParams as aL, DEFAULT_MIN_INCENTIVE_UI_AMOUNT as aM, DEFAULT_RECOLLATERALIZE_LOSS_SLIPPAGE_BPS as aN, type DecreaseCarryPositionParams as aO, type DecreaseCarryPositionTxPlanParams as aP, type DecreaseCarryRepaySteering as aQ, type DepositUnlentCollateralParams as aR, type DepositUnlentCollateralTxParams as aS, type ExternalPositionConfig as aT, type FeeConfig as aU, GENERAL_LOOKUP_TABLES as aV, type GroupedCpiExecutionPlan as aW, type IncreaseCarryPositionParams as aX, type IncreaseCarryPositionTxParams as aY, type IndexedCarryPosition as aZ, InterestDistribution as a_, type SetTokenCircuitBreakerIxArgs as aa, type SetTokenCircuitBreakerTxArgs as ab, type SetYieldingBankCircuitBreakerIxArgs as ac, type SetYieldingBankCircuitBreakerTxArgs as ad, type UpdateLendingPositionConfigIxArgs as ae, type UpdateTokenConfigurationIxArgs as af, type UpdateTokenMetadataIxArgs as ag, type UpdateYieldingBankConfigIxArgs as ah, type TransactionPlan as ai, BurnTokenBuilder as aj, MintTokenBuilder as ak, PdaClient as al, type SwapClient as am, LendingPlatformClientRegistry as an, type SupportedLendingPlatformClients as ao, type SendTransactionOptionsWithPostSuccess as ap, type OutstandingIncentive as aq, KaminoClient as ar, type DecreaseCarryPositionBuilderParams as as, type IndexedLendingPosition as at, type RebalanceSwapSpec as au, type RedemptionEpochSnapshot as av, AMOUNT_ALL_SENTINEL as aw, type AnchorInterestDistribution as ax, type AnchorLendingType as ay, type AssetAllocationConfig as az, LongYieldCarryBuilderBase as b, LYC_CB_KEYPAIR_FP as b0, LYC_MANAGER_KEYPAIR_FP as b1, LYC_PROGRAM_IDS as b2, LYC_TOKEN_METADATA as b3, LendingType as b4, type LongYieldCarryTransactionPlanDebug as b5, type LycTokenMetadataEntry as b6, MANAGER as b7, MAX_HEAP_FRAME_BYTES as b8, type MintAmounts as b9, type UpdateLendingPositionConfigParams as bA, type UpdateTokenConfigurationParams as bB, type UpdateTokenMetadataParams as bC, type UpdateYieldingBankConfigParams as bD, type UserHolding as bE, enumToInterestDistribution as bF, enumToLendingType as bG, interestDistributionToEnum as bH, lendingTypeToEnum as bI, type BurnTokenIxArgs as bJ, type BurnTokenTxArgs as bK, IDL as bL, type MintTokenIxArgs as bM, type MintTokenTxArgs as bN, type SendTransactionOptions as bO, signSendAndConfirmTransaction as bP, type MintTokenTxParams as ba, type OracleConfigDetails as bb, PROGRAM_ID as bc, PROTOCOL_ADMIN as bd, PROTOCOL_FEE_WALLET as be, type PlannedInstructionBase as bf, type ProcessAsyncBurnTxParams as bg, REBALANCE_TOKEN_RATE_LIMIT_SECS as bh, REDEMPTION_EPOCH_STATUS_FUNDING as bi, REDEMPTION_EPOCH_STATUS_OPEN as bj, REDEMPTION_EPOCH_STATUS_PROCESSING as bk, type RebalanceTokenParams as bl, type RebalanceTokenTxParams as bm, type RebalanceYieldingBankParams as bn, type RebalanceYieldingBankTxParams as bo, type RecollateralizeLossParams as bp, type RecollateralizeLossTxParams as bq, type RefreshTokensTxParams as br, type SetRedemptionEpochStatusParams as bs, TOKEN_LOOKUP_TABLES as bt, TOKEN_STALENESS_THRESHOLD_SECS as bu, type TokenAccountData as bv, type TokenCarryPositionData as bw, type TokenLpPositionAccountOverrides as bx, type TopUpUnlentReservesParams as by, type TopUpUnlentReservesTxParams as bz, type CreditUnlentToRedemptionEpochIxArgs as c, type LongYieldCarryTransactionPlan as d, type ProcessAsyncBurnIxArgs as e, type ProcessAsyncBurnTxArgs as f, type SetRedemptionEpochStatusIxArgs as g, type TopUpUnlentReservesTxArgs as h, type LongYieldCarryBuilderContext as i, LYCToken as j, type ClaimIncentivesIxArgs as k, type ClaimIncentivesTxArgs as l, LongYieldCarrySingleInstructionBuilderService as m, type CollectFeesIxArgs as n, type CollectInterestIxArgs as o, type CollectInterestTxArgs as p, type CreateCpiPlanIxArgs as q, type CreateTokenIxArgs as r, type CreateTokenLendingPositionIxArgs as s, type CreateTokenLendingPositionTxArgs as t, type CreateYieldingBankAllocationIxArgs as u, type CreateYieldingBankIxArgs as v, LendingPlatform$1 as w, LYCYieldingBank as x, type TokenLendingPositionData as y, LendingPlatformClientBase as z };