@compass-labs/api-sdk 2.2.100 → 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 (225) 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 +31 -18
  39. package/dist/commonjs/models/components/creditlooprequest.d.ts.map +1 -1
  40. package/dist/commonjs/models/components/creditlooprequest.js +5 -6
  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 +42 -10
  58. package/dist/commonjs/models/components/creditunlooprequest.d.ts.map +1 -1
  59. package/dist/commonjs/models/components/creditunlooprequest.js +13 -2
  60. package/dist/commonjs/models/components/creditunlooprequest.js.map +1 -1
  61. package/dist/commonjs/models/components/creditunloopresponse.d.ts +8 -8
  62. package/dist/commonjs/models/components/creditunloopresponse.d.ts.map +1 -1
  63. package/dist/commonjs/models/components/creditunloopresponse.js +2 -2
  64. package/dist/commonjs/models/components/creditunloopresponse.js.map +1 -1
  65. package/dist/commonjs/models/components/creditwithdrawparams.d.ts +18 -5
  66. package/dist/commonjs/models/components/creditwithdrawparams.d.ts.map +1 -1
  67. package/dist/commonjs/models/components/creditwithdrawparams.js.map +1 -1
  68. package/dist/commonjs/models/components/debtposition.d.ts +18 -5
  69. package/dist/commonjs/models/components/debtposition.d.ts.map +1 -1
  70. package/dist/commonjs/models/components/debtposition.js.map +1 -1
  71. package/dist/commonjs/models/components/loopedposition.d.ts +18 -5
  72. package/dist/commonjs/models/components/loopedposition.d.ts.map +1 -1
  73. package/dist/commonjs/models/components/loopedposition.js.map +1 -1
  74. package/dist/commonjs/models/components/rebalancetarget.d.ts +18 -5
  75. package/dist/commonjs/models/components/rebalancetarget.d.ts.map +1 -1
  76. package/dist/commonjs/models/components/rebalancetarget.js.map +1 -1
  77. package/dist/commonjs/models/components/rebalancetargetpreview.d.ts +18 -5
  78. package/dist/commonjs/models/components/rebalancetargetpreview.d.ts.map +1 -1
  79. package/dist/commonjs/models/components/rebalancetargetpreview.js.map +1 -1
  80. package/dist/commonjs/models/components/swapinfo.d.ts +2 -2
  81. package/dist/commonjs/sdk/credit.d.ts +44 -111
  82. package/dist/commonjs/sdk/credit.d.ts.map +1 -1
  83. package/dist/commonjs/sdk/credit.js +44 -111
  84. package/dist/commonjs/sdk/credit.js.map +1 -1
  85. package/dist/esm/funcs/creditCreditBorrow.d.ts +1 -1
  86. package/dist/esm/funcs/creditCreditBorrow.js +1 -1
  87. package/dist/esm/funcs/creditCreditLoop.d.ts +8 -22
  88. package/dist/esm/funcs/creditCreditLoop.d.ts.map +1 -1
  89. package/dist/esm/funcs/creditCreditLoop.js +8 -22
  90. package/dist/esm/funcs/creditCreditLoop.js.map +1 -1
  91. package/dist/esm/funcs/creditCreditLoopedPositions.d.ts +8 -7
  92. package/dist/esm/funcs/creditCreditLoopedPositions.d.ts.map +1 -1
  93. package/dist/esm/funcs/creditCreditLoopedPositions.js +8 -7
  94. package/dist/esm/funcs/creditCreditLoopedPositions.js.map +1 -1
  95. package/dist/esm/funcs/creditCreditRebalance.d.ts +11 -34
  96. package/dist/esm/funcs/creditCreditRebalance.d.ts.map +1 -1
  97. package/dist/esm/funcs/creditCreditRebalance.js +11 -34
  98. package/dist/esm/funcs/creditCreditRebalance.js.map +1 -1
  99. package/dist/esm/funcs/creditCreditRepay.d.ts +1 -1
  100. package/dist/esm/funcs/creditCreditRepay.js +1 -1
  101. package/dist/esm/funcs/creditCreditUnloop.d.ts +7 -38
  102. package/dist/esm/funcs/creditCreditUnloop.d.ts.map +1 -1
  103. package/dist/esm/funcs/creditCreditUnloop.js +7 -38
  104. package/dist/esm/funcs/creditCreditUnloop.js.map +1 -1
  105. package/dist/esm/lib/config.d.ts +2 -2
  106. package/dist/esm/lib/config.js +2 -2
  107. package/dist/esm/models/components/accountsummary.d.ts +18 -5
  108. package/dist/esm/models/components/accountsummary.d.ts.map +1 -1
  109. package/dist/esm/models/components/accountsummary.js.map +1 -1
  110. package/dist/esm/models/components/collateralposition.d.ts +18 -5
  111. package/dist/esm/models/components/collateralposition.d.ts.map +1 -1
  112. package/dist/esm/models/components/collateralposition.js.map +1 -1
  113. package/dist/esm/models/components/creditborrowparams.d.ts +18 -5
  114. package/dist/esm/models/components/creditborrowparams.d.ts.map +1 -1
  115. package/dist/esm/models/components/creditborrowparams.js.map +1 -1
  116. package/dist/esm/models/components/creditborrowrequest.d.ts +18 -5
  117. package/dist/esm/models/components/creditborrowrequest.d.ts.map +1 -1
  118. package/dist/esm/models/components/creditborrowrequest.js.map +1 -1
  119. package/dist/esm/models/components/creditenablecollateralparams.d.ts +18 -5
  120. package/dist/esm/models/components/creditenablecollateralparams.d.ts.map +1 -1
  121. package/dist/esm/models/components/creditenablecollateralparams.js.map +1 -1
  122. package/dist/esm/models/components/creditlooprequest.d.ts +31 -18
  123. package/dist/esm/models/components/creditlooprequest.d.ts.map +1 -1
  124. package/dist/esm/models/components/creditlooprequest.js +4 -5
  125. package/dist/esm/models/components/creditlooprequest.js.map +1 -1
  126. package/dist/esm/models/components/creditloopresponse.d.ts +5 -5
  127. package/dist/esm/models/components/creditloopresponse.js +1 -1
  128. package/dist/esm/models/components/creditprotocol.d.ts +36 -10
  129. package/dist/esm/models/components/creditprotocol.d.ts.map +1 -1
  130. package/dist/esm/models/components/creditprotocol.js +18 -5
  131. package/dist/esm/models/components/creditprotocol.js.map +1 -1
  132. package/dist/esm/models/components/creditrepayparams.d.ts +18 -5
  133. package/dist/esm/models/components/creditrepayparams.d.ts.map +1 -1
  134. package/dist/esm/models/components/creditrepayparams.js.map +1 -1
  135. package/dist/esm/models/components/creditrepayrequest.d.ts +18 -5
  136. package/dist/esm/models/components/creditrepayrequest.d.ts.map +1 -1
  137. package/dist/esm/models/components/creditrepayrequest.js.map +1 -1
  138. package/dist/esm/models/components/creditsupplyparams.d.ts +18 -5
  139. package/dist/esm/models/components/creditsupplyparams.d.ts.map +1 -1
  140. package/dist/esm/models/components/creditsupplyparams.js.map +1 -1
  141. package/dist/esm/models/components/creditunlooprequest.d.ts +42 -10
  142. package/dist/esm/models/components/creditunlooprequest.d.ts.map +1 -1
  143. package/dist/esm/models/components/creditunlooprequest.js +12 -1
  144. package/dist/esm/models/components/creditunlooprequest.js.map +1 -1
  145. package/dist/esm/models/components/creditunloopresponse.d.ts +8 -8
  146. package/dist/esm/models/components/creditunloopresponse.d.ts.map +1 -1
  147. package/dist/esm/models/components/creditunloopresponse.js +2 -2
  148. package/dist/esm/models/components/creditunloopresponse.js.map +1 -1
  149. package/dist/esm/models/components/creditwithdrawparams.d.ts +18 -5
  150. package/dist/esm/models/components/creditwithdrawparams.d.ts.map +1 -1
  151. package/dist/esm/models/components/creditwithdrawparams.js.map +1 -1
  152. package/dist/esm/models/components/debtposition.d.ts +18 -5
  153. package/dist/esm/models/components/debtposition.d.ts.map +1 -1
  154. package/dist/esm/models/components/debtposition.js.map +1 -1
  155. package/dist/esm/models/components/loopedposition.d.ts +18 -5
  156. package/dist/esm/models/components/loopedposition.d.ts.map +1 -1
  157. package/dist/esm/models/components/loopedposition.js.map +1 -1
  158. package/dist/esm/models/components/rebalancetarget.d.ts +18 -5
  159. package/dist/esm/models/components/rebalancetarget.d.ts.map +1 -1
  160. package/dist/esm/models/components/rebalancetarget.js.map +1 -1
  161. package/dist/esm/models/components/rebalancetargetpreview.d.ts +18 -5
  162. package/dist/esm/models/components/rebalancetargetpreview.d.ts.map +1 -1
  163. package/dist/esm/models/components/rebalancetargetpreview.js.map +1 -1
  164. package/dist/esm/models/components/swapinfo.d.ts +2 -2
  165. package/dist/esm/sdk/credit.d.ts +44 -111
  166. package/dist/esm/sdk/credit.d.ts.map +1 -1
  167. package/dist/esm/sdk/credit.js +44 -111
  168. package/dist/esm/sdk/credit.js.map +1 -1
  169. package/docs/models/components/accountsummary.md +11 -11
  170. package/docs/models/components/collateralposition.md +17 -17
  171. package/docs/models/components/creditborrowparams.md +11 -11
  172. package/docs/models/components/creditborrowrequest.md +21 -21
  173. package/docs/models/components/creditenablecollateralparams.md +7 -7
  174. package/docs/models/components/creditlooprequest.md +19 -19
  175. package/docs/models/components/creditlooprequestchain.md +1 -1
  176. package/docs/models/components/creditlooprequestinitialcollateralamount.md +1 -1
  177. package/docs/models/components/creditlooprequestloantovalue.md +1 -1
  178. package/docs/models/components/{pricing.md → creditlooprequestpricing.md} +3 -3
  179. package/docs/models/components/creditloopresponse.md +8 -8
  180. package/docs/models/components/creditloopresponseswapprovider.md +1 -1
  181. package/docs/models/components/creditprotocol.md +18 -5
  182. package/docs/models/components/creditrepayparams.md +10 -10
  183. package/docs/models/components/creditrepayrequest.md +20 -20
  184. package/docs/models/components/creditsupplyparams.md +9 -9
  185. package/docs/models/components/creditunlooprequest.md +17 -16
  186. package/docs/models/components/creditunlooprequestchain.md +1 -1
  187. package/docs/models/components/creditunlooprequestpricing.md +17 -0
  188. package/docs/models/components/creditunloopresponse.md +10 -10
  189. package/docs/models/components/creditunloopresponseswapprovider.md +1 -1
  190. package/docs/models/components/creditwithdrawparams.md +9 -9
  191. package/docs/models/components/debtposition.md +16 -16
  192. package/docs/models/components/loopedposition.md +14 -14
  193. package/docs/models/components/rebalancetarget.md +10 -10
  194. package/docs/models/components/rebalancetargetpreview.md +16 -16
  195. package/docs/models/components/swapinfo.md +10 -10
  196. package/docs/sdks/credit/README.md +40 -107
  197. package/openapi_prepped_for_speakeasy.json +47 -29
  198. package/package.json +1 -1
  199. package/src/funcs/creditCreditBorrow.ts +1 -1
  200. package/src/funcs/creditCreditLoop.ts +8 -22
  201. package/src/funcs/creditCreditLoopedPositions.ts +8 -7
  202. package/src/funcs/creditCreditRebalance.ts +11 -34
  203. package/src/funcs/creditCreditRepay.ts +1 -1
  204. package/src/funcs/creditCreditUnloop.ts +7 -38
  205. package/src/lib/config.ts +2 -2
  206. package/src/models/components/accountsummary.ts +18 -5
  207. package/src/models/components/collateralposition.ts +18 -5
  208. package/src/models/components/creditborrowparams.ts +18 -5
  209. package/src/models/components/creditborrowrequest.ts +18 -5
  210. package/src/models/components/creditenablecollateralparams.ts +18 -5
  211. package/src/models/components/creditlooprequest.ts +36 -20
  212. package/src/models/components/creditloopresponse.ts +5 -5
  213. package/src/models/components/creditprotocol.ts +36 -10
  214. package/src/models/components/creditrepayparams.ts +18 -5
  215. package/src/models/components/creditrepayrequest.ts +18 -5
  216. package/src/models/components/creditsupplyparams.ts +18 -5
  217. package/src/models/components/creditunlooprequest.ts +49 -10
  218. package/src/models/components/creditunloopresponse.ts +9 -9
  219. package/src/models/components/creditwithdrawparams.ts +18 -5
  220. package/src/models/components/debtposition.ts +18 -5
  221. package/src/models/components/loopedposition.ts +18 -5
  222. package/src/models/components/rebalancetarget.ts +18 -5
  223. package/src/models/components/rebalancetargetpreview.ts +18 -5
  224. package/src/models/components/swapinfo.ts +2 -2
  225. package/src/sdk/credit.ts +44 -111
@@ -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
  /**
@@ -48,19 +48,19 @@ export type CreditUnloopResponse = {
48
48
  */
49
49
  eip712?: BatchedSafeOperationsResponseOutput | null | undefined;
50
50
  /**
51
- * Projected end state of the unwind, computed on GUARANTEED swap floors.
51
+ * 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.
52
52
  */
53
- preview: CreditUnloopPreview;
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
  /**
63
- * 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.
63
+ * 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.
64
64
  */
65
65
  firmAvailable?: boolean | null | undefined;
66
66
  };
@@ -79,7 +79,7 @@ export const CreditUnloopResponse$inboundSchema: z.ZodType<
79
79
  transaction: z.nullable(UnsignedTransaction$inboundSchema).optional(),
80
80
  eip_712: z.nullable(BatchedSafeOperationsResponseOutput$inboundSchema)
81
81
  .optional(),
82
- preview: CreditUnloopPreview$inboundSchema,
82
+ preview: z.nullable(CreditUnloopPreview$inboundSchema),
83
83
  swap_provider: CreditUnloopResponseSwapProvider$inboundSchema.optional(),
84
84
  quote_expires_at: z.nullable(
85
85
  z.string().datetime({ offset: true }).transform(v => new Date(v)),
@@ -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
  /**
@@ -15,7 +15,7 @@ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
15
15
  *
16
16
  * Evidence is token-filtered and executor-proof: the sold (debt) token left the
17
17
  * account to a non-protocol counterparty and the bought (collateral) token
18
- * arrived from a non-protocol counterparty. 1inch fills often settle from an
18
+ * arrived from a non-protocol counterparty. Aggregator fills often settle from an
19
19
  * executor contract, so the router is recorded only when it happens to be the
20
20
  * outbound counterparty — it is never required for detection.
21
21
  */
@@ -45,7 +45,7 @@ export type SwapInfo = {
45
45
  */
46
46
  boughtAmount: string;
47
47
  /**
48
- * The outbound counterparty when it is the 1inch aggregation router. Null when the swap settled from an executor contract (informational only — never required to detect the swap).
48
+ * The outbound counterparty when it is the swap router itself. Null when the swap settled from an executor contract (informational only — never required to detect the swap).
49
49
  */
50
50
  router?: string | null | undefined;
51
51
  };
package/src/sdk/credit.ts CHANGED
@@ -65,14 +65,15 @@ export class Credit extends ClientSDK {
65
65
  * List looped (leveraged) credit positions
66
66
  *
67
67
  * @remarks
68
- * List looped (leveraged) positions for a credit account owner.
69
- *
70
- * Detects loops from the account's on-chain history: a transaction containing
71
- * lending + borrowing + swap legs is a loop transaction. Returns one position
72
- * per Morpho market / Aave collateral+debt reserve pair, each with its complete
73
- * per-transaction history, lifetime totals, and live on-chain state (health
74
- * factor, USD values, leverage) for open positions. Covers Aave V3 and Morpho
75
- * Blue.
68
+ * List the leveraged positions held by an owner's Credit Account.
69
+ *
70
+ * Positions are reconstructed from on-chain history rather than from API calls,
71
+ * so a loop assembled by hand through /v2/credit/bundle is recognised the same
72
+ * way as one opened through /v2/credit/loop. Only activity inside the Credit
73
+ * Account is visible leverage the owner holds directly in their wallet is not.
74
+ *
75
+ * See the [Leveraged Looping guide](https://docs.compasslabs.ai/v2/Products/Looping)
76
+ * for protocol coverage and how to read leverage, health factor and net APY.
76
77
  */
77
78
  async creditLoopedPositions(
78
79
  request: operations.V2CreditLoopedPositionsRequest,
@@ -163,7 +164,7 @@ export class Credit extends ClientSDK {
163
164
  * Bundles an optional swap, collateral supply, and borrow into a single atomic Safe transaction.
164
165
  *
165
166
  * - If `token_in` equals `collateral_token`, the tokens are supplied directly as collateral.
166
- * - If `token_in` differs from `collateral_token`, a swap is performed first via 1inch.
167
+ * - If `token_in` differs from `collateral_token`, a market swap is performed first.
167
168
  *
168
169
  * The Credit Account must already be created via `/v2/credit/create_account` and funded with `token_in`.
169
170
  */
@@ -182,30 +183,16 @@ export class Credit extends ClientSDK {
182
183
  * Open a leveraged loop
183
184
  *
184
185
  * @remarks
185
- * Open a leveraged loop into an Aave or Morpho market in ONE atomic transaction.
186
- *
187
- * Repeatedly supplies collateral, borrows at the requested loan-to-value, and
188
- * swaps the borrow back to collateral. Each iteration's supply uses the swap's
189
- * GUARANTEED minimum output (enforced on-chain), so a fill anywhere within the
190
- * slippage tolerance can never break a later step; any positive surplus stays
191
- * in the Credit Account (the preview reports the bound as estimated_max_dust).
192
- * Very large loops relative to pool depth can still exceed the slippage
193
- * tolerance through their own cumulative price impact — size accordingly or
194
- * raise max_slippage_percent. Conversely, the geometric tail can shrink below
195
- * the swap router's minimum routable size; when it does the loop simply ends
196
- * early on that supply — the achieved multiplier is still guaranteed within
197
- * 0.5% of the request or the call returns a clean 400.
198
- *
199
- * When the collateral token is itself an ERC-4626 vault share (e.g. a Morpho
200
- * vault token like steakUSDC), each conversion swaps the borrow token to the
201
- * vault's underlying asset and mints the shares via the vault's own deposit at
202
- * net asset value instead of swapping the share token on a DEX — share tokens
203
- * have no honest DEX route. A direct share-token route is only ever used when
204
- * it prices within 1% of net asset value.
205
- *
206
- * The Credit Account must already hold initial_collateral_amount of
207
- * collateral_token. For protocol=MORPHO pass a market_id from
208
- * /v2/credit/morpho_markets.
186
+ * Open a leveraged position in ONE atomic transaction.
187
+ *
188
+ * Supply collateral, borrow against it, swap the borrowed token back to
189
+ * collateral, repeat until total collateral reaches multiplier x
190
+ * initial_collateral_amount. If any step fails the whole transaction reverts,
191
+ * so a position is never left half-built.
192
+ *
193
+ * See the [Leveraged Looping guide](https://docs.compasslabs.ai/v2/Products/Looping)
194
+ * for chain coverage, market discovery, vault-share collateral, HyperEVM
195
+ * specifics and the full error list.
209
196
  */
210
197
  async creditLoop(
211
198
  request: components.CreditLoopRequest,
@@ -222,46 +209,15 @@ export class Credit extends ClientSDK {
222
209
  * Unwind a leveraged loop
223
210
  *
224
211
  * @remarks
225
- * Unwind an Aave or Morpho loop in ONE atomic transaction.
226
- *
227
- * Repeatedly withdraws collateral, swaps it to the borrow token at a GUARANTEED
228
- * minimum output (enforced on-chain), and repays. The floor discipline means a
229
- * swap filling anywhere within the slippage tolerance can never break a later
230
- * step; any positive surplus stays in the Credit Account as borrow-token dust
231
- * (the preview reports the bound as estimated_max_dust).
232
- *
233
- * When the collateral token is itself an ERC-4626 vault share (e.g. a Morpho
234
- * vault token like steakUSDC), each conversion redeems the shares through the
235
- * vault at net asset value and swaps the underlying asset to the borrow token
236
- * instead of swapping the share token on a DEX; a direct share-token route is
237
- * only ever used when it prices within 1% of net asset value.
238
- *
239
- * Omit target_multiplier for a full close: the debt is cleared exactly —
240
- * accrued interest included — and the pair collateral is returned to the Credit
241
- * Account. Pass 1 to clear the debt but keep the collateral supplied, or a value
242
- * above 1 to delever to that multiplier (it must be below the position's current
243
- * multiplier).
244
- *
245
- * Each withdrawal is sized to keep the position's health factor ≥ 1.02 at that
246
- * step, so a position opened very close to the liquidation threshold may need
247
- * more than one transaction to fully close — set allow_partial=true to return
248
- * the maximum single-transaction progress (preview.fully_unwound=false), then
249
- * call unloop again to finish. Very large unwinds relative to pool depth can
250
- * still exceed the slippage tolerance through their own cumulative price impact.
251
- *
252
- * Positions are unwound as far as the swap router can route; on a router-minimum
253
- * stop the engine still withdraws all collateral not needed to back the residual,
254
- * and completes a true full close whenever the unwind's own guaranteed swap
255
- * surpluses (or the Credit Account's idle balance) cover the remainder — a
256
- * residual below the router's minimum routable size never fails the call, it is
257
- * reported honestly in the preview (fully_unwound=false).
258
- *
259
- * When other open Aave loops share this position's collateral reserve, a full
260
- * close withdraws only this position's attributed share of the pooled collateral
261
- * (event-ledger bookkeeping), leaving the rest supplied for the other positions.
262
- *
263
- * For protocol=MORPHO pass a market_id from /v2/credit/morpho_markets; inspect
264
- * open loops via /v2/credit/looped_positions.
212
+ * Unwind a leveraged position in ONE atomic transaction.
213
+ *
214
+ * Withdraw collateral, swap it back to the borrow token, repay, repeat — until
215
+ * the position reaches target_multiplier, or until the debt is cleared exactly
216
+ * if you omit it. If any step fails the whole transaction reverts.
217
+ *
218
+ * See the [Leveraged Looping guide](https://docs.compasslabs.ai/v2/Products/Looping)
219
+ * for chain coverage, vault-share collateral, shared Aave reserves and the full
220
+ * error list.
265
221
  */
266
222
  async creditUnloop(
267
223
  request: components.CreditUnloopRequest,
@@ -278,43 +234,20 @@ export class Credit extends ClientSDK {
278
234
  * Rebalance the leveraged credit book
279
235
  *
280
236
  * @remarks
281
- * Rebalance the leveraged credit book in ONE atomic transaction.
282
- *
283
- * List only the positions to change — anything not named is left untouched;
284
- * remove a position with close=true. Each target states an end state:
285
- * target_equity_usd (net USD committed) × target_multiplier.
286
- *
287
- * Releasing targets run first (each unwind/delever frees tokens into the Credit
288
- * Account), the freed tokens are then routed by swaps at a GUARANTEED minimum
289
- * output (enforced on-chain), and consuming targets run last so moving a
290
- * levered position between markets, token pairs, or protocols (Aave Morpho) is
291
- * simply a close plus an open in the same transaction. Conversions involving an
292
- * ERC-4626 vault-share token (e.g. a Morpho vault token like steakUSDC) go
293
- * through the vault's own deposit/redeem at net asset value rather than a DEX
294
- * swap of the share token.
295
- *
296
- * Net book growth is funded from the Credit Account's existing idle balance —
297
- * fund it first via /v2/credit/transfer; a net release stays in the Credit
298
- * Account as idle balance. Any swap surplus above the guaranteed floors also
299
- * stays in the Credit Account (preview.estimated_max_dust) — recoverable, never
300
- * lost.
301
- *
302
- * A book already at its target returns transaction: null with the preview — the
303
- * call is idempotent and safe to drive from a converge-to-target loop.
304
- *
305
- * A rebalance too large for one transaction is rejected with a 422 — split it
306
- * into two calls. Every deleveraging step keeps the health factor ≥ 1.02 and
307
- * every leveraging step respects the protocol's borrow limits; Aave targets share
308
- * one account-level health factor, which the preview reports.
309
- *
310
- * Dust tails and routing swaps below the swap router's minimum routable size do
311
- * not fail the call: a releasing target that cannot fully unwind returns its
312
- * honest residual in the preview, and an unroutable routing swap is skipped
313
- * (its uncovered amount only 422s the rebalance if it breaches the funding
314
- * tolerance).
315
- *
316
- * For protocol=MORPHO pass a market_id from /v2/credit/morpho_markets; inspect the
317
- * current book via /v2/credit/looped_positions.
237
+ * Move one or more leveraged positions to the state you want, in ONE atomic
238
+ * transaction.
239
+ *
240
+ * List the positions to change and the end state you want for each. The API
241
+ * works out whether that means opening, growing, shrinking, delevering or
242
+ * closing, and does them all together.
243
+ *
244
+ * Money freed by shrinking or closing one position pays for growing or opening
245
+ * another, so shifting funds between positions needs no new deposit. Any
246
+ * shortfall is taken from the Credit Account's idle balance, and the call
247
+ * returns 422 if that does not cover it either.
248
+ *
249
+ * See the [Leveraged Looping guide](https://docs.compasslabs.ai/v2/Products/Looping)
250
+ * for protocol and chain coverage, capital routing and the full error list.
318
251
  */
319
252
  async creditRebalance(
320
253
  request: components.CreditRebalanceRequest,
@@ -363,7 +296,7 @@ export class Credit extends ClientSDK {
363
296
  * Bundles repayment, collateral withdrawal, and an optional swap into a single atomic Safe transaction.
364
297
  *
365
298
  * - If `token_out` is None or equals `withdraw_token`, the withdrawn collateral is kept as-is.
366
- * - If `token_out` differs from `withdraw_token`, a swap is performed after withdrawal via 1inch.
299
+ * - If `token_out` differs from `withdraw_token`, a market swap is performed after withdrawal.
367
300
  *
368
301
  * The Credit Account must already have a borrow position created via `/v2/credit/borrow`.
369
302
  * The repay_token must be available in the Credit Account (or pulled from EOA via Permit2).