@compass-labs/api-sdk 2.2.101 → 2.2.103

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 (223) hide show
  1. package/dist/commonjs/funcs/creditCreditBorrow.d.ts +1 -1
  2. package/dist/commonjs/funcs/creditCreditBorrow.js +1 -1
  3. package/dist/commonjs/funcs/creditCreditLoop.d.ts +8 -22
  4. package/dist/commonjs/funcs/creditCreditLoop.d.ts.map +1 -1
  5. package/dist/commonjs/funcs/creditCreditLoop.js +8 -22
  6. package/dist/commonjs/funcs/creditCreditLoop.js.map +1 -1
  7. package/dist/commonjs/funcs/creditCreditLoopedPositions.d.ts +8 -7
  8. package/dist/commonjs/funcs/creditCreditLoopedPositions.d.ts.map +1 -1
  9. package/dist/commonjs/funcs/creditCreditLoopedPositions.js +8 -7
  10. package/dist/commonjs/funcs/creditCreditLoopedPositions.js.map +1 -1
  11. package/dist/commonjs/funcs/creditCreditRebalance.d.ts +11 -34
  12. package/dist/commonjs/funcs/creditCreditRebalance.d.ts.map +1 -1
  13. package/dist/commonjs/funcs/creditCreditRebalance.js +11 -34
  14. package/dist/commonjs/funcs/creditCreditRebalance.js.map +1 -1
  15. package/dist/commonjs/funcs/creditCreditRepay.d.ts +1 -1
  16. package/dist/commonjs/funcs/creditCreditRepay.js +1 -1
  17. package/dist/commonjs/funcs/creditCreditUnloop.d.ts +7 -38
  18. package/dist/commonjs/funcs/creditCreditUnloop.d.ts.map +1 -1
  19. package/dist/commonjs/funcs/creditCreditUnloop.js +7 -38
  20. package/dist/commonjs/funcs/creditCreditUnloop.js.map +1 -1
  21. package/dist/commonjs/lib/config.d.ts +2 -2
  22. package/dist/commonjs/lib/config.js +2 -2
  23. package/dist/commonjs/models/components/accountsummary.d.ts +18 -5
  24. package/dist/commonjs/models/components/accountsummary.d.ts.map +1 -1
  25. package/dist/commonjs/models/components/accountsummary.js.map +1 -1
  26. package/dist/commonjs/models/components/collateralposition.d.ts +18 -5
  27. package/dist/commonjs/models/components/collateralposition.d.ts.map +1 -1
  28. package/dist/commonjs/models/components/collateralposition.js.map +1 -1
  29. package/dist/commonjs/models/components/creditborrowparams.d.ts +18 -5
  30. package/dist/commonjs/models/components/creditborrowparams.d.ts.map +1 -1
  31. package/dist/commonjs/models/components/creditborrowparams.js.map +1 -1
  32. package/dist/commonjs/models/components/creditborrowrequest.d.ts +18 -5
  33. package/dist/commonjs/models/components/creditborrowrequest.d.ts.map +1 -1
  34. package/dist/commonjs/models/components/creditborrowrequest.js.map +1 -1
  35. package/dist/commonjs/models/components/creditenablecollateralparams.d.ts +18 -5
  36. package/dist/commonjs/models/components/creditenablecollateralparams.d.ts.map +1 -1
  37. package/dist/commonjs/models/components/creditenablecollateralparams.js.map +1 -1
  38. package/dist/commonjs/models/components/creditlooprequest.d.ts +27 -14
  39. package/dist/commonjs/models/components/creditlooprequest.d.ts.map +1 -1
  40. package/dist/commonjs/models/components/creditlooprequest.js +1 -1
  41. package/dist/commonjs/models/components/creditlooprequest.js.map +1 -1
  42. package/dist/commonjs/models/components/creditloopresponse.d.ts +7 -7
  43. package/dist/commonjs/models/components/creditloopresponse.js +3 -3
  44. package/dist/commonjs/models/components/creditloopresponse.js.map +1 -1
  45. package/dist/commonjs/models/components/creditprotocol.d.ts +36 -10
  46. package/dist/commonjs/models/components/creditprotocol.d.ts.map +1 -1
  47. package/dist/commonjs/models/components/creditprotocol.js +18 -5
  48. package/dist/commonjs/models/components/creditprotocol.js.map +1 -1
  49. package/dist/commonjs/models/components/creditrepayparams.d.ts +18 -5
  50. package/dist/commonjs/models/components/creditrepayparams.d.ts.map +1 -1
  51. package/dist/commonjs/models/components/creditrepayparams.js.map +1 -1
  52. package/dist/commonjs/models/components/creditrepayrequest.d.ts +18 -5
  53. package/dist/commonjs/models/components/creditrepayrequest.d.ts.map +1 -1
  54. package/dist/commonjs/models/components/creditrepayrequest.js.map +1 -1
  55. package/dist/commonjs/models/components/creditsupplyparams.d.ts +18 -5
  56. package/dist/commonjs/models/components/creditsupplyparams.d.ts.map +1 -1
  57. package/dist/commonjs/models/components/creditsupplyparams.js.map +1 -1
  58. package/dist/commonjs/models/components/creditunlooprequest.d.ts +23 -10
  59. package/dist/commonjs/models/components/creditunlooprequest.d.ts.map +1 -1
  60. package/dist/commonjs/models/components/creditunlooprequest.js +1 -1
  61. package/dist/commonjs/models/components/creditunlooprequest.js.map +1 -1
  62. package/dist/commonjs/models/components/creditunloopresponse.d.ts +7 -7
  63. package/dist/commonjs/models/components/creditunloopresponse.js +3 -3
  64. package/dist/commonjs/models/components/creditunloopresponse.js.map +1 -1
  65. package/dist/commonjs/models/components/creditwithdrawparams.d.ts +18 -5
  66. package/dist/commonjs/models/components/creditwithdrawparams.d.ts.map +1 -1
  67. package/dist/commonjs/models/components/creditwithdrawparams.js.map +1 -1
  68. package/dist/commonjs/models/components/debtposition.d.ts +18 -5
  69. package/dist/commonjs/models/components/debtposition.d.ts.map +1 -1
  70. package/dist/commonjs/models/components/debtposition.js.map +1 -1
  71. package/dist/commonjs/models/components/loopedposition.d.ts +18 -5
  72. package/dist/commonjs/models/components/loopedposition.d.ts.map +1 -1
  73. package/dist/commonjs/models/components/loopedposition.js.map +1 -1
  74. package/dist/commonjs/models/components/rebalancetarget.d.ts +18 -5
  75. package/dist/commonjs/models/components/rebalancetarget.d.ts.map +1 -1
  76. package/dist/commonjs/models/components/rebalancetarget.js.map +1 -1
  77. package/dist/commonjs/models/components/rebalancetargetpreview.d.ts +18 -5
  78. package/dist/commonjs/models/components/rebalancetargetpreview.d.ts.map +1 -1
  79. package/dist/commonjs/models/components/rebalancetargetpreview.js.map +1 -1
  80. package/dist/commonjs/models/components/swapinfo.d.ts +2 -2
  81. package/dist/commonjs/sdk/credit.d.ts +44 -111
  82. package/dist/commonjs/sdk/credit.d.ts.map +1 -1
  83. package/dist/commonjs/sdk/credit.js +44 -111
  84. package/dist/commonjs/sdk/credit.js.map +1 -1
  85. package/dist/esm/funcs/creditCreditBorrow.d.ts +1 -1
  86. package/dist/esm/funcs/creditCreditBorrow.js +1 -1
  87. package/dist/esm/funcs/creditCreditLoop.d.ts +8 -22
  88. package/dist/esm/funcs/creditCreditLoop.d.ts.map +1 -1
  89. package/dist/esm/funcs/creditCreditLoop.js +8 -22
  90. package/dist/esm/funcs/creditCreditLoop.js.map +1 -1
  91. package/dist/esm/funcs/creditCreditLoopedPositions.d.ts +8 -7
  92. package/dist/esm/funcs/creditCreditLoopedPositions.d.ts.map +1 -1
  93. package/dist/esm/funcs/creditCreditLoopedPositions.js +8 -7
  94. package/dist/esm/funcs/creditCreditLoopedPositions.js.map +1 -1
  95. package/dist/esm/funcs/creditCreditRebalance.d.ts +11 -34
  96. package/dist/esm/funcs/creditCreditRebalance.d.ts.map +1 -1
  97. package/dist/esm/funcs/creditCreditRebalance.js +11 -34
  98. package/dist/esm/funcs/creditCreditRebalance.js.map +1 -1
  99. package/dist/esm/funcs/creditCreditRepay.d.ts +1 -1
  100. package/dist/esm/funcs/creditCreditRepay.js +1 -1
  101. package/dist/esm/funcs/creditCreditUnloop.d.ts +7 -38
  102. package/dist/esm/funcs/creditCreditUnloop.d.ts.map +1 -1
  103. package/dist/esm/funcs/creditCreditUnloop.js +7 -38
  104. package/dist/esm/funcs/creditCreditUnloop.js.map +1 -1
  105. package/dist/esm/lib/config.d.ts +2 -2
  106. package/dist/esm/lib/config.js +2 -2
  107. package/dist/esm/models/components/accountsummary.d.ts +18 -5
  108. package/dist/esm/models/components/accountsummary.d.ts.map +1 -1
  109. package/dist/esm/models/components/accountsummary.js.map +1 -1
  110. package/dist/esm/models/components/collateralposition.d.ts +18 -5
  111. package/dist/esm/models/components/collateralposition.d.ts.map +1 -1
  112. package/dist/esm/models/components/collateralposition.js.map +1 -1
  113. package/dist/esm/models/components/creditborrowparams.d.ts +18 -5
  114. package/dist/esm/models/components/creditborrowparams.d.ts.map +1 -1
  115. package/dist/esm/models/components/creditborrowparams.js.map +1 -1
  116. package/dist/esm/models/components/creditborrowrequest.d.ts +18 -5
  117. package/dist/esm/models/components/creditborrowrequest.d.ts.map +1 -1
  118. package/dist/esm/models/components/creditborrowrequest.js.map +1 -1
  119. package/dist/esm/models/components/creditenablecollateralparams.d.ts +18 -5
  120. package/dist/esm/models/components/creditenablecollateralparams.d.ts.map +1 -1
  121. package/dist/esm/models/components/creditenablecollateralparams.js.map +1 -1
  122. package/dist/esm/models/components/creditlooprequest.d.ts +27 -14
  123. package/dist/esm/models/components/creditlooprequest.d.ts.map +1 -1
  124. package/dist/esm/models/components/creditlooprequest.js +1 -1
  125. package/dist/esm/models/components/creditlooprequest.js.map +1 -1
  126. package/dist/esm/models/components/creditloopresponse.d.ts +7 -7
  127. package/dist/esm/models/components/creditloopresponse.js +3 -3
  128. package/dist/esm/models/components/creditloopresponse.js.map +1 -1
  129. package/dist/esm/models/components/creditprotocol.d.ts +36 -10
  130. package/dist/esm/models/components/creditprotocol.d.ts.map +1 -1
  131. package/dist/esm/models/components/creditprotocol.js +18 -5
  132. package/dist/esm/models/components/creditprotocol.js.map +1 -1
  133. package/dist/esm/models/components/creditrepayparams.d.ts +18 -5
  134. package/dist/esm/models/components/creditrepayparams.d.ts.map +1 -1
  135. package/dist/esm/models/components/creditrepayparams.js.map +1 -1
  136. package/dist/esm/models/components/creditrepayrequest.d.ts +18 -5
  137. package/dist/esm/models/components/creditrepayrequest.d.ts.map +1 -1
  138. package/dist/esm/models/components/creditrepayrequest.js.map +1 -1
  139. package/dist/esm/models/components/creditsupplyparams.d.ts +18 -5
  140. package/dist/esm/models/components/creditsupplyparams.d.ts.map +1 -1
  141. package/dist/esm/models/components/creditsupplyparams.js.map +1 -1
  142. package/dist/esm/models/components/creditunlooprequest.d.ts +23 -10
  143. package/dist/esm/models/components/creditunlooprequest.d.ts.map +1 -1
  144. package/dist/esm/models/components/creditunlooprequest.js +1 -1
  145. package/dist/esm/models/components/creditunlooprequest.js.map +1 -1
  146. package/dist/esm/models/components/creditunloopresponse.d.ts +7 -7
  147. package/dist/esm/models/components/creditunloopresponse.js +3 -3
  148. package/dist/esm/models/components/creditunloopresponse.js.map +1 -1
  149. package/dist/esm/models/components/creditwithdrawparams.d.ts +18 -5
  150. package/dist/esm/models/components/creditwithdrawparams.d.ts.map +1 -1
  151. package/dist/esm/models/components/creditwithdrawparams.js.map +1 -1
  152. package/dist/esm/models/components/debtposition.d.ts +18 -5
  153. package/dist/esm/models/components/debtposition.d.ts.map +1 -1
  154. package/dist/esm/models/components/debtposition.js.map +1 -1
  155. package/dist/esm/models/components/loopedposition.d.ts +18 -5
  156. package/dist/esm/models/components/loopedposition.d.ts.map +1 -1
  157. package/dist/esm/models/components/loopedposition.js.map +1 -1
  158. package/dist/esm/models/components/rebalancetarget.d.ts +18 -5
  159. package/dist/esm/models/components/rebalancetarget.d.ts.map +1 -1
  160. package/dist/esm/models/components/rebalancetarget.js.map +1 -1
  161. package/dist/esm/models/components/rebalancetargetpreview.d.ts +18 -5
  162. package/dist/esm/models/components/rebalancetargetpreview.d.ts.map +1 -1
  163. package/dist/esm/models/components/rebalancetargetpreview.js.map +1 -1
  164. package/dist/esm/models/components/swapinfo.d.ts +2 -2
  165. package/dist/esm/sdk/credit.d.ts +44 -111
  166. package/dist/esm/sdk/credit.d.ts.map +1 -1
  167. package/dist/esm/sdk/credit.js +44 -111
  168. package/dist/esm/sdk/credit.js.map +1 -1
  169. package/docs/models/components/accountsummary.md +11 -11
  170. package/docs/models/components/collateralposition.md +17 -17
  171. package/docs/models/components/creditborrowparams.md +11 -11
  172. package/docs/models/components/creditborrowrequest.md +21 -21
  173. package/docs/models/components/creditenablecollateralparams.md +7 -7
  174. package/docs/models/components/creditlooprequest.md +19 -19
  175. package/docs/models/components/creditlooprequestchain.md +1 -1
  176. package/docs/models/components/creditlooprequestinitialcollateralamount.md +1 -1
  177. package/docs/models/components/creditlooprequestloantovalue.md +1 -1
  178. package/docs/models/components/creditloopresponse.md +9 -9
  179. package/docs/models/components/creditloopresponseswapprovider.md +3 -3
  180. package/docs/models/components/creditprotocol.md +18 -5
  181. package/docs/models/components/creditrepayparams.md +10 -10
  182. package/docs/models/components/creditrepayrequest.md +20 -20
  183. package/docs/models/components/creditsupplyparams.md +9 -9
  184. package/docs/models/components/creditunlooprequest.md +17 -17
  185. package/docs/models/components/creditunlooprequestchain.md +1 -1
  186. package/docs/models/components/creditunloopresponse.md +9 -9
  187. package/docs/models/components/creditunloopresponseswapprovider.md +3 -3
  188. package/docs/models/components/creditwithdrawparams.md +9 -9
  189. package/docs/models/components/debtposition.md +16 -16
  190. package/docs/models/components/loopedposition.md +14 -14
  191. package/docs/models/components/rebalancetarget.md +10 -10
  192. package/docs/models/components/rebalancetargetpreview.md +16 -16
  193. package/docs/models/components/swapinfo.md +10 -10
  194. package/docs/sdks/credit/README.md +40 -107
  195. package/openapi_prepped_for_speakeasy.json +32 -32
  196. package/package.json +1 -1
  197. package/src/funcs/creditCreditBorrow.ts +1 -1
  198. package/src/funcs/creditCreditLoop.ts +8 -22
  199. package/src/funcs/creditCreditLoopedPositions.ts +8 -7
  200. package/src/funcs/creditCreditRebalance.ts +11 -34
  201. package/src/funcs/creditCreditRepay.ts +1 -1
  202. package/src/funcs/creditCreditUnloop.ts +7 -38
  203. package/src/lib/config.ts +2 -2
  204. package/src/models/components/accountsummary.ts +18 -5
  205. package/src/models/components/collateralposition.ts +18 -5
  206. package/src/models/components/creditborrowparams.ts +18 -5
  207. package/src/models/components/creditborrowrequest.ts +18 -5
  208. package/src/models/components/creditenablecollateralparams.ts +18 -5
  209. package/src/models/components/creditlooprequest.ts +27 -14
  210. package/src/models/components/creditloopresponse.ts +7 -7
  211. package/src/models/components/creditprotocol.ts +36 -10
  212. package/src/models/components/creditrepayparams.ts +18 -5
  213. package/src/models/components/creditrepayrequest.ts +18 -5
  214. package/src/models/components/creditsupplyparams.ts +18 -5
  215. package/src/models/components/creditunlooprequest.ts +23 -10
  216. package/src/models/components/creditunloopresponse.ts +7 -7
  217. package/src/models/components/creditwithdrawparams.ts +18 -5
  218. package/src/models/components/debtposition.ts +18 -5
  219. package/src/models/components/loopedposition.ts +18 -5
  220. package/src/models/components/rebalancetarget.ts +18 -5
  221. package/src/models/components/rebalancetargetpreview.ts +18 -5
  222. package/src/models/components/swapinfo.ts +2 -2
  223. package/src/sdk/credit.ts +44 -111
@@ -6020,7 +6020,7 @@
6020
6020
  "Credit"
6021
6021
  ],
6022
6022
  "summary": "List looped (leveraged) credit positions",
6023
- "description": "List looped (leveraged) positions for a credit account owner.\n\nDetects loops from the account's on-chain history: a transaction containing\nlending + borrowing + swap legs is a loop transaction. Returns one position\nper Morpho market / Aave collateral+debt reserve pair, each with its complete\nper-transaction history, lifetime totals, and live on-chain state (health\nfactor, USD values, leverage) for open positions. Covers Aave V3 and Morpho\nBlue.",
6023
+ "description": "List the leveraged positions held by an owner's Credit Account.\n\nPositions are reconstructed from on-chain history rather than from API calls,\nso a loop assembled by hand through /v2/credit/bundle is recognised the same\nway as one opened through /v2/credit/loop. Only activity inside the Credit\nAccount is visible \u2014 leverage the owner holds directly in their wallet is not.\n\nSee the [Leveraged Looping guide](https://docs.compasslabs.ai/v2/Products/Looping)\nfor protocol coverage and how to read leverage, health factor and net APY.",
6024
6024
  "operationId": "v2_credit_looped_positions",
6025
6025
  "parameters": [
6026
6026
  {
@@ -6289,7 +6289,7 @@
6289
6289
  "Credit"
6290
6290
  ],
6291
6291
  "summary": "Borrow against collateral",
6292
- "description": "Borrow an asset from Aave using a Credit Account.\n\nBundles an optional swap, collateral supply, and borrow into a single atomic Safe transaction.\n\n- If `token_in` equals `collateral_token`, the tokens are supplied directly as collateral.\n- If `token_in` differs from `collateral_token`, a swap is performed first via 1inch.\n\nThe Credit Account must already be created via `/v2/credit/create_account` and funded with `token_in`.",
6292
+ "description": "Borrow an asset from Aave using a Credit Account.\n\nBundles an optional swap, collateral supply, and borrow into a single atomic Safe transaction.\n\n- If `token_in` equals `collateral_token`, the tokens are supplied directly as collateral.\n- If `token_in` differs from `collateral_token`, a market swap is performed first.\n\nThe Credit Account must already be created via `/v2/credit/create_account` and funded with `token_in`.",
6293
6293
  "operationId": "v2_credit_borrow",
6294
6294
  "requestBody": {
6295
6295
  "content": {
@@ -6332,7 +6332,7 @@
6332
6332
  "Credit"
6333
6333
  ],
6334
6334
  "summary": "Open a leveraged loop",
6335
- "description": "Open a leveraged loop into an Aave or Morpho market in ONE atomic transaction.\n\nRepeatedly supplies collateral, borrows at the requested loan-to-value, and\nswaps the borrow back to collateral. Each iteration's supply uses the swap's\nGUARANTEED minimum output (enforced on-chain), so a fill anywhere within the\nslippage tolerance can never break a later step; any positive surplus stays\nin the Credit Account (the preview reports the bound as estimated_max_dust).\nVery large loops relative to pool depth can still exceed the slippage\ntolerance through their own cumulative price impact \u2014 size accordingly or\nraise max_slippage_percent. Conversely, the geometric tail can shrink below\nthe swap router's minimum routable size; when it does the loop simply ends\nearly on that supply \u2014 the achieved multiplier is still guaranteed within\n0.5% of the request or the call returns a clean 400.\n\nWhen the collateral token is itself an ERC-4626 vault share (e.g. a Morpho\nvault token like steakUSDC), each conversion swaps the borrow token to the\nvault's underlying asset and mints the shares via the vault's own deposit at\nnet asset value instead of swapping the share token on a DEX \u2014 share tokens\nhave no honest DEX route. A direct share-token route is only ever used when\nit prices within 1% of net asset value.\n\nThe Credit Account must already hold initial_collateral_amount of\ncollateral_token. For protocol=MORPHO pass a market_id from\n/v2/credit/morpho_markets.",
6335
+ "description": "Open a leveraged position in ONE atomic transaction.\n\nSupply collateral, borrow against it, swap the borrowed token back to\ncollateral, repeat \u2014 until total collateral reaches multiplier x\ninitial_collateral_amount. If any step fails the whole transaction reverts,\nso a position is never left half-built.\n\nSee the [Leveraged Looping guide](https://docs.compasslabs.ai/v2/Products/Looping)\nfor chain coverage, market discovery, vault-share collateral, HyperEVM\nspecifics and the full error list.",
6336
6336
  "operationId": "v2_credit_loop",
6337
6337
  "requestBody": {
6338
6338
  "content": {
@@ -6375,7 +6375,7 @@
6375
6375
  "Credit"
6376
6376
  ],
6377
6377
  "summary": "Unwind a leveraged loop",
6378
- "description": "Unwind an Aave or Morpho loop in ONE atomic transaction.\n\nRepeatedly withdraws collateral, swaps it to the borrow token at a GUARANTEED\nminimum output (enforced on-chain), and repays. The floor discipline means a\nswap filling anywhere within the slippage tolerance can never break a later\nstep; any positive surplus stays in the Credit Account as borrow-token dust\n(the preview reports the bound as estimated_max_dust).\n\nWhen the collateral token is itself an ERC-4626 vault share (e.g. a Morpho\nvault token like steakUSDC), each conversion redeems the shares through the\nvault at net asset value and swaps the underlying asset to the borrow token\ninstead of swapping the share token on a DEX; a direct share-token route is\nonly ever used when it prices within 1% of net asset value.\n\nOmit target_multiplier for a full close: the debt is cleared exactly \u2014\naccrued interest included \u2014 and the pair collateral is returned to the Credit\nAccount. Pass 1 to clear the debt but keep the collateral supplied, or a value\nabove 1 to delever to that multiplier (it must be below the position's current\nmultiplier).\n\nEach withdrawal is sized to keep the position's health factor \u2265 1.02 at that\nstep, so a position opened very close to the liquidation threshold may need\nmore than one transaction to fully close \u2014 set allow_partial=true to return\nthe maximum single-transaction progress (preview.fully_unwound=false), then\ncall unloop again to finish. Very large unwinds relative to pool depth can\nstill exceed the slippage tolerance through their own cumulative price impact.\n\nPositions are unwound as far as the swap router can route; on a router-minimum\nstop the engine still withdraws all collateral not needed to back the residual,\nand completes a true full close whenever the unwind's own guaranteed swap\nsurpluses (or the Credit Account's idle balance) cover the remainder \u2014 a\nresidual below the router's minimum routable size never fails the call, it is\nreported honestly in the preview (fully_unwound=false).\n\nWhen other open Aave loops share this position's collateral reserve, a full\nclose withdraws only this position's attributed share of the pooled collateral\n(event-ledger bookkeeping), leaving the rest supplied for the other positions.\n\nFor protocol=MORPHO pass a market_id from /v2/credit/morpho_markets; inspect\nopen loops via /v2/credit/looped_positions.",
6378
+ "description": "Unwind a leveraged position in ONE atomic transaction.\n\nWithdraw collateral, swap it back to the borrow token, repay, repeat \u2014 until\nthe position reaches target_multiplier, or until the debt is cleared exactly\nif you omit it. If any step fails the whole transaction reverts.\n\nSee the [Leveraged Looping guide](https://docs.compasslabs.ai/v2/Products/Looping)\nfor chain coverage, vault-share collateral, shared Aave reserves and the full\nerror list.",
6379
6379
  "operationId": "v2_credit_unloop",
6380
6380
  "requestBody": {
6381
6381
  "content": {
@@ -6418,7 +6418,7 @@
6418
6418
  "Credit"
6419
6419
  ],
6420
6420
  "summary": "Rebalance the leveraged credit book",
6421
- "description": "Rebalance the leveraged credit book in ONE atomic transaction.\n\nList only the positions to change \u2014 anything not named is left untouched;\nremove a position with close=true. Each target states an end state:\ntarget_equity_usd (net USD committed) \u00d7 target_multiplier.\n\nReleasing targets run first (each unwind/delever frees tokens into the Credit\nAccount), the freed tokens are then routed by swaps at a GUARANTEED minimum\noutput (enforced on-chain), and consuming targets run last \u2014 so moving a\nlevered position between markets, token pairs, or protocols (Aave \u2194 Morpho) is\nsimply a close plus an open in the same transaction. Conversions involving an\nERC-4626 vault-share token (e.g. a Morpho vault token like steakUSDC) go\nthrough the vault's own deposit/redeem at net asset value rather than a DEX\nswap of the share token.\n\nNet book growth is funded from the Credit Account's existing idle balance \u2014\nfund it first via /v2/credit/transfer; a net release stays in the Credit\nAccount as idle balance. Any swap surplus above the guaranteed floors also\nstays in the Credit Account (preview.estimated_max_dust) \u2014 recoverable, never\nlost.\n\nA book already at its target returns transaction: null with the preview \u2014 the\ncall is idempotent and safe to drive from a converge-to-target loop.\n\nA rebalance too large for one transaction is rejected with a 422 \u2014 split it\ninto two calls. Every deleveraging step keeps the health factor \u2265 1.02 and\nevery leveraging step respects the protocol's borrow limits; Aave targets share\none account-level health factor, which the preview reports.\n\nDust tails and routing swaps below the swap router's minimum routable size do\nnot fail the call: a releasing target that cannot fully unwind returns its\nhonest residual in the preview, and an unroutable routing swap is skipped\n(its uncovered amount only 422s the rebalance if it breaches the funding\ntolerance).\n\nFor protocol=MORPHO pass a market_id from /v2/credit/morpho_markets; inspect the\ncurrent book via /v2/credit/looped_positions.",
6421
+ "description": "Move one or more leveraged positions to the state you want, in ONE atomic\ntransaction.\n\nList the positions to change and the end state you want for each. The API\nworks out whether that means opening, growing, shrinking, delevering or\nclosing, and does them all together.\n\nMoney freed by shrinking or closing one position pays for growing or opening\nanother, so shifting funds between positions needs no new deposit. Any\nshortfall is taken from the Credit Account's idle balance, and the call\nreturns 422 if that does not cover it either.\n\nSee the [Leveraged Looping guide](https://docs.compasslabs.ai/v2/Products/Looping)\nfor protocol and chain coverage, capital routing and the full error list.",
6422
6422
  "operationId": "v2_credit_rebalance",
6423
6423
  "requestBody": {
6424
6424
  "content": {
@@ -6504,7 +6504,7 @@
6504
6504
  "Credit"
6505
6505
  ],
6506
6506
  "summary": "Repay debt and withdraw collateral",
6507
- "description": "Repay an Aave debt and withdraw collateral from a Credit Account.\n\nBundles repayment, collateral withdrawal, and an optional swap into a single atomic Safe transaction.\n\n- If `token_out` is None or equals `withdraw_token`, the withdrawn collateral is kept as-is.\n- If `token_out` differs from `withdraw_token`, a swap is performed after withdrawal via 1inch.\n\nThe Credit Account must already have a borrow position created via `/v2/credit/borrow`.\nThe repay_token must be available in the Credit Account (or pulled from EOA via Permit2).",
6507
+ "description": "Repay an Aave debt and withdraw collateral from a Credit Account.\n\nBundles repayment, collateral withdrawal, and an optional swap into a single atomic Safe transaction.\n\n- If `token_out` is None or equals `withdraw_token`, the withdrawn collateral is kept as-is.\n- If `token_out` differs from `withdraw_token`, a market swap is performed after withdrawal.\n\nThe Credit Account must already have a borrow position created via `/v2/credit/borrow`.\nThe repay_token must be available in the Credit Account (or pulled from EOA via Permit2).",
6508
6508
  "operationId": "v2_credit_repay",
6509
6509
  "requestBody": {
6510
6510
  "content": {
@@ -13138,12 +13138,12 @@
13138
13138
  "tempo"
13139
13139
  ],
13140
13140
  "title": "Chain",
13141
- "description": "Blockchain network.",
13141
+ "description": "Blockchain network. Not every protocol is deployed on every chain \u2014 see the protocol field \u2014 and a chain with no credit venue at all returns a 422 naming the chains that do.",
13142
13142
  "example": "ethereum"
13143
13143
  },
13144
13144
  "protocol": {
13145
13145
  "$ref": "#/components/schemas/CreditProtocol",
13146
- "description": "Lending protocol to loop into: AAVE, MORPHO, or EULER.",
13146
+ "description": "Lending protocol to loop into: AAVE, MORPHO, or EULER. On chain=hyperevm, AAVE is Hyperlend and MORPHO is Felix; EULER is not deployed there.",
13147
13147
  "example": "AAVE"
13148
13148
  },
13149
13149
  "market_id": {
@@ -13214,7 +13214,7 @@
13214
13214
  }
13215
13215
  ],
13216
13216
  "title": "Initial Collateral Amount",
13217
- "description": "Collateral (in token units) already held in the Credit Account to seed the loop.",
13217
+ "description": "Collateral (in token units) that the Credit Account must ALREADY hold when this is called \u2014 the loop never pulls from the owner's wallet mid-transaction. Fund the account first via /v2/credit/transfer (action=DEPOSIT).",
13218
13218
  "example": 1
13219
13219
  },
13220
13220
  "multiplier": {
@@ -13245,7 +13245,7 @@
13245
13245
  }
13246
13246
  ],
13247
13247
  "title": "Loan To Value",
13248
- "description": "Per-iteration borrow LTV in percent. Must not exceed the protocol's maximum for the market (Aave reserve/e-mode LTV; Morpho LLTV with a safety margin); borrows are sized slightly inside the requested value so no leg sits on the protocol's revert boundary.",
13248
+ "description": "Per-iteration borrow LTV in percent. Must not exceed the protocol's maximum for the market (Aave reserve/e-mode LTV; Morpho LLTV with a safety margin; Euler's borrow LTV for the collateral vault); borrows are sized slightly inside the requested value so no leg sits on the protocol's revert boundary.",
13249
13249
  "example": 70
13250
13250
  },
13251
13251
  "max_slippage_percent": {
@@ -13275,7 +13275,7 @@
13275
13275
  }
13276
13276
  ],
13277
13277
  "title": "Emode Category",
13278
- "description": "Aave only: e-mode category to enable before looping (higher LTV for correlated pairs, e.g. ETH-correlated)."
13278
+ "description": "Aave only: e-mode category to enable before looping (higher LTV for correlated pairs, e.g. ETH-correlated). Both tokens must belong to the category or the build returns a 422. On Hyperlend (chain=hyperevm) category 1 is the HYPE-correlated set covering wstHYPE and WHYPE."
13279
13279
  },
13280
13280
  "gas_sponsorship": {
13281
13281
  "type": "boolean",
@@ -13286,7 +13286,7 @@
13286
13286
  "preview": {
13287
13287
  "type": "boolean",
13288
13288
  "title": "Preview",
13289
- "description": "If true, build a display ESTIMATE: no firm RFQ quote is ever requested (quote_expires_at stays null) and no transaction is returned. How the estimate is priced follows `pricing`: on a firm-covered pair under 'auto' or 'firm' it is computed from the firm venue's live price levels (swap_provider='bebop', indicative); otherwise swap legs are priced by the default aggregator. Set it on every call made while a user is exploring parameters, and leave it false only for the build they actually intend to sign \u2014 firm quotes are single-use maker commitments, and requesting them for displays that are never executed degrades the pricing this API is offered.",
13289
+ "description": "If true, build a display ESTIMATE: no firm RFQ quote is ever requested (quote_expires_at stays null). NOTE that this guarantees only that no firm quote was spent \u2014 it does not guarantee an absent transaction: on a pair no firm provider covers, and under pricing=market, the call still falls through to the aggregator and returns a signable transaction. How the estimate is priced follows `pricing`: on a firm-covered pair under 'auto' or 'firm' it is computed from the firm provider's live price levels (indicative); otherwise swap legs are priced by the default aggregator. Set it on every call made while a user is exploring parameters, and leave it false only for the build they actually intend to sign \u2014 firm quotes are single-use maker commitments, and requesting them for displays that are never executed degrades the pricing this API is offered.",
13290
13290
  "example": false
13291
13291
  },
13292
13292
  "pricing": {
@@ -13337,7 +13337,7 @@
13337
13337
  "type": "null"
13338
13338
  }
13339
13339
  ],
13340
- "description": "Unsigned transaction for direct execution by the owner. Present when gas_sponsorship=false \u2014 except firm-priced previews (preview=true with swap_provider='bebop'), which carry numbers only: the firm quotes are fetched at execution time, so there is no payload to sign yet."
13340
+ "description": "Unsigned transaction for direct execution by the owner. Present when gas_sponsorship=false \u2014 except firm-priced previews (preview=true on a firm-priced build), which carry numbers only: the firm quotes are fetched at execution time, so there is no payload to sign yet."
13341
13341
  },
13342
13342
  "eip_712": {
13343
13343
  "anyOf": [
@@ -13364,12 +13364,12 @@
13364
13364
  "swap_provider": {
13365
13365
  "type": "string",
13366
13366
  "enum": [
13367
- "one_inch",
13368
- "bebop"
13367
+ "market",
13368
+ "firm"
13369
13369
  ],
13370
13370
  "title": "Swap Provider",
13371
- "description": "Which venue priced the swap leg(s): 'one_inch' (iterative loop, slippage-bounded floors) or 'bebop' (firm zero-slippage quotes, one per swap leg, each partially filled at the leg's size \u2014 exact fills, zero dust). On preview=true responses, 'bebop' means the numbers are INDICATIVE, computed from the firm venue's live maker price levels without spending any quote; execution fetches the firm quotes at signing time. Always present, including on fallbacks.",
13372
- "example": "one_inch"
13371
+ "description": "Identifies which route priced the swap leg(s): 'market' \u2014 a DEX aggregator (iterative loop across pool liquidity, slippage-bounded floors) \u2014 or 'firm' \u2014 zero-slippage quotes, one per swap leg, each partially filled at the leg's size (exact fills, zero dust). On preview=true responses 'firm' means the numbers are INDICATIVE, computed from live maker price levels without spending any quote; execution fetches the firm quotes at signing time. Always present, including on fallbacks. This is the authoritative firm-vs-market signal and clients do need to read it: `pricing` is only what was REQUESTED (under 'auto' a firm build can fall back to market transparently), and `quote_expires_at` is absent on every preview \u2014 so neither substitutes for this field.",
13372
+ "example": "market"
13373
13373
  },
13374
13374
  "quote_expires_at": {
13375
13375
  "anyOf": [
@@ -13382,7 +13382,7 @@
13382
13382
  }
13383
13383
  ],
13384
13384
  "title": "Quote Expires At",
13385
- "description": "Deadline of the firm swap quotes (the earliest across the loop's swap legs) \u2014 sign and broadcast before it or the transaction reverts on-chain; refresh by re-calling this endpoint (discard the previous payload). Present only on executable swap_provider='bebop' builds; null on previews (no quote is spent for a preview)."
13385
+ "description": "Deadline of the firm swap quotes (the earliest across the loop's swap legs) \u2014 sign and broadcast before it or the transaction reverts on-chain; refresh by re-calling this endpoint (discard the previous payload). Present only on executable firm-priced builds; null on previews (no quote is spent for a preview)."
13386
13386
  },
13387
13387
  "max_firm_multiplier": {
13388
13388
  "anyOf": [
@@ -13529,7 +13529,7 @@
13529
13529
  "MORPHO"
13530
13530
  ],
13531
13531
  "title": "CreditProtocol",
13532
- "description": "Which lending protocol a credit action targets.\n\n``AAVE`` is the default so existing callers (which never send a ``protocol``\nfield) keep hitting the unchanged Aave code path. ``MORPHO`` identifies Morpho\nBlue lending markets by their bytes32 ``market_id``. ``EULER`` identifies Euler\nV2 markets by their EVK ``collateral_vault`` + ``borrow_vault`` addresses and\nsupports isolated per-sub-account positions (``sub_account_id``). All three\nsupport the loop/unloop leverage endpoints."
13532
+ "description": "Which lending protocol a credit action targets.\n\n``AAVE`` is the default so existing callers (which never send a ``protocol``\nfield) keep hitting the unchanged Aave code path; markets are named by token\nsymbol. ``MORPHO`` identifies Morpho Blue lending markets by their bytes32\n``market_id``. ``EULER`` identifies Euler V2 markets by their EVK\n``collateral_vault`` + ``borrow_vault`` addresses and supports isolated\nper-sub-account positions (``sub_account_id``).\n\nDeployment is per chain, so a valid protocol can still 422 on a given chain:\nAAVE on Ethereum, Base, Arbitrum, BSC and HyperEVM (where it is Hyperlend, the\nchain's Aave V3 deployment); MORPHO on Ethereum, Base, Arbitrum and HyperEVM\n(where it is Felix); EULER on Ethereum, Base, Arbitrum and BSC.\n\nAll three support ``/v2/credit/loop`` and ``/v2/credit/unloop``. EULER does\nNOT: ``/v2/credit/rebalance`` rejects it with a 422, and\n``/v2/credit/looped_positions`` covers only AAVE and MORPHO \u2014 an Euler loop is\nsilently absent there rather than an error, so read it from\n``/v2/credit/positions`` instead. (EULER still appears in the\n``looped_positions`` response enum because this enum is shared; it is never\nemitted.)"
13533
13533
  },
13534
13534
  "CreditRebalancePreview": {
13535
13535
  "properties": {
@@ -14385,12 +14385,12 @@
14385
14385
  "tempo"
14386
14386
  ],
14387
14387
  "title": "Chain",
14388
- "description": "Blockchain network.",
14388
+ "description": "Blockchain network. Not every protocol is deployed on every chain \u2014 see the protocol field \u2014 and a chain with no credit venue at all returns a 422 naming the chains that do.",
14389
14389
  "example": "ethereum"
14390
14390
  },
14391
14391
  "protocol": {
14392
14392
  "$ref": "#/components/schemas/CreditProtocol",
14393
- "description": "Lending protocol to unwind: AAVE, MORPHO, or EULER.",
14393
+ "description": "Lending protocol to unwind: AAVE, MORPHO, or EULER. On chain=hyperevm, AAVE is Hyperlend and MORPHO is Felix; EULER is not deployed there.",
14394
14394
  "example": "AAVE"
14395
14395
  },
14396
14396
  "market_id": {
@@ -14485,7 +14485,7 @@
14485
14485
  "allow_partial": {
14486
14486
  "type": "boolean",
14487
14487
  "title": "Allow Partial",
14488
- "description": "If the target cannot be reached in one transaction (e.g. a position opened very close to the liquidation threshold), return the maximum-progress plan (preview.fully_unwound=false) instead of a 400. A second unloop call, now from a much lower leverage, finishes the job.",
14488
+ "description": "If the target cannot be reached in one transaction, return the maximum-progress plan (preview.fully_unwound=false) instead of a 400. This can happen because every withdrawal is sized to keep the health factor at or above 1.02 at that step, so a position opened very close to its liquidation threshold runs out of headroom before the target is met. A second unloop call, now from a much lower leverage, finishes the job.",
14489
14489
  "example": false
14490
14490
  },
14491
14491
  "gas_sponsorship": {
@@ -14497,7 +14497,7 @@
14497
14497
  "preview": {
14498
14498
  "type": "boolean",
14499
14499
  "title": "Preview",
14500
- "description": "If true, build a display estimate only \u2014 no single-use firm quote is ever spent. On a firm-covered unwind (pricing 'auto' or 'firm') the numbers are firm-INDICATIVE, priced off the firm venue's live maker levels (swap_provider='bebop'); otherwise they are market-priced with slippage-bounded floors. Under pricing='firm' a preview the firm venue cannot serve returns the advisory alone (preview=null + firm_available). Set it on every parameter-exploration call and omit it only on the build the user is about to sign.",
14500
+ "description": "If true, build a display estimate only \u2014 no single-use firm quote is ever spent. NOTE that this guarantees only that no firm quote was spent \u2014 it does not guarantee an absent transaction: on an unwind no firm provider covers, and under pricing=market, the call still falls through to the aggregator and returns a signable transaction. On a firm-covered unwind (pricing 'auto' or 'firm') the numbers are firm-INDICATIVE, priced off the firm provider's live maker levels; otherwise they are market-priced with slippage-bounded floors. Under pricing='firm' a preview no firm provider can serve returns the advisory alone (preview=null + firm_available). Set it on every parameter-exploration call and omit it only on the build the user is about to sign.",
14501
14501
  "example": false
14502
14502
  },
14503
14503
  "pricing": {
@@ -14543,7 +14543,7 @@
14543
14543
  "type": "null"
14544
14544
  }
14545
14545
  ],
14546
- "description": "Unsigned transaction for direct execution by the owner. Present when gas_sponsorship=false \u2014 except firm-priced previews (preview=true with swap_provider='bebop'), which carry numbers only: the firm quotes are fetched at execution time, so there is no payload to sign yet."
14546
+ "description": "Unsigned transaction for direct execution by the owner. Present when gas_sponsorship=false \u2014 except firm-priced previews (preview=true on a firm-priced build), which carry numbers only: the firm quotes are fetched at execution time, so there is no payload to sign yet."
14547
14547
  },
14548
14548
  "eip_712": {
14549
14549
  "anyOf": [
@@ -14570,12 +14570,12 @@
14570
14570
  "swap_provider": {
14571
14571
  "type": "string",
14572
14572
  "enum": [
14573
- "one_inch",
14574
- "bebop"
14573
+ "market",
14574
+ "firm"
14575
14575
  ],
14576
14576
  "title": "Swap Provider",
14577
- "description": "Which venue priced the swap leg(s): 'one_inch' (market route, slippage-bounded floors) or 'bebop' (firm quotes, one per swap leg, each partially filled at the leg's size). On preview=true responses, 'bebop' means the numbers are INDICATIVE, computed from the firm venue's live maker price levels without spending any quote; execution fetches the firm quotes at signing time. Always present, including on fallbacks.",
14578
- "example": "one_inch"
14577
+ "description": "Identifies which route priced the swap leg(s): 'market' \u2014 a DEX aggregator (pool liquidity, slippage-bounded floors) \u2014 or 'firm' \u2014 quotes, one per swap leg, each partially filled at the leg's size. On preview=true responses 'firm' means the numbers are INDICATIVE, computed from live maker price levels without spending any quote; execution fetches the firm quotes at signing time. Always present, including on fallbacks. This is the authoritative firm-vs-market signal and clients do need to read it: `pricing` is only what was REQUESTED (under 'auto' a firm build can fall back to market transparently), and `quote_expires_at` is absent on every preview \u2014 so neither substitutes for this field.",
14578
+ "example": "market"
14579
14579
  },
14580
14580
  "quote_expires_at": {
14581
14581
  "anyOf": [
@@ -14588,7 +14588,7 @@
14588
14588
  }
14589
14589
  ],
14590
14590
  "title": "Quote Expires At",
14591
- "description": "Deadline of the firm swap quotes (the earliest across the unwind's swap legs) \u2014 sign and broadcast before it or the transaction reverts on-chain; refresh by re-calling this endpoint (discard the previous payload). Present only on executable swap_provider='bebop' builds; null on previews (no quote is spent for a preview)."
14591
+ "description": "Deadline of the firm swap quotes (the earliest across the unwind's swap legs) \u2014 sign and broadcast before it or the transaction reverts on-chain; refresh by re-calling this endpoint (discard the previous payload). Present only on executable firm-priced builds; null on previews (no quote is spent for a preview)."
14592
14592
  },
14593
14593
  "firm_available": {
14594
14594
  "anyOf": [
@@ -16906,7 +16906,7 @@
16906
16906
  "properties": {
16907
16907
  "protocol": {
16908
16908
  "$ref": "#/components/schemas/CreditProtocol",
16909
- "description": "Lending protocol this position is on (AAVE or MORPHO)."
16909
+ "description": "Lending protocol this position is on. Only AAVE and MORPHO are ever returned; EULER is present in the enum because it is shared with the transact endpoints, but Euler loops are not listed here \u2014 read them from /v2/credit/positions."
16910
16910
  },
16911
16911
  "market_id": {
16912
16912
  "anyOf": [
@@ -25196,7 +25196,7 @@
25196
25196
  }
25197
25197
  ],
25198
25198
  "title": "Router",
25199
- "description": "The outbound counterparty when it is the 1inch aggregation router. Null when the swap settled from an executor contract (informational only \u2014 never required to detect the swap)."
25199
+ "description": "The outbound counterparty when it is the swap router itself. Null when the swap settled from an executor contract (informational only \u2014 never required to detect the swap)."
25200
25200
  }
25201
25201
  },
25202
25202
  "additionalProperties": false,
@@ -25210,7 +25210,7 @@
25210
25210
  "bought_amount"
25211
25211
  ],
25212
25212
  "title": "SwapInfo",
25213
- "description": "The DEX swap leg detected inside a loop transaction.\n\nEvidence is token-filtered and executor-proof: the sold (debt) token left the\naccount to a non-protocol counterparty and the bought (collateral) token\narrived from a non-protocol counterparty. 1inch fills often settle from an\nexecutor contract, so the router is recorded only when it happens to be the\noutbound counterparty \u2014 it is never required for detection."
25213
+ "description": "The DEX swap leg detected inside a loop transaction.\n\nEvidence is token-filtered and executor-proof: the sold (debt) token left the\naccount to a non-protocol counterparty and the bought (collateral) token\narrived from a non-protocol counterparty. Aggregator fills often settle from an\nexecutor contract, so the router is recorded only when it happens to be the\noutbound counterparty \u2014 it is never required for detection."
25214
25214
  },
25215
25215
  "SyPosition": {
25216
25216
  "properties": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@compass-labs/api-sdk",
3
- "version": "2.2.101",
3
+ "version": "2.2.103",
4
4
  "author": "royalnine",
5
5
  "type": "module",
6
6
  "tshy": {
@@ -35,7 +35,7 @@ import { Result } from "../types/fp.js";
35
35
  * Bundles an optional swap, collateral supply, and borrow into a single atomic Safe transaction.
36
36
  *
37
37
  * - If `token_in` equals `collateral_token`, the tokens are supplied directly as collateral.
38
- * - If `token_in` differs from `collateral_token`, a swap is performed first via 1inch.
38
+ * - If `token_in` differs from `collateral_token`, a market swap is performed first.
39
39
  *
40
40
  * The Credit Account must already be created via `/v2/credit/create_account` and funded with `token_in`.
41
41
  */
@@ -30,30 +30,16 @@ import { Result } from "../types/fp.js";
30
30
  * Open a leveraged loop
31
31
  *
32
32
  * @remarks
33
- * Open a leveraged loop into an Aave or Morpho market in ONE atomic transaction.
33
+ * Open a leveraged position in ONE atomic transaction.
34
34
  *
35
- * Repeatedly supplies collateral, borrows at the requested loan-to-value, and
36
- * swaps the borrow back to collateral. Each iteration's supply uses the swap's
37
- * GUARANTEED minimum output (enforced on-chain), so a fill anywhere within the
38
- * slippage tolerance can never break a later step; any positive surplus stays
39
- * in the Credit Account (the preview reports the bound as estimated_max_dust).
40
- * Very large loops relative to pool depth can still exceed the slippage
41
- * tolerance through their own cumulative price impact — size accordingly or
42
- * raise max_slippage_percent. Conversely, the geometric tail can shrink below
43
- * the swap router's minimum routable size; when it does the loop simply ends
44
- * early on that supply — the achieved multiplier is still guaranteed within
45
- * 0.5% of the request or the call returns a clean 400.
35
+ * Supply collateral, borrow against it, swap the borrowed token back to
36
+ * collateral, repeat until total collateral reaches multiplier x
37
+ * initial_collateral_amount. If any step fails the whole transaction reverts,
38
+ * so a position is never left half-built.
46
39
  *
47
- * When the collateral token is itself an ERC-4626 vault share (e.g. a Morpho
48
- * vault token like steakUSDC), each conversion swaps the borrow token to the
49
- * vault's underlying asset and mints the shares via the vault's own deposit at
50
- * net asset value instead of swapping the share token on a DEX — share tokens
51
- * have no honest DEX route. A direct share-token route is only ever used when
52
- * it prices within 1% of net asset value.
53
- *
54
- * The Credit Account must already hold initial_collateral_amount of
55
- * collateral_token. For protocol=MORPHO pass a market_id from
56
- * /v2/credit/morpho_markets.
40
+ * See the [Leveraged Looping guide](https://docs.compasslabs.ai/v2/Products/Looping)
41
+ * for chain coverage, market discovery, vault-share collateral, HyperEVM
42
+ * specifics and the full error list.
57
43
  */
58
44
  export function creditCreditLoop(
59
45
  client: CompassApiSDKCore,
@@ -31,14 +31,15 @@ import { Result } from "../types/fp.js";
31
31
  * List looped (leveraged) credit positions
32
32
  *
33
33
  * @remarks
34
- * List looped (leveraged) positions for a credit account owner.
34
+ * List the leveraged positions held by an owner's Credit Account.
35
35
  *
36
- * Detects loops from the account's on-chain history: a transaction containing
37
- * lending + borrowing + swap legs is a loop transaction. Returns one position
38
- * per Morpho market / Aave collateral+debt reserve pair, each with its complete
39
- * per-transaction history, lifetime totals, and live on-chain state (health
40
- * factor, USD values, leverage) for open positions. Covers Aave V3 and Morpho
41
- * Blue.
36
+ * Positions are reconstructed from on-chain history rather than from API calls,
37
+ * so a loop assembled by hand through /v2/credit/bundle is recognised the same
38
+ * way as one opened through /v2/credit/loop. Only activity inside the Credit
39
+ * Account is visible leverage the owner holds directly in their wallet is not.
40
+ *
41
+ * See the [Leveraged Looping guide](https://docs.compasslabs.ai/v2/Products/Looping)
42
+ * for protocol coverage and how to read leverage, health factor and net APY.
42
43
  */
43
44
  export function creditCreditLoopedPositions(
44
45
  client: CompassApiSDKCore,
@@ -30,43 +30,20 @@ import { Result } from "../types/fp.js";
30
30
  * Rebalance the leveraged credit book
31
31
  *
32
32
  * @remarks
33
- * Rebalance the leveraged credit book in ONE atomic transaction.
33
+ * Move one or more leveraged positions to the state you want, in ONE atomic
34
+ * transaction.
34
35
  *
35
- * List only the positions to change anything not named is left untouched;
36
- * remove a position with close=true. Each target states an end state:
37
- * target_equity_usd (net USD committed) × target_multiplier.
36
+ * List the positions to change and the end state you want for each. The API
37
+ * works out whether that means opening, growing, shrinking, delevering or
38
+ * closing, and does them all together.
38
39
  *
39
- * Releasing targets run first (each unwind/delever frees tokens into the Credit
40
- * Account), the freed tokens are then routed by swaps at a GUARANTEED minimum
41
- * output (enforced on-chain), and consuming targets run last so moving a
42
- * levered position between markets, token pairs, or protocols (Aave ↔ Morpho) is
43
- * simply a close plus an open in the same transaction. Conversions involving an
44
- * ERC-4626 vault-share token (e.g. a Morpho vault token like steakUSDC) go
45
- * through the vault's own deposit/redeem at net asset value rather than a DEX
46
- * swap of the share token.
40
+ * Money freed by shrinking or closing one position pays for growing or opening
41
+ * another, so shifting funds between positions needs no new deposit. Any
42
+ * shortfall is taken from the Credit Account's idle balance, and the call
43
+ * returns 422 if that does not cover it either.
47
44
  *
48
- * Net book growth is funded from the Credit Account's existing idle balance —
49
- * fund it first via /v2/credit/transfer; a net release stays in the Credit
50
- * Account as idle balance. Any swap surplus above the guaranteed floors also
51
- * stays in the Credit Account (preview.estimated_max_dust) — recoverable, never
52
- * lost.
53
- *
54
- * A book already at its target returns transaction: null with the preview — the
55
- * call is idempotent and safe to drive from a converge-to-target loop.
56
- *
57
- * A rebalance too large for one transaction is rejected with a 422 — split it
58
- * into two calls. Every deleveraging step keeps the health factor ≥ 1.02 and
59
- * every leveraging step respects the protocol's borrow limits; Aave targets share
60
- * one account-level health factor, which the preview reports.
61
- *
62
- * Dust tails and routing swaps below the swap router's minimum routable size do
63
- * not fail the call: a releasing target that cannot fully unwind returns its
64
- * honest residual in the preview, and an unroutable routing swap is skipped
65
- * (its uncovered amount only 422s the rebalance if it breaches the funding
66
- * tolerance).
67
- *
68
- * For protocol=MORPHO pass a market_id from /v2/credit/morpho_markets; inspect the
69
- * current book via /v2/credit/looped_positions.
45
+ * See the [Leveraged Looping guide](https://docs.compasslabs.ai/v2/Products/Looping)
46
+ * for protocol and chain coverage, capital routing and the full error list.
70
47
  */
71
48
  export function creditCreditRebalance(
72
49
  client: CompassApiSDKCore,
@@ -35,7 +35,7 @@ import { Result } from "../types/fp.js";
35
35
  * Bundles repayment, collateral withdrawal, and an optional swap into a single atomic Safe transaction.
36
36
  *
37
37
  * - If `token_out` is None or equals `withdraw_token`, the withdrawn collateral is kept as-is.
38
- * - If `token_out` differs from `withdraw_token`, a swap is performed after withdrawal via 1inch.
38
+ * - If `token_out` differs from `withdraw_token`, a market swap is performed after withdrawal.
39
39
  *
40
40
  * The Credit Account must already have a borrow position created via `/v2/credit/borrow`.
41
41
  * The repay_token must be available in the Credit Account (or pulled from EOA via Permit2).
@@ -30,46 +30,15 @@ import { Result } from "../types/fp.js";
30
30
  * Unwind a leveraged loop
31
31
  *
32
32
  * @remarks
33
- * Unwind an Aave or Morpho loop in ONE atomic transaction.
33
+ * Unwind a leveraged position in ONE atomic transaction.
34
34
  *
35
- * Repeatedly withdraws collateral, swaps it to the borrow token at a GUARANTEED
36
- * minimum output (enforced on-chain), and repays. The floor discipline means a
37
- * swap filling anywhere within the slippage tolerance can never break a later
38
- * step; any positive surplus stays in the Credit Account as borrow-token dust
39
- * (the preview reports the bound as estimated_max_dust).
35
+ * Withdraw collateral, swap it back to the borrow token, repay, repeat — until
36
+ * the position reaches target_multiplier, or until the debt is cleared exactly
37
+ * if you omit it. If any step fails the whole transaction reverts.
40
38
  *
41
- * When the collateral token is itself an ERC-4626 vault share (e.g. a Morpho
42
- * vault token like steakUSDC), each conversion redeems the shares through the
43
- * vault at net asset value and swaps the underlying asset to the borrow token
44
- * instead of swapping the share token on a DEX; a direct share-token route is
45
- * only ever used when it prices within 1% of net asset value.
46
- *
47
- * Omit target_multiplier for a full close: the debt is cleared exactly —
48
- * accrued interest included — and the pair collateral is returned to the Credit
49
- * Account. Pass 1 to clear the debt but keep the collateral supplied, or a value
50
- * above 1 to delever to that multiplier (it must be below the position's current
51
- * multiplier).
52
- *
53
- * Each withdrawal is sized to keep the position's health factor ≥ 1.02 at that
54
- * step, so a position opened very close to the liquidation threshold may need
55
- * more than one transaction to fully close — set allow_partial=true to return
56
- * the maximum single-transaction progress (preview.fully_unwound=false), then
57
- * call unloop again to finish. Very large unwinds relative to pool depth can
58
- * still exceed the slippage tolerance through their own cumulative price impact.
59
- *
60
- * Positions are unwound as far as the swap router can route; on a router-minimum
61
- * stop the engine still withdraws all collateral not needed to back the residual,
62
- * and completes a true full close whenever the unwind's own guaranteed swap
63
- * surpluses (or the Credit Account's idle balance) cover the remainder — a
64
- * residual below the router's minimum routable size never fails the call, it is
65
- * reported honestly in the preview (fully_unwound=false).
66
- *
67
- * When other open Aave loops share this position's collateral reserve, a full
68
- * close withdraws only this position's attributed share of the pooled collateral
69
- * (event-ledger bookkeeping), leaving the rest supplied for the other positions.
70
- *
71
- * For protocol=MORPHO pass a market_id from /v2/credit/morpho_markets; inspect
72
- * open loops via /v2/credit/looped_positions.
39
+ * See the [Leveraged Looping guide](https://docs.compasslabs.ai/v2/Products/Looping)
40
+ * for chain coverage, vault-share collateral, shared Aave reserves and the full
41
+ * error list.
73
42
  */
74
43
  export function creditCreditUnloop(
75
44
  client: CompassApiSDKCore,
package/src/lib/config.ts CHANGED
@@ -62,7 +62,7 @@ export const SDK_METADATA = {
62
62
  language: "typescript",
63
63
  openapiDocVersion: "0.0.1",
64
64
  sdkVersion: "2.0.0",
65
- genVersion: "2.931.0",
65
+ genVersion: "2.932.9",
66
66
  userAgent:
67
- "speakeasy-sdk/typescript 2.0.0 2.931.0 0.0.1 @compass-labs/api-sdk",
67
+ "speakeasy-sdk/typescript 2.0.0 2.932.9 0.0.1 @compass-labs/api-sdk",
68
68
  } as const;
@@ -28,11 +28,24 @@ export type AccountSummary = {
28
28
  * @remarks
29
29
  *
30
30
  * ``AAVE`` is the default so existing callers (which never send a ``protocol``
31
- * field) keep hitting the unchanged Aave code path. ``MORPHO`` identifies Morpho
32
- * Blue lending markets by their bytes32 ``market_id``. ``EULER`` identifies Euler
33
- * V2 markets by their EVK ``collateral_vault`` + ``borrow_vault`` addresses and
34
- * supports isolated per-sub-account positions (``sub_account_id``). All three
35
- * support the loop/unloop leverage endpoints.
31
+ * field) keep hitting the unchanged Aave code path; markets are named by token
32
+ * symbol. ``MORPHO`` identifies Morpho Blue lending markets by their bytes32
33
+ * ``market_id``. ``EULER`` identifies Euler V2 markets by their EVK
34
+ * ``collateral_vault`` + ``borrow_vault`` addresses and supports isolated
35
+ * per-sub-account positions (``sub_account_id``).
36
+ *
37
+ * Deployment is per chain, so a valid protocol can still 422 on a given chain:
38
+ * AAVE on Ethereum, Base, Arbitrum, BSC and HyperEVM (where it is Hyperlend, the
39
+ * chain's Aave V3 deployment); MORPHO on Ethereum, Base, Arbitrum and HyperEVM
40
+ * (where it is Felix); EULER on Ethereum, Base, Arbitrum and BSC.
41
+ *
42
+ * All three support ``/v2/credit/loop`` and ``/v2/credit/unloop``. EULER does
43
+ * NOT: ``/v2/credit/rebalance`` rejects it with a 422, and
44
+ * ``/v2/credit/looped_positions`` covers only AAVE and MORPHO — an Euler loop is
45
+ * silently absent there rather than an error, so read it from
46
+ * ``/v2/credit/positions`` instead. (EULER still appears in the
47
+ * ``looped_positions`` response enum because this enum is shared; it is never
48
+ * emitted.)
36
49
  */
37
50
  protocol?: CreditProtocol | undefined;
38
51
  /**
@@ -31,11 +31,24 @@ export type CollateralPosition = {
31
31
  * @remarks
32
32
  *
33
33
  * ``AAVE`` is the default so existing callers (which never send a ``protocol``
34
- * field) keep hitting the unchanged Aave code path. ``MORPHO`` identifies Morpho
35
- * Blue lending markets by their bytes32 ``market_id``. ``EULER`` identifies Euler
36
- * V2 markets by their EVK ``collateral_vault`` + ``borrow_vault`` addresses and
37
- * supports isolated per-sub-account positions (``sub_account_id``). All three
38
- * support the loop/unloop leverage endpoints.
34
+ * field) keep hitting the unchanged Aave code path; markets are named by token
35
+ * symbol. ``MORPHO`` identifies Morpho Blue lending markets by their bytes32
36
+ * ``market_id``. ``EULER`` identifies Euler V2 markets by their EVK
37
+ * ``collateral_vault`` + ``borrow_vault`` addresses and supports isolated
38
+ * per-sub-account positions (``sub_account_id``).
39
+ *
40
+ * Deployment is per chain, so a valid protocol can still 422 on a given chain:
41
+ * AAVE on Ethereum, Base, Arbitrum, BSC and HyperEVM (where it is Hyperlend, the
42
+ * chain's Aave V3 deployment); MORPHO on Ethereum, Base, Arbitrum and HyperEVM
43
+ * (where it is Felix); EULER on Ethereum, Base, Arbitrum and BSC.
44
+ *
45
+ * All three support ``/v2/credit/loop`` and ``/v2/credit/unloop``. EULER does
46
+ * NOT: ``/v2/credit/rebalance`` rejects it with a 422, and
47
+ * ``/v2/credit/looped_positions`` covers only AAVE and MORPHO — an Euler loop is
48
+ * silently absent there rather than an error, so read it from
49
+ * ``/v2/credit/positions`` instead. (EULER still appears in the
50
+ * ``looped_positions`` response enum because this enum is shared; it is never
51
+ * emitted.)
39
52
  */
40
53
  protocol?: CreditProtocol | undefined;
41
54
  /**
@@ -54,11 +54,24 @@ export type CreditBorrowParams = {
54
54
  * @remarks
55
55
  *
56
56
  * ``AAVE`` is the default so existing callers (which never send a ``protocol``
57
- * field) keep hitting the unchanged Aave code path. ``MORPHO`` identifies Morpho
58
- * Blue lending markets by their bytes32 ``market_id``. ``EULER`` identifies Euler
59
- * V2 markets by their EVK ``collateral_vault`` + ``borrow_vault`` addresses and
60
- * supports isolated per-sub-account positions (``sub_account_id``). All three
61
- * support the loop/unloop leverage endpoints.
57
+ * field) keep hitting the unchanged Aave code path; markets are named by token
58
+ * symbol. ``MORPHO`` identifies Morpho Blue lending markets by their bytes32
59
+ * ``market_id``. ``EULER`` identifies Euler V2 markets by their EVK
60
+ * ``collateral_vault`` + ``borrow_vault`` addresses and supports isolated
61
+ * per-sub-account positions (``sub_account_id``).
62
+ *
63
+ * Deployment is per chain, so a valid protocol can still 422 on a given chain:
64
+ * AAVE on Ethereum, Base, Arbitrum, BSC and HyperEVM (where it is Hyperlend, the
65
+ * chain's Aave V3 deployment); MORPHO on Ethereum, Base, Arbitrum and HyperEVM
66
+ * (where it is Felix); EULER on Ethereum, Base, Arbitrum and BSC.
67
+ *
68
+ * All three support ``/v2/credit/loop`` and ``/v2/credit/unloop``. EULER does
69
+ * NOT: ``/v2/credit/rebalance`` rejects it with a 422, and
70
+ * ``/v2/credit/looped_positions`` covers only AAVE and MORPHO — an Euler loop is
71
+ * silently absent there rather than an error, so read it from
72
+ * ``/v2/credit/positions`` instead. (EULER still appears in the
73
+ * ``looped_positions`` response enum because this enum is shared; it is never
74
+ * emitted.)
62
75
  */
63
76
  protocol?: CreditProtocol | undefined;
64
77
  /**