@compass-labs/api-sdk 2.2.76-rc.2 → 2.2.76-rc.3

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 (245) hide show
  1. package/README.md +7 -3
  2. package/codeSamples_typescript.yaml +12 -0
  3. package/dist/commonjs/funcs/creditCreditLoop.d.ts +31 -0
  4. package/dist/commonjs/funcs/creditCreditLoop.d.ts.map +1 -0
  5. package/dist/commonjs/funcs/creditCreditLoop.js +132 -0
  6. package/dist/commonjs/funcs/creditCreditLoop.js.map +1 -0
  7. package/dist/commonjs/funcs/creditCreditMorphoMarkets.d.ts +24 -0
  8. package/dist/commonjs/funcs/creditCreditMorphoMarkets.d.ts.map +1 -0
  9. package/dist/commonjs/funcs/creditCreditMorphoMarkets.js +128 -0
  10. package/dist/commonjs/funcs/creditCreditMorphoMarkets.js.map +1 -0
  11. package/dist/commonjs/models/components/aavelooprequest.d.ts +16 -16
  12. package/dist/commonjs/models/components/aavelooprequest.d.ts.map +1 -1
  13. package/dist/commonjs/models/components/aavelooprequest.js +17 -17
  14. package/dist/commonjs/models/components/aavelooprequest.js.map +1 -1
  15. package/dist/commonjs/models/components/accountsummary.d.ts +4 -0
  16. package/dist/commonjs/models/components/accountsummary.d.ts.map +1 -1
  17. package/dist/commonjs/models/components/accountsummary.js.map +1 -1
  18. package/dist/commonjs/models/components/collateralposition.d.ts +12 -0
  19. package/dist/commonjs/models/components/collateralposition.d.ts.map +1 -1
  20. package/dist/commonjs/models/components/collateralposition.js +4 -0
  21. package/dist/commonjs/models/components/collateralposition.js.map +1 -1
  22. package/dist/commonjs/models/components/creditborrowparams.d.ts +9 -0
  23. package/dist/commonjs/models/components/creditborrowparams.d.ts.map +1 -1
  24. package/dist/commonjs/models/components/creditborrowparams.js +2 -0
  25. package/dist/commonjs/models/components/creditborrowparams.js.map +1 -1
  26. package/dist/commonjs/models/components/creditborrowrequest.d.ts +9 -0
  27. package/dist/commonjs/models/components/creditborrowrequest.d.ts.map +1 -1
  28. package/dist/commonjs/models/components/creditborrowrequest.js +2 -0
  29. package/dist/commonjs/models/components/creditborrowrequest.js.map +1 -1
  30. package/dist/commonjs/models/components/creditenablecollateralparams.d.ts +4 -0
  31. package/dist/commonjs/models/components/creditenablecollateralparams.d.ts.map +1 -1
  32. package/dist/commonjs/models/components/creditenablecollateralparams.js.map +1 -1
  33. package/dist/commonjs/models/components/creditlooppreview.d.ts +45 -0
  34. package/dist/commonjs/models/components/creditlooppreview.d.ts.map +1 -0
  35. package/dist/commonjs/models/components/creditlooppreview.js +68 -0
  36. package/dist/commonjs/models/components/creditlooppreview.js.map +1 -0
  37. package/dist/commonjs/models/components/creditlooprequest.d.ts +125 -0
  38. package/dist/commonjs/models/components/creditlooprequest.d.ts.map +1 -0
  39. package/dist/commonjs/models/components/creditlooprequest.js +98 -0
  40. package/dist/commonjs/models/components/creditlooprequest.js.map +1 -0
  41. package/dist/commonjs/models/components/creditloopresponse.d.ts +27 -0
  42. package/dist/commonjs/models/components/creditloopresponse.d.ts.map +1 -0
  43. package/dist/commonjs/models/components/creditloopresponse.js +61 -0
  44. package/dist/commonjs/models/components/creditloopresponse.js.map +1 -0
  45. package/dist/commonjs/models/components/creditprotocol.d.ts +9 -0
  46. package/dist/commonjs/models/components/creditprotocol.d.ts.map +1 -1
  47. package/dist/commonjs/models/components/creditprotocol.js +5 -0
  48. package/dist/commonjs/models/components/creditprotocol.js.map +1 -1
  49. package/dist/commonjs/models/components/creditrepayparams.d.ts +9 -0
  50. package/dist/commonjs/models/components/creditrepayparams.d.ts.map +1 -1
  51. package/dist/commonjs/models/components/creditrepayparams.js +2 -0
  52. package/dist/commonjs/models/components/creditrepayparams.js.map +1 -1
  53. package/dist/commonjs/models/components/creditrepayrequest.d.ts +9 -0
  54. package/dist/commonjs/models/components/creditrepayrequest.d.ts.map +1 -1
  55. package/dist/commonjs/models/components/creditrepayrequest.js +2 -0
  56. package/dist/commonjs/models/components/creditrepayrequest.js.map +1 -1
  57. package/dist/commonjs/models/components/creditsupplyparams.d.ts +9 -0
  58. package/dist/commonjs/models/components/creditsupplyparams.d.ts.map +1 -1
  59. package/dist/commonjs/models/components/creditsupplyparams.js +2 -0
  60. package/dist/commonjs/models/components/creditsupplyparams.js.map +1 -1
  61. package/dist/commonjs/models/components/creditwithdrawparams.d.ts +9 -0
  62. package/dist/commonjs/models/components/creditwithdrawparams.d.ts.map +1 -1
  63. package/dist/commonjs/models/components/creditwithdrawparams.js +2 -0
  64. package/dist/commonjs/models/components/creditwithdrawparams.js.map +1 -1
  65. package/dist/commonjs/models/components/debtposition.d.ts +12 -0
  66. package/dist/commonjs/models/components/debtposition.d.ts.map +1 -1
  67. package/dist/commonjs/models/components/debtposition.js +4 -0
  68. package/dist/commonjs/models/components/debtposition.js.map +1 -1
  69. package/dist/commonjs/models/components/index.d.ts +6 -0
  70. package/dist/commonjs/models/components/index.d.ts.map +1 -1
  71. package/dist/commonjs/models/components/index.js +6 -0
  72. package/dist/commonjs/models/components/index.js.map +1 -1
  73. package/dist/commonjs/models/components/looplegpreview.d.ts +24 -0
  74. package/dist/commonjs/models/components/looplegpreview.d.ts.map +1 -0
  75. package/dist/commonjs/models/components/looplegpreview.js +59 -0
  76. package/dist/commonjs/models/components/looplegpreview.js.map +1 -0
  77. package/dist/commonjs/models/components/morpholendingmarket.d.ts +80 -0
  78. package/dist/commonjs/models/components/morpholendingmarket.d.ts.map +1 -0
  79. package/dist/commonjs/models/components/morpholendingmarket.js +82 -0
  80. package/dist/commonjs/models/components/morpholendingmarket.js.map +1 -0
  81. package/dist/commonjs/models/components/morphomarketsresponse.d.ts +21 -0
  82. package/dist/commonjs/models/components/morphomarketsresponse.d.ts.map +1 -0
  83. package/dist/commonjs/models/components/morphomarketsresponse.js +52 -0
  84. package/dist/commonjs/models/components/morphomarketsresponse.js.map +1 -0
  85. package/dist/commonjs/models/operations/index.d.ts +1 -0
  86. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  87. package/dist/commonjs/models/operations/index.js +1 -0
  88. package/dist/commonjs/models/operations/index.js.map +1 -1
  89. package/dist/commonjs/models/operations/v2creditmorphomarkets.d.ts +22 -0
  90. package/dist/commonjs/models/operations/v2creditmorphomarkets.d.ts.map +1 -0
  91. package/dist/commonjs/models/operations/v2creditmorphomarkets.js +57 -0
  92. package/dist/commonjs/models/operations/v2creditmorphomarkets.js.map +1 -0
  93. package/dist/commonjs/sdk/credit.d.ts +32 -0
  94. package/dist/commonjs/sdk/credit.d.ts.map +1 -1
  95. package/dist/commonjs/sdk/credit.js +38 -0
  96. package/dist/commonjs/sdk/credit.js.map +1 -1
  97. package/dist/esm/funcs/creditCreditLoop.d.ts +31 -0
  98. package/dist/esm/funcs/creditCreditLoop.d.ts.map +1 -0
  99. package/dist/esm/funcs/creditCreditLoop.js +96 -0
  100. package/dist/esm/funcs/creditCreditLoop.js.map +1 -0
  101. package/dist/esm/funcs/creditCreditMorphoMarkets.d.ts +24 -0
  102. package/dist/esm/funcs/creditCreditMorphoMarkets.d.ts.map +1 -0
  103. package/dist/esm/funcs/creditCreditMorphoMarkets.js +92 -0
  104. package/dist/esm/funcs/creditCreditMorphoMarkets.js.map +1 -0
  105. package/dist/esm/models/components/aavelooprequest.d.ts +16 -16
  106. package/dist/esm/models/components/aavelooprequest.d.ts.map +1 -1
  107. package/dist/esm/models/components/aavelooprequest.js +12 -12
  108. package/dist/esm/models/components/aavelooprequest.js.map +1 -1
  109. package/dist/esm/models/components/accountsummary.d.ts +4 -0
  110. package/dist/esm/models/components/accountsummary.d.ts.map +1 -1
  111. package/dist/esm/models/components/accountsummary.js.map +1 -1
  112. package/dist/esm/models/components/collateralposition.d.ts +12 -0
  113. package/dist/esm/models/components/collateralposition.d.ts.map +1 -1
  114. package/dist/esm/models/components/collateralposition.js +4 -0
  115. package/dist/esm/models/components/collateralposition.js.map +1 -1
  116. package/dist/esm/models/components/creditborrowparams.d.ts +9 -0
  117. package/dist/esm/models/components/creditborrowparams.d.ts.map +1 -1
  118. package/dist/esm/models/components/creditborrowparams.js +2 -0
  119. package/dist/esm/models/components/creditborrowparams.js.map +1 -1
  120. package/dist/esm/models/components/creditborrowrequest.d.ts +9 -0
  121. package/dist/esm/models/components/creditborrowrequest.d.ts.map +1 -1
  122. package/dist/esm/models/components/creditborrowrequest.js +2 -0
  123. package/dist/esm/models/components/creditborrowrequest.js.map +1 -1
  124. package/dist/esm/models/components/creditenablecollateralparams.d.ts +4 -0
  125. package/dist/esm/models/components/creditenablecollateralparams.d.ts.map +1 -1
  126. package/dist/esm/models/components/creditenablecollateralparams.js.map +1 -1
  127. package/dist/esm/models/components/creditlooppreview.d.ts +45 -0
  128. package/dist/esm/models/components/creditlooppreview.d.ts.map +1 -0
  129. package/dist/esm/models/components/creditlooppreview.js +31 -0
  130. package/dist/esm/models/components/creditlooppreview.js.map +1 -0
  131. package/dist/esm/models/components/creditlooprequest.d.ts +125 -0
  132. package/dist/esm/models/components/creditlooprequest.d.ts.map +1 -0
  133. package/dist/esm/models/components/creditlooprequest.js +57 -0
  134. package/dist/esm/models/components/creditlooprequest.js.map +1 -0
  135. package/dist/esm/models/components/creditloopresponse.d.ts +27 -0
  136. package/dist/esm/models/components/creditloopresponse.d.ts.map +1 -0
  137. package/dist/esm/models/components/creditloopresponse.js +24 -0
  138. package/dist/esm/models/components/creditloopresponse.js.map +1 -0
  139. package/dist/esm/models/components/creditprotocol.d.ts +9 -0
  140. package/dist/esm/models/components/creditprotocol.d.ts.map +1 -1
  141. package/dist/esm/models/components/creditprotocol.js +5 -0
  142. package/dist/esm/models/components/creditprotocol.js.map +1 -1
  143. package/dist/esm/models/components/creditrepayparams.d.ts +9 -0
  144. package/dist/esm/models/components/creditrepayparams.d.ts.map +1 -1
  145. package/dist/esm/models/components/creditrepayparams.js +2 -0
  146. package/dist/esm/models/components/creditrepayparams.js.map +1 -1
  147. package/dist/esm/models/components/creditrepayrequest.d.ts +9 -0
  148. package/dist/esm/models/components/creditrepayrequest.d.ts.map +1 -1
  149. package/dist/esm/models/components/creditrepayrequest.js +2 -0
  150. package/dist/esm/models/components/creditrepayrequest.js.map +1 -1
  151. package/dist/esm/models/components/creditsupplyparams.d.ts +9 -0
  152. package/dist/esm/models/components/creditsupplyparams.d.ts.map +1 -1
  153. package/dist/esm/models/components/creditsupplyparams.js +2 -0
  154. package/dist/esm/models/components/creditsupplyparams.js.map +1 -1
  155. package/dist/esm/models/components/creditwithdrawparams.d.ts +9 -0
  156. package/dist/esm/models/components/creditwithdrawparams.d.ts.map +1 -1
  157. package/dist/esm/models/components/creditwithdrawparams.js +2 -0
  158. package/dist/esm/models/components/creditwithdrawparams.js.map +1 -1
  159. package/dist/esm/models/components/debtposition.d.ts +12 -0
  160. package/dist/esm/models/components/debtposition.d.ts.map +1 -1
  161. package/dist/esm/models/components/debtposition.js +4 -0
  162. package/dist/esm/models/components/debtposition.js.map +1 -1
  163. package/dist/esm/models/components/index.d.ts +6 -0
  164. package/dist/esm/models/components/index.d.ts.map +1 -1
  165. package/dist/esm/models/components/index.js +6 -0
  166. package/dist/esm/models/components/index.js.map +1 -1
  167. package/dist/esm/models/components/looplegpreview.d.ts +24 -0
  168. package/dist/esm/models/components/looplegpreview.d.ts.map +1 -0
  169. package/dist/esm/models/components/looplegpreview.js +22 -0
  170. package/dist/esm/models/components/looplegpreview.js.map +1 -0
  171. package/dist/esm/models/components/morpholendingmarket.d.ts +80 -0
  172. package/dist/esm/models/components/morpholendingmarket.d.ts.map +1 -0
  173. package/dist/esm/models/components/morpholendingmarket.js +45 -0
  174. package/dist/esm/models/components/morpholendingmarket.js.map +1 -0
  175. package/dist/esm/models/components/morphomarketsresponse.d.ts +21 -0
  176. package/dist/esm/models/components/morphomarketsresponse.d.ts.map +1 -0
  177. package/dist/esm/models/components/morphomarketsresponse.js +15 -0
  178. package/dist/esm/models/components/morphomarketsresponse.js.map +1 -0
  179. package/dist/esm/models/operations/index.d.ts +1 -0
  180. package/dist/esm/models/operations/index.d.ts.map +1 -1
  181. package/dist/esm/models/operations/index.js +1 -0
  182. package/dist/esm/models/operations/index.js.map +1 -1
  183. package/dist/esm/models/operations/v2creditmorphomarkets.d.ts +22 -0
  184. package/dist/esm/models/operations/v2creditmorphomarkets.d.ts.map +1 -0
  185. package/dist/esm/models/operations/v2creditmorphomarkets.js +20 -0
  186. package/dist/esm/models/operations/v2creditmorphomarkets.js.map +1 -0
  187. package/dist/esm/sdk/credit.d.ts +32 -0
  188. package/dist/esm/sdk/credit.d.ts.map +1 -1
  189. package/dist/esm/sdk/credit.js +38 -0
  190. package/dist/esm/sdk/credit.js.map +1 -1
  191. package/docs/models/components/aavelooprequest.md +4 -4
  192. package/docs/models/components/{initialcollateralamount.md → aavelooprequestinitialcollateralamount.md} +1 -1
  193. package/docs/models/components/{loantovalue.md → aavelooprequestloantovalue.md} +1 -1
  194. package/docs/models/components/{maxslippagepercent.md → aavelooprequestmaxslippagepercent.md} +1 -1
  195. package/docs/models/components/{multiplier.md → aavelooprequestmultiplier.md} +1 -1
  196. package/docs/models/components/accountsummary.md +10 -10
  197. package/docs/models/components/collateralposition.md +16 -14
  198. package/docs/models/components/creditborrowparams.md +10 -9
  199. package/docs/models/components/creditborrowrequest.md +20 -19
  200. package/docs/models/components/creditenablecollateralparams.md +6 -6
  201. package/docs/models/components/creditlooppreview.md +33 -0
  202. package/docs/models/components/creditlooprequest.md +41 -0
  203. package/docs/models/components/creditlooprequestinitialcollateralamount.md +19 -0
  204. package/docs/models/components/creditlooprequestloantovalue.md +19 -0
  205. package/docs/models/components/creditlooprequestmaxslippagepercent.md +19 -0
  206. package/docs/models/components/creditlooprequestmultiplier.md +19 -0
  207. package/docs/models/components/creditloopresponse.md +30 -0
  208. package/docs/models/components/creditprotocol.md +5 -1
  209. package/docs/models/components/creditrepayparams.md +9 -8
  210. package/docs/models/components/creditrepayrequest.md +19 -18
  211. package/docs/models/components/creditsupplyparams.md +8 -7
  212. package/docs/models/components/creditwithdrawparams.md +8 -7
  213. package/docs/models/components/debtposition.md +15 -13
  214. package/docs/models/components/looplegpreview.md +21 -0
  215. package/docs/models/components/morpholendingmarket.md +49 -0
  216. package/docs/models/components/morphomarketsresponse.md +21 -0
  217. package/docs/models/operations/v2creditmorphomarketschain.md +15 -0
  218. package/docs/models/operations/v2creditmorphomarketsrequest.md +17 -0
  219. package/docs/sdks/credit/README.md +186 -0
  220. package/openapi_prepped_for_speakeasy.json +658 -2
  221. package/package.json +1 -1
  222. package/src/funcs/creditCreditLoop.ts +184 -0
  223. package/src/funcs/creditCreditMorphoMarkets.ts +182 -0
  224. package/src/models/components/aavelooprequest.ts +43 -30
  225. package/src/models/components/accountsummary.ts +4 -0
  226. package/src/models/components/collateralposition.ts +16 -0
  227. package/src/models/components/creditborrowparams.ts +11 -0
  228. package/src/models/components/creditborrowrequest.ts +11 -0
  229. package/src/models/components/creditenablecollateralparams.ts +4 -0
  230. package/src/models/components/creditlooppreview.ts +86 -0
  231. package/src/models/components/creditlooprequest.ts +235 -0
  232. package/src/models/components/creditloopresponse.ts +65 -0
  233. package/src/models/components/creditprotocol.ts +9 -0
  234. package/src/models/components/creditrepayparams.ts +11 -0
  235. package/src/models/components/creditrepayrequest.ts +11 -0
  236. package/src/models/components/creditsupplyparams.ts +11 -0
  237. package/src/models/components/creditwithdrawparams.ts +11 -0
  238. package/src/models/components/debtposition.ts +16 -0
  239. package/src/models/components/index.ts +6 -0
  240. package/src/models/components/looplegpreview.ts +54 -0
  241. package/src/models/components/morpholendingmarket.ts +133 -0
  242. package/src/models/components/morphomarketsresponse.ts +46 -0
  243. package/src/models/operations/index.ts +1 -0
  244. package/src/models/operations/v2creditmorphomarkets.ts +49 -0
  245. package/src/sdk/credit.ts +54 -0
@@ -6058,6 +6058,57 @@
6058
6058
  "x-speakeasy-name-override": "credit_euler_markets"
6059
6059
  }
6060
6060
  },
6061
+ "/v2/credit/morpho_markets": {
6062
+ "get": {
6063
+ "tags": [
6064
+ "Credit"
6065
+ ],
6066
+ "summary": "List curated Morpho markets",
6067
+ "description": "List curated Morpho Blue lending markets for a chain.\n\nMorpho Blue is permissionless, so credit actions identify a market by its\nbytes32 market id. This returns the curated market set with live LLTV,\nsupply/borrow APY, utilization, and available liquidity -- read on-chain per\nrequest -- so callers know which market_id to use and what it currently costs.",
6068
+ "operationId": "v2_credit_morpho_markets",
6069
+ "parameters": [
6070
+ {
6071
+ "name": "chain",
6072
+ "in": "query",
6073
+ "required": true,
6074
+ "schema": {
6075
+ "type": "string",
6076
+ "enum": [
6077
+ "arbitrum",
6078
+ "base",
6079
+ "ethereum",
6080
+ "tempo"
6081
+ ],
6082
+ "title": "Chain",
6083
+ "example": "ethereum"
6084
+ }
6085
+ }
6086
+ ],
6087
+ "responses": {
6088
+ "200": {
6089
+ "description": "Successful Response",
6090
+ "content": {
6091
+ "application/json": {
6092
+ "schema": {
6093
+ "$ref": "#/components/schemas/MorphoMarketsResponse"
6094
+ }
6095
+ }
6096
+ }
6097
+ },
6098
+ "422": {
6099
+ "description": "Validation Error",
6100
+ "content": {
6101
+ "application/json": {
6102
+ "schema": {
6103
+ "$ref": "#/components/schemas/HTTPValidationError"
6104
+ }
6105
+ }
6106
+ }
6107
+ }
6108
+ },
6109
+ "x-speakeasy-name-override": "credit_morpho_markets"
6110
+ }
6111
+ },
6061
6112
  "/v2/credit/create_account": {
6062
6113
  "post": {
6063
6114
  "tags": [
@@ -6144,6 +6195,49 @@
6144
6195
  "x-speakeasy-name-override": "credit_borrow"
6145
6196
  }
6146
6197
  },
6198
+ "/v2/credit/loop": {
6199
+ "post": {
6200
+ "tags": [
6201
+ "Credit"
6202
+ ],
6203
+ "summary": "Open a leveraged loop",
6204
+ "description": "Open a leveraged loop into an Aave or Morpho market in ONE atomic transaction.\n\nRepeatedly supplies collateral, borrows at the requested loan-to-value, and\nswaps the borrow back to collateral. Each iteration's supply uses the swap's\nGUARANTEED minimum output (enforced on-chain), so a fill anywhere within the\nslippage tolerance can never break a later step; any positive surplus stays\nin the Credit Account (the preview reports the bound as estimated_max_dust).\nVery large loops relative to pool depth can still exceed the slippage\ntolerance through their own cumulative price impact \u2014 size accordingly or\nraise max_slippage_percent.\n\nThe Credit Account must already hold initial_collateral_amount of\ncollateral_token. For protocol=MORPHO pass a market_id from\n/v2/credit/morpho_markets.",
6205
+ "operationId": "v2_credit_loop",
6206
+ "requestBody": {
6207
+ "content": {
6208
+ "application/json": {
6209
+ "schema": {
6210
+ "$ref": "#/components/schemas/CreditLoopRequest"
6211
+ }
6212
+ }
6213
+ },
6214
+ "required": true
6215
+ },
6216
+ "responses": {
6217
+ "200": {
6218
+ "description": "Successful Response",
6219
+ "content": {
6220
+ "application/json": {
6221
+ "schema": {
6222
+ "$ref": "#/components/schemas/CreditLoopResponse"
6223
+ }
6224
+ }
6225
+ }
6226
+ },
6227
+ "422": {
6228
+ "description": "Validation Error",
6229
+ "content": {
6230
+ "application/json": {
6231
+ "schema": {
6232
+ "$ref": "#/components/schemas/HTTPValidationError"
6233
+ }
6234
+ }
6235
+ }
6236
+ }
6237
+ },
6238
+ "x-speakeasy-name-override": "credit_loop"
6239
+ }
6240
+ },
6147
6241
  "/v2/credit/transfer": {
6148
6242
  "post": {
6149
6243
  "tags": [
@@ -11670,6 +11764,30 @@
11670
11764
  "title": "Vault",
11671
11765
  "description": "Euler only: the EVK collateral vault holding this position."
11672
11766
  },
11767
+ "market_id": {
11768
+ "anyOf": [
11769
+ {
11770
+ "type": "string"
11771
+ },
11772
+ {
11773
+ "type": "null"
11774
+ }
11775
+ ],
11776
+ "title": "Market Id",
11777
+ "description": "Morpho only: the bytes32 id of the isolated market holding this position."
11778
+ },
11779
+ "is_pure_supply": {
11780
+ "anyOf": [
11781
+ {
11782
+ "type": "boolean"
11783
+ },
11784
+ {
11785
+ "type": "null"
11786
+ }
11787
+ ],
11788
+ "title": "Is Pure Supply",
11789
+ "description": "Morpho only: true when this is a loan-asset supply position (earning supply APY) rather than collateral backing borrows."
11790
+ },
11673
11791
  "amount_supplied": {
11674
11792
  "anyOf": [
11675
11793
  {
@@ -12115,6 +12233,18 @@
12115
12233
  ],
12116
12234
  "title": "Borrow Vault",
12117
12235
  "description": "Euler only: the EVK vault to borrow from. Required when protocol=EULER."
12236
+ },
12237
+ "market_id": {
12238
+ "anyOf": [
12239
+ {
12240
+ "type": "string"
12241
+ },
12242
+ {
12243
+ "type": "null"
12244
+ }
12245
+ ],
12246
+ "title": "Market Id",
12247
+ "description": "Morpho only: the bytes32 market id (from /v2/credit/morpho_markets). Required when protocol=MORPHO."
12118
12248
  }
12119
12249
  },
12120
12250
  "type": "object",
@@ -12167,6 +12297,18 @@
12167
12297
  "title": "Borrow Vault",
12168
12298
  "description": "Euler only: the EVK vault to borrow from. Required when protocol=EULER."
12169
12299
  },
12300
+ "market_id": {
12301
+ "anyOf": [
12302
+ {
12303
+ "type": "string"
12304
+ },
12305
+ {
12306
+ "type": "null"
12307
+ }
12308
+ ],
12309
+ "title": "Market Id",
12310
+ "description": "Morpho only: the bytes32 market id (from /v2/credit/morpho_markets). Required when protocol=MORPHO."
12311
+ },
12170
12312
  "token_in": {
12171
12313
  "anyOf": [
12172
12314
  {
@@ -12595,6 +12737,252 @@
12595
12737
  "title": "CreditFee",
12596
12738
  "description": "Fee configuration for credit-product actions.\n\nSame shape as `Fee`, but narrows `denomination` to the values supported by\ncredit borrows. PERFORMANCE is not supported because realized-profit fees\nare not meaningful for debt positions."
12597
12739
  },
12740
+ "CreditLoopPreview": {
12741
+ "properties": {
12742
+ "iterations": {
12743
+ "type": "integer",
12744
+ "title": "Iterations",
12745
+ "description": "Number of loop iterations bundled."
12746
+ },
12747
+ "total_collateral_supplied": {
12748
+ "type": "string",
12749
+ "title": "Total Collateral Supplied",
12750
+ "description": "Guaranteed minimum total collateral supplied (token units); actual can only be higher (swap fills above the floor become dust)."
12751
+ },
12752
+ "total_borrowed": {
12753
+ "type": "string",
12754
+ "title": "Total Borrowed",
12755
+ "description": "Total loan tokens borrowed across iterations."
12756
+ },
12757
+ "achieved_multiplier": {
12758
+ "type": "string",
12759
+ "title": "Achieved Multiplier",
12760
+ "description": "Guaranteed leverage floor: total_collateral_supplied / initial_collateral_amount."
12761
+ },
12762
+ "projected_ltv": {
12763
+ "type": "string",
12764
+ "title": "Projected Ltv",
12765
+ "description": "Projected end loan-to-value in percent, at the sizing oracle prices."
12766
+ },
12767
+ "projected_health_factor": {
12768
+ "type": "string",
12769
+ "title": "Projected Health Factor",
12770
+ "description": "Projected health factor (liquidation threshold / projected LTV). Below 1 would be liquidatable \u2014 the request is rejected long before that."
12771
+ },
12772
+ "estimated_max_dust": {
12773
+ "type": "string",
12774
+ "title": "Estimated Max Dust",
12775
+ "description": "Upper bound of collateral-token surplus the swaps can leave in the Credit Account (sum of quote \u2212 guaranteed floor per swap). It is bounded by max_slippage_percent per iteration, stays in the account, and is never lost."
12776
+ },
12777
+ "legs": {
12778
+ "items": {
12779
+ "$ref": "#/components/schemas/LoopLegPreview"
12780
+ },
12781
+ "type": "array",
12782
+ "title": "Legs",
12783
+ "description": "Per-iteration breakdown.",
12784
+ "example": []
12785
+ }
12786
+ },
12787
+ "additionalProperties": false,
12788
+ "type": "object",
12789
+ "required": [
12790
+ "iterations",
12791
+ "total_collateral_supplied",
12792
+ "total_borrowed",
12793
+ "achieved_multiplier",
12794
+ "projected_ltv",
12795
+ "projected_health_factor",
12796
+ "estimated_max_dust"
12797
+ ],
12798
+ "title": "CreditLoopPreview",
12799
+ "description": "Projected end state of the loop, computed on GUARANTEED swap floors."
12800
+ },
12801
+ "CreditLoopRequest": {
12802
+ "properties": {
12803
+ "owner": {
12804
+ "type": "string",
12805
+ "title": "Owner",
12806
+ "description": "The address that owns the Credit Account.",
12807
+ "example": "0x5e5b00ed886A6879C2B934612D2312975427fcAf"
12808
+ },
12809
+ "chain": {
12810
+ "$ref": "#/components/schemas/Chain",
12811
+ "description": "Blockchain network.",
12812
+ "example": "ethereum"
12813
+ },
12814
+ "protocol": {
12815
+ "$ref": "#/components/schemas/CreditProtocol",
12816
+ "description": "Lending protocol to loop into: AAVE or MORPHO. EULER looping is not available yet.",
12817
+ "example": "AAVE"
12818
+ },
12819
+ "market_id": {
12820
+ "anyOf": [
12821
+ {
12822
+ "type": "string"
12823
+ },
12824
+ {
12825
+ "type": "null"
12826
+ }
12827
+ ],
12828
+ "title": "Market Id",
12829
+ "description": "Morpho only: the bytes32 market id (from /v2/credit/morpho_markets). Required when protocol=MORPHO."
12830
+ },
12831
+ "collateral_token": {
12832
+ "type": "string",
12833
+ "title": "Token",
12834
+ "description": "Token supplied as collateral each iteration. Must already be in the Credit Account for the initial amount. For MORPHO it must be the market's collateral token.",
12835
+ "example": "WETH"
12836
+ },
12837
+ "borrow_token": {
12838
+ "type": "string",
12839
+ "title": "Token",
12840
+ "description": "Token borrowed each iteration and swapped back to the collateral token. For MORPHO it must be the market's loan token.",
12841
+ "example": "USDC"
12842
+ },
12843
+ "initial_collateral_amount": {
12844
+ "anyOf": [
12845
+ {
12846
+ "type": "number",
12847
+ "exclusiveMinimum": 0.0
12848
+ },
12849
+ {
12850
+ "type": "string",
12851
+ "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
12852
+ }
12853
+ ],
12854
+ "title": "Initial Collateral Amount",
12855
+ "description": "Collateral (in token units) already held in the Credit Account to seed the loop.",
12856
+ "example": 1
12857
+ },
12858
+ "multiplier": {
12859
+ "anyOf": [
12860
+ {
12861
+ "type": "number",
12862
+ "exclusiveMinimum": 1.0
12863
+ },
12864
+ {
12865
+ "type": "string",
12866
+ "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
12867
+ }
12868
+ ],
12869
+ "title": "Multiplier",
12870
+ "description": "Target leverage: total collateral exposure = multiplier \u00d7 initial_collateral_amount. Must be achievable at the requested loan_to_value (max \u2248 0.9 / (1 \u2212 LTV)).",
12871
+ "example": 2
12872
+ },
12873
+ "loan_to_value": {
12874
+ "anyOf": [
12875
+ {
12876
+ "type": "number",
12877
+ "maximum": 100.0,
12878
+ "exclusiveMinimum": 0.0
12879
+ },
12880
+ {
12881
+ "type": "string",
12882
+ "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
12883
+ }
12884
+ ],
12885
+ "title": "Loan To Value",
12886
+ "description": "Per-iteration borrow LTV in percent. Must not exceed the protocol's maximum for the market (Aave reserve/e-mode LTV; Morpho LLTV with a safety margin); borrows are sized slightly inside the requested value so no leg sits on the protocol's revert boundary.",
12887
+ "example": 70
12888
+ },
12889
+ "max_slippage_percent": {
12890
+ "anyOf": [
12891
+ {
12892
+ "type": "number",
12893
+ "maximum": 10.0,
12894
+ "exclusiveMinimum": 0.0
12895
+ },
12896
+ {
12897
+ "type": "string",
12898
+ "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"
12899
+ }
12900
+ ],
12901
+ "title": "Max Slippage Percent",
12902
+ "description": "Per-swap slippage tolerance in percent. Loop dust is bounded by this per iteration, so tighter slippage means less dust.",
12903
+ "example": "0.5"
12904
+ },
12905
+ "emode_category": {
12906
+ "anyOf": [
12907
+ {
12908
+ "type": "integer",
12909
+ "minimum": 0.0
12910
+ },
12911
+ {
12912
+ "type": "null"
12913
+ }
12914
+ ],
12915
+ "title": "Emode Category",
12916
+ "description": "Aave only: e-mode category to enable before looping (higher LTV for correlated pairs, e.g. ETH-correlated)."
12917
+ },
12918
+ "gas_sponsorship": {
12919
+ "type": "boolean",
12920
+ "title": "Gas Sponsorship",
12921
+ "description": "If true, returns EIP-712 typed data for gas-sponsored execution instead of an unsigned transaction.",
12922
+ "example": false
12923
+ }
12924
+ },
12925
+ "type": "object",
12926
+ "required": [
12927
+ "owner",
12928
+ "chain",
12929
+ "collateral_token",
12930
+ "borrow_token",
12931
+ "initial_collateral_amount",
12932
+ "multiplier",
12933
+ "loan_to_value"
12934
+ ],
12935
+ "title": "CreditLoopRequest",
12936
+ "description": "Open a leveraged loop: repeatedly supply collateral, borrow, and swap the\nborrow back to collateral \u2014 all in ONE atomic transaction from the Credit\nAccount.",
12937
+ "example": {
12938
+ "owner": "0x5e5b00ed886A6879C2B934612D2312975427fcAf",
12939
+ "chain": "ethereum",
12940
+ "protocol": "AAVE",
12941
+ "collateral_token": "WETH",
12942
+ "borrow_token": "USDC",
12943
+ "initial_collateral_amount": 1,
12944
+ "multiplier": 2,
12945
+ "loan_to_value": 70,
12946
+ "max_slippage_percent": 0.5,
12947
+ "gas_sponsorship": false
12948
+ }
12949
+ },
12950
+ "CreditLoopResponse": {
12951
+ "properties": {
12952
+ "transaction": {
12953
+ "anyOf": [
12954
+ {
12955
+ "$ref": "#/components/schemas/UnsignedTransaction"
12956
+ },
12957
+ {
12958
+ "type": "null"
12959
+ }
12960
+ ],
12961
+ "description": "Unsigned transaction for direct execution by the owner. Present when gas_sponsorship=false."
12962
+ },
12963
+ "eip_712": {
12964
+ "anyOf": [
12965
+ {
12966
+ "$ref": "#/components/schemas/BatchedSafeOperationsResponse-Output"
12967
+ },
12968
+ {
12969
+ "type": "null"
12970
+ }
12971
+ ],
12972
+ "description": "EIP-712 typed data for gas-sponsored execution. Present when gas_sponsorship=true."
12973
+ },
12974
+ "preview": {
12975
+ "$ref": "#/components/schemas/CreditLoopPreview",
12976
+ "description": "Projected end state, computed on guaranteed swap floors."
12977
+ }
12978
+ },
12979
+ "type": "object",
12980
+ "required": [
12981
+ "preview"
12982
+ ],
12983
+ "title": "CreditLoopResponse",
12984
+ "description": "The atomic loop transaction plus its guaranteed-floor preview."
12985
+ },
12598
12986
  "CreditPositionsResponse": {
12599
12987
  "properties": {
12600
12988
  "collateral_positions": {
@@ -12672,10 +13060,11 @@
12672
13060
  "type": "string",
12673
13061
  "enum": [
12674
13062
  "AAVE",
12675
- "EULER"
13063
+ "EULER",
13064
+ "MORPHO"
12676
13065
  ],
12677
13066
  "title": "CreditProtocol",
12678
- "description": "Which lending protocol a credit action targets.\n\n``AAVE`` is the default so existing callers (which never send a ``protocol``\nfield) keep hitting the unchanged Aave code path. ``EULER`` opts in to the\nEuler V2 path, where the market is identified by EVK vault address(es)."
13067
+ "description": "Which lending protocol a credit action targets.\n\n``AAVE`` is the default so existing callers (which never send a ``protocol``\nfield) keep hitting the unchanged Aave code path. ``EULER`` opts in to the\nEuler V2 path, where the market is identified by EVK vault address(es).\n``MORPHO`` identifies Morpho Blue lending markets (bytes32 market id) and is\ncurrently read-only: positions and market discovery only \u2014 transaction\nbuilders land with the looping work (COM-7106/7107/7108), so transact\nendpoints reject it with a 422."
12679
13068
  },
12680
13069
  "CreditRepayParams": {
12681
13070
  "properties": {
@@ -12725,6 +13114,18 @@
12725
13114
  ],
12726
13115
  "title": "Borrow Vault",
12727
13116
  "description": "Euler only: the EVK vault the debt is owed to. Required when protocol=EULER."
13117
+ },
13118
+ "market_id": {
13119
+ "anyOf": [
13120
+ {
13121
+ "type": "string"
13122
+ },
13123
+ {
13124
+ "type": "null"
13125
+ }
13126
+ ],
13127
+ "title": "Market Id",
13128
+ "description": "Morpho only: the bytes32 market id (from /v2/credit/morpho_markets). Required when protocol=MORPHO."
12728
13129
  }
12729
13130
  },
12730
13131
  "type": "object",
@@ -12765,6 +13166,18 @@
12765
13166
  "title": "Borrow Vault",
12766
13167
  "description": "Euler only: the EVK vault the debt is owed to (repay target). Required when protocol=EULER."
12767
13168
  },
13169
+ "market_id": {
13170
+ "anyOf": [
13171
+ {
13172
+ "type": "string"
13173
+ },
13174
+ {
13175
+ "type": "null"
13176
+ }
13177
+ ],
13178
+ "title": "Market Id",
13179
+ "description": "Morpho only: the bytes32 market id (from /v2/credit/morpho_markets). Required when protocol=MORPHO."
13180
+ },
12768
13181
  "collateral_vault": {
12769
13182
  "anyOf": [
12770
13183
  {
@@ -13015,6 +13428,18 @@
13015
13428
  ],
13016
13429
  "title": "Collateral Vault",
13017
13430
  "description": "Euler only: the EVK collateral vault to supply into. Required when protocol=EULER."
13431
+ },
13432
+ "market_id": {
13433
+ "anyOf": [
13434
+ {
13435
+ "type": "string"
13436
+ },
13437
+ {
13438
+ "type": "null"
13439
+ }
13440
+ ],
13441
+ "title": "Market Id",
13442
+ "description": "Morpho only: the bytes32 market id (from /v2/credit/morpho_markets). Required when protocol=MORPHO."
13018
13443
  }
13019
13444
  },
13020
13445
  "type": "object",
@@ -13275,6 +13700,18 @@
13275
13700
  ],
13276
13701
  "title": "Collateral Vault",
13277
13702
  "description": "Euler only: the EVK collateral vault to withdraw from. Required when protocol=EULER."
13703
+ },
13704
+ "market_id": {
13705
+ "anyOf": [
13706
+ {
13707
+ "type": "string"
13708
+ },
13709
+ {
13710
+ "type": "null"
13711
+ }
13712
+ ],
13713
+ "title": "Market Id",
13714
+ "description": "Morpho only: the bytes32 market id (from /v2/credit/morpho_markets). Required when protocol=MORPHO."
13278
13715
  }
13279
13716
  },
13280
13717
  "type": "object",
@@ -13314,6 +13751,30 @@
13314
13751
  "title": "Vault",
13315
13752
  "description": "Euler only: the EVK borrow vault this debt is owed to."
13316
13753
  },
13754
+ "market_id": {
13755
+ "anyOf": [
13756
+ {
13757
+ "type": "string"
13758
+ },
13759
+ {
13760
+ "type": "null"
13761
+ }
13762
+ ],
13763
+ "title": "Market Id",
13764
+ "description": "Morpho only: the bytes32 id of the isolated market this debt is owed to."
13765
+ },
13766
+ "health_factor": {
13767
+ "anyOf": [
13768
+ {
13769
+ "type": "string"
13770
+ },
13771
+ {
13772
+ "type": "null"
13773
+ }
13774
+ ],
13775
+ "title": "Health Factor",
13776
+ "description": "Morpho only: this market's health factor (markets are isolated, so health is per market \u2014 below 1 the position is liquidatable). Null for other protocols and when the oracle read fails."
13777
+ },
13317
13778
  "amount_borrowed": {
13318
13779
  "anyOf": [
13319
13780
  {
@@ -16537,6 +16998,53 @@
16537
16998
  "title": "ListAaveMarketsResponse",
16538
16999
  "description": "Response containing Aave market rates organized by token symbol."
16539
17000
  },
17001
+ "LoopLegPreview": {
17002
+ "properties": {
17003
+ "supply_amount": {
17004
+ "anyOf": [
17005
+ {
17006
+ "type": "string"
17007
+ },
17008
+ {
17009
+ "type": "null"
17010
+ }
17011
+ ],
17012
+ "title": "Supply Amount",
17013
+ "description": "Collateral supplied this iteration (token units)."
17014
+ },
17015
+ "borrow_amount": {
17016
+ "anyOf": [
17017
+ {
17018
+ "type": "string"
17019
+ },
17020
+ {
17021
+ "type": "null"
17022
+ }
17023
+ ],
17024
+ "title": "Borrow Amount",
17025
+ "description": "Loan borrowed this iteration; null on the final supply-only iteration."
17026
+ },
17027
+ "min_swap_out": {
17028
+ "anyOf": [
17029
+ {
17030
+ "type": "string"
17031
+ },
17032
+ {
17033
+ "type": "null"
17034
+ }
17035
+ ],
17036
+ "title": "Min Swap Out",
17037
+ "description": "Guaranteed swap output (collateral units) \u2014 the next iteration's supply. Enforced on-chain by the swap's minimum-return."
17038
+ }
17039
+ },
17040
+ "additionalProperties": false,
17041
+ "type": "object",
17042
+ "required": [
17043
+ "supply_amount"
17044
+ ],
17045
+ "title": "LoopLegPreview",
17046
+ "description": "One planned loop iteration."
17047
+ },
16540
17048
  "LpBalance": {
16541
17049
  "properties": {
16542
17050
  "valuation": {
@@ -17657,6 +18165,130 @@
17657
18165
  ],
17658
18166
  "title": "MorphoGetVaultsResponse"
17659
18167
  },
18168
+ "MorphoLendingMarket": {
18169
+ "properties": {
18170
+ "market_id": {
18171
+ "type": "string",
18172
+ "title": "Market Id",
18173
+ "description": "Morpho Blue market id \u2014 the bytes32 keccak of the market's (loanToken, collateralToken, oracle, irm, lltv) tuple. Pass this to the Morpho credit actions to identify the market."
18174
+ },
18175
+ "loan_token": {
18176
+ "type": "string",
18177
+ "title": "Loan Token",
18178
+ "description": "Token that is supplied and borrowed in this market."
18179
+ },
18180
+ "loan_token_symbol": {
18181
+ "type": "string",
18182
+ "title": "Loan Token Symbol",
18183
+ "description": "Symbol of the loan token (e.g. USDC)."
18184
+ },
18185
+ "loan_token_decimals": {
18186
+ "type": "integer",
18187
+ "title": "Loan Token Decimals",
18188
+ "description": "Decimals of the loan token."
18189
+ },
18190
+ "collateral_token": {
18191
+ "type": "string",
18192
+ "title": "Collateral Token",
18193
+ "description": "Token accepted as collateral in this market."
18194
+ },
18195
+ "collateral_token_symbol": {
18196
+ "type": "string",
18197
+ "title": "Collateral Token Symbol",
18198
+ "description": "Symbol of the collateral token (e.g. wstETH)."
18199
+ },
18200
+ "collateral_token_decimals": {
18201
+ "type": "integer",
18202
+ "title": "Collateral Token Decimals",
18203
+ "description": "Decimals of the collateral token."
18204
+ },
18205
+ "oracle": {
18206
+ "type": "string",
18207
+ "title": "Oracle",
18208
+ "description": "Oracle pricing the collateral in loan-token terms for this market."
18209
+ },
18210
+ "irm": {
18211
+ "type": "string",
18212
+ "title": "Irm",
18213
+ "description": "Interest rate model contract of this market."
18214
+ },
18215
+ "lltv": {
18216
+ "type": "string",
18217
+ "title": "Lltv",
18218
+ "description": "Liquidation loan-to-value in percentage (e.g. 86 means a position is liquidatable once debt exceeds 86% of collateral value)."
18219
+ },
18220
+ "supply_apy": {
18221
+ "anyOf": [
18222
+ {
18223
+ "type": "string"
18224
+ },
18225
+ {
18226
+ "type": "null"
18227
+ }
18228
+ ],
18229
+ "title": "Supply Apy",
18230
+ "description": "Current supply APY for lending the loan token, in percentage (e.g. 3.5 means 3.5%). Null if the rate is unavailable."
18231
+ },
18232
+ "borrow_apy": {
18233
+ "anyOf": [
18234
+ {
18235
+ "type": "string"
18236
+ },
18237
+ {
18238
+ "type": "null"
18239
+ }
18240
+ ],
18241
+ "title": "Borrow Apy",
18242
+ "description": "Current borrow APY for the loan token, in percentage (e.g. 5.25 means 5.25%). Null if the rate is unavailable."
18243
+ },
18244
+ "utilization": {
18245
+ "type": "string",
18246
+ "title": "Utilization",
18247
+ "description": "Borrowed share of supplied assets, in percentage 0-100."
18248
+ },
18249
+ "total_supply_assets": {
18250
+ "type": "string",
18251
+ "title": "Total Supply Assets",
18252
+ "description": "Total loan tokens supplied to the market, in token units."
18253
+ },
18254
+ "total_borrow_assets": {
18255
+ "type": "string",
18256
+ "title": "Total Borrow Assets",
18257
+ "description": "Total loan tokens borrowed from the market, in token units."
18258
+ },
18259
+ "available_liquidity": {
18260
+ "type": "string",
18261
+ "title": "Available Liquidity",
18262
+ "description": "Loan tokens available to borrow or withdraw (supplied - borrowed), in token units."
18263
+ },
18264
+ "fee": {
18265
+ "type": "string",
18266
+ "title": "Fee",
18267
+ "description": "Protocol fee taken from interest, in percentage of interest (e.g. 0 means no fee)."
18268
+ }
18269
+ },
18270
+ "additionalProperties": false,
18271
+ "type": "object",
18272
+ "required": [
18273
+ "market_id",
18274
+ "loan_token",
18275
+ "loan_token_symbol",
18276
+ "loan_token_decimals",
18277
+ "collateral_token",
18278
+ "collateral_token_symbol",
18279
+ "collateral_token_decimals",
18280
+ "oracle",
18281
+ "irm",
18282
+ "lltv",
18283
+ "utilization",
18284
+ "total_supply_assets",
18285
+ "total_borrow_assets",
18286
+ "available_liquidity",
18287
+ "fee"
18288
+ ],
18289
+ "title": "MorphoLendingMarket",
18290
+ "description": "A Morpho Blue lending market: one isolated (collateral, loan) pair."
18291
+ },
17660
18292
  "MorphoMarket": {
17661
18293
  "properties": {
17662
18294
  "uniqueKey": {
@@ -17707,6 +18339,30 @@
17707
18339
  ],
17708
18340
  "title": "MorphoMarket"
17709
18341
  },
18342
+ "MorphoMarketsResponse": {
18343
+ "properties": {
18344
+ "morpho": {
18345
+ "type": "string",
18346
+ "title": "Morpho",
18347
+ "description": "Morpho Blue singleton contract the markets were read from."
18348
+ },
18349
+ "markets": {
18350
+ "items": {
18351
+ "$ref": "#/components/schemas/MorphoLendingMarket"
18352
+ },
18353
+ "type": "array",
18354
+ "title": "Markets",
18355
+ "description": "Curated lending markets with live LLTV, APYs, utilization, and liquidity.",
18356
+ "example": []
18357
+ }
18358
+ },
18359
+ "type": "object",
18360
+ "required": [
18361
+ "morpho"
18362
+ ],
18363
+ "title": "MorphoMarketsResponse",
18364
+ "description": "Curated Morpho Blue lending markets, read on-chain per request."
18365
+ },
17710
18366
  "MorphoRepayParams": {
17711
18367
  "properties": {
17712
18368
  "action_type": {