@compass-labs/api-sdk 2.2.101 → 2.2.102

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 (219) 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 +5 -5
  43. package/dist/commonjs/models/components/creditloopresponse.js +1 -1
  44. package/dist/commonjs/models/components/creditprotocol.d.ts +36 -10
  45. package/dist/commonjs/models/components/creditprotocol.d.ts.map +1 -1
  46. package/dist/commonjs/models/components/creditprotocol.js +18 -5
  47. package/dist/commonjs/models/components/creditprotocol.js.map +1 -1
  48. package/dist/commonjs/models/components/creditrepayparams.d.ts +18 -5
  49. package/dist/commonjs/models/components/creditrepayparams.d.ts.map +1 -1
  50. package/dist/commonjs/models/components/creditrepayparams.js.map +1 -1
  51. package/dist/commonjs/models/components/creditrepayrequest.d.ts +18 -5
  52. package/dist/commonjs/models/components/creditrepayrequest.d.ts.map +1 -1
  53. package/dist/commonjs/models/components/creditrepayrequest.js.map +1 -1
  54. package/dist/commonjs/models/components/creditsupplyparams.d.ts +18 -5
  55. package/dist/commonjs/models/components/creditsupplyparams.d.ts.map +1 -1
  56. package/dist/commonjs/models/components/creditsupplyparams.js.map +1 -1
  57. package/dist/commonjs/models/components/creditunlooprequest.d.ts +23 -10
  58. package/dist/commonjs/models/components/creditunlooprequest.d.ts.map +1 -1
  59. package/dist/commonjs/models/components/creditunlooprequest.js +1 -1
  60. package/dist/commonjs/models/components/creditunlooprequest.js.map +1 -1
  61. package/dist/commonjs/models/components/creditunloopresponse.d.ts +5 -5
  62. package/dist/commonjs/models/components/creditunloopresponse.js +1 -1
  63. package/dist/commonjs/models/components/creditwithdrawparams.d.ts +18 -5
  64. package/dist/commonjs/models/components/creditwithdrawparams.d.ts.map +1 -1
  65. package/dist/commonjs/models/components/creditwithdrawparams.js.map +1 -1
  66. package/dist/commonjs/models/components/debtposition.d.ts +18 -5
  67. package/dist/commonjs/models/components/debtposition.d.ts.map +1 -1
  68. package/dist/commonjs/models/components/debtposition.js.map +1 -1
  69. package/dist/commonjs/models/components/loopedposition.d.ts +18 -5
  70. package/dist/commonjs/models/components/loopedposition.d.ts.map +1 -1
  71. package/dist/commonjs/models/components/loopedposition.js.map +1 -1
  72. package/dist/commonjs/models/components/rebalancetarget.d.ts +18 -5
  73. package/dist/commonjs/models/components/rebalancetarget.d.ts.map +1 -1
  74. package/dist/commonjs/models/components/rebalancetarget.js.map +1 -1
  75. package/dist/commonjs/models/components/rebalancetargetpreview.d.ts +18 -5
  76. package/dist/commonjs/models/components/rebalancetargetpreview.d.ts.map +1 -1
  77. package/dist/commonjs/models/components/rebalancetargetpreview.js.map +1 -1
  78. package/dist/commonjs/models/components/swapinfo.d.ts +2 -2
  79. package/dist/commonjs/sdk/credit.d.ts +44 -111
  80. package/dist/commonjs/sdk/credit.d.ts.map +1 -1
  81. package/dist/commonjs/sdk/credit.js +44 -111
  82. package/dist/commonjs/sdk/credit.js.map +1 -1
  83. package/dist/esm/funcs/creditCreditBorrow.d.ts +1 -1
  84. package/dist/esm/funcs/creditCreditBorrow.js +1 -1
  85. package/dist/esm/funcs/creditCreditLoop.d.ts +8 -22
  86. package/dist/esm/funcs/creditCreditLoop.d.ts.map +1 -1
  87. package/dist/esm/funcs/creditCreditLoop.js +8 -22
  88. package/dist/esm/funcs/creditCreditLoop.js.map +1 -1
  89. package/dist/esm/funcs/creditCreditLoopedPositions.d.ts +8 -7
  90. package/dist/esm/funcs/creditCreditLoopedPositions.d.ts.map +1 -1
  91. package/dist/esm/funcs/creditCreditLoopedPositions.js +8 -7
  92. package/dist/esm/funcs/creditCreditLoopedPositions.js.map +1 -1
  93. package/dist/esm/funcs/creditCreditRebalance.d.ts +11 -34
  94. package/dist/esm/funcs/creditCreditRebalance.d.ts.map +1 -1
  95. package/dist/esm/funcs/creditCreditRebalance.js +11 -34
  96. package/dist/esm/funcs/creditCreditRebalance.js.map +1 -1
  97. package/dist/esm/funcs/creditCreditRepay.d.ts +1 -1
  98. package/dist/esm/funcs/creditCreditRepay.js +1 -1
  99. package/dist/esm/funcs/creditCreditUnloop.d.ts +7 -38
  100. package/dist/esm/funcs/creditCreditUnloop.d.ts.map +1 -1
  101. package/dist/esm/funcs/creditCreditUnloop.js +7 -38
  102. package/dist/esm/funcs/creditCreditUnloop.js.map +1 -1
  103. package/dist/esm/lib/config.d.ts +2 -2
  104. package/dist/esm/lib/config.js +2 -2
  105. package/dist/esm/models/components/accountsummary.d.ts +18 -5
  106. package/dist/esm/models/components/accountsummary.d.ts.map +1 -1
  107. package/dist/esm/models/components/accountsummary.js.map +1 -1
  108. package/dist/esm/models/components/collateralposition.d.ts +18 -5
  109. package/dist/esm/models/components/collateralposition.d.ts.map +1 -1
  110. package/dist/esm/models/components/collateralposition.js.map +1 -1
  111. package/dist/esm/models/components/creditborrowparams.d.ts +18 -5
  112. package/dist/esm/models/components/creditborrowparams.d.ts.map +1 -1
  113. package/dist/esm/models/components/creditborrowparams.js.map +1 -1
  114. package/dist/esm/models/components/creditborrowrequest.d.ts +18 -5
  115. package/dist/esm/models/components/creditborrowrequest.d.ts.map +1 -1
  116. package/dist/esm/models/components/creditborrowrequest.js.map +1 -1
  117. package/dist/esm/models/components/creditenablecollateralparams.d.ts +18 -5
  118. package/dist/esm/models/components/creditenablecollateralparams.d.ts.map +1 -1
  119. package/dist/esm/models/components/creditenablecollateralparams.js.map +1 -1
  120. package/dist/esm/models/components/creditlooprequest.d.ts +27 -14
  121. package/dist/esm/models/components/creditlooprequest.d.ts.map +1 -1
  122. package/dist/esm/models/components/creditlooprequest.js +1 -1
  123. package/dist/esm/models/components/creditlooprequest.js.map +1 -1
  124. package/dist/esm/models/components/creditloopresponse.d.ts +5 -5
  125. package/dist/esm/models/components/creditloopresponse.js +1 -1
  126. package/dist/esm/models/components/creditprotocol.d.ts +36 -10
  127. package/dist/esm/models/components/creditprotocol.d.ts.map +1 -1
  128. package/dist/esm/models/components/creditprotocol.js +18 -5
  129. package/dist/esm/models/components/creditprotocol.js.map +1 -1
  130. package/dist/esm/models/components/creditrepayparams.d.ts +18 -5
  131. package/dist/esm/models/components/creditrepayparams.d.ts.map +1 -1
  132. package/dist/esm/models/components/creditrepayparams.js.map +1 -1
  133. package/dist/esm/models/components/creditrepayrequest.d.ts +18 -5
  134. package/dist/esm/models/components/creditrepayrequest.d.ts.map +1 -1
  135. package/dist/esm/models/components/creditrepayrequest.js.map +1 -1
  136. package/dist/esm/models/components/creditsupplyparams.d.ts +18 -5
  137. package/dist/esm/models/components/creditsupplyparams.d.ts.map +1 -1
  138. package/dist/esm/models/components/creditsupplyparams.js.map +1 -1
  139. package/dist/esm/models/components/creditunlooprequest.d.ts +23 -10
  140. package/dist/esm/models/components/creditunlooprequest.d.ts.map +1 -1
  141. package/dist/esm/models/components/creditunlooprequest.js +1 -1
  142. package/dist/esm/models/components/creditunlooprequest.js.map +1 -1
  143. package/dist/esm/models/components/creditunloopresponse.d.ts +5 -5
  144. package/dist/esm/models/components/creditunloopresponse.js +1 -1
  145. package/dist/esm/models/components/creditwithdrawparams.d.ts +18 -5
  146. package/dist/esm/models/components/creditwithdrawparams.d.ts.map +1 -1
  147. package/dist/esm/models/components/creditwithdrawparams.js.map +1 -1
  148. package/dist/esm/models/components/debtposition.d.ts +18 -5
  149. package/dist/esm/models/components/debtposition.d.ts.map +1 -1
  150. package/dist/esm/models/components/debtposition.js.map +1 -1
  151. package/dist/esm/models/components/loopedposition.d.ts +18 -5
  152. package/dist/esm/models/components/loopedposition.d.ts.map +1 -1
  153. package/dist/esm/models/components/loopedposition.js.map +1 -1
  154. package/dist/esm/models/components/rebalancetarget.d.ts +18 -5
  155. package/dist/esm/models/components/rebalancetarget.d.ts.map +1 -1
  156. package/dist/esm/models/components/rebalancetarget.js.map +1 -1
  157. package/dist/esm/models/components/rebalancetargetpreview.d.ts +18 -5
  158. package/dist/esm/models/components/rebalancetargetpreview.d.ts.map +1 -1
  159. package/dist/esm/models/components/rebalancetargetpreview.js.map +1 -1
  160. package/dist/esm/models/components/swapinfo.d.ts +2 -2
  161. package/dist/esm/sdk/credit.d.ts +44 -111
  162. package/dist/esm/sdk/credit.d.ts.map +1 -1
  163. package/dist/esm/sdk/credit.js +44 -111
  164. package/dist/esm/sdk/credit.js.map +1 -1
  165. package/docs/models/components/accountsummary.md +11 -11
  166. package/docs/models/components/collateralposition.md +17 -17
  167. package/docs/models/components/creditborrowparams.md +11 -11
  168. package/docs/models/components/creditborrowrequest.md +21 -21
  169. package/docs/models/components/creditenablecollateralparams.md +7 -7
  170. package/docs/models/components/creditlooprequest.md +19 -19
  171. package/docs/models/components/creditlooprequestchain.md +1 -1
  172. package/docs/models/components/creditlooprequestinitialcollateralamount.md +1 -1
  173. package/docs/models/components/creditlooprequestloantovalue.md +1 -1
  174. package/docs/models/components/creditloopresponse.md +8 -8
  175. package/docs/models/components/creditloopresponseswapprovider.md +1 -1
  176. package/docs/models/components/creditprotocol.md +18 -5
  177. package/docs/models/components/creditrepayparams.md +10 -10
  178. package/docs/models/components/creditrepayrequest.md +20 -20
  179. package/docs/models/components/creditsupplyparams.md +9 -9
  180. package/docs/models/components/creditunlooprequest.md +17 -17
  181. package/docs/models/components/creditunlooprequestchain.md +1 -1
  182. package/docs/models/components/creditunloopresponse.md +8 -8
  183. package/docs/models/components/creditunloopresponseswapprovider.md +1 -1
  184. package/docs/models/components/creditwithdrawparams.md +9 -9
  185. package/docs/models/components/debtposition.md +16 -16
  186. package/docs/models/components/loopedposition.md +14 -14
  187. package/docs/models/components/rebalancetarget.md +10 -10
  188. package/docs/models/components/rebalancetargetpreview.md +16 -16
  189. package/docs/models/components/swapinfo.md +10 -10
  190. package/docs/sdks/credit/README.md +40 -107
  191. package/openapi_prepped_for_speakeasy.json +26 -26
  192. package/package.json +1 -1
  193. package/src/funcs/creditCreditBorrow.ts +1 -1
  194. package/src/funcs/creditCreditLoop.ts +8 -22
  195. package/src/funcs/creditCreditLoopedPositions.ts +8 -7
  196. package/src/funcs/creditCreditRebalance.ts +11 -34
  197. package/src/funcs/creditCreditRepay.ts +1 -1
  198. package/src/funcs/creditCreditUnloop.ts +7 -38
  199. package/src/lib/config.ts +2 -2
  200. package/src/models/components/accountsummary.ts +18 -5
  201. package/src/models/components/collateralposition.ts +18 -5
  202. package/src/models/components/creditborrowparams.ts +18 -5
  203. package/src/models/components/creditborrowrequest.ts +18 -5
  204. package/src/models/components/creditenablecollateralparams.ts +18 -5
  205. package/src/models/components/creditlooprequest.ts +27 -14
  206. package/src/models/components/creditloopresponse.ts +5 -5
  207. package/src/models/components/creditprotocol.ts +36 -10
  208. package/src/models/components/creditrepayparams.ts +18 -5
  209. package/src/models/components/creditrepayrequest.ts +18 -5
  210. package/src/models/components/creditsupplyparams.ts +18 -5
  211. package/src/models/components/creditunlooprequest.ts +23 -10
  212. package/src/models/components/creditunloopresponse.ts +5 -5
  213. package/src/models/components/creditwithdrawparams.ts +18 -5
  214. package/src/models/components/debtposition.ts +18 -5
  215. package/src/models/components/loopedposition.ts +18 -5
  216. package/src/models/components/rebalancetarget.ts +18 -5
  217. package/src/models/components/rebalancetargetpreview.ts +18 -5
  218. package/src/models/components/swapinfo.ts +2 -2
  219. package/src/sdk/credit.ts +44 -111
@@ -23,20 +23,20 @@ let value: CreditUnloopRequest = {
23
23
 
24
24
  ## Fields
25
25
 
26
- | Field | Type | Required | Description | Example |
27
- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
28
- | `owner` | *string* | :heavy_check_mark: | The address that owns the Credit Account. | 0x0E407CdeBD8e078E6966ef6740540d25F5897082 |
29
- | `chain` | [components.CreditUnloopRequestChain](../../models/components/creditunlooprequestchain.md) | :heavy_check_mark: | Blockchain network. | ethereum |
30
- | `protocol` | [components.CreditProtocol](../../models/components/creditprotocol.md) | :heavy_minus_sign: | 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. | |
31
- | `marketId` | *string* | :heavy_minus_sign: | Morpho only: the bytes32 market id (from /v2/credit/morpho_markets). Required when protocol=MORPHO. | |
32
- | `collateralVault` | *string* | :heavy_minus_sign: | Euler only: the EVK vault the loop's collateral is in. Required when protocol=EULER. | |
33
- | `borrowVault` | *string* | :heavy_minus_sign: | Euler only: the EVK vault the loop borrowed from (the sub-account's controller). Required when protocol=EULER. | |
34
- | `subAccountId` | *number* | :heavy_minus_sign: | Euler only: the EVC sub-account (0-255) holding the looped position to unwind. 0 is the Credit Account itself. | 0 |
35
- | `collateralToken` | *string* | :heavy_check_mark: | Token supplied as collateral in the loop being unwound. For MORPHO it must be the market's collateral token. | WETH |
36
- | `borrowToken` | *string* | :heavy_check_mark: | Token borrowed in the loop; withdrawn collateral is swapped back to it and used to repay. For MORPHO it must be the market's loan token. | USDC |
37
- | `targetMultiplier` | *components.CreditUnloopRequestTargetMultiplier* | :heavy_minus_sign: | Target leverage after the unwind. Omit (null) for a FULL unwind: the debt is cleared exactly — accrued interest included — and all pair collateral is withdrawn back to the Credit Account. `1` runs the same exact debt close but leaves the collateral supplied (earning). A value greater than 1 delevers the position to that multiplier. Must be below the position's current multiplier. | |
38
- | `maxSlippagePercent` | *components.CreditUnloopRequestMaxSlippagePercent* | :heavy_minus_sign: | Per-swap slippage tolerance in percent. Unwind dust is bounded by this per iteration, so tighter slippage means less dust. | 0.5 |
39
- | `allowPartial` | *boolean* | :heavy_minus_sign: | 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. | false |
40
- | `gasSponsorship` | *boolean* | :heavy_minus_sign: | If true, returns EIP-712 typed data for gas-sponsored execution instead of an unsigned transaction. | false |
41
- | `preview` | *boolean* | :heavy_minus_sign: | If true, build a display estimate only — 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. | false |
42
- | `pricing` | [components.CreditUnloopRequestPricing](../../models/components/creditunlooprequestpricing.md) | :heavy_minus_sign: | Swap-leg routing policy. 'auto': firm quotes where a firm venue covers the pair, transparent fallback to the market aggregator otherwise. 'firm': never price on the market route — previews the firm venue cannot serve return the firm_available advisory alone (preview=null, zero aggregator calls), and executions fail with a typed error instead of silently substituting market pricing. 'market': never route through the firm venue; every leg is priced by the aggregator. max_slippage_percent applies on EVERY policy — unlike the loop, firm unwinds consume it to size the guaranteed withdraw/repay floors (the fills themselves are exact). 'firm' is incompatible with gas_sponsorship (sponsored unwinds force market routing). | auto |
26
+ | Field | Type | Required | Description | Example |
27
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
28
+ | `owner` | *string* | :heavy_check_mark: | The address that owns the Credit Account. | 0x0E407CdeBD8e078E6966ef6740540d25F5897082 |
29
+ | `chain` | [components.CreditUnloopRequestChain](../../models/components/creditunlooprequestchain.md) | :heavy_check_mark: | Blockchain network. Not every protocol is deployed on every chain — see the protocol field — and a chain with no credit venue at all returns a 422 naming the chains that do. | ethereum |
30
+ | `protocol` | [components.CreditProtocol](../../models/components/creditprotocol.md) | :heavy_minus_sign: | 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.) | |
31
+ | `marketId` | *string* | :heavy_minus_sign: | Morpho only: the bytes32 market id (from /v2/credit/morpho_markets). Required when protocol=MORPHO. | |
32
+ | `collateralVault` | *string* | :heavy_minus_sign: | Euler only: the EVK vault the loop's collateral is in. Required when protocol=EULER. | |
33
+ | `borrowVault` | *string* | :heavy_minus_sign: | Euler only: the EVK vault the loop borrowed from (the sub-account's controller). Required when protocol=EULER. | |
34
+ | `subAccountId` | *number* | :heavy_minus_sign: | Euler only: the EVC sub-account (0-255) holding the looped position to unwind. 0 is the Credit Account itself. | 0 |
35
+ | `collateralToken` | *string* | :heavy_check_mark: | Token supplied as collateral in the loop being unwound. For MORPHO it must be the market's collateral token. | WETH |
36
+ | `borrowToken` | *string* | :heavy_check_mark: | Token borrowed in the loop; withdrawn collateral is swapped back to it and used to repay. For MORPHO it must be the market's loan token. | USDC |
37
+ | `targetMultiplier` | *components.CreditUnloopRequestTargetMultiplier* | :heavy_minus_sign: | Target leverage after the unwind. Omit (null) for a FULL unwind: the debt is cleared exactly — accrued interest included — and all pair collateral is withdrawn back to the Credit Account. `1` runs the same exact debt close but leaves the collateral supplied (earning). A value greater than 1 delevers the position to that multiplier. Must be below the position's current multiplier. | |
38
+ | `maxSlippagePercent` | *components.CreditUnloopRequestMaxSlippagePercent* | :heavy_minus_sign: | Per-swap slippage tolerance in percent. Unwind dust is bounded by this per iteration, so tighter slippage means less dust. | 0.5 |
39
+ | `allowPartial` | *boolean* | :heavy_minus_sign: | 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. | false |
40
+ | `gasSponsorship` | *boolean* | :heavy_minus_sign: | If true, returns EIP-712 typed data for gas-sponsored execution instead of an unsigned transaction. | false |
41
+ | `preview` | *boolean* | :heavy_minus_sign: | If true, build a display estimate only — no single-use firm quote is ever spent. NOTE that this guarantees only that no firm quote was spent — 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. | false |
42
+ | `pricing` | [components.CreditUnloopRequestPricing](../../models/components/creditunlooprequestpricing.md) | :heavy_minus_sign: | Swap-leg routing policy. 'auto': firm quotes where a firm venue covers the pair, transparent fallback to the market aggregator otherwise. 'firm': never price on the market route — previews the firm venue cannot serve return the firm_available advisory alone (preview=null, zero aggregator calls), and executions fail with a typed error instead of silently substituting market pricing. 'market': never route through the firm venue; every leg is priced by the aggregator. max_slippage_percent applies on EVERY policy — unlike the loop, firm unwinds consume it to size the guaranteed withdraw/repay floors (the fills themselves are exact). 'firm' is incompatible with gas_sponsorship (sponsored unwinds force market routing). | auto |
@@ -1,6 +1,6 @@
1
1
  # CreditUnloopRequestChain
2
2
 
3
- Blockchain network.
3
+ Blockchain network. Not every protocol is deployed on every chain — see the protocol field — and a chain with no credit venue at all returns a 422 naming the chains that do.
4
4
 
5
5
  ## Example Usage
6
6
 
@@ -27,11 +27,11 @@ let value: CreditUnloopResponse = {
27
27
 
28
28
  ## Fields
29
29
 
30
- | Field | Type | Required | Description | Example |
31
- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
32
- | `transaction` | [components.UnsignedTransaction](../../models/components/unsignedtransaction.md) | :heavy_minus_sign: | Unsigned transaction for direct execution by the owner. Present when gas_sponsorship=false — 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. | |
33
- | `eip712` | [components.BatchedSafeOperationsResponseOutput](../../models/components/batchedsafeoperationsresponseoutput.md) | :heavy_minus_sign: | EIP-712 typed data for gas-sponsored execution. Present when gas_sponsorship=true. | |
34
- | `preview` | [components.CreditUnloopPreview](../../models/components/creditunlooppreview.md) | :heavy_check_mark: | Projected end state, computed on guaranteed swap floors. Null only on pricing='firm' preview responses whose unwind the firm venue cannot serve: no leg was priced on any venue, and the response carries the firm_available advisory alone. | |
35
- | `swapProvider` | [components.CreditUnloopResponseSwapProvider](../../models/components/creditunloopresponseswapprovider.md) | :heavy_minus_sign: | 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. | one_inch |
36
- | `quoteExpiresAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | Deadline of the firm swap quotes (the earliest across the unwind's swap legs) — 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). | |
37
- | `firmAvailable` | *boolean* | :heavy_minus_sign: | Preview-only advisory: whether a firm-quote venue can serve this unwind's swap legs (estimated without spending any quote). Present only on preview=true responses; null otherwise. Computed on every policy — including pricing='market', whose preview numbers stay market-priced — so a client that opted out can keep the boundary visible. | |
30
+ | Field | Type | Required | Description | Example |
31
+ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
32
+ | `transaction` | [components.UnsignedTransaction](../../models/components/unsignedtransaction.md) | :heavy_minus_sign: | Unsigned transaction for direct execution by the owner. Present when gas_sponsorship=false — 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. | |
33
+ | `eip712` | [components.BatchedSafeOperationsResponseOutput](../../models/components/batchedsafeoperationsresponseoutput.md) | :heavy_minus_sign: | EIP-712 typed data for gas-sponsored execution. Present when gas_sponsorship=true. | |
34
+ | `preview` | [components.CreditUnloopPreview](../../models/components/creditunlooppreview.md) | :heavy_check_mark: | Projected end state, computed on guaranteed swap floors. Null only on pricing='firm' preview responses whose unwind the firm venue cannot serve: no leg was priced on any venue, and the response carries the firm_available advisory alone. | |
35
+ | `swapProvider` | [components.CreditUnloopResponseSwapProvider](../../models/components/creditunloopresponseswapprovider.md) | :heavy_minus_sign: | Identifies which route priced the swap leg(s): a DEX AGGREGATOR (pool liquidity, slippage-bounded floors) or a FIRM provider (quotes, one per swap leg, each partially filled at the leg's size). On preview=true responses a firm value 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 — so neither substitutes for this field. | one_inch |
36
+ | `quoteExpiresAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | Deadline of the firm swap quotes (the earliest across the unwind's swap legs) — 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). | |
37
+ | `firmAvailable` | *boolean* | :heavy_minus_sign: | Preview-only advisory: whether a firm-quote venue can serve this unwind's swap legs (estimated without spending any quote). Present only on preview=true responses; null otherwise. Computed on every policy — including pricing='market', whose preview numbers stay market-priced — so a client that opted out can keep the boundary visible. | |
@@ -1,6 +1,6 @@
1
1
  # CreditUnloopResponseSwapProvider
2
2
 
3
- 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.
3
+ Identifies which route priced the swap leg(s): a DEX AGGREGATOR (pool liquidity, slippage-bounded floors) or a FIRM provider (quotes, one per swap leg, each partially filled at the leg's size). On preview=true responses a firm value 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 — so neither substitutes for this field.
4
4
 
5
5
  ## Example Usage
6
6