@compass-labs/api-sdk 2.2.77-rc.0 → 2.2.77-rc.1

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 (115) hide show
  1. package/README.md +5 -3
  2. package/codeSamples_typescript.yaml +6 -0
  3. package/dist/commonjs/funcs/creditCreditLoopedPositions.d.ts +26 -0
  4. package/dist/commonjs/funcs/creditCreditLoopedPositions.d.ts.map +1 -0
  5. package/dist/commonjs/funcs/creditCreditLoopedPositions.js +131 -0
  6. package/dist/commonjs/funcs/creditCreditLoopedPositions.js.map +1 -0
  7. package/dist/commonjs/models/components/creditloopedpositionsresponse.d.ts +26 -0
  8. package/dist/commonjs/models/components/creditloopedpositionsresponse.d.ts.map +1 -0
  9. package/dist/commonjs/models/components/creditloopedpositionsresponse.js +60 -0
  10. package/dist/commonjs/models/components/creditloopedpositionsresponse.js.map +1 -0
  11. package/dist/commonjs/models/components/index.d.ts +6 -0
  12. package/dist/commonjs/models/components/index.d.ts.map +1 -1
  13. package/dist/commonjs/models/components/index.js +6 -0
  14. package/dist/commonjs/models/components/index.js.map +1 -1
  15. package/dist/commonjs/models/components/loopedposition.d.ts +88 -0
  16. package/dist/commonjs/models/components/loopedposition.d.ts.map +1 -0
  17. package/dist/commonjs/models/components/loopedposition.js +85 -0
  18. package/dist/commonjs/models/components/loopedposition.js.map +1 -0
  19. package/dist/commonjs/models/components/loopedpositioncurrentstate.d.ts +58 -0
  20. package/dist/commonjs/models/components/loopedpositioncurrentstate.d.ts.map +1 -0
  21. package/dist/commonjs/models/components/loopedpositioncurrentstate.js +77 -0
  22. package/dist/commonjs/models/components/loopedpositioncurrentstate.js.map +1 -0
  23. package/dist/commonjs/models/components/loopedpositionhistoryentry.d.ts +71 -0
  24. package/dist/commonjs/models/components/loopedpositionhistoryentry.d.ts.map +1 -0
  25. package/dist/commonjs/models/components/loopedpositionhistoryentry.js +85 -0
  26. package/dist/commonjs/models/components/loopedpositionhistoryentry.js.map +1 -0
  27. package/dist/commonjs/models/components/loopedpositiontotals.d.ts +40 -0
  28. package/dist/commonjs/models/components/loopedpositiontotals.d.ts.map +1 -0
  29. package/dist/commonjs/models/components/loopedpositiontotals.js +67 -0
  30. package/dist/commonjs/models/components/loopedpositiontotals.js.map +1 -0
  31. package/dist/commonjs/models/components/swapinfo.d.ts +48 -0
  32. package/dist/commonjs/models/components/swapinfo.d.ts.map +1 -0
  33. package/dist/commonjs/models/components/swapinfo.js +66 -0
  34. package/dist/commonjs/models/components/swapinfo.js.map +1 -0
  35. package/dist/commonjs/models/operations/index.d.ts +1 -0
  36. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  37. package/dist/commonjs/models/operations/index.js +1 -0
  38. package/dist/commonjs/models/operations/index.js.map +1 -1
  39. package/dist/commonjs/models/operations/v2creditloopedpositions.d.ts +28 -0
  40. package/dist/commonjs/models/operations/v2creditloopedpositions.d.ts.map +1 -0
  41. package/dist/commonjs/models/operations/v2creditloopedpositions.js +59 -0
  42. package/dist/commonjs/models/operations/v2creditloopedpositions.js.map +1 -0
  43. package/dist/commonjs/sdk/credit.d.ts +14 -0
  44. package/dist/commonjs/sdk/credit.d.ts.map +1 -1
  45. package/dist/commonjs/sdk/credit.js +17 -0
  46. package/dist/commonjs/sdk/credit.js.map +1 -1
  47. package/dist/esm/funcs/creditCreditLoopedPositions.d.ts +26 -0
  48. package/dist/esm/funcs/creditCreditLoopedPositions.d.ts.map +1 -0
  49. package/dist/esm/funcs/creditCreditLoopedPositions.js +95 -0
  50. package/dist/esm/funcs/creditCreditLoopedPositions.js.map +1 -0
  51. package/dist/esm/models/components/creditloopedpositionsresponse.d.ts +26 -0
  52. package/dist/esm/models/components/creditloopedpositionsresponse.d.ts.map +1 -0
  53. package/dist/esm/models/components/creditloopedpositionsresponse.js +23 -0
  54. package/dist/esm/models/components/creditloopedpositionsresponse.js.map +1 -0
  55. package/dist/esm/models/components/index.d.ts +6 -0
  56. package/dist/esm/models/components/index.d.ts.map +1 -1
  57. package/dist/esm/models/components/index.js +6 -0
  58. package/dist/esm/models/components/index.js.map +1 -1
  59. package/dist/esm/models/components/loopedposition.d.ts +88 -0
  60. package/dist/esm/models/components/loopedposition.d.ts.map +1 -0
  61. package/dist/esm/models/components/loopedposition.js +48 -0
  62. package/dist/esm/models/components/loopedposition.js.map +1 -0
  63. package/dist/esm/models/components/loopedpositioncurrentstate.d.ts +58 -0
  64. package/dist/esm/models/components/loopedpositioncurrentstate.d.ts.map +1 -0
  65. package/dist/esm/models/components/loopedpositioncurrentstate.js +40 -0
  66. package/dist/esm/models/components/loopedpositioncurrentstate.js.map +1 -0
  67. package/dist/esm/models/components/loopedpositionhistoryentry.d.ts +71 -0
  68. package/dist/esm/models/components/loopedpositionhistoryentry.d.ts.map +1 -0
  69. package/dist/esm/models/components/loopedpositionhistoryentry.js +48 -0
  70. package/dist/esm/models/components/loopedpositionhistoryentry.js.map +1 -0
  71. package/dist/esm/models/components/loopedpositiontotals.d.ts +40 -0
  72. package/dist/esm/models/components/loopedpositiontotals.d.ts.map +1 -0
  73. package/dist/esm/models/components/loopedpositiontotals.js +30 -0
  74. package/dist/esm/models/components/loopedpositiontotals.js.map +1 -0
  75. package/dist/esm/models/components/swapinfo.d.ts +48 -0
  76. package/dist/esm/models/components/swapinfo.d.ts.map +1 -0
  77. package/dist/esm/models/components/swapinfo.js +29 -0
  78. package/dist/esm/models/components/swapinfo.js.map +1 -0
  79. package/dist/esm/models/operations/index.d.ts +1 -0
  80. package/dist/esm/models/operations/index.d.ts.map +1 -1
  81. package/dist/esm/models/operations/index.js +1 -0
  82. package/dist/esm/models/operations/index.js.map +1 -1
  83. package/dist/esm/models/operations/v2creditloopedpositions.d.ts +28 -0
  84. package/dist/esm/models/operations/v2creditloopedpositions.d.ts.map +1 -0
  85. package/dist/esm/models/operations/v2creditloopedpositions.js +22 -0
  86. package/dist/esm/models/operations/v2creditloopedpositions.js.map +1 -0
  87. package/dist/esm/sdk/credit.d.ts +14 -0
  88. package/dist/esm/sdk/credit.d.ts.map +1 -1
  89. package/dist/esm/sdk/credit.js +17 -0
  90. package/dist/esm/sdk/credit.js.map +1 -1
  91. package/docs/models/components/classification.md +17 -0
  92. package/docs/models/components/creditloopedpositionsresponse.md +30 -0
  93. package/docs/models/components/healthfactorscope.md +17 -0
  94. package/docs/models/components/loopedposition.md +46 -0
  95. package/docs/models/components/loopedpositioncurrentstate.md +28 -0
  96. package/docs/models/components/loopedpositionhistoryentry.md +33 -0
  97. package/docs/models/components/loopedpositionstatus.md +17 -0
  98. package/docs/models/components/loopedpositiontotals.md +31 -0
  99. package/docs/models/components/swapinfo.md +36 -0
  100. package/docs/models/operations/v2creditloopedpositionschain.md +15 -0
  101. package/docs/models/operations/v2creditloopedpositionsrequest.md +19 -0
  102. package/docs/sdks/credit/README.md +84 -0
  103. package/openapi_prepped_for_speakeasy.json +510 -0
  104. package/package.json +1 -1
  105. package/src/funcs/creditCreditLoopedPositions.ts +185 -0
  106. package/src/models/components/creditloopedpositionsresponse.ts +61 -0
  107. package/src/models/components/index.ts +6 -0
  108. package/src/models/components/loopedposition.ts +149 -0
  109. package/src/models/components/loopedpositioncurrentstate.ts +101 -0
  110. package/src/models/components/loopedpositionhistoryentry.ts +115 -0
  111. package/src/models/components/loopedpositiontotals.ts +78 -0
  112. package/src/models/components/swapinfo.ts +85 -0
  113. package/src/models/operations/index.ts +1 -0
  114. package/src/models/operations/v2creditloopedpositions.ts +56 -0
  115. package/src/sdk/credit.ts +25 -0
@@ -0,0 +1,30 @@
1
+ # CreditLoopedPositionsResponse
2
+
3
+ Looped positions across Aave V3 and Morpho Blue for a credit account.
4
+
5
+ ## Example Usage
6
+
7
+ ```typescript
8
+ import { CreditLoopedPositionsResponse } from "@compass-labs/api-sdk/models/components";
9
+
10
+ let value: CreditLoopedPositionsResponse = {
11
+ creditAccountAddress: "<value>",
12
+ positions: [],
13
+ aaveAccountSummary: {
14
+ healthFactor: "<value>",
15
+ totalCollateralUsd: "<value>",
16
+ totalDebtUsd: "<value>",
17
+ availableBorrowsUsd: "<value>",
18
+ ltv: "<value>",
19
+ emodeCategoryId: 0,
20
+ },
21
+ };
22
+ ```
23
+
24
+ ## Fields
25
+
26
+ | Field | Type | Required | Description | Example |
27
+ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
28
+ | `creditAccountAddress` | *string* | :heavy_check_mark: | The credit product account address derived from the owner. | |
29
+ | `positions` | [components.LoopedPosition](../../models/components/loopedposition.md)[] | :heavy_minus_sign: | All looped positions, on both Aave and Morpho. | [] |
30
+ | `aaveAccountSummary` | [components.AccountSummary](../../models/components/accountsummary.md) | :heavy_minus_sign: | Aave account-level summary (health factor, LTV, borrow capacity). Present when the account holds any open Aave looped position, since Aave collateral is pooled and health is account-level. Null for Morpho-only accounts. | |
@@ -0,0 +1,17 @@
1
+ # HealthFactorScope
2
+
3
+ 'market' for Morpho (isolated per-market health). 'account' for Aave: collateral is pooled, so all collateral backs all debt and this health factor is shared by every Aave position on the account — see aave_account_summary for the account-level figures.
4
+
5
+ ## Example Usage
6
+
7
+ ```typescript
8
+ import { HealthFactorScope } from "@compass-labs/api-sdk/models/components";
9
+
10
+ let value: HealthFactorScope = "market";
11
+ ```
12
+
13
+ ## Values
14
+
15
+ ```typescript
16
+ "market" | "account"
17
+ ```
@@ -0,0 +1,46 @@
1
+ # LoopedPosition
2
+
3
+ A single looped (leveraged) position with its full history.
4
+
5
+ ## Example Usage
6
+
7
+ ```typescript
8
+ import { LoopedPosition } from "@compass-labs/api-sdk/models/components";
9
+
10
+ let value: LoopedPosition = {
11
+ protocol: "AAVE",
12
+ collateralToken: "<value>",
13
+ collateralSymbol: "<value>",
14
+ debtToken: "<value>",
15
+ debtSymbol: "<value>",
16
+ status: "OPEN",
17
+ openedAt: new Date("2025-04-19T22:45:09.421Z"),
18
+ totals: {
19
+ totalCollateralAdded: "<value>",
20
+ totalCollateralRemoved: "<value>",
21
+ totalDebtAdded: "<value>",
22
+ totalDebtRemoved: "<value>",
23
+ loopTxCount: 622180,
24
+ unwindTxCount: 197847,
25
+ liquidationCount: 358955,
26
+ },
27
+ history: [],
28
+ };
29
+ ```
30
+
31
+ ## Fields
32
+
33
+ | Field | Type | Required | Description | Example |
34
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
35
+ | `protocol` | [components.CreditProtocol](../../models/components/creditprotocol.md) | :heavy_check_mark: | Which lending protocol a credit action targets.<br/><br/>``AAVE`` is the default so existing callers (which never send a ``protocol``<br/>field) keep hitting the unchanged Aave code path. ``EULER`` opts in to the<br/>Euler V2 path, where the market is identified by EVK vault address(es).<br/>``MORPHO`` identifies Morpho Blue lending markets (bytes32 market id) and is<br/>currently read-only: positions and market discovery only — transaction<br/>builders land with the looping work (COM-7106/7107/7108), so transact<br/>endpoints reject it with a 422. | |
36
+ | `marketId` | *string* | :heavy_minus_sign: | Morpho only: the bytes32 id of the isolated market. | |
37
+ | `collateralToken` | *string* | :heavy_check_mark: | Address of the collateral token. | |
38
+ | `collateralSymbol` | *string* | :heavy_check_mark: | Symbol of the collateral token. | |
39
+ | `debtToken` | *string* | :heavy_check_mark: | Address of the debt token. | |
40
+ | `debtSymbol` | *string* | :heavy_check_mark: | Symbol of the debt token. | |
41
+ | `status` | [components.LoopedPositionStatus](../../models/components/loopedpositionstatus.md) | :heavy_check_mark: | Whether the position is currently open or fully closed. | |
42
+ | `openedAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_check_mark: | Timestamp of the position's first transaction. | |
43
+ | `closedAt` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_minus_sign: | Timestamp the position was fully closed; null while open. | |
44
+ | `current` | [components.LoopedPositionCurrentState](../../models/components/loopedpositioncurrentstate.md) | :heavy_minus_sign: | Live on-chain state; null for CLOSED positions. | |
45
+ | `totals` | [components.LoopedPositionTotals](../../models/components/loopedpositiontotals.md) | :heavy_check_mark: | Lifetime totals across all of a looped position's transactions. | |
46
+ | `history` | [components.LoopedPositionHistoryEntry](../../models/components/loopedpositionhistoryentry.md)[] | :heavy_minus_sign: | All transactions for this position, chronological. | [] |
@@ -0,0 +1,28 @@
1
+ # LoopedPositionCurrentState
2
+
3
+ Live on-chain state of an OPEN looped position.
4
+
5
+ ## Example Usage
6
+
7
+ ```typescript
8
+ import { LoopedPositionCurrentState } from "@compass-labs/api-sdk/models/components";
9
+
10
+ let value: LoopedPositionCurrentState = {
11
+ collateralAmount: "<value>",
12
+ debtAmount: "<value>",
13
+ healthFactorScope: "account",
14
+ };
15
+ ```
16
+
17
+ ## Fields
18
+
19
+ | Field | Type | Required | Description |
20
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
21
+ | `collateralAmount` | *string* | :heavy_check_mark: | Current on-chain collateral amount for this position. |
22
+ | `debtAmount` | *string* | :heavy_check_mark: | Current on-chain debt amount for this position. |
23
+ | `collateralUsd` | *string* | :heavy_minus_sign: | Collateral value in USD (null if unpriced). |
24
+ | `debtUsd` | *string* | :heavy_minus_sign: | Debt value in USD (null if unpriced). |
25
+ | `netUsdValue` | *string* | :heavy_minus_sign: | Net position value in USD (collateral - debt); null if unpriced. |
26
+ | `leverage` | *string* | :heavy_minus_sign: | Leverage multiplier: collateral_usd / (collateral_usd - debt_usd). Null when unpriced or net value is non-positive. |
27
+ | `healthFactor` | *string* | :heavy_minus_sign: | Health factor. Above 1 is safe; below 1 risks liquidation. See health_factor_scope for what it covers. |
28
+ | `healthFactorScope` | [components.HealthFactorScope](../../models/components/healthfactorscope.md) | :heavy_check_mark: | 'market' for Morpho (isolated per-market health). 'account' for Aave: collateral is pooled, so all collateral backs all debt and this health factor is shared by every Aave position on the account — see aave_account_summary for the account-level figures. |
@@ -0,0 +1,33 @@
1
+ # LoopedPositionHistoryEntry
2
+
3
+ One transaction in a looped position's lifetime.
4
+
5
+ ## Example Usage
6
+
7
+ ```typescript
8
+ import { LoopedPositionHistoryEntry } from "@compass-labs/api-sdk/models/components";
9
+
10
+ let value: LoopedPositionHistoryEntry = {
11
+ transactionHash: "<value>",
12
+ blockNumber: 765879,
13
+ blockTimestamp: new Date("2026-02-06T05:55:08.384Z"),
14
+ classification: "liquidation",
15
+ collateralDelta: "<value>",
16
+ debtDelta: "<value>",
17
+ events: [],
18
+ };
19
+ ```
20
+
21
+ ## Fields
22
+
23
+ | Field | Type | Required | Description | Example |
24
+ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
25
+ | `transactionHash` | *string* | :heavy_check_mark: | Transaction hash. | |
26
+ | `blockNumber` | *number* | :heavy_check_mark: | Block number of the transaction. | |
27
+ | `blockTimestamp` | [Date](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date) | :heavy_check_mark: | Timestamp of the transaction. | |
28
+ | `classification` | [components.Classification](../../models/components/classification.md) | :heavy_check_mark: | What this transaction did to the position: loop_open / loop_increase (lever up with a swap), unwind (delever), single-sided supply/withdraw/borrow/repay, liquidation, or mixed. | |
29
+ | `iterations` | *number* | :heavy_minus_sign: | Loop transactions only: number of borrow legs in this transaction (one per loop iteration). Null for non-loop transactions. | |
30
+ | `collateralDelta` | *string* | :heavy_check_mark: | Signed change in collateral in this transaction (positive = added). | |
31
+ | `debtDelta` | *string* | :heavy_check_mark: | Signed change in debt in this transaction (positive = borrowed). | |
32
+ | `swap` | [components.SwapInfo](../../models/components/swapinfo.md) | :heavy_minus_sign: | The swap leg detected in this transaction, if any. | |
33
+ | `events` | [components.CreditEvent](../../models/components/creditevent.md)[] | :heavy_minus_sign: | The raw lending events that make up this transaction (Morpho supply_collateral maps to 'supply', withdraw_collateral to 'withdraw'). | [] |
@@ -0,0 +1,17 @@
1
+ # LoopedPositionStatus
2
+
3
+ Whether the position is currently open or fully closed.
4
+
5
+ ## Example Usage
6
+
7
+ ```typescript
8
+ import { LoopedPositionStatus } from "@compass-labs/api-sdk/models/components";
9
+
10
+ let value: LoopedPositionStatus = "CLOSED";
11
+ ```
12
+
13
+ ## Values
14
+
15
+ ```typescript
16
+ "OPEN" | "CLOSED"
17
+ ```
@@ -0,0 +1,31 @@
1
+ # LoopedPositionTotals
2
+
3
+ Lifetime totals across all of a looped position's transactions.
4
+
5
+ ## Example Usage
6
+
7
+ ```typescript
8
+ import { LoopedPositionTotals } from "@compass-labs/api-sdk/models/components";
9
+
10
+ let value: LoopedPositionTotals = {
11
+ totalCollateralAdded: "<value>",
12
+ totalCollateralRemoved: "<value>",
13
+ totalDebtAdded: "<value>",
14
+ totalDebtRemoved: "<value>",
15
+ loopTxCount: 994708,
16
+ unwindTxCount: 202920,
17
+ liquidationCount: 868925,
18
+ };
19
+ ```
20
+
21
+ ## Fields
22
+
23
+ | Field | Type | Required | Description |
24
+ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ | ------------------------------------------------------ |
25
+ | `totalCollateralAdded` | *string* | :heavy_check_mark: | Total collateral added over the position's lifetime. |
26
+ | `totalCollateralRemoved` | *string* | :heavy_check_mark: | Total collateral removed over the position's lifetime. |
27
+ | `totalDebtAdded` | *string* | :heavy_check_mark: | Total debt borrowed over the position's lifetime. |
28
+ | `totalDebtRemoved` | *string* | :heavy_check_mark: | Total debt repaid over the position's lifetime. |
29
+ | `loopTxCount` | *number* | :heavy_check_mark: | Number of loop_open + loop_increase transactions. |
30
+ | `unwindTxCount` | *number* | :heavy_check_mark: | Number of unwind transactions. |
31
+ | `liquidationCount` | *number* | :heavy_check_mark: | Number of liquidation events. |
@@ -0,0 +1,36 @@
1
+ # SwapInfo
2
+
3
+ The DEX swap leg detected inside a loop transaction.
4
+
5
+ Evidence is token-filtered and executor-proof: the sold (debt) token left the
6
+ account to a non-protocol counterparty and the bought (collateral) token
7
+ arrived from a non-protocol counterparty. 1inch fills often settle from an
8
+ executor contract, so the router is recorded only when it happens to be the
9
+ outbound counterparty — it is never required for detection.
10
+
11
+ ## Example Usage
12
+
13
+ ```typescript
14
+ import { SwapInfo } from "@compass-labs/api-sdk/models/components";
15
+
16
+ let value: SwapInfo = {
17
+ soldToken: "<value>",
18
+ soldSymbol: "<value>",
19
+ soldAmount: "<value>",
20
+ boughtToken: "<value>",
21
+ boughtSymbol: "<value>",
22
+ boughtAmount: "<value>",
23
+ };
24
+ ```
25
+
26
+ ## Fields
27
+
28
+ | Field | Type | Required | Description |
29
+ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
30
+ | `soldToken` | *string* | :heavy_check_mark: | Token sold in the swap (the borrowed/debt token). |
31
+ | `soldSymbol` | *string* | :heavy_check_mark: | Symbol of the sold token. |
32
+ | `soldAmount` | *string* | :heavy_check_mark: | Amount of the sold token. |
33
+ | `boughtToken` | *string* | :heavy_check_mark: | Token bought in the swap (the collateral token). |
34
+ | `boughtSymbol` | *string* | :heavy_check_mark: | Symbol of the bought token. |
35
+ | `boughtAmount` | *string* | :heavy_check_mark: | Amount of the bought token. |
36
+ | `router` | *string* | :heavy_minus_sign: | The outbound counterparty when it is the 1inch aggregation router. Null when the swap settled from an executor contract (informational only — never required to detect the swap). |
@@ -0,0 +1,15 @@
1
+ # V2CreditLoopedPositionsChain
2
+
3
+ ## Example Usage
4
+
5
+ ```typescript
6
+ import { V2CreditLoopedPositionsChain } from "@compass-labs/api-sdk/models/operations";
7
+
8
+ let value: V2CreditLoopedPositionsChain = "base";
9
+ ```
10
+
11
+ ## Values
12
+
13
+ ```typescript
14
+ "arbitrum" | "base" | "bsc" | "ethereum" | "tempo"
15
+ ```
@@ -0,0 +1,19 @@
1
+ # V2CreditLoopedPositionsRequest
2
+
3
+ ## Example Usage
4
+
5
+ ```typescript
6
+ import { V2CreditLoopedPositionsRequest } from "@compass-labs/api-sdk/models/operations";
7
+
8
+ let value: V2CreditLoopedPositionsRequest = {
9
+ chain: "base",
10
+ owner: "0x06A9aF046187895AcFc7258450B15397CAc67400",
11
+ };
12
+ ```
13
+
14
+ ## Fields
15
+
16
+ | Field | Type | Required | Description | Example |
17
+ | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
18
+ | `chain` | [operations.V2CreditLoopedPositionsChain](../../models/operations/v2creditloopedpositionschain.md) | :heavy_check_mark: | N/A | base |
19
+ | `owner` | *string* | :heavy_check_mark: | The address of the owner of the credit account to get looped positions for. | 0x06A9aF046187895AcFc7258450B15397CAc67400 |
@@ -6,6 +6,7 @@
6
6
 
7
7
  * [creditPositions](#creditpositions) - List credit positions
8
8
  * [creditBalances](#creditbalances) - Get credit account token balances
9
+ * [creditLoopedPositions](#creditloopedpositions) - List looped (leveraged) credit positions
9
10
  * [creditEulerMarkets](#crediteulermarkets) - List curated Euler markets
10
11
  * [creditMorphoMarkets](#creditmorphomarkets) - List curated Morpho markets
11
12
  * [creditCreateAccount](#creditcreateaccount) - Create credit account
@@ -173,6 +174,89 @@ run();
173
174
  | errors.HTTPValidationError | 422 | application/json |
174
175
  | errors.APIError | 4XX, 5XX | \*/\* |
175
176
 
177
+ ## creditLoopedPositions
178
+
179
+ List looped (leveraged) positions for a credit account owner.
180
+
181
+ Detects loops from the account's on-chain history: a transaction containing
182
+ lending + borrowing + swap legs is a loop transaction. Returns one position
183
+ per Morpho market / Aave collateral+debt reserve pair, each with its complete
184
+ per-transaction history, lifetime totals, and live on-chain state (health
185
+ factor, USD values, leverage) for open positions. Covers Aave V3 and Morpho
186
+ Blue.
187
+
188
+ ### Example Usage
189
+
190
+ <!-- UsageSnippet language="typescript" operationID="v2_credit_looped_positions" method="get" path="/v2/credit/looped_positions" -->
191
+ ```typescript
192
+ import { CompassApiSDK } from "@compass-labs/api-sdk";
193
+
194
+ const compassApiSDK = new CompassApiSDK({
195
+ apiKeyAuth: "<YOUR_API_KEY_HERE>",
196
+ });
197
+
198
+ async function run() {
199
+ const result = await compassApiSDK.credit.creditLoopedPositions({
200
+ chain: "base",
201
+ owner: "0x06A9aF046187895AcFc7258450B15397CAc67400",
202
+ });
203
+
204
+ console.log(result);
205
+ }
206
+
207
+ run();
208
+ ```
209
+
210
+ ### Standalone function
211
+
212
+ The standalone function version of this method:
213
+
214
+ ```typescript
215
+ import { CompassApiSDKCore } from "@compass-labs/api-sdk/core.js";
216
+ import { creditCreditLoopedPositions } from "@compass-labs/api-sdk/funcs/creditCreditLoopedPositions.js";
217
+
218
+ // Use `CompassApiSDKCore` for best tree-shaking performance.
219
+ // You can create one instance of it to use across an application.
220
+ const compassApiSDK = new CompassApiSDKCore({
221
+ apiKeyAuth: "<YOUR_API_KEY_HERE>",
222
+ });
223
+
224
+ async function run() {
225
+ const res = await creditCreditLoopedPositions(compassApiSDK, {
226
+ chain: "base",
227
+ owner: "0x06A9aF046187895AcFc7258450B15397CAc67400",
228
+ });
229
+ if (res.ok) {
230
+ const { value: result } = res;
231
+ console.log(result);
232
+ } else {
233
+ console.log("creditCreditLoopedPositions failed:", res.error);
234
+ }
235
+ }
236
+
237
+ run();
238
+ ```
239
+
240
+ ### Parameters
241
+
242
+ | Parameter | Type | Required | Description |
243
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
244
+ | `request` | [operations.V2CreditLoopedPositionsRequest](../../models/operations/v2creditloopedpositionsrequest.md) | :heavy_check_mark: | The request object to use for the request. |
245
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
246
+ | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
247
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
248
+
249
+ ### Response
250
+
251
+ **Promise\<[components.CreditLoopedPositionsResponse](../../models/components/creditloopedpositionsresponse.md)\>**
252
+
253
+ ### Errors
254
+
255
+ | Error Type | Status Code | Content Type |
256
+ | -------------------------- | -------------------------- | -------------------------- |
257
+ | errors.HTTPValidationError | 422 | application/json |
258
+ | errors.APIError | 4XX, 5XX | \*/\* |
259
+
176
260
  ## creditEulerMarkets
177
261
 
178
262
  List curated Euler V2 credit markets for a chain.