@gearbox-protocol/sdk 18.3.1 → 18.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (179) hide show
  1. package/dist/cjs/abi/310/iKillSwitchProxy.js +130 -0
  2. package/dist/cjs/onchain/index.js +18 -0
  3. package/dist/cjs/onchain/market/adapters/abi/adapters/iTreehouseFastlaneAdapter.js +113 -0
  4. package/dist/cjs/onchain/market/adapters/abi/adapters/iTreehouseRedemptionGatewayAdapter.js +258 -0
  5. package/dist/cjs/onchain/market/adapters/abi/adapters/iTreehouseRouterAdapter.js +161 -0
  6. package/dist/cjs/onchain/market/adapters/abi/adapters/index.js +6 -0
  7. package/dist/cjs/onchain/market/adapters/abi/index.js +13 -0
  8. package/dist/cjs/onchain/market/adapters/abi/treehouse/iTreehouseFastlane.js +39 -0
  9. package/dist/cjs/onchain/market/adapters/abi/treehouse/iTreehouseRedemptionGateway.js +230 -0
  10. package/dist/cjs/onchain/market/adapters/abi/treehouse/iTreehouseRouter.js +29 -0
  11. package/dist/cjs/onchain/market/adapters/abi/treehouse/index.js +7 -0
  12. package/dist/cjs/onchain/market/adapters/contracts/TreehouseFastlaneAdapterContract.js +72 -0
  13. package/dist/cjs/onchain/market/adapters/contracts/TreehouseRedemptionGatewayAdapterContract.js +117 -0
  14. package/dist/cjs/onchain/market/adapters/contracts/TreehouseRouterAdapterContract.js +61 -0
  15. package/dist/cjs/onchain/market/adapters/contracts/index.js +6 -0
  16. package/dist/cjs/onchain/market/adapters/createAdapter.js +6 -0
  17. package/dist/cjs/onchain/market/adapters/index.js +18 -0
  18. package/dist/cjs/onchain/market/index.js +18 -0
  19. package/dist/cjs/permissionless/api/index.js +31 -0
  20. package/dist/cjs/permissionless/api/oracles/PermissionlessOracles.js +637 -65
  21. package/dist/cjs/permissionless/api/oracles/enrich.js +99 -0
  22. package/dist/cjs/permissionless/api/oracles/index.js +33 -0
  23. package/dist/cjs/permissionless/api/oracles/onchain-feed.js +25 -0
  24. package/dist/cjs/permissionless/api/oracles/schemas.js +84 -59
  25. package/dist/cjs/permissionless/api/oracles/score/formula.js +56 -0
  26. package/dist/cjs/permissionless/api/oracles/score/index.js +11 -0
  27. package/dist/cjs/permissionless/api/oracles/score/run.js +252 -0
  28. package/dist/cjs/permissionless/api/oracles/score/types.js +1 -0
  29. package/dist/cjs/permissionless/api/oracles/stress/classify.js +258 -0
  30. package/dist/cjs/permissionless/api/oracles/stress/index.js +24 -0
  31. package/dist/cjs/permissionless/api/oracles/stress/override.js +125 -0
  32. package/dist/cjs/permissionless/api/oracles/stress/run.js +485 -0
  33. package/dist/cjs/permissionless/api/oracles/stress/score.js +98 -0
  34. package/dist/cjs/permissionless/api/oracles/stress/types.js +1 -0
  35. package/dist/cjs/permissionless/api/schemas.js +0 -3
  36. package/dist/cjs/permissionless/api/transactions/InstanceOwnerTransactions.js +14 -3
  37. package/dist/cjs/permissionless/api/transactions/lp-price-feeds.js +10 -4
  38. package/dist/cjs/permissionless/bindings/bytecode-repository.js +8 -0
  39. package/dist/cjs/permissionless/bindings/governance/governor.js +1 -1
  40. package/dist/cjs/permissionless/bindings/index.js +8 -3
  41. package/dist/cjs/permissionless/bindings/kill-switch-proxy.js +188 -0
  42. package/dist/cjs/permissionless/bindings/market-configurator-factory.js +39 -1
  43. package/dist/cjs/permissionless/bindings/market-configurator.js +142 -0
  44. package/dist/cjs/permissionless/index.js +42 -3
  45. package/dist/cjs/permissionless/utils/index.js +3 -0
  46. package/dist/cjs/permissionless/utils/literals.js +2 -0
  47. package/dist/cjs/permissionless/utils/price-update/get-prices.js +64 -0
  48. package/dist/cjs/permissionless/utils/price-update/index.js +2 -0
  49. package/dist/cjs/testnets/TestnetsAPI.js +179 -0
  50. package/dist/cjs/testnets/errors/TestnetNotFoundError.js +15 -0
  51. package/dist/cjs/testnets/errors/TestnetRequestFailedError.js +24 -0
  52. package/dist/cjs/testnets/errors/TestnetStatusError.js +19 -0
  53. package/dist/cjs/testnets/errors/TestnetValidationError.js +24 -0
  54. package/dist/cjs/testnets/errors/TestnetWaitTimeoutError.js +30 -0
  55. package/dist/cjs/testnets/errors/TestnetsError.js +34 -0
  56. package/dist/cjs/testnets/errors/index.js +13 -0
  57. package/dist/cjs/testnets/index.js +32 -0
  58. package/dist/cjs/testnets/package.json +1 -0
  59. package/dist/cjs/testnets/schemas.js +242 -0
  60. package/dist/cjs/testnets/types.js +1 -0
  61. package/dist/esm/abi/310/iKillSwitchProxy.js +129 -0
  62. package/dist/esm/onchain/index.js +10 -1
  63. package/dist/esm/onchain/market/adapters/abi/adapters/iTreehouseFastlaneAdapter.js +112 -0
  64. package/dist/esm/onchain/market/adapters/abi/adapters/iTreehouseRedemptionGatewayAdapter.js +257 -0
  65. package/dist/esm/onchain/market/adapters/abi/adapters/iTreehouseRouterAdapter.js +160 -0
  66. package/dist/esm/onchain/market/adapters/abi/adapters/index.js +4 -1
  67. package/dist/esm/onchain/market/adapters/abi/index.js +8 -1
  68. package/dist/esm/onchain/market/adapters/abi/treehouse/iTreehouseFastlane.js +38 -0
  69. package/dist/esm/onchain/market/adapters/abi/treehouse/iTreehouseRedemptionGateway.js +229 -0
  70. package/dist/esm/onchain/market/adapters/abi/treehouse/iTreehouseRouter.js +28 -0
  71. package/dist/esm/onchain/market/adapters/abi/treehouse/index.js +4 -0
  72. package/dist/esm/onchain/market/adapters/contracts/TreehouseFastlaneAdapterContract.js +71 -0
  73. package/dist/esm/onchain/market/adapters/contracts/TreehouseRedemptionGatewayAdapterContract.js +116 -0
  74. package/dist/esm/onchain/market/adapters/contracts/TreehouseRouterAdapterContract.js +60 -0
  75. package/dist/esm/onchain/market/adapters/contracts/index.js +4 -1
  76. package/dist/esm/onchain/market/adapters/createAdapter.js +6 -0
  77. package/dist/esm/onchain/market/adapters/index.js +10 -1
  78. package/dist/esm/onchain/market/index.js +10 -1
  79. package/dist/esm/permissionless/api/index.js +7 -1
  80. package/dist/esm/permissionless/api/oracles/PermissionlessOracles.js +639 -67
  81. package/dist/esm/permissionless/api/oracles/enrich.js +94 -0
  82. package/dist/esm/permissionless/api/oracles/index.js +10 -1
  83. package/dist/esm/permissionless/api/oracles/onchain-feed.js +24 -0
  84. package/dist/esm/permissionless/api/oracles/schemas.js +80 -58
  85. package/dist/esm/permissionless/api/oracles/score/formula.js +51 -0
  86. package/dist/esm/permissionless/api/oracles/score/index.js +4 -0
  87. package/dist/esm/permissionless/api/oracles/score/run.js +250 -0
  88. package/dist/esm/permissionless/api/oracles/score/types.js +1 -0
  89. package/dist/esm/permissionless/api/oracles/stress/classify.js +256 -0
  90. package/dist/esm/permissionless/api/oracles/stress/index.js +6 -0
  91. package/dist/esm/permissionless/api/oracles/stress/override.js +119 -0
  92. package/dist/esm/permissionless/api/oracles/stress/run.js +478 -0
  93. package/dist/esm/permissionless/api/oracles/stress/score.js +95 -0
  94. package/dist/esm/permissionless/api/oracles/stress/types.js +1 -0
  95. package/dist/esm/permissionless/api/schemas.js +2 -4
  96. package/dist/esm/permissionless/api/transactions/InstanceOwnerTransactions.js +14 -3
  97. package/dist/esm/permissionless/api/transactions/lp-price-feeds.js +10 -4
  98. package/dist/esm/permissionless/bindings/bytecode-repository.js +8 -0
  99. package/dist/esm/permissionless/bindings/governance/governor.js +1 -1
  100. package/dist/esm/permissionless/bindings/index.js +5 -4
  101. package/dist/esm/permissionless/bindings/kill-switch-proxy.js +184 -0
  102. package/dist/esm/permissionless/bindings/market-configurator-factory.js +37 -0
  103. package/dist/esm/permissionless/bindings/market-configurator.js +143 -1
  104. package/dist/esm/permissionless/index.js +13 -6
  105. package/dist/esm/permissionless/utils/index.js +3 -3
  106. package/dist/esm/permissionless/utils/literals.js +2 -1
  107. package/dist/esm/permissionless/utils/price-update/get-prices.js +63 -1
  108. package/dist/esm/permissionless/utils/price-update/index.js +2 -2
  109. package/dist/esm/testnets/TestnetsAPI.js +178 -0
  110. package/dist/esm/testnets/errors/TestnetNotFoundError.js +14 -0
  111. package/dist/esm/testnets/errors/TestnetRequestFailedError.js +23 -0
  112. package/dist/esm/testnets/errors/TestnetStatusError.js +18 -0
  113. package/dist/esm/testnets/errors/TestnetValidationError.js +23 -0
  114. package/dist/esm/testnets/errors/TestnetWaitTimeoutError.js +29 -0
  115. package/dist/esm/testnets/errors/TestnetsError.js +33 -0
  116. package/dist/esm/testnets/errors/index.js +7 -0
  117. package/dist/esm/testnets/index.js +11 -0
  118. package/dist/esm/testnets/package.json +1 -0
  119. package/dist/esm/testnets/schemas.js +228 -0
  120. package/dist/esm/testnets/types.js +1 -0
  121. package/dist/types/abi/310/iKillSwitchProxy.d.ts +114 -0
  122. package/dist/types/onchain/index.d.ts +10 -1
  123. package/dist/types/onchain/market/adapters/abi/adapters/iTreehouseFastlaneAdapter.d.ts +101 -0
  124. package/dist/types/onchain/market/adapters/abi/adapters/iTreehouseRedemptionGatewayAdapter.d.ts +237 -0
  125. package/dist/types/onchain/market/adapters/abi/adapters/iTreehouseRouterAdapter.d.ts +146 -0
  126. package/dist/types/onchain/market/adapters/abi/adapters/index.d.ts +4 -1
  127. package/dist/types/onchain/market/adapters/abi/index.d.ts +8 -1
  128. package/dist/types/onchain/market/adapters/abi/treehouse/iTreehouseFastlane.d.ts +33 -0
  129. package/dist/types/onchain/market/adapters/abi/treehouse/iTreehouseRedemptionGateway.d.ts +207 -0
  130. package/dist/types/onchain/market/adapters/abi/treehouse/iTreehouseRouter.d.ts +27 -0
  131. package/dist/types/onchain/market/adapters/abi/treehouse/index.d.ts +4 -0
  132. package/dist/types/onchain/market/adapters/contracts/TreehouseFastlaneAdapterContract.d.ts +156 -0
  133. package/dist/types/onchain/market/adapters/contracts/TreehouseRedemptionGatewayAdapterContract.d.ts +481 -0
  134. package/dist/types/onchain/market/adapters/contracts/TreehouseRouterAdapterContract.d.ts +193 -0
  135. package/dist/types/onchain/market/adapters/contracts/index.d.ts +4 -1
  136. package/dist/types/onchain/market/adapters/index.d.ts +10 -1
  137. package/dist/types/onchain/market/index.d.ts +10 -1
  138. package/dist/types/permissionless/api/index.d.ts +10 -2
  139. package/dist/types/permissionless/api/oracles/PermissionlessOracles.d.ts +237 -47
  140. package/dist/types/permissionless/api/oracles/enrich.d.ts +59 -0
  141. package/dist/types/permissionless/api/oracles/index.d.ts +12 -2
  142. package/dist/types/permissionless/api/oracles/onchain-feed.d.ts +15 -0
  143. package/dist/types/permissionless/api/oracles/schemas.d.ts +147 -41
  144. package/dist/types/permissionless/api/oracles/score/formula.d.ts +36 -0
  145. package/dist/types/permissionless/api/oracles/score/index.d.ts +4 -0
  146. package/dist/types/permissionless/api/oracles/score/run.d.ts +42 -0
  147. package/dist/types/permissionless/api/oracles/score/types.d.ts +118 -0
  148. package/dist/types/permissionless/api/oracles/stress/classify.d.ts +57 -0
  149. package/dist/types/permissionless/api/oracles/stress/index.d.ts +6 -0
  150. package/dist/types/permissionless/api/oracles/stress/override.d.ts +59 -0
  151. package/dist/types/permissionless/api/oracles/stress/run.d.ts +100 -0
  152. package/dist/types/permissionless/api/oracles/stress/score.d.ts +57 -0
  153. package/dist/types/permissionless/api/oracles/stress/types.d.ts +272 -0
  154. package/dist/types/permissionless/api/oracles/types.d.ts +320 -125
  155. package/dist/types/permissionless/api/schemas.d.ts +0 -2
  156. package/dist/types/permissionless/api/transactions/lp-price-feeds.d.ts +9 -1
  157. package/dist/types/permissionless/bindings/bytecode-repository.d.ts +10 -1
  158. package/dist/types/permissionless/bindings/index.d.ts +4 -3
  159. package/dist/types/permissionless/bindings/kill-switch-proxy.d.ts +205 -0
  160. package/dist/types/permissionless/bindings/market-configurator-factory.d.ts +30 -0
  161. package/dist/types/permissionless/bindings/market-configurator.d.ts +30 -1
  162. package/dist/types/permissionless/bindings/types.d.ts +27 -0
  163. package/dist/types/permissionless/index.d.ts +15 -6
  164. package/dist/types/permissionless/utils/index.d.ts +3 -3
  165. package/dist/types/permissionless/utils/literals.d.ts +1 -0
  166. package/dist/types/permissionless/utils/price-update/get-prices.d.ts +33 -0
  167. package/dist/types/permissionless/utils/price-update/index.d.ts +2 -2
  168. package/dist/types/testnets/TestnetsAPI.d.ts +108 -0
  169. package/dist/types/testnets/errors/TestnetNotFoundError.d.ts +12 -0
  170. package/dist/types/testnets/errors/TestnetRequestFailedError.d.ts +11 -0
  171. package/dist/types/testnets/errors/TestnetStatusError.d.ts +15 -0
  172. package/dist/types/testnets/errors/TestnetValidationError.d.ts +16 -0
  173. package/dist/types/testnets/errors/TestnetWaitTimeoutError.d.ts +21 -0
  174. package/dist/types/testnets/errors/TestnetsError.d.ts +47 -0
  175. package/dist/types/testnets/errors/index.d.ts +7 -0
  176. package/dist/types/testnets/index.d.ts +11 -0
  177. package/dist/types/testnets/schemas.d.ts +554 -0
  178. package/dist/types/testnets/types.d.ts +717 -0
  179. package/package.json +6 -1
@@ -28,6 +28,9 @@ import { iSecuritizeOnRampAdapterV310Abi } from "./abi/adapters/iSecuritizeOnRam
28
28
  import { iSecuritizeRedemptionGatewayAdapterV311Abi } from "./abi/adapters/iSecuritizeRedemptionGatewayAdapterV311.js";
29
29
  import { iStakingRewardsAdapterAbi } from "./abi/adapters/iStakingRewardsAdapter.js";
30
30
  import { iTraderJoeRouterAdapterAbi } from "./abi/adapters/iTraderJoeRouterAdapter.js";
31
+ import { iTreehouseFastlaneAdapterAbi } from "./abi/adapters/iTreehouseFastlaneAdapter.js";
32
+ import { iTreehouseRedemptionGatewayAdapterAbi } from "./abi/adapters/iTreehouseRedemptionGatewayAdapter.js";
33
+ import { iTreehouseRouterAdapterAbi } from "./abi/adapters/iTreehouseRouterAdapter.js";
31
34
  import { iUniswapV2AdapterAbi } from "./abi/adapters/iUniswapV2Adapter.js";
32
35
  import { iUniswapV3AdapterAbi } from "./abi/adapters/iUniswapV3Adapter.js";
33
36
  import { iUniswapV4AdapterAbi, iUniswapV4GatewayAbi } from "./abi/adapters/iUniswapV4Adapter.js";
@@ -41,6 +44,9 @@ import { iBaseOnRampAbi } from "./abi/securitize/iBaseOnRamp.js";
41
44
  import { iSecuritizeOnRampAbi } from "./abi/securitize/iSecuritizeOnRamp.js";
42
45
  import { iSecuritizeRedemptionGatewayV311Abi } from "./abi/securitize/iSecuritizeRedemptionGatewayV311.js";
43
46
  import { iBalancerV3RouterAbi, iBalancerV3WrapperAbi, iBaseRewardPoolAbi, iBoosterAbi, iCamelotV3RouterAbi, iCurvePoolAbi, iCurvePoolStableNGAbi, iCurvePool_2Abi, iCurvePool_3Abi, iCurvePool_4Abi, iDaiUsdsAbi, iERC4626Abi, iERC4626ReferralAbi, iFluidDexAbi, iInfinifiGatewayAbi, iKelpLRTDepositPoolGatewayAbi, iKelpLRTWithdrawalManagerGatewayAbi, iMellowClaimerAbi, iMellowWrapperAbi, iMidasIssuanceVaultV310Abi, iPendleRouterAbi, iStakingRewardsAbi, iTraderJoeRouterAbi, iUniswapV2Router02Abi, iUniswapV3Abi, iVelodromeV2RouterAbi, iwstETHAbi, lidoV1_WETHGatewayAbi } from "./abi/targetContractAbi.js";
47
+ import { iTreehouseFastlaneAbi } from "./abi/treehouse/iTreehouseFastlane.js";
48
+ import { iTreehouseRedemptionGatewayAbi } from "./abi/treehouse/iTreehouseRedemptionGateway.js";
49
+ import { iTreehouseRouterAbi } from "./abi/treehouse/iTreehouseRouter.js";
44
50
  import { getAdapterActionAbi, getAdapterDeployParamsAbi, getAdapterType, hasAdapterDeployParamsAbi, parseAdapterAction, parseAdapterDeployParams } from "./abi/utils.js";
45
51
  import "./abi/index.js";
46
52
  import { BalancerSwap, BasicSwapCall, ConvexDeposit, ConvexDepositAndStake, ConvexStake, ConvexWithdraw, ConvexWithdrawAndClaim, CurveAddLiquidity, CurveClaims, CurveExchange, CurveRemoveLiquidity, CurveRemoveLiquidityOneCoin, CurveWithdrawal, GetReward, LegacyAdapterOperation, LidoSubmit, MakerDeposit, MakerRedeem, Swap, TokenAmount, Transfers, UniswapSwap, VaultDeposit, WithdrawCollateral, WstETHUnwrap, WstETHWrap } from "./legacyAdapterOperations.js";
@@ -77,6 +83,9 @@ import { SecuritizeOnRampAdapterContract } from "./contracts/SecuritizeOnRampAda
77
83
  import { SecuritizeRedemptionGatewayAdapterContract } from "./contracts/SecuritizeRedemptionGatewayAdapterContract.js";
78
84
  import { StakingRewardsAdapterContract } from "./contracts/StakingRewardsAdapterContract.js";
79
85
  import { TraderJoePool, TraderJoePoolVersion, TraderJoeRouterAdapterContract } from "./contracts/TraderJoeRouterAdapterContract.js";
86
+ import { TreehouseFastlaneAdapterContract } from "./contracts/TreehouseFastlaneAdapterContract.js";
87
+ import { TreehouseRedemptionGatewayAdapterContract } from "./contracts/TreehouseRedemptionGatewayAdapterContract.js";
88
+ import { TreehouseRouterAdapterContract } from "./contracts/TreehouseRouterAdapterContract.js";
80
89
  import { UniswapV2AdapterContract } from "./contracts/UniswapV2AdapterContract.js";
81
90
  import { UniswapV3AdapterContract } from "./contracts/UniswapV3AdapterContract.js";
82
91
  import { UniswapV4AdapterContract } from "./contracts/UniswapV4AdapterContract.js";
@@ -87,4 +96,4 @@ import "./contracts/index.js";
87
96
  import { AdapterFactoryArgs, createAdapter } from "./createAdapter.js";
88
97
  import { TokenTransfer } from "./transfers.js";
89
98
  import { allTransfersAsTokenAmounts, classifyCurveOperation, curveAddLiquidityFromTransfers, curveRemoveLiquidityFromTransfers, fnSigToName, parsePosNegAmount, rewardsFromTransfers, swapFromTransfers, toNetTransfers } from "./transferHelpers.js";
90
- export { AbstractAdapterContract, AbstractAdapterContractOptions, AccountMigratorAdapterContract, AdapterContractStateHuman, AdapterContractType, AdapterFactoryArgs, AdapterProtocolOperation, AdapterType, BalancerSwap, BalancerV3Pool, BalancerV3PoolStatus, BalancerV3RouterAdapterContract, BalancerV3WrapperAdapterContract, BasicSwapCall, CamelotPool, CamelotV3AdapterContract, ConcreteAdapterContractOptions, ConvexDeposit, ConvexDepositAndStake, ConvexStake, ConvexV1BaseRewardPoolAdapterContract, ConvexV1BoosterAdapterContract, ConvexWithdraw, ConvexWithdrawAndClaim, Curve2AssetsAdapterContract, Curve3AssetsAdapterContract, Curve4AssetsAdapterContract, CurveAddLiquidity, CurveClaims, CurveExchange, CurveRemoveLiquidity, CurveRemoveLiquidityOneCoin, CurveV1AdapterStETHContract, CurveV1StableNGAdapterContract, CurveWithdrawal, DaiUsdsAdapterContract, DelayedWithdrawalClaim, DelayedWithdrawalRequest, ERC4626AdapterContract, ERC4626ReferralAdapterContract, FluidDexAdapterContract, GetReward, IAdapterContract, InfinifiGatewayAdapterContract, InfinifiUnwindingGatewayAdapterContract, KelpLRTDepositPoolAdapterContract, KelpLRTWithdrawalManagerAdapterContract, LegacyAdapterOperation, LidoSubmit, LidoV1AdapterContract, MakerDeposit, MakerRedeem, MellowClaimerAdapterContract, MellowDVVAdapterContract, MellowERC4626VaultAdapterContract, MellowWrapperAdapterContract, MidasGatewayAdapterContract, MidasIssuanceVaultAdapterContract, MidasRedemptionVaultAdapterContract, PendlePair, PendlePairStatus, PendleRouterAdapterContract, PendleTokenType, SecuritizeOnRampAdapterContract, SecuritizeRedemptionGatewayAdapterContract, StakingRewardsAdapterContract, Swap, TokenAmount, TokenTransfer, TraderJoePool, TraderJoePoolVersion, TraderJoeRouterAdapterContract, Transfers, UniswapSwap, UniswapV2AdapterContract, UniswapV3AdapterContract, UniswapV4AdapterContract, UpshiftVaultAdapterContract, VaultDeposit, VelodromeV2RouterAdapterContract, VersionedAbi, WithdrawCollateral, WstETHUnwrap, WstETHV1AdapterContract, WstETHWrap, adapterActionAbi, adapterActionSelectors, adapterActionSignatures, adapterConstructorAbi, allTransfersAsTokenAmounts, classifyCurveOperation, createAdapter, curveAddLiquidityFromTransfers, curveRemoveLiquidityFromTransfers, erc4626ReferralAdapterAbi, fnSigToName, getAdapterActionAbi, getAdapterDeployParamsAbi, getAdapterType, hasAdapterDeployParamsAbi, iBalancerV3RouterAbi, iBalancerV3RouterAdapterAbi, iBalancerV3WrapperAbi, iBalancerV3WrapperAdapterAbi, iBaseOnRampAbi, iBaseRewardPoolAbi, iBoosterAbi, iCamelotV3AdapterAbi, iCamelotV3RouterAbi, iConvexV1BaseRewardPoolAdapterAbi, iConvexV1BoosterAdapterAbi, iCurvePoolAbi, iCurvePoolStableNGAbi, iCurvePool_2Abi, iCurvePool_3Abi, iCurvePool_4Abi, iCurveV1StableNgAdapterAbi, iCurveV1_2AssetsAdapterAbi, iCurveV1_3AssetsAdapterAbi, iCurveV1_4AssetsAdapterAbi, iDaiUsdsAbi, iDaiUsdsAdapterAbi, iERC4626Abi, iERC4626ReferralAbi, iFluidDexAbi, iFluidDexAdapterAbi, iInfinifiGatewayAbi, iInfinifiGatewayAdapterAbi, iInfinifiUnwindingGatewayAbi, iInfinifiUnwindingGatewayAdapterAbi, iKelpLRTDepositPoolGatewayAbi, iKelpLRTWithdrawalManagerGatewayAbi, iKelpLrtDepositPoolAdapterAbi, iKelpLrtDepositPoolGatewayAbi, iKelpLrtWithdrawalManagerAdapterAbi, iKelpLrtWithdrawalManagerGatewayAbi, iLidoV1AdapterAbi, iMellow4626VaultAdapterAbi, iMellowClaimerAbi, iMellowClaimerAdapterAbi, iMellowWrapperAbi, iMellowWrapperAdapterAbi, iMidasGatewayAdapterV311Abi, iMidasGatewayV311Abi, iMidasIssuanceVaultAdapterV310Abi, iMidasIssuanceVaultV310Abi, iMidasRedemptionVaultAdapterV310Abi, iMidasRedemptionVaultGatewayV310Abi, iPendleRouterAbi, iPendleRouterAdapterAbi, iSecuritizeOnRampAbi, iSecuritizeOnRampAdapterV310Abi, iSecuritizeRedemptionGatewayAdapterV311Abi, iSecuritizeRedemptionGatewayV311Abi, iStakingRewardsAbi, iStakingRewardsAdapterAbi, iTraderJoeRouterAbi, iTraderJoeRouterAdapterAbi, iUniswapV2AdapterAbi, iUniswapV2Router02Abi, iUniswapV3Abi, iUniswapV3AdapterAbi, iUniswapV4AdapterAbi, iUniswapV4GatewayAbi, iUpshiftVaultAdapterAbi, iUpshiftVaultGatewayAbi, iVelodromeV2RouterAbi, iVelodromeV2RouterAdapterAbi, iwstETHAbi, iwstEthv1AdapterAbi, lidoV1_WETHGatewayAbi, mellowDvvAdapterAbi, parseAdapterAction, parseAdapterDeployParams, parsePosNegAmount, rewardsFromTransfers, swapFromTransfers, toNetTransfers };
99
+ export { AbstractAdapterContract, AbstractAdapterContractOptions, AccountMigratorAdapterContract, AdapterContractStateHuman, AdapterContractType, AdapterFactoryArgs, AdapterProtocolOperation, AdapterType, BalancerSwap, BalancerV3Pool, BalancerV3PoolStatus, BalancerV3RouterAdapterContract, BalancerV3WrapperAdapterContract, BasicSwapCall, CamelotPool, CamelotV3AdapterContract, ConcreteAdapterContractOptions, ConvexDeposit, ConvexDepositAndStake, ConvexStake, ConvexV1BaseRewardPoolAdapterContract, ConvexV1BoosterAdapterContract, ConvexWithdraw, ConvexWithdrawAndClaim, Curve2AssetsAdapterContract, Curve3AssetsAdapterContract, Curve4AssetsAdapterContract, CurveAddLiquidity, CurveClaims, CurveExchange, CurveRemoveLiquidity, CurveRemoveLiquidityOneCoin, CurveV1AdapterStETHContract, CurveV1StableNGAdapterContract, CurveWithdrawal, DaiUsdsAdapterContract, DelayedWithdrawalClaim, DelayedWithdrawalRequest, ERC4626AdapterContract, ERC4626ReferralAdapterContract, FluidDexAdapterContract, GetReward, IAdapterContract, InfinifiGatewayAdapterContract, InfinifiUnwindingGatewayAdapterContract, KelpLRTDepositPoolAdapterContract, KelpLRTWithdrawalManagerAdapterContract, LegacyAdapterOperation, LidoSubmit, LidoV1AdapterContract, MakerDeposit, MakerRedeem, MellowClaimerAdapterContract, MellowDVVAdapterContract, MellowERC4626VaultAdapterContract, MellowWrapperAdapterContract, MidasGatewayAdapterContract, MidasIssuanceVaultAdapterContract, MidasRedemptionVaultAdapterContract, PendlePair, PendlePairStatus, PendleRouterAdapterContract, PendleTokenType, SecuritizeOnRampAdapterContract, SecuritizeRedemptionGatewayAdapterContract, StakingRewardsAdapterContract, Swap, TokenAmount, TokenTransfer, TraderJoePool, TraderJoePoolVersion, TraderJoeRouterAdapterContract, Transfers, TreehouseFastlaneAdapterContract, TreehouseRedemptionGatewayAdapterContract, TreehouseRouterAdapterContract, UniswapSwap, UniswapV2AdapterContract, UniswapV3AdapterContract, UniswapV4AdapterContract, UpshiftVaultAdapterContract, VaultDeposit, VelodromeV2RouterAdapterContract, VersionedAbi, WithdrawCollateral, WstETHUnwrap, WstETHV1AdapterContract, WstETHWrap, adapterActionAbi, adapterActionSelectors, adapterActionSignatures, adapterConstructorAbi, allTransfersAsTokenAmounts, classifyCurveOperation, createAdapter, curveAddLiquidityFromTransfers, curveRemoveLiquidityFromTransfers, erc4626ReferralAdapterAbi, fnSigToName, getAdapterActionAbi, getAdapterDeployParamsAbi, getAdapterType, hasAdapterDeployParamsAbi, iBalancerV3RouterAbi, iBalancerV3RouterAdapterAbi, iBalancerV3WrapperAbi, iBalancerV3WrapperAdapterAbi, iBaseOnRampAbi, iBaseRewardPoolAbi, iBoosterAbi, iCamelotV3AdapterAbi, iCamelotV3RouterAbi, iConvexV1BaseRewardPoolAdapterAbi, iConvexV1BoosterAdapterAbi, iCurvePoolAbi, iCurvePoolStableNGAbi, iCurvePool_2Abi, iCurvePool_3Abi, iCurvePool_4Abi, iCurveV1StableNgAdapterAbi, iCurveV1_2AssetsAdapterAbi, iCurveV1_3AssetsAdapterAbi, iCurveV1_4AssetsAdapterAbi, iDaiUsdsAbi, iDaiUsdsAdapterAbi, iERC4626Abi, iERC4626ReferralAbi, iFluidDexAbi, iFluidDexAdapterAbi, iInfinifiGatewayAbi, iInfinifiGatewayAdapterAbi, iInfinifiUnwindingGatewayAbi, iInfinifiUnwindingGatewayAdapterAbi, iKelpLRTDepositPoolGatewayAbi, iKelpLRTWithdrawalManagerGatewayAbi, iKelpLrtDepositPoolAdapterAbi, iKelpLrtDepositPoolGatewayAbi, iKelpLrtWithdrawalManagerAdapterAbi, iKelpLrtWithdrawalManagerGatewayAbi, iLidoV1AdapterAbi, iMellow4626VaultAdapterAbi, iMellowClaimerAbi, iMellowClaimerAdapterAbi, iMellowWrapperAbi, iMellowWrapperAdapterAbi, iMidasGatewayAdapterV311Abi, iMidasGatewayV311Abi, iMidasIssuanceVaultAdapterV310Abi, iMidasIssuanceVaultV310Abi, iMidasRedemptionVaultAdapterV310Abi, iMidasRedemptionVaultGatewayV310Abi, iPendleRouterAbi, iPendleRouterAdapterAbi, iSecuritizeOnRampAbi, iSecuritizeOnRampAdapterV310Abi, iSecuritizeRedemptionGatewayAdapterV311Abi, iSecuritizeRedemptionGatewayV311Abi, iStakingRewardsAbi, iStakingRewardsAdapterAbi, iTraderJoeRouterAbi, iTraderJoeRouterAdapterAbi, iTreehouseFastlaneAbi, iTreehouseFastlaneAdapterAbi, iTreehouseRedemptionGatewayAbi, iTreehouseRedemptionGatewayAdapterAbi, iTreehouseRouterAbi, iTreehouseRouterAdapterAbi, iUniswapV2AdapterAbi, iUniswapV2Router02Abi, iUniswapV3Abi, iUniswapV3AdapterAbi, iUniswapV4AdapterAbi, iUniswapV4GatewayAbi, iUpshiftVaultAdapterAbi, iUpshiftVaultGatewayAbi, iVelodromeV2RouterAbi, iVelodromeV2RouterAdapterAbi, iwstETHAbi, iwstEthv1AdapterAbi, lidoV1_WETHGatewayAbi, mellowDvvAdapterAbi, parseAdapterAction, parseAdapterDeployParams, parsePosNegAmount, rewardsFromTransfers, swapFromTransfers, toNetTransfers };
@@ -39,6 +39,9 @@ import { iSecuritizeOnRampAdapterV310Abi } from "./adapters/abi/adapters/iSecuri
39
39
  import { iSecuritizeRedemptionGatewayAdapterV311Abi } from "./adapters/abi/adapters/iSecuritizeRedemptionGatewayAdapterV311.js";
40
40
  import { iStakingRewardsAdapterAbi } from "./adapters/abi/adapters/iStakingRewardsAdapter.js";
41
41
  import { iTraderJoeRouterAdapterAbi } from "./adapters/abi/adapters/iTraderJoeRouterAdapter.js";
42
+ import { iTreehouseFastlaneAdapterAbi } from "./adapters/abi/adapters/iTreehouseFastlaneAdapter.js";
43
+ import { iTreehouseRedemptionGatewayAdapterAbi } from "./adapters/abi/adapters/iTreehouseRedemptionGatewayAdapter.js";
44
+ import { iTreehouseRouterAdapterAbi } from "./adapters/abi/adapters/iTreehouseRouterAdapter.js";
42
45
  import { iUniswapV2AdapterAbi } from "./adapters/abi/adapters/iUniswapV2Adapter.js";
43
46
  import { iUniswapV3AdapterAbi } from "./adapters/abi/adapters/iUniswapV3Adapter.js";
44
47
  import { iUniswapV4AdapterAbi, iUniswapV4GatewayAbi } from "./adapters/abi/adapters/iUniswapV4Adapter.js";
@@ -52,6 +55,9 @@ import { iBaseOnRampAbi } from "./adapters/abi/securitize/iBaseOnRamp.js";
52
55
  import { iSecuritizeOnRampAbi } from "./adapters/abi/securitize/iSecuritizeOnRamp.js";
53
56
  import { iSecuritizeRedemptionGatewayV311Abi } from "./adapters/abi/securitize/iSecuritizeRedemptionGatewayV311.js";
54
57
  import { iBalancerV3RouterAbi, iBalancerV3WrapperAbi, iBaseRewardPoolAbi, iBoosterAbi, iCamelotV3RouterAbi, iCurvePoolAbi, iCurvePoolStableNGAbi, iCurvePool_2Abi, iCurvePool_3Abi, iCurvePool_4Abi, iDaiUsdsAbi, iERC4626Abi, iERC4626ReferralAbi, iFluidDexAbi, iInfinifiGatewayAbi, iKelpLRTDepositPoolGatewayAbi, iKelpLRTWithdrawalManagerGatewayAbi, iMellowClaimerAbi, iMellowWrapperAbi, iMidasIssuanceVaultV310Abi, iPendleRouterAbi, iStakingRewardsAbi, iTraderJoeRouterAbi, iUniswapV2Router02Abi, iUniswapV3Abi, iVelodromeV2RouterAbi, iwstETHAbi, lidoV1_WETHGatewayAbi } from "./adapters/abi/targetContractAbi.js";
58
+ import { iTreehouseFastlaneAbi } from "./adapters/abi/treehouse/iTreehouseFastlane.js";
59
+ import { iTreehouseRedemptionGatewayAbi } from "./adapters/abi/treehouse/iTreehouseRedemptionGateway.js";
60
+ import { iTreehouseRouterAbi } from "./adapters/abi/treehouse/iTreehouseRouter.js";
55
61
  import { getAdapterActionAbi, getAdapterDeployParamsAbi, getAdapterType, hasAdapterDeployParamsAbi, parseAdapterAction, parseAdapterDeployParams } from "./adapters/abi/utils.js";
56
62
  import { BalancerSwap, BasicSwapCall, ConvexDeposit, ConvexDepositAndStake, ConvexStake, ConvexWithdraw, ConvexWithdrawAndClaim, CurveAddLiquidity, CurveClaims, CurveExchange, CurveRemoveLiquidity, CurveRemoveLiquidityOneCoin, CurveWithdrawal, GetReward, LegacyAdapterOperation, LidoSubmit, MakerDeposit, MakerRedeem, Swap, TokenAmount, Transfers, UniswapSwap, VaultDeposit, WithdrawCollateral, WstETHUnwrap, WstETHWrap } from "./adapters/legacyAdapterOperations.js";
57
63
  import { AbstractAdapterContract, AbstractAdapterContractOptions, ConcreteAdapterContractOptions } from "./adapters/contracts/AbstractAdapter.js";
@@ -87,6 +93,9 @@ import { SecuritizeOnRampAdapterContract } from "./adapters/contracts/Securitize
87
93
  import { SecuritizeRedemptionGatewayAdapterContract } from "./adapters/contracts/SecuritizeRedemptionGatewayAdapterContract.js";
88
94
  import { StakingRewardsAdapterContract } from "./adapters/contracts/StakingRewardsAdapterContract.js";
89
95
  import { TraderJoePool, TraderJoePoolVersion, TraderJoeRouterAdapterContract } from "./adapters/contracts/TraderJoeRouterAdapterContract.js";
96
+ import { TreehouseFastlaneAdapterContract } from "./adapters/contracts/TreehouseFastlaneAdapterContract.js";
97
+ import { TreehouseRedemptionGatewayAdapterContract } from "./adapters/contracts/TreehouseRedemptionGatewayAdapterContract.js";
98
+ import { TreehouseRouterAdapterContract } from "./adapters/contracts/TreehouseRouterAdapterContract.js";
90
99
  import { UniswapV2AdapterContract } from "./adapters/contracts/UniswapV2AdapterContract.js";
91
100
  import { UniswapV3AdapterContract } from "./adapters/contracts/UniswapV3AdapterContract.js";
92
101
  import { UniswapV4AdapterContract } from "./adapters/contracts/UniswapV4AdapterContract.js";
@@ -158,4 +167,4 @@ import "./zapper/index.js";
158
167
  import { MarketRegister, MarketRegistryState, MarketRegistryStateHuman } from "./MarketRegister.js";
159
168
  import { DEFAULT_QUOTA_BUFFER_BPS, MAX_LEVERAGE_BUFFER_BPS, OptimalPartialLiquidationAmounts, OptimalPartialLiquidationAmountsProps, PARTIAL_LIQUIDATION_BUFFER_BPS, QuotaMode, StrategyRateInputs, bpsToRay, calcBorrowApy, calcEffectiveBorrowApy, calcMaxLeverage, calcNetStrategyApy, calcPositionLeverage, calcQuotaRate, calcUtilization, calcUtilizationRaw, healthFactorBps, minSeizedAmount, optimalHFForPartialLiquidation, optimalPartialLiquidationAmounts, rayToBps, usdToNumber } from "./math.js";
160
169
  import { strategyName } from "./strategyName.js";
161
- export { AbstractAdapterContract, AbstractAdapterContractOptions, AbstractLPPriceFeedContract, AbstractPriceFeedContract, AccountMigratorAdapterContract, AdapterContractStateHuman, AdapterContractType, AdapterFactoryArgs, AdapterProtocolOperation, AdapterType, BalanceDelta, BalancerStablePriceFeedContract, BalancerSwap, BalancerV3Pool, BalancerV3PoolStatus, BalancerV3RouterAdapterContract, BalancerV3WrapperAdapterContract, BalancerWeightedPriceFeedContract, BasicSwapCall, BoundedPriceFeedContract, CamelotPool, CamelotV3AdapterContract, CompositePriceFeedContract, CompressorZapperData, ConcreteAdapterContractOptions, ConstantPriceFeedContract, ConvertFn, ConvexDeposit, ConvexDepositAndStake, ConvexStake, ConvexV1BaseRewardPoolAdapterContract, ConvexV1BoosterAdapterContract, ConvexWithdraw, ConvexWithdrawAndClaim, CreditAccountTokenQuota, CreditConfiguratorV310Contract, type abi as CreditFacadeV310Abi, abi as creditFacadeV310Abi, CreditFacadeV310BaseContract, CreditFacadeV310Contract, CreditManagerV310Contract, CreditSuite, CreditSuiteStrategy, Curve2AssetsAdapterContract, Curve3AssetsAdapterContract, Curve4AssetsAdapterContract, CurveAddLiquidity, CurveClaims, CurveCryptoPriceFeedContract, CurveExchange, CurveRemoveLiquidity, CurveRemoveLiquidityOneCoin, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, CurveV1AdapterStETHContract, CurveV1StableNGAdapterContract, CurveWithdrawal, DEFAULT_QUOTA_BUFFER_BPS, DEGEN_NFT_MIDAS, DEGEN_NFT_SECURITIZE, DStokenData, DaiUsdsAdapterContract, DelayedWithdrawalClaim, DelayedWithdrawalRequest, ERC4626AdapterContract, ERC4626ReferralAdapterContract, Erc4626PriceFeedContract, ExpectedBalanceDeltasProps, ExpectedOutput, ExternalPriceFeedContract, FluidDexAdapterContract, GaugeContract, GaugeParams, GetInvestorOptions, GetOpenAccountRequirementsProps, GetReward, IAdapterContract, ICreditConfiguratorContract, ICreditFacadeContract, ICreditManagerContract, IDegenNFT, IERC20ZapperContract, IETHZapperContract, IInterestRateModelContract, IPoolContract, IPriceFeedContract, IPriceOracleContract, type IPriceUpdateTask, type IPriceUpdater, IRWAFactory, IRateKeeperContract, type IUpdatablePriceFeedContract, IZapperContract, InfinifiGatewayAdapterContract, InfinifiUnwindingGatewayAdapterContract, InterestRateModelType, KelpLRTDepositPoolAdapterContract, KelpLRTWithdrawalManagerAdapterContract, type LatestUpdate, LegacyAdapterOperation, LidoSubmit, LidoV1AdapterContract, LinearInterestRateModelContract, LiquidationFees, MAX_LEVERAGE_BUFFER_BPS, MakerDeposit, MakerRedeem, MarketRegister, MarketRegistryState, MarketRegistryStateHuman, MarketSuite, MaxBorrowAmount, MellowClaimerAdapterContract, MellowDVVAdapterContract, MellowERC4626VaultAdapterContract, MellowLRTPriceFeedContract, MellowWrapperAdapterContract, MidasDegenNFT, MidasGatewayAdapterContract, MidasIssuanceVaultAdapterContract, MidasLiquidatorContract, MidasRedemptionVaultAdapterContract, OptimalPartialLiquidationAmounts, OptimalPartialLiquidationAmountsProps, PARTIAL_LIQUIDATION_BUFFER_BPS, PHANTOM_TOKEN_MIDAS_REDEMPTION, PHANTOM_TOKEN_SECURITIZE_REDEMPTION, ParsedZapperDeposit, ParsedZapperOperation, ParsedZapperRedeem, PartialPriceFeedInitError, PartialPriceFeedTreeNode, PendlePair, PendlePairStatus, PendleRouterAdapterContract, PendleTWAPPTPriceFeed, PendleTokenType, PoolQuotaKeeperContract, PoolSuite, PoolV310Contract, PrepareUpdateQuotasProps, PriceFeedConstructorArgs, PriceFeedContractType, PriceFeedRef, PriceFeedRegistry, PriceFeedUsageType, PriceFeedsForAccountOptions, PriceFeedsForTokensOptions, PriceOracleV310Contract, PriceUpdate, PriceUpdatesCache, PythPriceFeed, QuotaMode, QuotaSlice, RWACompressorCall, RWACompressorInvestorData, RWACompressorResponse, RWAFactoryData, RWAFactoryProtocol, RWAFactoryStateHuman, RWAInvestorData, RWARegistry, RWAState, RWAStateHuman, RWAUnderlyingData, RWA_COMPRESSOR_ADDRESS, RWA_LIQUIDATOR_MIDAS, RWA_LIQUIDATOR_SECURITIZE, RampEvent, RateKeeperType, RedstonePriceFeedContract, SecuritizeCreditAccountData, SecuritizeDegenNFT, SecuritizeInvestorData, SecuritizeLiquidatorContract, SecuritizeOnRampAdapterContract, SecuritizeRWAFactory, SecuritizeRWAFactoryStateHuman, SecuritizeRedemptionGatewayAdapterContract, StakingRewardsAdapterContract, StrategyCollateralProps, StrategyRateInputs, Swap, type TimestampedCalldata, TokenAmount, TokenTransfer, TraderJoePool, TraderJoePoolVersion, TraderJoeRouterAdapterContract, Transfers, UniswapSwap, UniswapV2AdapterContract, UniswapV3AdapterContract, UniswapV4AdapterContract, UpdatablePriceFeedRegistry, type UpdatablePriceFeedRegistryHooks, type UpdatePriceFeedsResult, UpshiftVaultAdapterContract, VaultDeposit, VelodromeV2RouterAdapterContract, VersionedAbi, WithdrawCollateral, WstETHPriceFeedContract, WstETHUnwrap, WstETHV1AdapterContract, WstETHWrap, YearnPriceFeedContract, ZapperContract, ZapperData, ZeroPriceFeedContract, adapterActionAbi, adapterActionSelectors, adapterActionSignatures, adapterConstructorAbi, allTransfersAsTokenAmounts, bpsToRay, calcBorrowApy, calcEffectiveBorrowApy, calcMaxLeverage, calcNetStrategyApy, calcPositionLeverage, calcQuotaRate, calcUtilization, calcUtilizationRaw, classifyCurveOperation, collateralPriceInUnderlying, createAdapter, createPriceOracle, createZapper, curveAddLiquidityFromTransfers, curveRemoveLiquidityFromTransfers, dominantCollateral, erc4626ReferralAdapterAbi, expectedBalanceDeltas, fnSigToName, getAdapterActionAbi, getAdapterDeployParamsAbi, getAdapterType, getRawPriceUpdates, hasAdapterDeployParamsAbi, healthFactorBps, iBalancerV3RouterAbi, iBalancerV3RouterAdapterAbi, iBalancerV3WrapperAbi, iBalancerV3WrapperAdapterAbi, iBaseOnRampAbi, iBaseRewardPoolAbi, iBoosterAbi, iCamelotV3AdapterAbi, iCamelotV3RouterAbi, iConvexV1BaseRewardPoolAdapterAbi, iConvexV1BoosterAdapterAbi, iCurvePoolAbi, iCurvePoolStableNGAbi, iCurvePool_2Abi, iCurvePool_3Abi, iCurvePool_4Abi, iCurveV1StableNgAdapterAbi, iCurveV1_2AssetsAdapterAbi, iCurveV1_3AssetsAdapterAbi, iCurveV1_4AssetsAdapterAbi, iDaiUsdsAbi, iDaiUsdsAdapterAbi, iERC4626Abi, iERC4626ReferralAbi, iFluidDexAbi, iFluidDexAdapterAbi, iInfinifiGatewayAbi, iInfinifiGatewayAdapterAbi, iInfinifiUnwindingGatewayAbi, iInfinifiUnwindingGatewayAdapterAbi, iKelpLRTDepositPoolGatewayAbi, iKelpLRTWithdrawalManagerGatewayAbi, iKelpLrtDepositPoolAdapterAbi, iKelpLrtDepositPoolGatewayAbi, iKelpLrtWithdrawalManagerAdapterAbi, iKelpLrtWithdrawalManagerGatewayAbi, iLidoV1AdapterAbi, iMellow4626VaultAdapterAbi, iMellowClaimerAbi, iMellowClaimerAdapterAbi, iMellowWrapperAbi, iMellowWrapperAdapterAbi, iMidasGatewayAdapterV311Abi, iMidasGatewayV311Abi, iMidasIssuanceVaultAdapterV310Abi, iMidasIssuanceVaultV310Abi, iMidasRedemptionVaultAdapterV310Abi, iMidasRedemptionVaultGatewayV310Abi, iPendleRouterAbi, iPendleRouterAdapterAbi, iSecuritizeOnRampAbi, iSecuritizeOnRampAdapterV310Abi, iSecuritizeRedemptionGatewayAdapterV311Abi, iSecuritizeRedemptionGatewayV311Abi, iStakingRewardsAbi, iStakingRewardsAdapterAbi, iTraderJoeRouterAbi, iTraderJoeRouterAdapterAbi, iUniswapV2AdapterAbi, iUniswapV2Router02Abi, iUniswapV3Abi, iUniswapV3AdapterAbi, iUniswapV4AdapterAbi, iUniswapV4GatewayAbi, iUpshiftVaultAdapterAbi, iUpshiftVaultGatewayAbi, iVelodromeV2RouterAbi, iVelodromeV2RouterAdapterAbi, isLPPriceFeed, isRWAFactory, isStrategyCollateral, isUpdatablePriceFeed, iwstETHAbi, iwstEthv1AdapterAbi, lidoV1_WETHGatewayAbi, mellowDvvAdapterAbi, minSeizedAmount, optimalHFForPartialLiquidation, optimalPartialLiquidationAmounts, parseAdapterAction, parseAdapterDeployParams, parsePosNegAmount, pickStrategyTargetCollateral, rayToBps, rewardsFromTransfers, strategyName, swapFromTransfers, toNetTransfers, updatableDependencies, usdToNumber };
170
+ export { AbstractAdapterContract, AbstractAdapterContractOptions, AbstractLPPriceFeedContract, AbstractPriceFeedContract, AccountMigratorAdapterContract, AdapterContractStateHuman, AdapterContractType, AdapterFactoryArgs, AdapterProtocolOperation, AdapterType, BalanceDelta, BalancerStablePriceFeedContract, BalancerSwap, BalancerV3Pool, BalancerV3PoolStatus, BalancerV3RouterAdapterContract, BalancerV3WrapperAdapterContract, BalancerWeightedPriceFeedContract, BasicSwapCall, BoundedPriceFeedContract, CamelotPool, CamelotV3AdapterContract, CompositePriceFeedContract, CompressorZapperData, ConcreteAdapterContractOptions, ConstantPriceFeedContract, ConvertFn, ConvexDeposit, ConvexDepositAndStake, ConvexStake, ConvexV1BaseRewardPoolAdapterContract, ConvexV1BoosterAdapterContract, ConvexWithdraw, ConvexWithdrawAndClaim, CreditAccountTokenQuota, CreditConfiguratorV310Contract, type abi as CreditFacadeV310Abi, abi as creditFacadeV310Abi, CreditFacadeV310BaseContract, CreditFacadeV310Contract, CreditManagerV310Contract, CreditSuite, CreditSuiteStrategy, Curve2AssetsAdapterContract, Curve3AssetsAdapterContract, Curve4AssetsAdapterContract, CurveAddLiquidity, CurveClaims, CurveCryptoPriceFeedContract, CurveExchange, CurveRemoveLiquidity, CurveRemoveLiquidityOneCoin, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, CurveV1AdapterStETHContract, CurveV1StableNGAdapterContract, CurveWithdrawal, DEFAULT_QUOTA_BUFFER_BPS, DEGEN_NFT_MIDAS, DEGEN_NFT_SECURITIZE, DStokenData, DaiUsdsAdapterContract, DelayedWithdrawalClaim, DelayedWithdrawalRequest, ERC4626AdapterContract, ERC4626ReferralAdapterContract, Erc4626PriceFeedContract, ExpectedBalanceDeltasProps, ExpectedOutput, ExternalPriceFeedContract, FluidDexAdapterContract, GaugeContract, GaugeParams, GetInvestorOptions, GetOpenAccountRequirementsProps, GetReward, IAdapterContract, ICreditConfiguratorContract, ICreditFacadeContract, ICreditManagerContract, IDegenNFT, IERC20ZapperContract, IETHZapperContract, IInterestRateModelContract, IPoolContract, IPriceFeedContract, IPriceOracleContract, type IPriceUpdateTask, type IPriceUpdater, IRWAFactory, IRateKeeperContract, type IUpdatablePriceFeedContract, IZapperContract, InfinifiGatewayAdapterContract, InfinifiUnwindingGatewayAdapterContract, InterestRateModelType, KelpLRTDepositPoolAdapterContract, KelpLRTWithdrawalManagerAdapterContract, type LatestUpdate, LegacyAdapterOperation, LidoSubmit, LidoV1AdapterContract, LinearInterestRateModelContract, LiquidationFees, MAX_LEVERAGE_BUFFER_BPS, MakerDeposit, MakerRedeem, MarketRegister, MarketRegistryState, MarketRegistryStateHuman, MarketSuite, MaxBorrowAmount, MellowClaimerAdapterContract, MellowDVVAdapterContract, MellowERC4626VaultAdapterContract, MellowLRTPriceFeedContract, MellowWrapperAdapterContract, MidasDegenNFT, MidasGatewayAdapterContract, MidasIssuanceVaultAdapterContract, MidasLiquidatorContract, MidasRedemptionVaultAdapterContract, OptimalPartialLiquidationAmounts, OptimalPartialLiquidationAmountsProps, PARTIAL_LIQUIDATION_BUFFER_BPS, PHANTOM_TOKEN_MIDAS_REDEMPTION, PHANTOM_TOKEN_SECURITIZE_REDEMPTION, ParsedZapperDeposit, ParsedZapperOperation, ParsedZapperRedeem, PartialPriceFeedInitError, PartialPriceFeedTreeNode, PendlePair, PendlePairStatus, PendleRouterAdapterContract, PendleTWAPPTPriceFeed, PendleTokenType, PoolQuotaKeeperContract, PoolSuite, PoolV310Contract, PrepareUpdateQuotasProps, PriceFeedConstructorArgs, PriceFeedContractType, PriceFeedRef, PriceFeedRegistry, PriceFeedUsageType, PriceFeedsForAccountOptions, PriceFeedsForTokensOptions, PriceOracleV310Contract, PriceUpdate, PriceUpdatesCache, PythPriceFeed, QuotaMode, QuotaSlice, RWACompressorCall, RWACompressorInvestorData, RWACompressorResponse, RWAFactoryData, RWAFactoryProtocol, RWAFactoryStateHuman, RWAInvestorData, RWARegistry, RWAState, RWAStateHuman, RWAUnderlyingData, RWA_COMPRESSOR_ADDRESS, RWA_LIQUIDATOR_MIDAS, RWA_LIQUIDATOR_SECURITIZE, RampEvent, RateKeeperType, RedstonePriceFeedContract, SecuritizeCreditAccountData, SecuritizeDegenNFT, SecuritizeInvestorData, SecuritizeLiquidatorContract, SecuritizeOnRampAdapterContract, SecuritizeRWAFactory, SecuritizeRWAFactoryStateHuman, SecuritizeRedemptionGatewayAdapterContract, StakingRewardsAdapterContract, StrategyCollateralProps, StrategyRateInputs, Swap, type TimestampedCalldata, TokenAmount, TokenTransfer, TraderJoePool, TraderJoePoolVersion, TraderJoeRouterAdapterContract, Transfers, TreehouseFastlaneAdapterContract, TreehouseRedemptionGatewayAdapterContract, TreehouseRouterAdapterContract, UniswapSwap, UniswapV2AdapterContract, UniswapV3AdapterContract, UniswapV4AdapterContract, UpdatablePriceFeedRegistry, type UpdatablePriceFeedRegistryHooks, type UpdatePriceFeedsResult, UpshiftVaultAdapterContract, VaultDeposit, VelodromeV2RouterAdapterContract, VersionedAbi, WithdrawCollateral, WstETHPriceFeedContract, WstETHUnwrap, WstETHV1AdapterContract, WstETHWrap, YearnPriceFeedContract, ZapperContract, ZapperData, ZeroPriceFeedContract, adapterActionAbi, adapterActionSelectors, adapterActionSignatures, adapterConstructorAbi, allTransfersAsTokenAmounts, bpsToRay, calcBorrowApy, calcEffectiveBorrowApy, calcMaxLeverage, calcNetStrategyApy, calcPositionLeverage, calcQuotaRate, calcUtilization, calcUtilizationRaw, classifyCurveOperation, collateralPriceInUnderlying, createAdapter, createPriceOracle, createZapper, curveAddLiquidityFromTransfers, curveRemoveLiquidityFromTransfers, dominantCollateral, erc4626ReferralAdapterAbi, expectedBalanceDeltas, fnSigToName, getAdapterActionAbi, getAdapterDeployParamsAbi, getAdapterType, getRawPriceUpdates, hasAdapterDeployParamsAbi, healthFactorBps, iBalancerV3RouterAbi, iBalancerV3RouterAdapterAbi, iBalancerV3WrapperAbi, iBalancerV3WrapperAdapterAbi, iBaseOnRampAbi, iBaseRewardPoolAbi, iBoosterAbi, iCamelotV3AdapterAbi, iCamelotV3RouterAbi, iConvexV1BaseRewardPoolAdapterAbi, iConvexV1BoosterAdapterAbi, iCurvePoolAbi, iCurvePoolStableNGAbi, iCurvePool_2Abi, iCurvePool_3Abi, iCurvePool_4Abi, iCurveV1StableNgAdapterAbi, iCurveV1_2AssetsAdapterAbi, iCurveV1_3AssetsAdapterAbi, iCurveV1_4AssetsAdapterAbi, iDaiUsdsAbi, iDaiUsdsAdapterAbi, iERC4626Abi, iERC4626ReferralAbi, iFluidDexAbi, iFluidDexAdapterAbi, iInfinifiGatewayAbi, iInfinifiGatewayAdapterAbi, iInfinifiUnwindingGatewayAbi, iInfinifiUnwindingGatewayAdapterAbi, iKelpLRTDepositPoolGatewayAbi, iKelpLRTWithdrawalManagerGatewayAbi, iKelpLrtDepositPoolAdapterAbi, iKelpLrtDepositPoolGatewayAbi, iKelpLrtWithdrawalManagerAdapterAbi, iKelpLrtWithdrawalManagerGatewayAbi, iLidoV1AdapterAbi, iMellow4626VaultAdapterAbi, iMellowClaimerAbi, iMellowClaimerAdapterAbi, iMellowWrapperAbi, iMellowWrapperAdapterAbi, iMidasGatewayAdapterV311Abi, iMidasGatewayV311Abi, iMidasIssuanceVaultAdapterV310Abi, iMidasIssuanceVaultV310Abi, iMidasRedemptionVaultAdapterV310Abi, iMidasRedemptionVaultGatewayV310Abi, iPendleRouterAbi, iPendleRouterAdapterAbi, iSecuritizeOnRampAbi, iSecuritizeOnRampAdapterV310Abi, iSecuritizeRedemptionGatewayAdapterV311Abi, iSecuritizeRedemptionGatewayV311Abi, iStakingRewardsAbi, iStakingRewardsAdapterAbi, iTraderJoeRouterAbi, iTraderJoeRouterAdapterAbi, iTreehouseFastlaneAbi, iTreehouseFastlaneAdapterAbi, iTreehouseRedemptionGatewayAbi, iTreehouseRedemptionGatewayAdapterAbi, iTreehouseRouterAbi, iTreehouseRouterAdapterAbi, iUniswapV2AdapterAbi, iUniswapV2Router02Abi, iUniswapV3Abi, iUniswapV3AdapterAbi, iUniswapV4AdapterAbi, iUniswapV4GatewayAbi, iUpshiftVaultAdapterAbi, iUpshiftVaultGatewayAbi, iVelodromeV2RouterAbi, iVelodromeV2RouterAdapterAbi, isLPPriceFeed, isRWAFactory, isStrategyCollateral, isUpdatablePriceFeed, iwstETHAbi, iwstEthv1AdapterAbi, lidoV1_WETHGatewayAbi, mellowDvvAdapterAbi, minSeizedAmount, optimalHFForPartialLiquidation, optimalPartialLiquidationAmounts, parseAdapterAction, parseAdapterDeployParams, parsePosNegAmount, pickStrategyTargetCollateral, rayToBps, rewardsFromTransfers, strategyName, swapFromTransfers, toNetTransfers, updatableDependencies, usdToNumber };
@@ -5,7 +5,9 @@ import { AttachChainsArgs, ChainScope, ChainSummaryArgs, PermissionlessChain, Pe
5
5
  import { ChainsNamespace } from "./chains/ChainsNamespace.js";
6
6
  import { DeployArgs, DeployContractArgs, DeployPriceFeedArgs, PreparedDeployment, PreparedPriceFeedDeployment } from "./deploy/types.js";
7
7
  import { DEFAULT_DEPLOY_SALT, PermissionlessDeploy, priceFeedSalt } from "./deploy/PermissionlessDeploy.js";
8
- import { AssetArgs, GetPricesArgs, PermissionlessAsset, PermissionlessAssetDetails, PermissionlessAssetMarket, PermissionlessAssetMarketFeed, PermissionlessAssetPrices, PermissionlessPriceFeedAsset, PermissionlessPriceFeedDetails, PermissionlessPriceFeedMarket, PermissionlessPriceFeedMarketCaps, PermissionlessPriceFeedStore, PermissionlessPrices, PriceFeedArgs } from "./oracles/types.js";
8
+ import { AssetScore, AssetScoresArgs, FeedPairScore, FeedPairScoreArgs, GroupImpact, MarketScore, ScoredFeed } from "./oracles/score/types.js";
9
+ import { BreakingPoint, FeedOutcome, GroupReport, GroupScenarioOutcome, SlotOutcome, StressReport, StressScenario, StressSource, StressSourceKind, StressTestArgs } from "./oracles/stress/types.js";
10
+ import { AssetArgs, AssetCap, AssetsArgs, FeedCap, MarketCap, PermissionlessAsset, PermissionlessAssetDetails, PermissionlessAssetMarket, PermissionlessAssetMarketFeed, PermissionlessAssetQuota, PermissionlessAssetSummary, PermissionlessIndexedAssetDetails, PermissionlessIndexedAssetSummary, PermissionlessIndexedPriceFeedDetails, PermissionlessIndexedPriceFeedMarket, PermissionlessMarket, PermissionlessMarketSlot, PermissionlessPriceFeedAsset, PermissionlessPriceFeedDetails, PermissionlessPriceFeedMarket, PermissionlessPriceFeedStore, PermissionlessQuotaTotals, PriceFeedArgs, PriceFeedDecimals, PriceFeedPrice, PriceFeedRef } from "./oracles/types.js";
9
11
  import { GET_PRICES_CHUNK_SIZE, GET_PRICES_GAS_LIMIT_BY_CHAIN_ID, PermissionlessOracles } from "./oracles/PermissionlessOracles.js";
10
12
  import { AddFeedsArgs, ChangeNamesArgs, ChangeStalenessPeriodsArgs, ForbidFeedsArgs, InstanceTxsArgs, PriceFeedPair } from "./transactions/types.js";
11
13
  import { InstanceOwnerTransactions } from "./transactions/InstanceOwnerTransactions.js";
@@ -15,6 +17,12 @@ import "./chains/index.js";
15
17
  import { deriveEffectiveStalenessPeriod } from "./deploy/effective-staleness.js";
16
18
  import "./deploy/index.js";
17
19
  import { PermissionlessChainUnreachableError, PermissionlessNotAttachedError, PriceFeedNotInStoreError, PriceFeedSaltMissingError, PriceFeedStalenessUnknownError } from "./errors.js";
20
+ import { SCORE_MULTIPLIER, factorOf, finalPrice, scoreOfFactor, worstOf } from "./oracles/score/formula.js";
21
+ import { runAssetScores, runFeedPairScore } from "./oracles/score/run.js";
22
+ import { TreeNode, classifySources, sourcesByFeed } from "./oracles/stress/classify.js";
23
+ import { UNBOUNDED_DOWN, UNBOUNDED_UP, groupOverride, perturb, rateStub, roundDataStub } from "./oracles/stress/override.js";
24
+ import { DEFAULT_SCENARIOS, RATE_FEED_TYPE, readFeedTrees, readForest, readRateTargets, readUnder, runStressTest } from "./oracles/stress/run.js";
25
+ import { scoreGroup, slotHarm, verdictOf } from "./oracles/stress/score.js";
18
26
  import "./oracles/index.js";
19
27
  import "./transactions/index.js";
20
- export { AddFeedsArgs, AssetArgs, AttachChainsArgs, ChainScope, ChainSummaryArgs, ChainsNamespace, ChangeNamesArgs, ChangeStalenessPeriodsArgs, DEFAULT_DEPLOY_SALT, DeployArgs, DeployContractArgs, DeployPriceFeedArgs, ForbidFeedsArgs, GET_PRICES_CHUNK_SIZE, GET_PRICES_GAS_LIMIT_BY_CHAIN_ID, GearboxPermissionless, GearboxPermissionlessOptions, GetPricesArgs, InstanceOwnerTransactions, InstanceTxsArgs, PermissionlessAnalytics, PermissionlessAsset, PermissionlessAssetDetails, PermissionlessAssetMarket, PermissionlessAssetMarketFeed, PermissionlessAssetPrices, PermissionlessChain, PermissionlessChainSummary, PermissionlessChainUnreachableError, PermissionlessDeploy, PermissionlessNotAttachedError, PermissionlessOracles, PermissionlessPriceFeedAsset, PermissionlessPriceFeedDetails, PermissionlessPriceFeedMarket, PermissionlessPriceFeedMarketCaps, PermissionlessPriceFeedStore, PermissionlessPrices, PreparedDeployment, PreparedPriceFeedDeployment, PriceChartArgs, PriceFeedArgs, PriceFeedChartPoint, PriceFeedNotInStoreError, PriceFeedPair, PriceFeedPriceChart, PriceFeedSaltMissingError, PriceFeedStalenessUnknownError, deriveEffectiveStalenessPeriod, priceFeedSalt };
28
+ export { AddFeedsArgs, AssetArgs, AssetCap, AssetScore, AssetScoresArgs, AssetsArgs, AttachChainsArgs, BreakingPoint, ChainScope, ChainSummaryArgs, ChainsNamespace, ChangeNamesArgs, ChangeStalenessPeriodsArgs, DEFAULT_DEPLOY_SALT, DEFAULT_SCENARIOS, DeployArgs, DeployContractArgs, DeployPriceFeedArgs, FeedCap, FeedOutcome, FeedPairScore, FeedPairScoreArgs, ForbidFeedsArgs, GET_PRICES_CHUNK_SIZE, GET_PRICES_GAS_LIMIT_BY_CHAIN_ID, GearboxPermissionless, GearboxPermissionlessOptions, GroupImpact, GroupReport, GroupScenarioOutcome, InstanceOwnerTransactions, InstanceTxsArgs, MarketCap, MarketScore, PermissionlessAnalytics, PermissionlessAsset, PermissionlessAssetDetails, PermissionlessAssetMarket, PermissionlessAssetMarketFeed, PermissionlessAssetQuota, PermissionlessAssetSummary, PermissionlessChain, PermissionlessChainSummary, PermissionlessChainUnreachableError, PermissionlessDeploy, PermissionlessIndexedAssetDetails, PermissionlessIndexedAssetSummary, PermissionlessIndexedPriceFeedDetails, PermissionlessIndexedPriceFeedMarket, PermissionlessMarket, PermissionlessMarketSlot, PermissionlessNotAttachedError, PermissionlessOracles, PermissionlessPriceFeedAsset, PermissionlessPriceFeedDetails, PermissionlessPriceFeedMarket, PermissionlessPriceFeedStore, PermissionlessQuotaTotals, PreparedDeployment, PreparedPriceFeedDeployment, PriceChartArgs, PriceFeedArgs, PriceFeedChartPoint, PriceFeedDecimals, PriceFeedNotInStoreError, PriceFeedPair, PriceFeedPrice, PriceFeedPriceChart, PriceFeedRef, PriceFeedSaltMissingError, PriceFeedStalenessUnknownError, RATE_FEED_TYPE, SCORE_MULTIPLIER, ScoredFeed, SlotOutcome, StressReport, StressScenario, StressSource, StressSourceKind, StressTestArgs, TreeNode, UNBOUNDED_DOWN, UNBOUNDED_UP, classifySources, deriveEffectiveStalenessPeriod, factorOf, finalPrice, groupOverride, perturb, priceFeedSalt, rateStub, readFeedTrees, readForest, readRateTargets, readUnder, roundDataStub, runAssetScores, runFeedPairScore, runStressTest, scoreGroup, scoreOfFactor, slotHarm, sourcesByFeed, verdictOf, worstOf };
@@ -2,8 +2,9 @@ import { PriceFeedData } from "../../../model/opportunities.js";
2
2
  import { AbstractOffchainNamespace } from "../../../offchain/AbstractOffchainNamespace.js";
3
3
  import { GearboxPermissionlessOptions } from "../types.js";
4
4
  import { ChainsNamespace } from "../chains/ChainsNamespace.js";
5
- import { AssetArgs, GetPricesArgs, PermissionlessAssetDetails, PermissionlessAssetPrices, PermissionlessPriceFeedDetails, PermissionlessPriceFeedMarketCaps, PermissionlessPriceFeedStore, PermissionlessPrices, PriceFeedArgs } from "./types.js";
6
- import { Address } from "viem";
5
+ import { AssetScore, AssetScoresArgs, FeedPairScore, FeedPairScoreArgs } from "./score/types.js";
6
+ import { StressReport, StressTestArgs } from "./stress/types.js";
7
+ import { AssetArgs, AssetCap, AssetsArgs, FeedCap, MarketCap, PermissionlessAssetDetails, PermissionlessAssetSummary, PermissionlessMarketSlot, PermissionlessPriceFeedDetails, PermissionlessPriceFeedStore, PriceFeedArgs, PriceFeedDecimals, PriceFeedPrice, PriceFeedRef } from "./types.js";
7
8
  //#region src/permissionless/api/oracles/PermissionlessOracles.d.ts
8
9
  export declare const GET_PRICES_GAS_LIMIT_BY_CHAIN_ID: Record<number, bigint>;
9
10
  export declare const GET_PRICES_CHUNK_SIZE = 200;
@@ -13,9 +14,17 @@ export declare const GET_PRICES_CHUNK_SIZE = 200;
13
14
  *
14
15
  * ```ts
15
16
  * const store = await permissionless.oracles.store({ chainId: 1 });
16
- * const { prices } = await permissionless.oracles.prices({ chainId: 1 });
17
+ * const prices = await permissionless.oracles.getPrices(
18
+ * store.priceFeeds.map(({ address }) => ({ chainId: 1, address })),
19
+ * );
17
20
  * ```
18
21
  *
22
+ * The backend answers what it has indexed; anything that is only true at a
23
+ * block — a price, a market cap, a quota in one currency, the period an
24
+ * oracle holds for a slot — is read here, off the chain, and folded into what
25
+ * it answered. That is why these reads mix a request with a multicall rather
26
+ * than being either one.
27
+ *
19
28
  * Read-only. What the store carries is decided on chain, so putting a feed
20
29
  * there is a batch the instance owner executes — see
21
30
  * {@link InstanceOwnerTransactions} — not a row a client writes here.
@@ -25,10 +34,52 @@ export declare class PermissionlessOracles extends AbstractOffchainNamespace {
25
34
  constructor(options: GearboxPermissionlessOptions, chains: ChainsNamespace);
26
35
  /**
27
36
  * The store with the assets and feeds of one chain.
37
+ *
38
+ * {@link stores} narrowed to one and unwrapped, which is the whole of it:
39
+ * there is one route either way, and a chain the backend does not serve has
40
+ * no store to answer with rather than an empty one.
41
+ *
42
+ * @throws When the backend serves no store for the chain.
28
43
  **/
29
44
  store({ chainId }: {
30
45
  chainId: number;
31
46
  }): Promise<PermissionlessPriceFeedStore>;
47
+ /**
48
+ * The same stores for every chain the backend serves.
49
+ *
50
+ * One request rather than {@link store} per chain, which is what a page
51
+ * showing all of them would otherwise do: the backend assembles them in the
52
+ * same few queries it assembles one in, so the chains cost little more than
53
+ * the largest of them.
54
+ *
55
+ * Each entry names its own chain, so a store is never attributed by
56
+ * position. `chainId` narrows it to one, for a caller that wants the list
57
+ * shape either way.
58
+ *
59
+ * ```ts
60
+ * const stores = await permissionless.oracles.stores();
61
+ * ```
62
+ **/
63
+ stores({ chainId }?: AssetsArgs): Promise<PermissionlessPriceFeedStore[]>;
64
+ /**
65
+ * Every market slot in force, with the feed holding it and what the market
66
+ * has riding on it.
67
+ *
68
+ * The chain's whole slot table, which {@link feed} and {@link asset} answer
69
+ * one subject's slice of. What reads it this way is analysis over every
70
+ * market at once — which feed holds which slot, and what breaks if it
71
+ * lies — and asking a feed at a time would be a few hundred requests for
72
+ * the same rows.
73
+ *
74
+ * Served as indexed, with nothing folded in: the quotas are in each
75
+ * market's own underlying, as everywhere else, and pricing them is
76
+ * {@link getPrices} over the `underlyingPriceFeed` column.
77
+ *
78
+ * ```ts
79
+ * const slots = await permissionless.oracles.slots({ chainId: 1 });
80
+ * ```
81
+ **/
82
+ slots({ chainId }?: AssetsArgs): Promise<PermissionlessMarketSlot[]>;
32
83
  /**
33
84
  * One feed of the store: what it is, which assets it may price, and which
34
85
  * market slots it currently fills.
@@ -44,8 +95,18 @@ export declare class PermissionlessOracles extends AbstractOffchainNamespace {
44
95
  * });
45
96
  * ```
46
97
  *
47
- * @throws When the store does not carry the feed. A private draft is not
48
- * here — it lives in whichever app wrote it.
98
+ * Each market row also carries the staleness period that market's own
99
+ * oracle holds for the slot, read off the chain here — see
100
+ * {@link PermissionlessPriceFeedMarket.marketStalenessPeriod}.
101
+ *
102
+ * A feed the store does not carry is read off the chain instead, through
103
+ * the PriceFeedCompressor, and answered with `inStore: false`: its type,
104
+ * version and description are the chain's, while what only the store knows
105
+ * — who deployed it, its staleness period, the assets it may price and the
106
+ * markets it fills — is answered as unknown or empty.
107
+ *
108
+ * @throws When neither the store nor the chain knows the feed. A private
109
+ * draft is not here — it lives in whichever app wrote it.
49
110
  **/
50
111
  feed({ chainId, address }: PriceFeedArgs): Promise<PermissionlessPriceFeedDetails>;
51
112
  /**
@@ -62,29 +123,129 @@ export declare class PermissionlessOracles extends AbstractOffchainNamespace {
62
123
  * await permissionless.oracles.asset({ chainId: 1, address: token });
63
124
  * ```
64
125
  *
126
+ * The quota totals are worked out here, over the very market rows this
127
+ * answers with — see {@link PermissionlessQuotaTotals}.
128
+ *
65
129
  * @throws When the chain has no metadata for the address. An asset nothing
66
130
  * was indexed for has no symbol or decimals, so there is no row to answer.
67
131
  **/
68
132
  asset({ chainId, address }: AssetArgs): Promise<PermissionlessAssetDetails>;
69
133
  /**
70
- * What each of one asset's feeds prices it at, and the market cap each of
71
- * them implies.
134
+ * Every asset the store carries, with what its markets make of it.
72
135
  *
73
- * The asset-side counterpart of {@link feedMarketCaps}, and priced the same
74
- * way: one `totalSupply` read for the asset and one price per feed, rather
75
- * than the chain-wide pass {@link prices} makes.
136
+ * Enough on its own to render a list of assets: the alternative is the
137
+ * store's whole read for the names plus a call per row for the quotas, and
138
+ * this is one request either way you scope it.
76
139
  *
77
- * Several feeds for one asset do not have to agree — that is the point of
78
- * having a reserve feed — so this answers per feed rather than picking one.
140
+ * Ordered by how central each asset is — the markets it underlies first,
141
+ * then what is quoted against it, then what it is allowed — so a consumer
142
+ * renders the rows as they arrive. Omit `chainId` for every chain the
143
+ * backend serves, ordered the same way across all of them.
144
+ *
145
+ * Each row also carries its quota totals and what this SDK's tables say the
146
+ * asset is, neither of which is served — see
147
+ * {@link PermissionlessAssetSummary}. The totals are what the last two terms
148
+ * of the order are over, so this waits for them rather than handing back a
149
+ * list that would reshuffle a moment later.
79
150
  *
80
151
  * ```ts
81
- * const { prices, marketCaps } = await permissionless.oracles.assetPrices({
152
+ * const assets = await permissionless.oracles.assets({ chainId: 1 });
153
+ * const everywhere = await permissionless.oracles.assets();
154
+ * ```
155
+ **/
156
+ assets({ chainId }?: AssetsArgs): Promise<PermissionlessAssetSummary[]>;
157
+ /**
158
+ * What each source of price information can do to the chain's markets if it
159
+ * lies.
160
+ *
161
+ * The feeds under a chain's oracles are partitioned by where their numbers
162
+ * actually come from — Chainlink, Redstone, Pyth, Lido, Curve, each vault's
163
+ * own issuer — on the grounds that a source fails as a whole: whoever
164
+ * trusts one Chainlink aggregator trusts the operator behind all of them.
165
+ * Each group is then made to report a multiple of what it reports now, and
166
+ * every feed the markets read is read again inside that same call.
167
+ *
168
+ * No fork and no harness. The lie is a state override on an `eth_call`, so
169
+ * the composite feeds above it, their bounds and the oracle's own checks all
170
+ * run as deployed, against real state, at the current block — what comes
171
+ * back is what the market would have read.
172
+ *
173
+ * Each slot is scored by how its collateral moved *against its market's own
174
+ * underlying*, because that is what an account is valued by: a group that
175
+ * moves both legs has moved nothing. Beyond the two unbounded ends, each
176
+ * group is bisected for the multiple at which something first breaks, which
177
+ * is the figure that separates a source held in check by a bound from one
178
+ * nothing is checking.
179
+ *
180
+ * ```ts
181
+ * const report = await permissionless.oracles.stressTest({ chainId: 1 });
182
+ * for (const group of report.groups) {
183
+ * console.log(group.verdict);
184
+ * }
185
+ * ```
186
+ *
187
+ * Report {@link StressReport.unidentifiedUsd} alongside anything taken from
188
+ * this: it is the quota priced through a source the partition could only
189
+ * name after its own description, and nothing says what that fails with.
190
+ *
191
+ * Reads the chain directly, so the client has to have attached — see
192
+ * {@link GearboxPermissionless.attach}. Costs one request for the slots and
193
+ * then, per group, one `eth_call` per scenario plus the bisection's; a whole
194
+ * chain comes to a minute or so, and `thresholds: false` cuts it to seconds.
195
+ *
196
+ * @throws When the client has not attached, when the chain has no client
197
+ * configured, or when no PriceFeedCompressor is deployed on it — none of the
198
+ * three leaves anything to simulate.
199
+ **/
200
+ /**
201
+ * Every asset's manipulation resistance: how far, from 1 to 10 times, a
202
+ * lying source can push the price its markets hold for it.
203
+ *
204
+ * Each source group behind an asset's feeds — Chainlink, Redstone, Lido and
205
+ * so on — is made in turn to answer ten times what it answers now, and a
206
+ * market scores by how far that moves its final price, `min(main,
207
+ * reserve)`, as a multiple either way: 1 for not at all, 1.04 for 4%, 10
208
+ * for the whole lie. A group under which the price stops answering moves
209
+ * nothing and is listed rather than scored. An asset scores its worst
210
+ * running market, underlying or collateral.
211
+ *
212
+ * Simulated on the chain as it stands, through state overrides in
213
+ * `eth_call`: one call per source group per chain, so the node behind the
214
+ * client has to accept overrides. A chain with no client configured, or
215
+ * whose node refuses, is left out with a warning rather than failing the
216
+ * rest.
217
+ *
218
+ * ```ts
219
+ * const scores = await permissionless.oracles.assetScores({ chainId: 1 });
220
+ * ```
221
+ *
222
+ * @throws {PermissionlessNotAttachedError} before
223
+ * {@link GearboxPermissionless.attach} has resolved.
224
+ **/
225
+ assetScores({ chainId }?: AssetScoresArgs): Promise<AssetScore[]>;
226
+ /**
227
+ * The manipulation resistance of any main feed and reserve on a chain,
228
+ * scored the way {@link assetScores} scores a market holding them — for
229
+ * trying a pair before any market does.
230
+ *
231
+ * ```ts
232
+ * const pair = await permissionless.oracles.feedPairScore({
82
233
  * chainId: 1,
83
- * address: token,
234
+ * main: "0x…",
235
+ * reserve: "0x…",
84
236
  * });
85
237
  * ```
238
+ *
239
+ * Reads the chain directly, through state overrides in `eth_call`, so the
240
+ * client has to have attached and the node behind it has to accept them.
241
+ *
242
+ * @throws When the client has not attached, when the chain has no client or
243
+ * no PriceFeedCompressor, or when there is nothing to score: a feed the
244
+ * compressor cannot read, a `ZeroPriceFeed` main, or a final price that does
245
+ * not answer.
86
246
  **/
87
- assetPrices({ chainId, address }: AssetArgs): Promise<PermissionlessAssetPrices>;
247
+ feedPairScore({ chainId, main, reserve }: FeedPairScoreArgs): Promise<FeedPairScore>;
248
+ stressTest({ chainId, ...options }: StressTestArgs): Promise<StressReport>;
88
249
  /**
89
250
  * The feeds one feed reads from, recursively.
90
251
  *
@@ -101,54 +262,83 @@ export declare class PermissionlessOracles extends AbstractOffchainNamespace {
101
262
  **/
102
263
  dependencies({ chainId, address }: PriceFeedArgs): Promise<PriceFeedData>;
103
264
  /**
104
- * What the market values each of one feed's assets at.
265
+ * What the named feeds price, read off the chain.
266
+ *
267
+ * Prices exactly what is asked for, at the current block, across as many
268
+ * chains as the list names — one read per chain, so a screen listing every
269
+ * chain's feeds pays per chain and not per row. A feed the store does not
270
+ * carry prices the same way, which is what makes this the call to reach for
271
+ * after a deploy, or while a form is still choosing between candidates.
105
272
  *
106
- * Prefer this over {@link prices} whenever the caller is looking at a single
107
- * feed. That one prices the whole store, which costs the backend one
108
- * `totalSupply` call per asset of every market on the chain; this costs it
109
- * one price lookup and one multicall over the feed's own assets.
273
+ * Read in two passes. The first asks every feed what it reports as it
274
+ * stands, which is one multicall per chain; a feed that will not answer
275
+ * until it has been given a fresh one is then priced inside a simulation
276
+ * that updates it first, so a push-based feed prices as readily as a
277
+ * pull-based one. The second pass costs an `OnchainSDK` to attach, hence
278
+ * only the feeds that need it rather than all of them.
279
+ *
280
+ * `null` is a feed neither pass could read, and a chain with no client
281
+ * configured is every one of its feeds reading `null` rather than a failed
282
+ * call — the figures built on them are floors either way.
110
283
  *
111
284
  * ```ts
112
- * const { marketCaps } = await permissionless.oracles.feedMarketCaps({
113
- * chainId: 1,
114
- * address: feed,
115
- * });
285
+ * const [{ price }] = await permissionless.oracles.getPrices([
286
+ * { chainId: 1, address: feed },
287
+ * ]);
116
288
  * ```
289
+ *
290
+ * @returns One entry per feed asked for, in the order asked, each price in
291
+ * the 8 decimals every Gearbox feed reports.
117
292
  **/
118
- feedMarketCaps({ chainId, address }: PriceFeedArgs): Promise<PermissionlessPriceFeedMarketCaps>;
293
+ getPrices(feeds: PriceFeedRef[]): Promise<PriceFeedPrice[]>;
119
294
  /**
120
- * A price per feed, and a market cap per feed and asset. The feeds the
121
- * indexer has not seen are read off the chain by the backend, so the store
122
- * is priced whole.
295
+ * The scale each of the named feeds answers in.
296
+ *
297
+ * The companion to {@link getPrices} for the callers whose feeds are not
298
+ * all an oracle's: everything an oracle holds reports 8 decimals, but the
299
+ * feeds under a composite are whatever was deployed, and a rate leg at 18
300
+ * read as 8 is wrong by ten orders of magnitude rather than visibly wrong.
123
301
  *
124
- * Chain-wide, and priced accordingly — see {@link feedMarketCaps} for one
125
- * feed.
302
+ * Separate from the price because the two keep different company: this is
303
+ * fixed for the life of the contract and worth caching for the session,
304
+ * while a price is re-read whenever the reader asks. One multicall per
305
+ * chain either way.
306
+ *
307
+ * `null` is a feed that would not answer, or one on a chain with no client
308
+ * configured.
309
+ *
310
+ * ```ts
311
+ * const [{ decimals }] = await permissionless.oracles.getDecimals([
312
+ * { chainId: 1, address: feed },
313
+ * ]);
314
+ * ```
315
+ *
316
+ * @returns One entry per feed asked for, in the order asked.
126
317
  **/
127
- prices({ chainId }: {
128
- chainId: number;
129
- }): Promise<PermissionlessPrices>;
318
+ getDecimals(feeds: PriceFeedRef[]): Promise<PriceFeedDecimals[]>;
130
319
  /**
131
- * The price each of the named feeds reports, read off the chain.
320
+ * What one chain's feeds value one chain's assets at: `price × totalSupply`
321
+ * per pair.
132
322
  *
133
- * Where {@link prices} answers for the store as a whole and at whatever
134
- * moment the backend priced it, this prices exactly the feeds asked for, at
135
- * the current block. A feed the store does not carry prices the same way,
136
- * which is what makes this the call to reach for after a deploy, or while a
137
- * form is still choosing between candidates.
323
+ * Asked from whichever side the caller is looking at — one asset through
324
+ * each of its feeds, or one feed over each of the assets it prices — because
325
+ * a screen shows one row per feed or one row per asset, never the full
326
+ * cross product. Both answer the same pairs in the same shape.
138
327
  *
139
- * Feeds needing a fresh answer before they can be read are updated inside
140
- * the same simulation, so a push-based feed prices as readily as a
141
- * pull-based one. `null` is a feed whose read reverted, not a zero.
328
+ * Two reads per chain: the prices, and one multicall for the assets'
329
+ * supplies and decimals. Several scopes can be asked at once, which is how a
330
+ * table of every asset's feeds pays per chain rather than per row; the pairs
331
+ * come back in the order the scopes named them. A pair neither read could
332
+ * resolve has a `null` cap, which is not a zero.
142
333
  *
143
334
  * ```ts
144
- * const prices = await permissionless.oracles.getPrices({
335
+ * const caps = await permissionless.oracles.getMarketCap({
145
336
  * chainId: 1,
146
- * priceFeeds: [feed],
337
+ * asset: token,
338
+ * priceFeeds: [main, reserve],
147
339
  * });
148
340
  * ```
149
- *
150
- * @returns A price per feed, in the 8 decimals every Gearbox feed reports.
151
341
  **/
152
- getPrices({ chainId, priceFeeds }: GetPricesArgs): Promise<Record<Address, bigint | null>>;
342
+ getMarketCap(scope: AssetCap | FeedCap | Array<AssetCap | FeedCap>): Promise<MarketCap[]>;
153
343
  }
154
344
  //#endregion
@@ -0,0 +1,59 @@
1
+ import { PermissionlessAssetQuota, PermissionlessIndexedAssetSummary, PermissionlessQuotaTotals, PriceFeedPrice } from "./types.js";
2
+ import { Address } from "viem";
3
+ //#region src/permissionless/api/oracles/enrich.d.ts
4
+ /**
5
+ * What the oracles namespace works out for itself once the backend has
6
+ * answered.
7
+ *
8
+ * All of it used to be the backend's, and all of it needs the chain: a quota
9
+ * is denominated in its market's own underlying and a market cap is a supply
10
+ * times a price, so none of these can be indexed — they can only be read at
11
+ * the block the reader is on. Keeping them here means one description of each
12
+ * rule rather than one per service that wants it, and a backend that holds no
13
+ * viem client at all.
14
+ **/
15
+ /** Identifies a feed across chains, since an address alone does not. */
16
+ export declare function feedKey(chainId: number, address: Address): string;
17
+ /** Prices looked up the way {@link totalQuotas} and the caps need them. */
18
+ export declare function pricesByFeed(prices: PriceFeedPrice[]): Map<string, bigint | null>;
19
+ /**
20
+ * The asset's quota across its markets, totalled in USD.
21
+ *
22
+ * Each market's figures are converted at the price that market's own oracle
23
+ * holds for its underlying, which is the same number that market's accounting
24
+ * uses.
25
+ *
26
+ * Limits count only the markets still running, because a shut down market's
27
+ * limit is not borrowable; what is already quoted counts everywhere, because
28
+ * debt outstanding is exposure either way. A market whose underlying could not
29
+ * be priced is skipped, which makes both figures floors, and `null` is nothing
30
+ * to total rather than a zero.
31
+ *
32
+ * @param priceOf - The price each underlying feed reports, in the 8 decimals
33
+ * every Gearbox feed uses.
34
+ */
35
+ export declare function totalQuotas(quotas: PermissionlessAssetQuota[], priceOf: (feed: Address) => bigint | null | undefined): PermissionlessQuotaTotals;
36
+ /**
37
+ * What one feed values one asset's supply at: `price × totalSupply`.
38
+ *
39
+ * Multiplied as integers and formatted once, rather than through two floats:
40
+ * an 8-decimal price times an 18-decimal supply loses its small end to a JS
41
+ * number long before it loses the large one, and the figure is a total rather
42
+ * than an estimate.
43
+ *
44
+ * `null` if either side could not be read — an asset nobody could price is
45
+ * not an asset worth nothing.
46
+ */
47
+ export declare function toCap(price: bigint | null | undefined, totalSupply: bigint | null | undefined, decimals: number): string | null;
48
+ /**
49
+ * Assets ordered the way a reader scans them: what the protocol is built on
50
+ * first, then what is actually borrowed against it, then what it is merely
51
+ * allowed to be borrowed against.
52
+ *
53
+ * Applied here and not by the backend because the two middle terms are the
54
+ * converted quotas, which only exist once the chain has been read. The
55
+ * backend orders by the first term and the tie-breakers, so a caller reading
56
+ * the route directly still gets a stable order; this refines it.
57
+ */
58
+ export declare function byCentrality<T extends PermissionlessIndexedAssetSummary & PermissionlessQuotaTotals>(a: T, b: T): number;
59
+ //#endregion
@@ -1,3 +1,13 @@
1
- import { AssetArgs, GetPricesArgs, PermissionlessAsset, PermissionlessAssetDetails, PermissionlessAssetMarket, PermissionlessAssetMarketFeed, PermissionlessAssetPrices, PermissionlessPriceFeedAsset, PermissionlessPriceFeedDetails, PermissionlessPriceFeedMarket, PermissionlessPriceFeedMarketCaps, PermissionlessPriceFeedStore, PermissionlessPrices, PriceFeedArgs } from "./types.js";
1
+ import { AssetScore, AssetScoresArgs, FeedPairScore, FeedPairScoreArgs, GroupImpact, MarketScore, ScoredFeed } from "./score/types.js";
2
+ import { BreakingPoint, FeedOutcome, GroupReport, GroupScenarioOutcome, SlotOutcome, StressReport, StressScenario, StressSource, StressSourceKind, StressTestArgs } from "./stress/types.js";
3
+ import { AssetArgs, AssetCap, AssetsArgs, FeedCap, MarketCap, PermissionlessAsset, PermissionlessAssetDetails, PermissionlessAssetMarket, PermissionlessAssetMarketFeed, PermissionlessAssetQuota, PermissionlessAssetSummary, PermissionlessIndexedAssetDetails, PermissionlessIndexedAssetSummary, PermissionlessIndexedPriceFeedDetails, PermissionlessIndexedPriceFeedMarket, PermissionlessMarket, PermissionlessMarketSlot, PermissionlessPriceFeedAsset, PermissionlessPriceFeedDetails, PermissionlessPriceFeedMarket, PermissionlessPriceFeedStore, PermissionlessQuotaTotals, PriceFeedArgs, PriceFeedDecimals, PriceFeedPrice, PriceFeedRef } from "./types.js";
2
4
  import { GET_PRICES_CHUNK_SIZE, GET_PRICES_GAS_LIMIT_BY_CHAIN_ID, PermissionlessOracles } from "./PermissionlessOracles.js";
3
- export { AssetArgs, GET_PRICES_CHUNK_SIZE, GET_PRICES_GAS_LIMIT_BY_CHAIN_ID, GetPricesArgs, PermissionlessAsset, PermissionlessAssetDetails, PermissionlessAssetMarket, PermissionlessAssetMarketFeed, PermissionlessAssetPrices, PermissionlessOracles, PermissionlessPriceFeedAsset, PermissionlessPriceFeedDetails, PermissionlessPriceFeedMarket, PermissionlessPriceFeedMarketCaps, PermissionlessPriceFeedStore, PermissionlessPrices, PriceFeedArgs };
5
+ import { SCORE_MULTIPLIER, factorOf, finalPrice, scoreOfFactor, worstOf } from "./score/formula.js";
6
+ import { runAssetScores, runFeedPairScore } from "./score/run.js";
7
+ import "./score/index.js";
8
+ import { TreeNode, classifySources, sourcesByFeed } from "./stress/classify.js";
9
+ import { UNBOUNDED_DOWN, UNBOUNDED_UP, groupOverride, perturb, rateStub, roundDataStub } from "./stress/override.js";
10
+ import { DEFAULT_SCENARIOS, RATE_FEED_TYPE, readFeedTrees, readForest, readRateTargets, readUnder, runStressTest } from "./stress/run.js";
11
+ import { scoreGroup, slotHarm, verdictOf } from "./stress/score.js";
12
+ import "./stress/index.js";
13
+ export { AssetArgs, AssetCap, AssetScore, AssetScoresArgs, AssetsArgs, BreakingPoint, DEFAULT_SCENARIOS, FeedCap, FeedOutcome, FeedPairScore, FeedPairScoreArgs, GET_PRICES_CHUNK_SIZE, GET_PRICES_GAS_LIMIT_BY_CHAIN_ID, GroupImpact, GroupReport, GroupScenarioOutcome, MarketCap, MarketScore, PermissionlessAsset, PermissionlessAssetDetails, PermissionlessAssetMarket, PermissionlessAssetMarketFeed, PermissionlessAssetQuota, PermissionlessAssetSummary, PermissionlessIndexedAssetDetails, PermissionlessIndexedAssetSummary, PermissionlessIndexedPriceFeedDetails, PermissionlessIndexedPriceFeedMarket, PermissionlessMarket, PermissionlessMarketSlot, PermissionlessOracles, PermissionlessPriceFeedAsset, PermissionlessPriceFeedDetails, PermissionlessPriceFeedMarket, PermissionlessPriceFeedStore, PermissionlessQuotaTotals, PriceFeedArgs, PriceFeedDecimals, PriceFeedPrice, PriceFeedRef, RATE_FEED_TYPE, SCORE_MULTIPLIER, ScoredFeed, SlotOutcome, StressReport, StressScenario, StressSource, StressSourceKind, StressTestArgs, TreeNode, UNBOUNDED_DOWN, UNBOUNDED_UP, classifySources, factorOf, finalPrice, groupOverride, perturb, rateStub, readFeedTrees, readForest, readRateTargets, readUnder, roundDataStub, runAssetScores, runFeedPairScore, runStressTest, scoreGroup, scoreOfFactor, slotHarm, sourcesByFeed, verdictOf, worstOf };