@compass-labs/api-sdk 2.2.114-rc.0 → 2.2.115

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 (78) hide show
  1. package/codeSamples_typescript.yaml +2 -2
  2. package/dist/commonjs/models/components/index.d.ts +1 -0
  3. package/dist/commonjs/models/components/index.d.ts.map +1 -1
  4. package/dist/commonjs/models/components/index.js +1 -0
  5. package/dist/commonjs/models/components/index.js.map +1 -1
  6. package/dist/commonjs/models/components/loopedposition.d.ts +5 -0
  7. package/dist/commonjs/models/components/loopedposition.d.ts.map +1 -1
  8. package/dist/commonjs/models/components/loopedposition.js +2 -0
  9. package/dist/commonjs/models/components/loopedposition.js.map +1 -1
  10. package/dist/commonjs/models/components/loopedpositionhistoryentry.d.ts +16 -1
  11. package/dist/commonjs/models/components/loopedpositionhistoryentry.d.ts.map +1 -1
  12. package/dist/commonjs/models/components/loopedpositionhistoryentry.js +12 -1
  13. package/dist/commonjs/models/components/loopedpositionhistoryentry.js.map +1 -1
  14. package/dist/commonjs/models/components/loopedpositionpnl.d.ts +36 -0
  15. package/dist/commonjs/models/components/loopedpositionpnl.d.ts.map +1 -0
  16. package/dist/commonjs/models/components/loopedpositionpnl.js +59 -0
  17. package/dist/commonjs/models/components/loopedpositionpnl.js.map +1 -0
  18. package/dist/commonjs/models/components/marketallocation.d.ts +5 -1
  19. package/dist/commonjs/models/components/marketallocation.d.ts.map +1 -1
  20. package/dist/commonjs/models/components/marketallocation.js +2 -0
  21. package/dist/commonjs/models/components/marketallocation.js.map +1 -1
  22. package/dist/commonjs/models/components/swapinfo.d.ts +8 -8
  23. package/dist/commonjs/models/operations/v2earnpendlemarkets.d.ts +5 -5
  24. package/dist/commonjs/models/operations/v2earnpendlemarkets.d.ts.map +1 -1
  25. package/dist/commonjs/models/operations/v2earnpendlemarkets.js +1 -1
  26. package/dist/commonjs/models/operations/v2earnpendlemarkets.js.map +1 -1
  27. package/dist/commonjs/models/operations/v2earnvaults.d.ts +5 -5
  28. package/dist/commonjs/models/operations/v2earnvaults.d.ts.map +1 -1
  29. package/dist/commonjs/models/operations/v2earnvaults.js +1 -1
  30. package/dist/commonjs/models/operations/v2earnvaults.js.map +1 -1
  31. package/dist/esm/models/components/index.d.ts +1 -0
  32. package/dist/esm/models/components/index.d.ts.map +1 -1
  33. package/dist/esm/models/components/index.js +1 -0
  34. package/dist/esm/models/components/index.js.map +1 -1
  35. package/dist/esm/models/components/loopedposition.d.ts +5 -0
  36. package/dist/esm/models/components/loopedposition.d.ts.map +1 -1
  37. package/dist/esm/models/components/loopedposition.js +2 -0
  38. package/dist/esm/models/components/loopedposition.js.map +1 -1
  39. package/dist/esm/models/components/loopedpositionhistoryentry.d.ts +16 -1
  40. package/dist/esm/models/components/loopedpositionhistoryentry.d.ts.map +1 -1
  41. package/dist/esm/models/components/loopedpositionhistoryentry.js +11 -0
  42. package/dist/esm/models/components/loopedpositionhistoryentry.js.map +1 -1
  43. package/dist/esm/models/components/loopedpositionpnl.d.ts +36 -0
  44. package/dist/esm/models/components/loopedpositionpnl.d.ts.map +1 -0
  45. package/dist/esm/models/components/loopedpositionpnl.js +22 -0
  46. package/dist/esm/models/components/loopedpositionpnl.js.map +1 -0
  47. package/dist/esm/models/components/marketallocation.d.ts +5 -1
  48. package/dist/esm/models/components/marketallocation.d.ts.map +1 -1
  49. package/dist/esm/models/components/marketallocation.js +2 -0
  50. package/dist/esm/models/components/marketallocation.js.map +1 -1
  51. package/dist/esm/models/components/swapinfo.d.ts +8 -8
  52. package/dist/esm/models/operations/v2earnpendlemarkets.d.ts +5 -5
  53. package/dist/esm/models/operations/v2earnpendlemarkets.d.ts.map +1 -1
  54. package/dist/esm/models/operations/v2earnpendlemarkets.js +1 -1
  55. package/dist/esm/models/operations/v2earnpendlemarkets.js.map +1 -1
  56. package/dist/esm/models/operations/v2earnvaults.d.ts +5 -5
  57. package/dist/esm/models/operations/v2earnvaults.d.ts.map +1 -1
  58. package/dist/esm/models/operations/v2earnvaults.js +1 -1
  59. package/dist/esm/models/operations/v2earnvaults.js.map +1 -1
  60. package/docs/models/components/flowbasis.md +15 -0
  61. package/docs/models/components/loopedposition.md +1 -0
  62. package/docs/models/components/loopedpositionhistoryentry.md +13 -11
  63. package/docs/models/components/loopedpositionpnl.md +27 -0
  64. package/docs/models/components/marketallocation.md +12 -11
  65. package/docs/models/components/swapinfo.md +8 -8
  66. package/docs/models/operations/v2earnpendlemarketsrequest.md +10 -10
  67. package/docs/models/operations/v2earnvaultsrequest.md +12 -12
  68. package/docs/sdks/earn/README.md +4 -4
  69. package/openapi_prepped_for_speakeasy.json +126 -27
  70. package/package.json +1 -1
  71. package/src/models/components/index.ts +1 -0
  72. package/src/models/components/loopedposition.ts +9 -0
  73. package/src/models/components/loopedpositionhistoryentry.ts +23 -1
  74. package/src/models/components/loopedpositionpnl.ts +66 -0
  75. package/src/models/components/marketallocation.ts +7 -1
  76. package/src/models/components/swapinfo.ts +8 -8
  77. package/src/models/operations/v2earnpendlemarkets.ts +6 -6
  78. package/src/models/operations/v2earnvaults.ts +6 -6
@@ -1 +1 @@
1
- {"version":3,"file":"v2earnvaults.js","sourceRoot":"","sources":["../../../../src/models/operations/v2earnvaults.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAE1D,OAAO,KAAK,UAAU,MAAM,wBAAwB,CAAC;AAErD;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,GAAG,EAAE,KAAK;IACV,IAAI,EAAE,MAAM;CACJ,CAAC;AA4DX,gBAAgB;AAChB,MAAM,CAAC,MAAM,oCAAoC,GAE7C,CAAC,CAAC,UAAU,CAAC,qBAAqB,CAAC,CAAC;AAKxC,gBAAgB;AAChB,MAAM,CAAC,MAAM,oCAAoC,GAI7C,CAAC,CAAC,KAAK,CAAC,C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O,IAAI,CAAC,SAAS,CACnB,kCAAkC,CAAC,KAAK,CAAC,mBAAmB,CAAC,CAC9D,CAAC;AACJ,CAAC"}
@@ -0,0 +1,15 @@
1
+ # FlowBasis
2
+
3
+ ## Example Usage
4
+
5
+ ```typescript
6
+ import { FlowBasis } from "@compass-labs/api-sdk/models/components";
7
+
8
+ let value: FlowBasis = "oracle";
9
+ ```
10
+
11
+ ## Values
12
+
13
+ ```typescript
14
+ "swap" | "oracle"
15
+ ```
@@ -46,4 +46,5 @@ let value: LoopedPosition = {
46
46
  | `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. | |
47
47
  | `current` | [components.LoopedPositionCurrentState](../../models/components/loopedpositioncurrentstate.md) | :heavy_minus_sign: | Live on-chain state; null for CLOSED positions. | |
48
48
  | `totals` | [components.LoopedPositionTotals](../../models/components/loopedpositiontotals.md) | :heavy_check_mark: | Lifetime totals across all of a looped position's transactions. | |
49
+ | `pnl` | [components.LoopedPositionPnl](../../models/components/loopedpositionpnl.md) | :heavy_minus_sign: | Profit or loss since the position opened, for OPEN and CLOSED positions alike. Null when it cannot be stated honestly: the position's recorded history is incomplete (it starts after the opening, or does not add up to what the position holds now), a transaction could not be priced, the position's current value could not be read or separated from another position's, or a transaction's legs cannot be told apart from another position's. | |
49
50
  | `history` | [components.LoopedPositionHistoryEntry](../../models/components/loopedpositionhistoryentry.md)[] | :heavy_minus_sign: | All transactions for this position, chronological. | [] |
@@ -20,14 +20,16 @@ let value: LoopedPositionHistoryEntry = {
20
20
 
21
21
  ## Fields
22
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'). | [] |
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 of a loop (debt sold for collateral) or an unwind (collateral sold for debt), when the transaction shows one. | |
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'). | [] |
34
+ | `equityFlowQuote` | *string* | :heavy_minus_sign: | Equity this transaction put into the position (positive) or took out of it (negative), in the debt token, valued when it landed. 0 for a liquidation, whose loss stays in the position's equity. Null when the transaction could not be valued. | |
35
+ | `flowBasis` | [components.FlowBasis](../../models/components/flowbasis.md) | :heavy_minus_sign: | How equity_flow_quote was measured. 'swap': from this transaction's own swap, so the swap's cost shows up in PnL. 'oracle': from the net amounts at the market price; on a loop or unwind that folds the swap's cost into the flow instead. Null for a liquidation and for a transaction that could not be valued. | |
@@ -0,0 +1,27 @@
1
+ # LoopedPositionPnl
2
+
3
+ What a looped position has made or lost since it opened.
4
+
5
+ Measured in the position's debt token (the quote), with USD alongside.
6
+ Every transaction is an equity flow valued when it landed: a loop's
7
+ principal goes in, an unwind's proceeds come out. PnL is what the position
8
+ is worth now plus everything taken out, minus everything put in; each
9
+ history entry carries its own flow in equity_flow_quote.
10
+
11
+ ## Example Usage
12
+
13
+ ```typescript
14
+ import { LoopedPositionPnl } from "@compass-labs/api-sdk/models/components";
15
+
16
+ let value: LoopedPositionPnl = {
17
+ totalPnlQuote: "<value>",
18
+ };
19
+ ```
20
+
21
+ ## Fields
22
+
23
+ | Field | Type | Required | Description |
24
+ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
25
+ | `totalPnlQuote` | *string* | :heavy_check_mark: | Profit or loss since the position opened, in the position's debt token: what the position is worth now, plus everything taken out, minus everything put in, each valued when it happened. It includes the entry and exit swap costs, the carry (what the collateral earned minus the interest paid) and the collateral's price move against the debt token. Realized once the position is closed, unrealized while it is open. Where a loop or unwind's own swap could not be used (its history entry has flow_basis 'oracle'), that swap's cost is not counted and the figure reads higher by roughly that amount.<br/><br/>Measured in the debt token, not USD: on a correlated loop (wstHYPE against WHYPE, wstETH against WETH) a positive figure here can still be a USD loss when the debt token itself falls. total_pnl_usd carries that. |
26
+ | `totalPnlPercent` | *string* | :heavy_minus_sign: | total_pnl_quote as a percentage of the equity put in (e.g. 4.2 = 4.2%): the return on the capital contributed, not annualized. |
27
+ | `totalPnlUsd` | *string* | :heavy_minus_sign: | Profit or loss since the position opened, in USD: each flow at the debt token's USD price when it happened, the position's current value at its price now. Unlike total_pnl_quote it includes the debt token's own USD move. Null when any of those prices is unavailable. |
@@ -17,14 +17,15 @@ let value: MarketAllocation = {
17
17
 
18
18
  ## Fields
19
19
 
20
- | Field | Type | Required | Description |
21
- | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------ |
22
- | `marketId` | *string* | :heavy_check_mark: | Morpho Blue market unique identifier (bytes32 hex string). |
23
- | `loanToken` | *string* | :heavy_check_mark: | Address of the token being lent in this market. |
24
- | `loanTokenSymbol` | *string* | :heavy_minus_sign: | Symbol of the loan token (e.g., 'USDC'). |
25
- | `collateralToken` | *string* | :heavy_check_mark: | Address of the collateral token accepted by this market. |
26
- | `collateralTokenSymbol` | *string* | :heavy_minus_sign: | Symbol of the collateral token (e.g., 'WETH'). |
27
- | `lltv` | *string* | :heavy_check_mark: | Liquidation Loan-To-Value ratio as a raw uint256 string. Divide by 1e18 to get the decimal ratio (e.g., '860000000000000000' = 86%). |
28
- | `supplyCap` | *string* | :heavy_minus_sign: | Maximum amount the vault is allowed to supply to this market, as a raw uint184 string in the smallest token unit. |
29
- | `supplyAssets` | *string* | :heavy_minus_sign: | Amount currently supplied by the vault to this market, in the smallest token unit (converted from shares). |
30
- | `allocationPct` | *number* | :heavy_minus_sign: | Percentage of the vault's total supplied capital allocated to this market (e.g., 45.5 means 45.5%). |
20
+ | Field | Type | Required | Description |
21
+ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
22
+ | `marketId` | *string* | :heavy_check_mark: | Morpho Blue market unique identifier (bytes32 hex string). |
23
+ | `loanToken` | *string* | :heavy_check_mark: | Address of the token being lent in this market. |
24
+ | `loanTokenSymbol` | *string* | :heavy_minus_sign: | Symbol of the loan token (e.g., 'USDC'). |
25
+ | `collateralToken` | *string* | :heavy_check_mark: | Address of the collateral token accepted by this market. |
26
+ | `collateralTokenSymbol` | *string* | :heavy_minus_sign: | Symbol of the collateral token (e.g., 'WETH'). |
27
+ | `lltv` | *string* | :heavy_check_mark: | Liquidation Loan-To-Value ratio as a raw uint256 string scaled by 1e18 (e.g., '860000000000000000' = 86%). Kept for backward compatibility; prefer `lltv_percent`. |
28
+ | `lltvPercent` | *string* | :heavy_minus_sign: | Liquidation Loan-To-Value in percent (e.g. 86 means a position is liquidatable once debt exceeds 86% of collateral value). Same scale as `lltv` on /v2/credit/morpho_markets. |
29
+ | `supplyCap` | *string* | :heavy_minus_sign: | Maximum amount the vault is allowed to supply to this market, as a raw uint184 string in the smallest token unit. |
30
+ | `supplyAssets` | *string* | :heavy_minus_sign: | Amount currently supplied by the vault to this market, in the smallest token unit (converted from shares). |
31
+ | `allocationPct` | *number* | :heavy_minus_sign: | Percentage of the vault's total supplied capital allocated to this market (e.g., 45.5 means 45.5%). |
@@ -1,12 +1,12 @@
1
1
  # SwapInfo
2
2
 
3
- The DEX swap leg detected inside a loop transaction.
3
+ The swap leg detected inside a loop or unwind transaction.
4
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. Aggregator 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.
5
+ Evidence is token-filtered and executor-proof: the sold token left the
6
+ account to a non-protocol counterparty and the bought token arrived from a
7
+ non-protocol counterparty. Aggregator fills often settle from an executor
8
+ contract, so the router is recorded only when it happens to be the outbound
9
+ counterparty — it is never required for detection.
10
10
 
11
11
  ## Example Usage
12
12
 
@@ -27,10 +27,10 @@ let value: SwapInfo = {
27
27
 
28
28
  | Field | Type | Required | Description |
29
29
  | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
30
- | `soldToken` | *string* | :heavy_check_mark: | Token sold in the swap (the borrowed/debt token). |
30
+ | `soldToken` | *string* | :heavy_check_mark: | The token leaving the account: the debt token on a loop, the collateral token on an unwind. |
31
31
  | `soldSymbol` | *string* | :heavy_check_mark: | Symbol of the sold token. |
32
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). |
33
+ | `boughtToken` | *string* | :heavy_check_mark: | The token arriving in the account: the collateral token on a loop, the debt token on an unwind. |
34
34
  | `boughtSymbol` | *string* | :heavy_check_mark: | Symbol of the bought token. |
35
35
  | `boughtAmount` | *string* | :heavy_check_mark: | Amount of the bought token. |
36
36
  | `router` | *string* | :heavy_minus_sign: | 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). |
@@ -6,21 +6,21 @@
6
6
  import { V2EarnPendleMarketsRequest } from "@compass-labs/api-sdk/models/operations";
7
7
 
8
8
  let value: V2EarnPendleMarketsRequest = {
9
- orderBy: "tvl_usd",
10
9
  direction: "desc",
11
10
  offset: 0,
12
11
  limit: 50,
12
+ orderBy: "tvl_usd",
13
13
  };
14
14
  ```
15
15
 
16
16
  ## Fields
17
17
 
18
- | Field | Type | Required | Description | Example |
19
- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
20
- | `orderBy` | *string* | :heavy_check_mark: | The field to order the results by. | tvl_usd |
21
- | `direction` | [operations.V2EarnPendleMarketsDirection](../../models/operations/v2earnpendlemarketsdirection.md) | :heavy_minus_sign: | The direction to order the results by. | desc |
22
- | `offset` | *number* | :heavy_minus_sign: | The offset of the first item to return. | 0 |
23
- | `limit` | *number* | :heavy_minus_sign: | The number of items to return. | 50 |
24
- | `chain` | [components.Chain](../../models/components/chain.md) | :heavy_minus_sign: | Optional chain filter. If not provided, returns markets for all chains. | |
25
- | `underlyingSymbol` | *string* | :heavy_minus_sign: | Filter markets by underlying asset symbol (e.g., 'USDC', 'WETH'). | |
26
- | `minTvlUsd` | *operations.V2EarnPendleMarketsMinTvlUsd* | :heavy_minus_sign: | Minimum TVL in USD. Markets with TVL below this value will be excluded. | |
18
+ | Field | Type | Required | Description | Example |
19
+ | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- |
20
+ | `direction` | [operations.V2EarnPendleMarketsDirection](../../models/operations/v2earnpendlemarketsdirection.md) | :heavy_minus_sign: | The direction to order the results by. | desc |
21
+ | `offset` | *number* | :heavy_minus_sign: | The offset of the first item to return. | 0 |
22
+ | `limit` | *number* | :heavy_minus_sign: | The number of items to return. | 50 |
23
+ | `chain` | [components.Chain](../../models/components/chain.md) | :heavy_minus_sign: | Optional chain filter. If not provided, returns markets for all chains. | |
24
+ | `orderBy` | *string* | :heavy_minus_sign: | Field to order the markets by. One of: tvl_usd, implied_apy. Defaults to tvl_usd; unknown values also fall back to tvl_usd. | tvl_usd |
25
+ | `underlyingSymbol` | *string* | :heavy_minus_sign: | Filter markets by underlying asset symbol (e.g., 'USDC', 'WETH'). | |
26
+ | `minTvlUsd` | *operations.V2EarnPendleMarketsMinTvlUsd* | :heavy_minus_sign: | Minimum TVL in USD. Markets with TVL below this value will be excluded. | |
@@ -6,23 +6,23 @@
6
6
  import { V2EarnVaultsRequest } from "@compass-labs/api-sdk/models/operations";
7
7
 
8
8
  let value: V2EarnVaultsRequest = {
9
- orderBy: "tvl_usd",
10
9
  direction: "desc",
11
10
  offset: 0,
12
11
  limit: 50,
12
+ orderBy: "tvl_usd",
13
13
  };
14
14
  ```
15
15
 
16
16
  ## Fields
17
17
 
18
- | Field | Type | Required | Description | Example |
19
- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
20
- | `orderBy` | *string* | :heavy_check_mark: | The field to order the results by. | tvl_usd |
21
- | `direction` | [operations.V2EarnVaultsDirection](../../models/operations/v2earnvaultsdirection.md) | :heavy_minus_sign: | The direction to order the results by. | desc |
22
- | `offset` | *number* | :heavy_minus_sign: | The offset of the first item to return. | 0 |
23
- | `limit` | *number* | :heavy_minus_sign: | The number of items to return. | 50 |
24
- | `chain` | [components.Chain](../../models/components/chain.md) | :heavy_minus_sign: | Optional chain filter. If not provided, returns vaults for all chains. | |
25
- | `assetSymbol` | *string* | :heavy_minus_sign: | Filter vaults by underlying asset symbol (e.g., 'USDC', 'WETH'). | |
26
- | `minTvlUsd` | *operations.V2EarnVaultsMinTvlUsd* | :heavy_minus_sign: | Minimum TVL in USD. Vaults with TVL below this value will be excluded. | |
27
- | `minLiquidityUsd` | *operations.MinLiquidityUsd* | :heavy_minus_sign: | Minimum available liquidity in USD. Vaults below this are excluded. | |
28
- | `minDepositCapUsd` | *operations.MinDepositCapUsd* | :heavy_minus_sign: | Minimum deposit capacity in USD. Vaults below this are excluded. Set to 0 to exclude paused vaults. | |
18
+ | Field | Type | Required | Description | Example |
19
+ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
20
+ | `direction` | [operations.V2EarnVaultsDirection](../../models/operations/v2earnvaultsdirection.md) | :heavy_minus_sign: | The direction to order the results by. | desc |
21
+ | `offset` | *number* | :heavy_minus_sign: | The offset of the first item to return. | 0 |
22
+ | `limit` | *number* | :heavy_minus_sign: | The number of items to return. | 50 |
23
+ | `chain` | [components.Chain](../../models/components/chain.md) | :heavy_minus_sign: | Optional chain filter. If not provided, returns vaults for all chains. | |
24
+ | `orderBy` | *string* | :heavy_minus_sign: | Field to order the vaults by. One of: tvl_usd, liquidity_usd, deposit_cap_usd, apy_7d, apy_30d, apy_90d. Defaults to tvl_usd; unknown values also fall back to tvl_usd. | tvl_usd |
25
+ | `assetSymbol` | *string* | :heavy_minus_sign: | Filter vaults by underlying asset symbol (e.g., 'USDC', 'WETH'). | |
26
+ | `minTvlUsd` | *operations.V2EarnVaultsMinTvlUsd* | :heavy_minus_sign: | Minimum TVL in USD. Vaults with TVL below this value will be excluded. | |
27
+ | `minLiquidityUsd` | *operations.MinLiquidityUsd* | :heavy_minus_sign: | Minimum available liquidity in USD. Vaults below this are excluded. | |
28
+ | `minDepositCapUsd` | *operations.MinDepositCapUsd* | :heavy_minus_sign: | Minimum deposit capacity in USD. Vaults below this are excluded. Set to 0 to exclude paused vaults. | |
@@ -203,10 +203,10 @@ const compassApiSDK = new CompassApiSDK({
203
203
 
204
204
  async function run() {
205
205
  const result = await compassApiSDK.earn.earnVaults({
206
- orderBy: "tvl_usd",
207
206
  direction: "desc",
208
207
  offset: 0,
209
208
  limit: 50,
209
+ orderBy: "tvl_usd",
210
210
  });
211
211
 
212
212
  console.log(result);
@@ -231,10 +231,10 @@ const compassApiSDK = new CompassApiSDKCore({
231
231
 
232
232
  async function run() {
233
233
  const res = await earnEarnVaults(compassApiSDK, {
234
- orderBy: "tvl_usd",
235
234
  direction: "desc",
236
235
  offset: 0,
237
236
  limit: 50,
237
+ orderBy: "tvl_usd",
238
238
  });
239
239
  if (res.ok) {
240
240
  const { value: result } = res;
@@ -372,10 +372,10 @@ const compassApiSDK = new CompassApiSDK({
372
372
 
373
373
  async function run() {
374
374
  const result = await compassApiSDK.earn.earnPendleMarkets({
375
- orderBy: "tvl_usd",
376
375
  direction: "desc",
377
376
  offset: 0,
378
377
  limit: 50,
378
+ orderBy: "tvl_usd",
379
379
  });
380
380
 
381
381
  console.log(result);
@@ -400,10 +400,10 @@ const compassApiSDK = new CompassApiSDKCore({
400
400
 
401
401
  async function run() {
402
402
  const res = await earnEarnPendleMarkets(compassApiSDK, {
403
- orderBy: "tvl_usd",
404
403
  direction: "desc",
405
404
  offset: 0,
406
405
  limit: 50,
406
+ orderBy: "tvl_usd",
407
407
  });
408
408
  if (res.ok) {
409
409
  const { value: result } = res;