@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
@@ -26,19 +26,19 @@ let value: RebalanceTargetPreview = {
26
26
 
27
27
  ## Fields
28
28
 
29
- | Field | Type | Required | Description | Example |
30
- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
31
- | `protocol` | [components.CreditProtocol](../../models/components/creditprotocol.md) | :heavy_check_mark: | Which lending protocol a credit action targets.<br/><br/>``AAVE`` is the default so existing callers (which never send a ``protocol``<br/>field) keep hitting the unchanged Aave code path. ``MORPHO`` identifies Morpho<br/>Blue lending markets by their bytes32 ``market_id``. ``EULER`` identifies Euler<br/>V2 markets by their EVK ``collateral_vault`` + ``borrow_vault`` addresses and<br/>supports isolated per-sub-account positions (``sub_account_id``). All three<br/>support the loop/unloop leverage endpoints. | |
32
- | `marketId` | *string* | :heavy_minus_sign: | Morpho only: the bytes32 market id of this position. | |
33
- | `collateralToken` | *string* | :heavy_check_mark: | Collateral token address (echoes the request target; joins against /v2/credit/looped_positions). | |
34
- | `borrowToken` | *string* | :heavy_check_mark: | Borrow token address (echoes the request target). | |
35
- | `direction` | [components.RebalanceDirection](../../models/components/rebalancedirection.md) | :heavy_check_mark: | What the plan does to one named target. | |
36
- | `legs` | *number* | :heavy_check_mark: | On-chain legs planned for this target (loop + unloop iterations); 0 for a noop. | |
37
- | `unloopLegs` | [components.UnloopLegPreview](../../models/components/unlooplegpreview.md)[] | :heavy_minus_sign: | Per-iteration unwind breakdown — populated for releasers (close / shrink / lever_down). | [] |
38
- | `loopLegs` | [components.LoopLegPreview](../../models/components/looplegpreview.md)[] | :heavy_minus_sign: | Per-iteration loop breakdown — populated for consumers (open / grow / lever_up). | [] |
39
- | `resultingCollateral` | *string* | :heavy_check_mark: | Guaranteed minimum collateral supplied to this position after the rebalance (token units). | |
40
- | `resultingDebt` | *string* | :heavy_check_mark: | Projected debt owed by this position after the rebalance (borrow-token units); 0 on a close. | |
41
- | `resultingMultiplier` | *string* | :heavy_check_mark: | Projected leverage of this position after the rebalance; 1 when the debt is cleared. Never promises more leverage (or, when deleveraging, more deleverage) than is guaranteed. | |
42
- | `resultingHealthFactor` | *string* | :heavy_check_mark: | Projected health factor of this position after the rebalance. Never overstated at the 1.0 boundary — a liquidatable position is never presented as safe. See health_factor_scope for what it covers. | |
43
- | `healthFactorScope` | [components.RebalanceTargetPreviewHealthFactorScope](../../models/components/rebalancetargetpreviewhealthfactorscope.md) | :heavy_check_mark: | 'market' for Morpho (isolated per-market health). 'account' for Aave: collateral is pooled, so all collateral backs all debt and this health factor is shared by every Aave position on the account. | |
44
- | `estimatedMaxDust` | *string* | :heavy_check_mark: | Upper bound of surplus this target's own swaps can leave in the Credit Account (sum of each swap's quote minus its guaranteed floor). Routing swaps are counted book-level, not here. It accumulates in the Credit Account, is recoverable, and is never lost. | |
29
+ | Field | Type | Required | Description | Example |
30
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
31
+ | `protocol` | [components.CreditProtocol](../../models/components/creditprotocol.md) | :heavy_check_mark: | Which lending protocol a credit action targets.<br/><br/>``AAVE`` is the default so existing callers (which never send a ``protocol``<br/>field) keep hitting the unchanged Aave code path; markets are named by token<br/>symbol. ``MORPHO`` identifies Morpho Blue lending markets by their bytes32<br/>``market_id``. ``EULER`` identifies Euler V2 markets by their EVK<br/>``collateral_vault`` + ``borrow_vault`` addresses and supports isolated<br/>per-sub-account positions (``sub_account_id``).<br/><br/>Deployment is per chain, so a valid protocol can still 422 on a given chain:<br/>AAVE on Ethereum, Base, Arbitrum, BSC and HyperEVM (where it is Hyperlend, the<br/>chain's Aave V3 deployment); MORPHO on Ethereum, Base, Arbitrum and HyperEVM<br/>(where it is Felix); EULER on Ethereum, Base, Arbitrum and BSC.<br/><br/>All three support ``/v2/credit/loop`` and ``/v2/credit/unloop``. EULER does<br/>NOT: ``/v2/credit/rebalance`` rejects it with a 422, and<br/>``/v2/credit/looped_positions`` covers only AAVE and MORPHO — an Euler loop is<br/>silently absent there rather than an error, so read it from<br/>``/v2/credit/positions`` instead. (EULER still appears in the<br/>``looped_positions`` response enum because this enum is shared; it is never<br/>emitted.) | |
32
+ | `marketId` | *string* | :heavy_minus_sign: | Morpho only: the bytes32 market id of this position. | |
33
+ | `collateralToken` | *string* | :heavy_check_mark: | Collateral token address (echoes the request target; joins against /v2/credit/looped_positions). | |
34
+ | `borrowToken` | *string* | :heavy_check_mark: | Borrow token address (echoes the request target). | |
35
+ | `direction` | [components.RebalanceDirection](../../models/components/rebalancedirection.md) | :heavy_check_mark: | What the plan does to one named target. | |
36
+ | `legs` | *number* | :heavy_check_mark: | On-chain legs planned for this target (loop + unloop iterations); 0 for a noop. | |
37
+ | `unloopLegs` | [components.UnloopLegPreview](../../models/components/unlooplegpreview.md)[] | :heavy_minus_sign: | Per-iteration unwind breakdown — populated for releasers (close / shrink / lever_down). | [] |
38
+ | `loopLegs` | [components.LoopLegPreview](../../models/components/looplegpreview.md)[] | :heavy_minus_sign: | Per-iteration loop breakdown — populated for consumers (open / grow / lever_up). | [] |
39
+ | `resultingCollateral` | *string* | :heavy_check_mark: | Guaranteed minimum collateral supplied to this position after the rebalance (token units). | |
40
+ | `resultingDebt` | *string* | :heavy_check_mark: | Projected debt owed by this position after the rebalance (borrow-token units); 0 on a close. | |
41
+ | `resultingMultiplier` | *string* | :heavy_check_mark: | Projected leverage of this position after the rebalance; 1 when the debt is cleared. Never promises more leverage (or, when deleveraging, more deleverage) than is guaranteed. | |
42
+ | `resultingHealthFactor` | *string* | :heavy_check_mark: | Projected health factor of this position after the rebalance. Never overstated at the 1.0 boundary — a liquidatable position is never presented as safe. See health_factor_scope for what it covers. | |
43
+ | `healthFactorScope` | [components.RebalanceTargetPreviewHealthFactorScope](../../models/components/rebalancetargetpreviewhealthfactorscope.md) | :heavy_check_mark: | 'market' for Morpho (isolated per-market health). 'account' for Aave: collateral is pooled, so all collateral backs all debt and this health factor is shared by every Aave position on the account. | |
44
+ | `estimatedMaxDust` | *string* | :heavy_check_mark: | Upper bound of surplus this target's own swaps can leave in the Credit Account (sum of each swap's quote minus its guaranteed floor). Routing swaps are counted book-level, not here. It accumulates in the Credit Account, is recoverable, and is never lost. | |
@@ -4,7 +4,7 @@ The DEX swap leg detected inside a loop transaction.
4
4
 
5
5
  Evidence is token-filtered and executor-proof: the sold (debt) token left the
6
6
  account to a non-protocol counterparty and the bought (collateral) token
7
- arrived from a non-protocol counterparty. 1inch fills often settle from an
7
+ arrived from a non-protocol counterparty. Aggregator fills often settle from an
8
8
  executor contract, so the router is recorded only when it happens to be the
9
9
  outbound counterparty — it is never required for detection.
10
10
 
@@ -25,12 +25,12 @@ let value: SwapInfo = {
25
25
 
26
26
  ## Fields
27
27
 
28
- | Field | Type | Required | Description |
29
- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
30
- | `soldToken` | *string* | :heavy_check_mark: | Token sold in the swap (the borrowed/debt token). |
31
- | `soldSymbol` | *string* | :heavy_check_mark: | Symbol of the sold token. |
32
- | `soldAmount` | *string* | :heavy_check_mark: | Amount of the sold token. |
33
- | `boughtToken` | *string* | :heavy_check_mark: | Token bought in the swap (the collateral token). |
34
- | `boughtSymbol` | *string* | :heavy_check_mark: | Symbol of the bought token. |
35
- | `boughtAmount` | *string* | :heavy_check_mark: | Amount of the bought token. |
36
- | `router` | *string* | :heavy_minus_sign: | The outbound counterparty when it is the 1inch aggregation router. Null when the swap settled from an executor contract (informational only — never required to detect the swap). |
28
+ | Field | Type | Required | Description |
29
+ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
30
+ | `soldToken` | *string* | :heavy_check_mark: | Token sold in the swap (the borrowed/debt token). |
31
+ | `soldSymbol` | *string* | :heavy_check_mark: | Symbol of the sold token. |
32
+ | `soldAmount` | *string* | :heavy_check_mark: | Amount of the sold token. |
33
+ | `boughtToken` | *string* | :heavy_check_mark: | Token bought in the swap (the collateral token). |
34
+ | `boughtSymbol` | *string* | :heavy_check_mark: | Symbol of the bought token. |
35
+ | `boughtAmount` | *string* | :heavy_check_mark: | Amount of the bought token. |
36
+ | `router` | *string* | :heavy_minus_sign: | The outbound counterparty when it is the swap router itself. Null when the swap settled from an executor contract (informational only — never required to detect the swap). |
@@ -178,14 +178,15 @@ run();
178
178
 
179
179
  ## creditLoopedPositions
180
180
 
181
- List looped (leveraged) positions for a credit account owner.
181
+ List the leveraged positions held by an owner's Credit Account.
182
182
 
183
- Detects loops from the account's on-chain history: a transaction containing
184
- lending + borrowing + swap legs is a loop transaction. Returns one position
185
- per Morpho market / Aave collateral+debt reserve pair, each with its complete
186
- per-transaction history, lifetime totals, and live on-chain state (health
187
- factor, USD values, leverage) for open positions. Covers Aave V3 and Morpho
188
- Blue.
183
+ Positions are reconstructed from on-chain history rather than from API calls,
184
+ so a loop assembled by hand through /v2/credit/bundle is recognised the same
185
+ way as one opened through /v2/credit/loop. Only activity inside the Credit
186
+ Account is visible leverage the owner holds directly in their wallet is not.
187
+
188
+ See the [Leveraged Looping guide](https://docs.compasslabs.ai/v2/Products/Looping)
189
+ for protocol coverage and how to read leverage, health factor and net APY.
189
190
 
190
191
  ### Example Usage
191
192
 
@@ -518,7 +519,7 @@ Borrow an asset from Aave using a Credit Account.
518
519
  Bundles an optional swap, collateral supply, and borrow into a single atomic Safe transaction.
519
520
 
520
521
  - If `token_in` equals `collateral_token`, the tokens are supplied directly as collateral.
521
- - If `token_in` differs from `collateral_token`, a swap is performed first via 1inch.
522
+ - If `token_in` differs from `collateral_token`, a market swap is performed first.
522
523
 
523
524
  The Credit Account must already be created via `/v2/credit/create_account` and funded with `token_in`.
524
525
 
@@ -612,30 +613,16 @@ run();
612
613
 
613
614
  ## creditLoop
614
615
 
615
- Open a leveraged loop into an Aave or Morpho market in ONE atomic transaction.
616
-
617
- Repeatedly supplies collateral, borrows at the requested loan-to-value, and
618
- swaps the borrow back to collateral. Each iteration's supply uses the swap's
619
- GUARANTEED minimum output (enforced on-chain), so a fill anywhere within the
620
- slippage tolerance can never break a later step; any positive surplus stays
621
- in the Credit Account (the preview reports the bound as estimated_max_dust).
622
- Very large loops relative to pool depth can still exceed the slippage
623
- tolerance through their own cumulative price impact — size accordingly or
624
- raise max_slippage_percent. Conversely, the geometric tail can shrink below
625
- the swap router's minimum routable size; when it does the loop simply ends
626
- early on that supply — the achieved multiplier is still guaranteed within
627
- 0.5% of the request or the call returns a clean 400.
628
-
629
- When the collateral token is itself an ERC-4626 vault share (e.g. a Morpho
630
- vault token like steakUSDC), each conversion swaps the borrow token to the
631
- vault's underlying asset and mints the shares via the vault's own deposit at
632
- net asset value instead of swapping the share token on a DEX — share tokens
633
- have no honest DEX route. A direct share-token route is only ever used when
634
- it prices within 1% of net asset value.
635
-
636
- The Credit Account must already hold initial_collateral_amount of
637
- collateral_token. For protocol=MORPHO pass a market_id from
638
- /v2/credit/morpho_markets.
616
+ Open a leveraged position in ONE atomic transaction.
617
+
618
+ Supply collateral, borrow against it, swap the borrowed token back to
619
+ collateral, repeat until total collateral reaches multiplier x
620
+ initial_collateral_amount. If any step fails the whole transaction reverts,
621
+ so a position is never left half-built.
622
+
623
+ See the [Leveraged Looping guide](https://docs.compasslabs.ai/v2/Products/Looping)
624
+ for chain coverage, market discovery, vault-share collateral, HyperEVM
625
+ specifics and the full error list.
639
626
 
640
627
  ### Example Usage
641
628
 
@@ -727,46 +714,15 @@ run();
727
714
 
728
715
  ## creditUnloop
729
716
 
730
- Unwind an Aave or Morpho loop in ONE atomic transaction.
731
-
732
- Repeatedly withdraws collateral, swaps it to the borrow token at a GUARANTEED
733
- minimum output (enforced on-chain), and repays. The floor discipline means a
734
- swap filling anywhere within the slippage tolerance can never break a later
735
- step; any positive surplus stays in the Credit Account as borrow-token dust
736
- (the preview reports the bound as estimated_max_dust).
737
-
738
- When the collateral token is itself an ERC-4626 vault share (e.g. a Morpho
739
- vault token like steakUSDC), each conversion redeems the shares through the
740
- vault at net asset value and swaps the underlying asset to the borrow token
741
- instead of swapping the share token on a DEX; a direct share-token route is
742
- only ever used when it prices within 1% of net asset value.
743
-
744
- Omit target_multiplier for a full close: the debt is cleared exactly —
745
- accrued interest included — and the pair collateral is returned to the Credit
746
- Account. Pass 1 to clear the debt but keep the collateral supplied, or a value
747
- above 1 to delever to that multiplier (it must be below the position's current
748
- multiplier).
749
-
750
- Each withdrawal is sized to keep the position's health factor ≥ 1.02 at that
751
- step, so a position opened very close to the liquidation threshold may need
752
- more than one transaction to fully close — set allow_partial=true to return
753
- the maximum single-transaction progress (preview.fully_unwound=false), then
754
- call unloop again to finish. Very large unwinds relative to pool depth can
755
- still exceed the slippage tolerance through their own cumulative price impact.
756
-
757
- Positions are unwound as far as the swap router can route; on a router-minimum
758
- stop the engine still withdraws all collateral not needed to back the residual,
759
- and completes a true full close whenever the unwind's own guaranteed swap
760
- surpluses (or the Credit Account's idle balance) cover the remainder — a
761
- residual below the router's minimum routable size never fails the call, it is
762
- reported honestly in the preview (fully_unwound=false).
763
-
764
- When other open Aave loops share this position's collateral reserve, a full
765
- close withdraws only this position's attributed share of the pooled collateral
766
- (event-ledger bookkeeping), leaving the rest supplied for the other positions.
767
-
768
- For protocol=MORPHO pass a market_id from /v2/credit/morpho_markets; inspect
769
- open loops via /v2/credit/looped_positions.
717
+ Unwind a leveraged position in ONE atomic transaction.
718
+
719
+ Withdraw collateral, swap it back to the borrow token, repay, repeat — until
720
+ the position reaches target_multiplier, or until the debt is cleared exactly
721
+ if you omit it. If any step fails the whole transaction reverts.
722
+
723
+ See the [Leveraged Looping guide](https://docs.compasslabs.ai/v2/Products/Looping)
724
+ for chain coverage, vault-share collateral, shared Aave reserves and the full
725
+ error list.
770
726
 
771
727
  ### Example Usage
772
728
 
@@ -854,43 +810,20 @@ run();
854
810
 
855
811
  ## creditRebalance
856
812
 
857
- Rebalance the leveraged credit book in ONE atomic transaction.
858
-
859
- List only the positions to change — anything not named is left untouched;
860
- remove a position with close=true. Each target states an end state:
861
- target_equity_usd (net USD committed) × target_multiplier.
862
-
863
- Releasing targets run first (each unwind/delever frees tokens into the Credit
864
- Account), the freed tokens are then routed by swaps at a GUARANTEED minimum
865
- output (enforced on-chain), and consuming targets run last — so moving a
866
- levered position between markets, token pairs, or protocols (Aave ↔ Morpho) is
867
- simply a close plus an open in the same transaction. Conversions involving an
868
- ERC-4626 vault-share token (e.g. a Morpho vault token like steakUSDC) go
869
- through the vault's own deposit/redeem at net asset value rather than a DEX
870
- swap of the share token.
871
-
872
- Net book growth is funded from the Credit Account's existing idle balance —
873
- fund it first via /v2/credit/transfer; a net release stays in the Credit
874
- Account as idle balance. Any swap surplus above the guaranteed floors also
875
- stays in the Credit Account (preview.estimated_max_dust) — recoverable, never
876
- lost.
877
-
878
- A book already at its target returns transaction: null with the preview — the
879
- call is idempotent and safe to drive from a converge-to-target loop.
813
+ Move one or more leveraged positions to the state you want, in ONE atomic
814
+ transaction.
880
815
 
881
- A rebalance too large for one transaction is rejected with a 422 split it
882
- into two calls. Every deleveraging step keeps the health factor ≥ 1.02 and
883
- every leveraging step respects the protocol's borrow limits; Aave targets share
884
- one account-level health factor, which the preview reports.
816
+ List the positions to change and the end state you want for each. The API
817
+ works out whether that means opening, growing, shrinking, delevering or
818
+ closing, and does them all together.
885
819
 
886
- Dust tails and routing swaps below the swap router's minimum routable size do
887
- not fail the call: a releasing target that cannot fully unwind returns its
888
- honest residual in the preview, and an unroutable routing swap is skipped
889
- (its uncovered amount only 422s the rebalance if it breaches the funding
890
- tolerance).
820
+ Money freed by shrinking or closing one position pays for growing or opening
821
+ another, so shifting funds between positions needs no new deposit. Any
822
+ shortfall is taken from the Credit Account's idle balance, and the call
823
+ returns 422 if that does not cover it either.
891
824
 
892
- For protocol=MORPHO pass a market_id from /v2/credit/morpho_markets; inspect the
893
- current book via /v2/credit/looped_positions.
825
+ See the [Leveraged Looping guide](https://docs.compasslabs.ai/v2/Products/Looping)
826
+ for protocol and chain coverage, capital routing and the full error list.
894
827
 
895
828
  ### Example Usage
896
829
 
@@ -1083,7 +1016,7 @@ Repay an Aave debt and withdraw collateral from a Credit Account.
1083
1016
  Bundles repayment, collateral withdrawal, and an optional swap into a single atomic Safe transaction.
1084
1017
 
1085
1018
  - If `token_out` is None or equals `withdraw_token`, the withdrawn collateral is kept as-is.
1086
- - If `token_out` differs from `withdraw_token`, a swap is performed after withdrawal via 1inch.
1019
+ - If `token_out` differs from `withdraw_token`, a market swap is performed after withdrawal.
1087
1020
 
1088
1021
  The Credit Account must already have a borrow position created via `/v2/credit/borrow`.
1089
1022
  The repay_token must be available in the Credit Account (or pulled from EOA via Permit2).