@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
@@ -29,11 +29,24 @@ export type CreditEnableCollateralParams = {
29
29
  * @remarks
30
30
  *
31
31
  * ``AAVE`` is the default so existing callers (which never send a ``protocol``
32
- * field) keep hitting the unchanged Aave code path. ``MORPHO`` identifies Morpho
33
- * Blue lending markets by their bytes32 ``market_id``. ``EULER`` identifies Euler
34
- * V2 markets by their EVK ``collateral_vault`` + ``borrow_vault`` addresses and
35
- * supports isolated per-sub-account positions (``sub_account_id``). All three
36
- * support the loop/unloop leverage endpoints.
32
+ * field) keep hitting the unchanged Aave code path; markets are named by token
33
+ * symbol. ``MORPHO`` identifies Morpho Blue lending markets by their bytes32
34
+ * ``market_id``. ``EULER`` identifies Euler V2 markets by their EVK
35
+ * ``collateral_vault`` + ``borrow_vault`` addresses and supports isolated
36
+ * per-sub-account positions (``sub_account_id``).
37
+ *
38
+ * Deployment is per chain, so a valid protocol can still 422 on a given chain:
39
+ * AAVE on Ethereum, Base, Arbitrum, BSC and HyperEVM (where it is Hyperlend, the
40
+ * chain's Aave V3 deployment); MORPHO on Ethereum, Base, Arbitrum and HyperEVM
41
+ * (where it is Felix); EULER on Ethereum, Base, Arbitrum and BSC.
42
+ *
43
+ * All three support ``/v2/credit/loop`` and ``/v2/credit/unloop``. EULER does
44
+ * NOT: ``/v2/credit/rebalance`` rejects it with a 422, and
45
+ * ``/v2/credit/looped_positions`` covers only AAVE and MORPHO — an Euler loop is
46
+ * silently absent there rather than an error, so read it from
47
+ * ``/v2/credit/positions`` instead. (EULER still appears in the
48
+ * ``looped_positions`` response enum because this enum is shared; it is never
49
+ * emitted.)
37
50
  */
38
51
  protocol?: CreditProtocol | undefined;
39
52
  /**
@@ -11,7 +11,7 @@ import {
11
11
  } from "./creditprotocol.js";
12
12
 
13
13
  /**
14
- * Blockchain network.
14
+ * 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.
15
15
  */
16
16
  export const CreditLoopRequestChain = {
17
17
  Arbitrum: "arbitrum",
@@ -22,12 +22,12 @@ export const CreditLoopRequestChain = {
22
22
  Tempo: "tempo",
23
23
  } as const;
24
24
  /**
25
- * Blockchain network.
25
+ * 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.
26
26
  */
27
27
  export type CreditLoopRequestChain = ClosedEnum<typeof CreditLoopRequestChain>;
28
28
 
29
29
  /**
30
- * Collateral (in token units) already held in the Credit Account to seed the loop.
30
+ * Collateral (in token units) that the Credit Account must ALREADY hold when this is called — the loop never pulls from the owner's wallet mid-transaction. Fund the account first via /v2/credit/transfer (action=DEPOSIT).
31
31
  */
32
32
  export type CreditLoopRequestInitialCollateralAmount = number | string;
33
33
 
@@ -37,7 +37,7 @@ export type CreditLoopRequestInitialCollateralAmount = number | string;
37
37
  export type CreditLoopRequestMultiplier = number | string;
38
38
 
39
39
  /**
40
- * Per-iteration borrow LTV in percent. Must not exceed the protocol's maximum for the market (Aave reserve/e-mode LTV; Morpho LLTV with a safety margin); borrows are sized slightly inside the requested value so no leg sits on the protocol's revert boundary.
40
+ * Per-iteration borrow LTV in percent. Must not exceed the protocol's maximum for the market (Aave reserve/e-mode LTV; Morpho LLTV with a safety margin; Euler's borrow LTV for the collateral vault); borrows are sized slightly inside the requested value so no leg sits on the protocol's revert boundary.
41
41
  */
42
42
  export type CreditLoopRequestLoanToValue = number | string;
43
43
 
@@ -74,7 +74,7 @@ export type CreditLoopRequest = {
74
74
  */
75
75
  owner: string;
76
76
  /**
77
- * Blockchain network.
77
+ * 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.
78
78
  */
79
79
  chain: CreditLoopRequestChain;
80
80
  /**
@@ -83,11 +83,24 @@ export type CreditLoopRequest = {
83
83
  * @remarks
84
84
  *
85
85
  * ``AAVE`` is the default so existing callers (which never send a ``protocol``
86
- * field) keep hitting the unchanged Aave code path. ``MORPHO`` identifies Morpho
87
- * Blue lending markets by their bytes32 ``market_id``. ``EULER`` identifies Euler
88
- * V2 markets by their EVK ``collateral_vault`` + ``borrow_vault`` addresses and
89
- * supports isolated per-sub-account positions (``sub_account_id``). All three
90
- * support the loop/unloop leverage endpoints.
86
+ * field) keep hitting the unchanged Aave code path; markets are named by token
87
+ * symbol. ``MORPHO`` identifies Morpho Blue lending markets by their bytes32
88
+ * ``market_id``. ``EULER`` identifies Euler V2 markets by their EVK
89
+ * ``collateral_vault`` + ``borrow_vault`` addresses and supports isolated
90
+ * per-sub-account positions (``sub_account_id``).
91
+ *
92
+ * Deployment is per chain, so a valid protocol can still 422 on a given chain:
93
+ * AAVE on Ethereum, Base, Arbitrum, BSC and HyperEVM (where it is Hyperlend, the
94
+ * chain's Aave V3 deployment); MORPHO on Ethereum, Base, Arbitrum and HyperEVM
95
+ * (where it is Felix); EULER on Ethereum, Base, Arbitrum and BSC.
96
+ *
97
+ * All three support ``/v2/credit/loop`` and ``/v2/credit/unloop``. EULER does
98
+ * NOT: ``/v2/credit/rebalance`` rejects it with a 422, and
99
+ * ``/v2/credit/looped_positions`` covers only AAVE and MORPHO — an Euler loop is
100
+ * silently absent there rather than an error, so read it from
101
+ * ``/v2/credit/positions`` instead. (EULER still appears in the
102
+ * ``looped_positions`` response enum because this enum is shared; it is never
103
+ * emitted.)
91
104
  */
92
105
  protocol?: CreditProtocol | undefined;
93
106
  /**
@@ -115,7 +128,7 @@ export type CreditLoopRequest = {
115
128
  */
116
129
  borrowToken: string;
117
130
  /**
118
- * Collateral (in token units) already held in the Credit Account to seed the loop.
131
+ * Collateral (in token units) that the Credit Account must ALREADY hold when this is called — the loop never pulls from the owner's wallet mid-transaction. Fund the account first via /v2/credit/transfer (action=DEPOSIT).
119
132
  */
120
133
  initialCollateralAmount: number | string;
121
134
  /**
@@ -123,7 +136,7 @@ export type CreditLoopRequest = {
123
136
  */
124
137
  multiplier: number | string;
125
138
  /**
126
- * Per-iteration borrow LTV in percent. Must not exceed the protocol's maximum for the market (Aave reserve/e-mode LTV; Morpho LLTV with a safety margin); borrows are sized slightly inside the requested value so no leg sits on the protocol's revert boundary.
139
+ * Per-iteration borrow LTV in percent. Must not exceed the protocol's maximum for the market (Aave reserve/e-mode LTV; Morpho LLTV with a safety margin; Euler's borrow LTV for the collateral vault); borrows are sized slightly inside the requested value so no leg sits on the protocol's revert boundary.
127
140
  */
128
141
  loanToValue: number | string;
129
142
  /**
@@ -131,7 +144,7 @@ export type CreditLoopRequest = {
131
144
  */
132
145
  maxSlippagePercent?: number | string | undefined;
133
146
  /**
134
- * Aave only: e-mode category to enable before looping (higher LTV for correlated pairs, e.g. ETH-correlated).
147
+ * Aave only: e-mode category to enable before looping (higher LTV for correlated pairs, e.g. ETH-correlated). Both tokens must belong to the category or the build returns a 422. On Hyperlend (chain=hyperevm) category 1 is the HYPE-correlated set covering wstHYPE and WHYPE.
135
148
  */
136
149
  emodeCategory?: number | null | undefined;
137
150
  /**
@@ -139,7 +152,7 @@ export type CreditLoopRequest = {
139
152
  */
140
153
  gasSponsorship?: boolean | undefined;
141
154
  /**
142
- * If true, build a display ESTIMATE: no firm RFQ quote is ever requested (quote_expires_at stays null) and no transaction is returned. How the estimate is priced follows `pricing`: on a firm-covered pair under 'auto' or 'firm' it is computed from the firm venue's live price levels (swap_provider='bebop', indicative); otherwise swap legs are priced by the default aggregator. Set it on every call made while a user is exploring parameters, and leave it false only for the build they actually intend to sign — firm quotes are single-use maker commitments, and requesting them for displays that are never executed degrades the pricing this API is offered.
155
+ * If true, build a display ESTIMATE: no firm RFQ quote is ever requested (quote_expires_at stays null). NOTE that this guarantees only that no firm quote was spent — it does not guarantee an absent transaction: on a pair no firm provider covers, and under pricing=market, the call still falls through to the aggregator and returns a signable transaction. How the estimate is priced follows `pricing`: on a firm-covered pair under 'auto' or 'firm' it is computed from the firm provider's live price levels (indicative); otherwise swap legs are priced by the default aggregator. Set it on every call made while a user is exploring parameters, and leave it false only for the build they actually intend to sign — firm quotes are single-use maker commitments, and requesting them for displays that are never executed degrades the pricing this API is offered.
143
156
  */
144
157
  preview?: boolean | undefined;
145
158
  /**
@@ -22,14 +22,14 @@ import {
22
22
  } from "./unsignedtransaction.js";
23
23
 
24
24
  /**
25
- * Which venue priced the swap leg(s): 'one_inch' (iterative loop, slippage-bounded floors) or 'bebop' (firm zero-slippage quotes, one per swap leg, each partially filled at the leg's size — exact fills, zero dust). On preview=true responses, 'bebop' means the numbers are INDICATIVE, computed from the firm venue's live maker price levels without spending any quote; execution fetches the firm quotes at signing time. Always present, including on fallbacks.
25
+ * Identifies which route priced the swap leg(s): a DEX AGGREGATOR (iterative loop across pool liquidity, slippage-bounded floors) or a FIRM provider (zero-slippage quotes, one per swap leg, each partially filled at the leg's size — exact fills, zero dust). 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.
26
26
  */
27
27
  export const CreditLoopResponseSwapProvider = {
28
28
  OneInch: "one_inch",
29
29
  Bebop: "bebop",
30
30
  } as const;
31
31
  /**
32
- * Which venue priced the swap leg(s): 'one_inch' (iterative loop, slippage-bounded floors) or 'bebop' (firm zero-slippage quotes, one per swap leg, each partially filled at the leg's size — exact fills, zero dust). On preview=true responses, 'bebop' means the numbers are INDICATIVE, computed from the firm venue's live maker price levels without spending any quote; execution fetches the firm quotes at signing time. Always present, including on fallbacks.
32
+ * Identifies which route priced the swap leg(s): a DEX AGGREGATOR (iterative loop across pool liquidity, slippage-bounded floors) or a FIRM provider (zero-slippage quotes, one per swap leg, each partially filled at the leg's size — exact fills, zero dust). 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.
33
33
  */
34
34
  export type CreditLoopResponseSwapProvider = ClosedEnum<
35
35
  typeof CreditLoopResponseSwapProvider
@@ -40,7 +40,7 @@ export type CreditLoopResponseSwapProvider = ClosedEnum<
40
40
  */
41
41
  export type CreditLoopResponse = {
42
42
  /**
43
- * 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.
43
+ * 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.
44
44
  */
45
45
  transaction?: UnsignedTransaction | null | undefined;
46
46
  /**
@@ -52,11 +52,11 @@ export type CreditLoopResponse = {
52
52
  */
53
53
  preview: CreditLoopPreview | null;
54
54
  /**
55
- * Which venue priced the swap leg(s): 'one_inch' (iterative loop, slippage-bounded floors) or 'bebop' (firm zero-slippage quotes, one per swap leg, each partially filled at the leg's size — exact fills, zero dust). On preview=true responses, 'bebop' means the numbers are INDICATIVE, computed from the firm venue's live maker price levels without spending any quote; execution fetches the firm quotes at signing time. Always present, including on fallbacks.
55
+ * Identifies which route priced the swap leg(s): a DEX AGGREGATOR (iterative loop across pool liquidity, slippage-bounded floors) or a FIRM provider (zero-slippage quotes, one per swap leg, each partially filled at the leg's size — exact fills, zero dust). 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.
56
56
  */
57
57
  swapProvider?: CreditLoopResponseSwapProvider | undefined;
58
58
  /**
59
- * Deadline of the firm swap quotes (the earliest across the loop'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).
59
+ * Deadline of the firm swap quotes (the earliest across the loop'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).
60
60
  */
61
61
  quoteExpiresAt?: Date | null | undefined;
62
62
  /**
@@ -11,11 +11,24 @@ import { ClosedEnum } from "../../types/enums.js";
11
11
  * @remarks
12
12
  *
13
13
  * ``AAVE`` is the default so existing callers (which never send a ``protocol``
14
- * field) keep hitting the unchanged Aave code path. ``MORPHO`` identifies Morpho
15
- * Blue lending markets by their bytes32 ``market_id``. ``EULER`` identifies Euler
16
- * V2 markets by their EVK ``collateral_vault`` + ``borrow_vault`` addresses and
17
- * supports isolated per-sub-account positions (``sub_account_id``). All three
18
- * support the loop/unloop leverage endpoints.
14
+ * field) keep hitting the unchanged Aave code path; markets are named by token
15
+ * symbol. ``MORPHO`` identifies Morpho Blue lending markets by their bytes32
16
+ * ``market_id``. ``EULER`` identifies Euler V2 markets by their EVK
17
+ * ``collateral_vault`` + ``borrow_vault`` addresses and supports isolated
18
+ * per-sub-account positions (``sub_account_id``).
19
+ *
20
+ * Deployment is per chain, so a valid protocol can still 422 on a given chain:
21
+ * AAVE on Ethereum, Base, Arbitrum, BSC and HyperEVM (where it is Hyperlend, the
22
+ * chain's Aave V3 deployment); MORPHO on Ethereum, Base, Arbitrum and HyperEVM
23
+ * (where it is Felix); EULER on Ethereum, Base, Arbitrum and BSC.
24
+ *
25
+ * All three support ``/v2/credit/loop`` and ``/v2/credit/unloop``. EULER does
26
+ * NOT: ``/v2/credit/rebalance`` rejects it with a 422, and
27
+ * ``/v2/credit/looped_positions`` covers only AAVE and MORPHO — an Euler loop is
28
+ * silently absent there rather than an error, so read it from
29
+ * ``/v2/credit/positions`` instead. (EULER still appears in the
30
+ * ``looped_positions`` response enum because this enum is shared; it is never
31
+ * emitted.)
19
32
  */
20
33
  export const CreditProtocol = {
21
34
  Aave: "AAVE",
@@ -28,11 +41,24 @@ export const CreditProtocol = {
28
41
  * @remarks
29
42
  *
30
43
  * ``AAVE`` is the default so existing callers (which never send a ``protocol``
31
- * field) keep hitting the unchanged Aave code path. ``MORPHO`` identifies Morpho
32
- * Blue lending markets by their bytes32 ``market_id``. ``EULER`` identifies Euler
33
- * V2 markets by their EVK ``collateral_vault`` + ``borrow_vault`` addresses and
34
- * supports isolated per-sub-account positions (``sub_account_id``). All three
35
- * support the loop/unloop leverage endpoints.
44
+ * field) keep hitting the unchanged Aave code path; markets are named by token
45
+ * symbol. ``MORPHO`` identifies Morpho Blue lending markets by their bytes32
46
+ * ``market_id``. ``EULER`` identifies Euler V2 markets by their EVK
47
+ * ``collateral_vault`` + ``borrow_vault`` addresses and supports isolated
48
+ * per-sub-account positions (``sub_account_id``).
49
+ *
50
+ * Deployment is per chain, so a valid protocol can still 422 on a given chain:
51
+ * AAVE on Ethereum, Base, Arbitrum, BSC and HyperEVM (where it is Hyperlend, the
52
+ * chain's Aave V3 deployment); MORPHO on Ethereum, Base, Arbitrum and HyperEVM
53
+ * (where it is Felix); EULER on Ethereum, Base, Arbitrum and BSC.
54
+ *
55
+ * All three support ``/v2/credit/loop`` and ``/v2/credit/unloop``. EULER does
56
+ * NOT: ``/v2/credit/rebalance`` rejects it with a 422, and
57
+ * ``/v2/credit/looped_positions`` covers only AAVE and MORPHO — an Euler loop is
58
+ * silently absent there rather than an error, so read it from
59
+ * ``/v2/credit/positions`` instead. (EULER still appears in the
60
+ * ``looped_positions`` response enum because this enum is shared; it is never
61
+ * emitted.)
36
62
  */
37
63
  export type CreditProtocol = ClosedEnum<typeof CreditProtocol>;
38
64
 
@@ -45,11 +45,24 @@ export type CreditRepayParams = {
45
45
  * @remarks
46
46
  *
47
47
  * ``AAVE`` is the default so existing callers (which never send a ``protocol``
48
- * field) keep hitting the unchanged Aave code path. ``MORPHO`` identifies Morpho
49
- * Blue lending markets by their bytes32 ``market_id``. ``EULER`` identifies Euler
50
- * V2 markets by their EVK ``collateral_vault`` + ``borrow_vault`` addresses and
51
- * supports isolated per-sub-account positions (``sub_account_id``). All three
52
- * support the loop/unloop leverage endpoints.
48
+ * field) keep hitting the unchanged Aave code path; markets are named by token
49
+ * symbol. ``MORPHO`` identifies Morpho Blue lending markets by their bytes32
50
+ * ``market_id``. ``EULER`` identifies Euler V2 markets by their EVK
51
+ * ``collateral_vault`` + ``borrow_vault`` addresses and supports isolated
52
+ * per-sub-account positions (``sub_account_id``).
53
+ *
54
+ * Deployment is per chain, so a valid protocol can still 422 on a given chain:
55
+ * AAVE on Ethereum, Base, Arbitrum, BSC and HyperEVM (where it is Hyperlend, the
56
+ * chain's Aave V3 deployment); MORPHO on Ethereum, Base, Arbitrum and HyperEVM
57
+ * (where it is Felix); EULER on Ethereum, Base, Arbitrum and BSC.
58
+ *
59
+ * All three support ``/v2/credit/loop`` and ``/v2/credit/unloop``. EULER does
60
+ * NOT: ``/v2/credit/rebalance`` rejects it with a 422, and
61
+ * ``/v2/credit/looped_positions`` covers only AAVE and MORPHO — an Euler loop is
62
+ * silently absent there rather than an error, so read it from
63
+ * ``/v2/credit/positions`` instead. (EULER still appears in the
64
+ * ``looped_positions`` response enum because this enum is shared; it is never
65
+ * emitted.)
53
66
  */
54
67
  protocol?: CreditProtocol | undefined;
55
68
  /**
@@ -62,11 +62,24 @@ export type CreditRepayRequest = {
62
62
  * @remarks
63
63
  *
64
64
  * ``AAVE`` is the default so existing callers (which never send a ``protocol``
65
- * field) keep hitting the unchanged Aave code path. ``MORPHO`` identifies Morpho
66
- * Blue lending markets by their bytes32 ``market_id``. ``EULER`` identifies Euler
67
- * V2 markets by their EVK ``collateral_vault`` + ``borrow_vault`` addresses and
68
- * supports isolated per-sub-account positions (``sub_account_id``). All three
69
- * support the loop/unloop leverage endpoints.
65
+ * field) keep hitting the unchanged Aave code path; markets are named by token
66
+ * symbol. ``MORPHO`` identifies Morpho Blue lending markets by their bytes32
67
+ * ``market_id``. ``EULER`` identifies Euler V2 markets by their EVK
68
+ * ``collateral_vault`` + ``borrow_vault`` addresses and supports isolated
69
+ * per-sub-account positions (``sub_account_id``).
70
+ *
71
+ * Deployment is per chain, so a valid protocol can still 422 on a given chain:
72
+ * AAVE on Ethereum, Base, Arbitrum, BSC and HyperEVM (where it is Hyperlend, the
73
+ * chain's Aave V3 deployment); MORPHO on Ethereum, Base, Arbitrum and HyperEVM
74
+ * (where it is Felix); EULER on Ethereum, Base, Arbitrum and BSC.
75
+ *
76
+ * All three support ``/v2/credit/loop`` and ``/v2/credit/unloop``. EULER does
77
+ * NOT: ``/v2/credit/rebalance`` rejects it with a 422, and
78
+ * ``/v2/credit/looped_positions`` covers only AAVE and MORPHO — an Euler loop is
79
+ * silently absent there rather than an error, so read it from
80
+ * ``/v2/credit/positions`` instead. (EULER still appears in the
81
+ * ``looped_positions`` response enum because this enum is shared; it is never
82
+ * emitted.)
70
83
  */
71
84
  protocol?: CreditProtocol | undefined;
72
85
  /**
@@ -33,11 +33,24 @@ export type CreditSupplyParams = {
33
33
  * @remarks
34
34
  *
35
35
  * ``AAVE`` is the default so existing callers (which never send a ``protocol``
36
- * field) keep hitting the unchanged Aave code path. ``MORPHO`` identifies Morpho
37
- * Blue lending markets by their bytes32 ``market_id``. ``EULER`` identifies Euler
38
- * V2 markets by their EVK ``collateral_vault`` + ``borrow_vault`` addresses and
39
- * supports isolated per-sub-account positions (``sub_account_id``). All three
40
- * support the loop/unloop leverage endpoints.
36
+ * field) keep hitting the unchanged Aave code path; markets are named by token
37
+ * symbol. ``MORPHO`` identifies Morpho Blue lending markets by their bytes32
38
+ * ``market_id``. ``EULER`` identifies Euler V2 markets by their EVK
39
+ * ``collateral_vault`` + ``borrow_vault`` addresses and supports isolated
40
+ * per-sub-account positions (``sub_account_id``).
41
+ *
42
+ * Deployment is per chain, so a valid protocol can still 422 on a given chain:
43
+ * AAVE on Ethereum, Base, Arbitrum, BSC and HyperEVM (where it is Hyperlend, the
44
+ * chain's Aave V3 deployment); MORPHO on Ethereum, Base, Arbitrum and HyperEVM
45
+ * (where it is Felix); EULER on Ethereum, Base, Arbitrum and BSC.
46
+ *
47
+ * All three support ``/v2/credit/loop`` and ``/v2/credit/unloop``. EULER does
48
+ * NOT: ``/v2/credit/rebalance`` rejects it with a 422, and
49
+ * ``/v2/credit/looped_positions`` covers only AAVE and MORPHO — an Euler loop is
50
+ * silently absent there rather than an error, so read it from
51
+ * ``/v2/credit/positions`` instead. (EULER still appears in the
52
+ * ``looped_positions`` response enum because this enum is shared; it is never
53
+ * emitted.)
41
54
  */
42
55
  protocol?: CreditProtocol | undefined;
43
56
  /**
@@ -11,7 +11,7 @@ import {
11
11
  } from "./creditprotocol.js";
12
12
 
13
13
  /**
14
- * Blockchain network.
14
+ * 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.
15
15
  */
16
16
  export const CreditUnloopRequestChain = {
17
17
  Arbitrum: "arbitrum",
@@ -22,7 +22,7 @@ export const CreditUnloopRequestChain = {
22
22
  Tempo: "tempo",
23
23
  } as const;
24
24
  /**
25
- * Blockchain network.
25
+ * 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.
26
26
  */
27
27
  export type CreditUnloopRequestChain = ClosedEnum<
28
28
  typeof CreditUnloopRequestChain
@@ -66,7 +66,7 @@ export type CreditUnloopRequest = {
66
66
  */
67
67
  owner: string;
68
68
  /**
69
- * Blockchain network.
69
+ * 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.
70
70
  */
71
71
  chain: CreditUnloopRequestChain;
72
72
  /**
@@ -75,11 +75,24 @@ export type CreditUnloopRequest = {
75
75
  * @remarks
76
76
  *
77
77
  * ``AAVE`` is the default so existing callers (which never send a ``protocol``
78
- * field) keep hitting the unchanged Aave code path. ``MORPHO`` identifies Morpho
79
- * Blue lending markets by their bytes32 ``market_id``. ``EULER`` identifies Euler
80
- * V2 markets by their EVK ``collateral_vault`` + ``borrow_vault`` addresses and
81
- * supports isolated per-sub-account positions (``sub_account_id``). All three
82
- * support the loop/unloop leverage endpoints.
78
+ * field) keep hitting the unchanged Aave code path; markets are named by token
79
+ * symbol. ``MORPHO`` identifies Morpho Blue lending markets by their bytes32
80
+ * ``market_id``. ``EULER`` identifies Euler V2 markets by their EVK
81
+ * ``collateral_vault`` + ``borrow_vault`` addresses and supports isolated
82
+ * per-sub-account positions (``sub_account_id``).
83
+ *
84
+ * Deployment is per chain, so a valid protocol can still 422 on a given chain:
85
+ * AAVE on Ethereum, Base, Arbitrum, BSC and HyperEVM (where it is Hyperlend, the
86
+ * chain's Aave V3 deployment); MORPHO on Ethereum, Base, Arbitrum and HyperEVM
87
+ * (where it is Felix); EULER on Ethereum, Base, Arbitrum and BSC.
88
+ *
89
+ * All three support ``/v2/credit/loop`` and ``/v2/credit/unloop``. EULER does
90
+ * NOT: ``/v2/credit/rebalance`` rejects it with a 422, and
91
+ * ``/v2/credit/looped_positions`` covers only AAVE and MORPHO — an Euler loop is
92
+ * silently absent there rather than an error, so read it from
93
+ * ``/v2/credit/positions`` instead. (EULER still appears in the
94
+ * ``looped_positions`` response enum because this enum is shared; it is never
95
+ * emitted.)
83
96
  */
84
97
  protocol?: CreditProtocol | undefined;
85
98
  /**
@@ -115,7 +128,7 @@ export type CreditUnloopRequest = {
115
128
  */
116
129
  maxSlippagePercent?: number | string | undefined;
117
130
  /**
118
- * 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.
131
+ * 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.
119
132
  */
120
133
  allowPartial?: boolean | undefined;
121
134
  /**
@@ -123,7 +136,7 @@ export type CreditUnloopRequest = {
123
136
  */
124
137
  gasSponsorship?: boolean | undefined;
125
138
  /**
126
- * 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.
139
+ * 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.
127
140
  */
128
141
  preview?: boolean | undefined;
129
142
  /**
@@ -22,14 +22,14 @@ import {
22
22
  } from "./unsignedtransaction.js";
23
23
 
24
24
  /**
25
- * 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.
25
+ * 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.
26
26
  */
27
27
  export const CreditUnloopResponseSwapProvider = {
28
28
  OneInch: "one_inch",
29
29
  Bebop: "bebop",
30
30
  } as const;
31
31
  /**
32
- * 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.
32
+ * 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.
33
33
  */
34
34
  export type CreditUnloopResponseSwapProvider = ClosedEnum<
35
35
  typeof CreditUnloopResponseSwapProvider
@@ -40,7 +40,7 @@ export type CreditUnloopResponseSwapProvider = ClosedEnum<
40
40
  */
41
41
  export type CreditUnloopResponse = {
42
42
  /**
43
- * 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.
43
+ * 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.
44
44
  */
45
45
  transaction?: UnsignedTransaction | null | undefined;
46
46
  /**
@@ -52,11 +52,11 @@ export type CreditUnloopResponse = {
52
52
  */
53
53
  preview: CreditUnloopPreview | null;
54
54
  /**
55
- * 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.
55
+ * 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.
56
56
  */
57
57
  swapProvider?: CreditUnloopResponseSwapProvider | undefined;
58
58
  /**
59
- * 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).
59
+ * 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).
60
60
  */
61
61
  quoteExpiresAt?: Date | null | undefined;
62
62
  /**
@@ -33,11 +33,24 @@ export type CreditWithdrawParams = {
33
33
  * @remarks
34
34
  *
35
35
  * ``AAVE`` is the default so existing callers (which never send a ``protocol``
36
- * field) keep hitting the unchanged Aave code path. ``MORPHO`` identifies Morpho
37
- * Blue lending markets by their bytes32 ``market_id``. ``EULER`` identifies Euler
38
- * V2 markets by their EVK ``collateral_vault`` + ``borrow_vault`` addresses and
39
- * supports isolated per-sub-account positions (``sub_account_id``). All three
40
- * support the loop/unloop leverage endpoints.
36
+ * field) keep hitting the unchanged Aave code path; markets are named by token
37
+ * symbol. ``MORPHO`` identifies Morpho Blue lending markets by their bytes32
38
+ * ``market_id``. ``EULER`` identifies Euler V2 markets by their EVK
39
+ * ``collateral_vault`` + ``borrow_vault`` addresses and supports isolated
40
+ * per-sub-account positions (``sub_account_id``).
41
+ *
42
+ * Deployment is per chain, so a valid protocol can still 422 on a given chain:
43
+ * AAVE on Ethereum, Base, Arbitrum, BSC and HyperEVM (where it is Hyperlend, the
44
+ * chain's Aave V3 deployment); MORPHO on Ethereum, Base, Arbitrum and HyperEVM
45
+ * (where it is Felix); EULER on Ethereum, Base, Arbitrum and BSC.
46
+ *
47
+ * All three support ``/v2/credit/loop`` and ``/v2/credit/unloop``. EULER does
48
+ * NOT: ``/v2/credit/rebalance`` rejects it with a 422, and
49
+ * ``/v2/credit/looped_positions`` covers only AAVE and MORPHO — an Euler loop is
50
+ * silently absent there rather than an error, so read it from
51
+ * ``/v2/credit/positions`` instead. (EULER still appears in the
52
+ * ``looped_positions`` response enum because this enum is shared; it is never
53
+ * emitted.)
41
54
  */
42
55
  protocol?: CreditProtocol | undefined;
43
56
  /**
@@ -31,11 +31,24 @@ export type DebtPosition = {
31
31
  * @remarks
32
32
  *
33
33
  * ``AAVE`` is the default so existing callers (which never send a ``protocol``
34
- * field) keep hitting the unchanged Aave code path. ``MORPHO`` identifies Morpho
35
- * Blue lending markets by their bytes32 ``market_id``. ``EULER`` identifies Euler
36
- * V2 markets by their EVK ``collateral_vault`` + ``borrow_vault`` addresses and
37
- * supports isolated per-sub-account positions (``sub_account_id``). All three
38
- * support the loop/unloop leverage endpoints.
34
+ * field) keep hitting the unchanged Aave code path; markets are named by token
35
+ * symbol. ``MORPHO`` identifies Morpho Blue lending markets by their bytes32
36
+ * ``market_id``. ``EULER`` identifies Euler V2 markets by their EVK
37
+ * ``collateral_vault`` + ``borrow_vault`` addresses and supports isolated
38
+ * per-sub-account positions (``sub_account_id``).
39
+ *
40
+ * Deployment is per chain, so a valid protocol can still 422 on a given chain:
41
+ * AAVE on Ethereum, Base, Arbitrum, BSC and HyperEVM (where it is Hyperlend, the
42
+ * chain's Aave V3 deployment); MORPHO on Ethereum, Base, Arbitrum and HyperEVM
43
+ * (where it is Felix); EULER on Ethereum, Base, Arbitrum and BSC.
44
+ *
45
+ * All three support ``/v2/credit/loop`` and ``/v2/credit/unloop``. EULER does
46
+ * NOT: ``/v2/credit/rebalance`` rejects it with a 422, and
47
+ * ``/v2/credit/looped_positions`` covers only AAVE and MORPHO — an Euler loop is
48
+ * silently absent there rather than an error, so read it from
49
+ * ``/v2/credit/positions`` instead. (EULER still appears in the
50
+ * ``looped_positions`` response enum because this enum is shared; it is never
51
+ * emitted.)
39
52
  */
40
53
  protocol?: CreditProtocol | undefined;
41
54
  /**
@@ -47,11 +47,24 @@ export type LoopedPosition = {
47
47
  * @remarks
48
48
  *
49
49
  * ``AAVE`` is the default so existing callers (which never send a ``protocol``
50
- * field) keep hitting the unchanged Aave code path. ``MORPHO`` identifies Morpho
51
- * Blue lending markets by their bytes32 ``market_id``. ``EULER`` identifies Euler
52
- * V2 markets by their EVK ``collateral_vault`` + ``borrow_vault`` addresses and
53
- * supports isolated per-sub-account positions (``sub_account_id``). All three
54
- * support the loop/unloop leverage endpoints.
50
+ * field) keep hitting the unchanged Aave code path; markets are named by token
51
+ * symbol. ``MORPHO`` identifies Morpho Blue lending markets by their bytes32
52
+ * ``market_id``. ``EULER`` identifies Euler V2 markets by their EVK
53
+ * ``collateral_vault`` + ``borrow_vault`` addresses and supports isolated
54
+ * per-sub-account positions (``sub_account_id``).
55
+ *
56
+ * Deployment is per chain, so a valid protocol can still 422 on a given chain:
57
+ * AAVE on Ethereum, Base, Arbitrum, BSC and HyperEVM (where it is Hyperlend, the
58
+ * chain's Aave V3 deployment); MORPHO on Ethereum, Base, Arbitrum and HyperEVM
59
+ * (where it is Felix); EULER on Ethereum, Base, Arbitrum and BSC.
60
+ *
61
+ * All three support ``/v2/credit/loop`` and ``/v2/credit/unloop``. EULER does
62
+ * NOT: ``/v2/credit/rebalance`` rejects it with a 422, and
63
+ * ``/v2/credit/looped_positions`` covers only AAVE and MORPHO — an Euler loop is
64
+ * silently absent there rather than an error, so read it from
65
+ * ``/v2/credit/positions`` instead. (EULER still appears in the
66
+ * ``looped_positions`` response enum because this enum is shared; it is never
67
+ * emitted.)
55
68
  */
56
69
  protocol: CreditProtocol;
57
70
  /**
@@ -40,11 +40,24 @@ export type RebalanceTarget = {
40
40
  * @remarks
41
41
  *
42
42
  * ``AAVE`` is the default so existing callers (which never send a ``protocol``
43
- * field) keep hitting the unchanged Aave code path. ``MORPHO`` identifies Morpho
44
- * Blue lending markets by their bytes32 ``market_id``. ``EULER`` identifies Euler
45
- * V2 markets by their EVK ``collateral_vault`` + ``borrow_vault`` addresses and
46
- * supports isolated per-sub-account positions (``sub_account_id``). All three
47
- * support the loop/unloop leverage endpoints.
43
+ * field) keep hitting the unchanged Aave code path; markets are named by token
44
+ * symbol. ``MORPHO`` identifies Morpho Blue lending markets by their bytes32
45
+ * ``market_id``. ``EULER`` identifies Euler V2 markets by their EVK
46
+ * ``collateral_vault`` + ``borrow_vault`` addresses and supports isolated
47
+ * per-sub-account positions (``sub_account_id``).
48
+ *
49
+ * Deployment is per chain, so a valid protocol can still 422 on a given chain:
50
+ * AAVE on Ethereum, Base, Arbitrum, BSC and HyperEVM (where it is Hyperlend, the
51
+ * chain's Aave V3 deployment); MORPHO on Ethereum, Base, Arbitrum and HyperEVM
52
+ * (where it is Felix); EULER on Ethereum, Base, Arbitrum and BSC.
53
+ *
54
+ * All three support ``/v2/credit/loop`` and ``/v2/credit/unloop``. EULER does
55
+ * NOT: ``/v2/credit/rebalance`` rejects it with a 422, and
56
+ * ``/v2/credit/looped_positions`` covers only AAVE and MORPHO — an Euler loop is
57
+ * silently absent there rather than an error, so read it from
58
+ * ``/v2/credit/positions`` instead. (EULER still appears in the
59
+ * ``looped_positions`` response enum because this enum is shared; it is never
60
+ * emitted.)
48
61
  */
49
62
  protocol?: CreditProtocol | undefined;
50
63
  /**
@@ -49,11 +49,24 @@ export type RebalanceTargetPreview = {
49
49
  * @remarks
50
50
  *
51
51
  * ``AAVE`` is the default so existing callers (which never send a ``protocol``
52
- * field) keep hitting the unchanged Aave code path. ``MORPHO`` identifies Morpho
53
- * Blue lending markets by their bytes32 ``market_id``. ``EULER`` identifies Euler
54
- * V2 markets by their EVK ``collateral_vault`` + ``borrow_vault`` addresses and
55
- * supports isolated per-sub-account positions (``sub_account_id``). All three
56
- * support the loop/unloop leverage endpoints.
52
+ * field) keep hitting the unchanged Aave code path; markets are named by token
53
+ * symbol. ``MORPHO`` identifies Morpho Blue lending markets by their bytes32
54
+ * ``market_id``. ``EULER`` identifies Euler V2 markets by their EVK
55
+ * ``collateral_vault`` + ``borrow_vault`` addresses and supports isolated
56
+ * per-sub-account positions (``sub_account_id``).
57
+ *
58
+ * Deployment is per chain, so a valid protocol can still 422 on a given chain:
59
+ * AAVE on Ethereum, Base, Arbitrum, BSC and HyperEVM (where it is Hyperlend, the
60
+ * chain's Aave V3 deployment); MORPHO on Ethereum, Base, Arbitrum and HyperEVM
61
+ * (where it is Felix); EULER on Ethereum, Base, Arbitrum and BSC.
62
+ *
63
+ * All three support ``/v2/credit/loop`` and ``/v2/credit/unloop``. EULER does
64
+ * NOT: ``/v2/credit/rebalance`` rejects it with a 422, and
65
+ * ``/v2/credit/looped_positions`` covers only AAVE and MORPHO — an Euler loop is
66
+ * silently absent there rather than an error, so read it from
67
+ * ``/v2/credit/positions`` instead. (EULER still appears in the
68
+ * ``looped_positions`` response enum because this enum is shared; it is never
69
+ * emitted.)
57
70
  */
58
71
  protocol: CreditProtocol;
59
72
  /**