@compass-labs/api-sdk 2.1.26-rc.0 → 2.1.26-rc.10

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 (125) hide show
  1. package/codeSamples_typescript.yaml +1 -1
  2. package/dist/commonjs/funcs/earnEarnManage.d.ts +4 -1
  3. package/dist/commonjs/funcs/earnEarnManage.d.ts.map +1 -1
  4. package/dist/commonjs/funcs/earnEarnManage.js +4 -1
  5. package/dist/commonjs/funcs/earnEarnManage.js.map +1 -1
  6. package/dist/commonjs/funcs/earnEarnPositions.d.ts +1 -1
  7. package/dist/commonjs/funcs/earnEarnPositions.js +1 -2
  8. package/dist/commonjs/funcs/earnEarnPositions.js.map +1 -1
  9. package/dist/commonjs/lib/config.d.ts +2 -2
  10. package/dist/commonjs/lib/config.js +2 -2
  11. package/dist/commonjs/lib/config.js.map +1 -1
  12. package/dist/commonjs/models/components/aaveposition.d.ts +5 -4
  13. package/dist/commonjs/models/components/aaveposition.d.ts.map +1 -1
  14. package/dist/commonjs/models/components/aaveposition.js +2 -1
  15. package/dist/commonjs/models/components/aaveposition.js.map +1 -1
  16. package/dist/commonjs/models/components/compassapibackendv2modelsearnreadresponsepositionsvaultposition.d.ts +5 -4
  17. package/dist/commonjs/models/components/compassapibackendv2modelsearnreadresponsepositionsvaultposition.d.ts.map +1 -1
  18. package/dist/commonjs/models/components/compassapibackendv2modelsearnreadresponsepositionsvaultposition.js +2 -1
  19. package/dist/commonjs/models/components/compassapibackendv2modelsearnreadresponsepositionsvaultposition.js.map +1 -1
  20. package/dist/commonjs/models/components/depositevent.d.ts +32 -0
  21. package/dist/commonjs/models/components/depositevent.d.ts.map +1 -0
  22. package/dist/commonjs/models/components/depositevent.js +63 -0
  23. package/dist/commonjs/models/components/depositevent.js.map +1 -0
  24. package/dist/commonjs/models/components/fee.d.ts +6 -5
  25. package/dist/commonjs/models/components/fee.d.ts.map +1 -1
  26. package/dist/commonjs/models/components/fee.js +2 -1
  27. package/dist/commonjs/models/components/fee.js.map +1 -1
  28. package/dist/commonjs/models/components/index.d.ts +3 -0
  29. package/dist/commonjs/models/components/index.d.ts.map +1 -1
  30. package/dist/commonjs/models/components/index.js +3 -0
  31. package/dist/commonjs/models/components/index.js.map +1 -1
  32. package/dist/commonjs/models/components/positionpnl.d.ts +50 -0
  33. package/dist/commonjs/models/components/positionpnl.d.ts.map +1 -0
  34. package/dist/commonjs/models/components/positionpnl.js +71 -0
  35. package/dist/commonjs/models/components/positionpnl.js.map +1 -0
  36. package/dist/commonjs/models/components/withdrawalevent.d.ts +40 -0
  37. package/dist/commonjs/models/components/withdrawalevent.d.ts.map +1 -0
  38. package/dist/commonjs/models/components/withdrawalevent.js +67 -0
  39. package/dist/commonjs/models/components/withdrawalevent.js.map +1 -0
  40. package/dist/commonjs/models/operations/v2earnpositions.d.ts +0 -5
  41. package/dist/commonjs/models/operations/v2earnpositions.d.ts.map +1 -1
  42. package/dist/commonjs/models/operations/v2earnpositions.js +0 -1
  43. package/dist/commonjs/models/operations/v2earnpositions.js.map +1 -1
  44. package/dist/commonjs/sdk/earn.d.ts +5 -2
  45. package/dist/commonjs/sdk/earn.d.ts.map +1 -1
  46. package/dist/commonjs/sdk/earn.js +5 -2
  47. package/dist/commonjs/sdk/earn.js.map +1 -1
  48. package/dist/esm/funcs/earnEarnManage.d.ts +4 -1
  49. package/dist/esm/funcs/earnEarnManage.d.ts.map +1 -1
  50. package/dist/esm/funcs/earnEarnManage.js +4 -1
  51. package/dist/esm/funcs/earnEarnManage.js.map +1 -1
  52. package/dist/esm/funcs/earnEarnPositions.d.ts +1 -1
  53. package/dist/esm/funcs/earnEarnPositions.js +1 -2
  54. package/dist/esm/funcs/earnEarnPositions.js.map +1 -1
  55. package/dist/esm/lib/config.d.ts +2 -2
  56. package/dist/esm/lib/config.js +2 -2
  57. package/dist/esm/lib/config.js.map +1 -1
  58. package/dist/esm/models/components/aaveposition.d.ts +5 -4
  59. package/dist/esm/models/components/aaveposition.d.ts.map +1 -1
  60. package/dist/esm/models/components/aaveposition.js +2 -1
  61. package/dist/esm/models/components/aaveposition.js.map +1 -1
  62. package/dist/esm/models/components/compassapibackendv2modelsearnreadresponsepositionsvaultposition.d.ts +5 -4
  63. package/dist/esm/models/components/compassapibackendv2modelsearnreadresponsepositionsvaultposition.d.ts.map +1 -1
  64. package/dist/esm/models/components/compassapibackendv2modelsearnreadresponsepositionsvaultposition.js +2 -1
  65. package/dist/esm/models/components/compassapibackendv2modelsearnreadresponsepositionsvaultposition.js.map +1 -1
  66. package/dist/esm/models/components/depositevent.d.ts +32 -0
  67. package/dist/esm/models/components/depositevent.d.ts.map +1 -0
  68. package/dist/esm/models/components/depositevent.js +26 -0
  69. package/dist/esm/models/components/depositevent.js.map +1 -0
  70. package/dist/esm/models/components/fee.d.ts +6 -5
  71. package/dist/esm/models/components/fee.d.ts.map +1 -1
  72. package/dist/esm/models/components/fee.js +2 -1
  73. package/dist/esm/models/components/fee.js.map +1 -1
  74. package/dist/esm/models/components/index.d.ts +3 -0
  75. package/dist/esm/models/components/index.d.ts.map +1 -1
  76. package/dist/esm/models/components/index.js +3 -0
  77. package/dist/esm/models/components/index.js.map +1 -1
  78. package/dist/esm/models/components/positionpnl.d.ts +50 -0
  79. package/dist/esm/models/components/positionpnl.d.ts.map +1 -0
  80. package/dist/esm/models/components/positionpnl.js +34 -0
  81. package/dist/esm/models/components/positionpnl.js.map +1 -0
  82. package/dist/esm/models/components/withdrawalevent.d.ts +40 -0
  83. package/dist/esm/models/components/withdrawalevent.d.ts.map +1 -0
  84. package/dist/esm/models/components/withdrawalevent.js +30 -0
  85. package/dist/esm/models/components/withdrawalevent.js.map +1 -0
  86. package/dist/esm/models/operations/v2earnpositions.d.ts +0 -5
  87. package/dist/esm/models/operations/v2earnpositions.d.ts.map +1 -1
  88. package/dist/esm/models/operations/v2earnpositions.js +0 -1
  89. package/dist/esm/models/operations/v2earnpositions.js.map +1 -1
  90. package/dist/esm/sdk/earn.d.ts +5 -2
  91. package/dist/esm/sdk/earn.d.ts.map +1 -1
  92. package/dist/esm/sdk/earn.js +5 -2
  93. package/dist/esm/sdk/earn.js.map +1 -1
  94. package/docs/models/components/aaveliquiditychangeresponse.md +2 -2
  95. package/docs/models/components/aaveposition.md +8 -9
  96. package/docs/models/components/compassapibackendv2modelsearnreadresponsepositionsvaultposition.md +8 -9
  97. package/docs/models/components/cooldownend.md +1 -1
  98. package/docs/models/components/cooldownposition.md +1 -1
  99. package/docs/models/components/denomination.md +2 -2
  100. package/docs/models/components/depositevent.md +27 -0
  101. package/docs/models/components/fee.md +5 -5
  102. package/docs/models/components/feeamount.md +1 -1
  103. package/docs/models/components/pendlegetmarketresponse.md +1 -1
  104. package/docs/models/components/pendlelistmarketsresponse.md +2 -2
  105. package/docs/models/components/pendlelistuserpositionsresponse.md +1 -1
  106. package/docs/models/components/pendlemarket.md +2 -2
  107. package/docs/models/components/position.md +1 -1
  108. package/docs/models/components/positionpnl.md +33 -0
  109. package/docs/models/components/userposition.md +0 -2
  110. package/docs/models/components/withdrawalevent.md +31 -0
  111. package/docs/models/operations/v2earnpositionsrequest.md +1 -3
  112. package/docs/sdks/earn/README.md +5 -4
  113. package/package.json +1 -1
  114. package/src/funcs/earnEarnManage.ts +4 -1
  115. package/src/funcs/earnEarnPositions.ts +1 -2
  116. package/src/lib/config.ts +2 -2
  117. package/src/models/components/aaveposition.ts +6 -5
  118. package/src/models/components/compassapibackendv2modelsearnreadresponsepositionsvaultposition.ts +6 -5
  119. package/src/models/components/depositevent.ts +66 -0
  120. package/src/models/components/fee.ts +6 -5
  121. package/src/models/components/index.ts +3 -0
  122. package/src/models/components/positionpnl.ts +93 -0
  123. package/src/models/components/withdrawalevent.ts +78 -0
  124. package/src/models/operations/v2earnpositions.ts +0 -6
  125. package/src/sdk/earn.ts +5 -2
@@ -1,6 +1,6 @@
1
1
  # Denomination
2
2
 
3
- The unit type for the fee amount. Use 'PERCENTAGE' for a percentage-based fee (e.g., 1.5 means 1.5% of the transaction amount) or 'FIXED' for a fixed token amount (e.g., 0.1 means 0.1 tokens).
3
+ The unit type for the fee amount. Use 'PERCENTAGE' for a percentage-based fee (e.g., 1.5 means 1.5% of the transaction amount), 'FIXED' for a fixed token amount (e.g., 0.1 means 0.1 tokens), or 'PERFORMANCE' for a fee based on realized profit using FIFO cost basis (e.g., 10 means 10% of profit).
4
4
 
5
5
  ## Example Usage
6
6
 
@@ -13,5 +13,5 @@ let value: Denomination = "PERCENTAGE";
13
13
  ## Values
14
14
 
15
15
  ```typescript
16
- "PERCENTAGE" | "FIXED"
16
+ "PERCENTAGE" | "FIXED" | "PERFORMANCE"
17
17
  ```
@@ -0,0 +1,27 @@
1
+ # DepositEvent
2
+
3
+ Historical deposit event for position transparency.
4
+
5
+ ## Example Usage
6
+
7
+ ```typescript
8
+ import { DepositEvent } from "@compass-labs/api-sdk/models/components";
9
+
10
+ let value: DepositEvent = {
11
+ blockNumber: 328246,
12
+ transactionHash: "<value>",
13
+ assetsDeposited: "<value>",
14
+ unitsReceived: "<value>",
15
+ costPerUnit: "<value>",
16
+ };
17
+ ```
18
+
19
+ ## Fields
20
+
21
+ | Field | Type | Required | Description |
22
+ | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- |
23
+ | `blockNumber` | *number* | :heavy_check_mark: | Block number when deposit occurred |
24
+ | `transactionHash` | *string* | :heavy_check_mark: | Transaction hash of the deposit |
25
+ | `assetsDeposited` | *string* | :heavy_check_mark: | Amount of underlying asset deposited |
26
+ | `unitsReceived` | *string* | :heavy_check_mark: | Shares (vault) or aTokens (Aave) received |
27
+ | `costPerUnit` | *string* | :heavy_check_mark: | Cost basis per unit at time of deposit |
@@ -14,8 +14,8 @@ let value: Fee = {
14
14
 
15
15
  ## Fields
16
16
 
17
- | Field | Type | Required | Description | Example |
18
- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
19
- | `recipient` | *string* | :heavy_check_mark: | The wallet address that will receive the fee. | |
20
- | `amount` | *components.FeeAmount* | :heavy_check_mark: | The fee amount. If `denomination` is 'PERCENTAGE', this is a percentage of the transaction amount (e.g., 1.5 for 1.5%). If `denomination` is 'FIXED', this is a fixed amount in token units (e.g., 0.1 for 0.1 tokens). | |
21
- | `denomination` | [components.Denomination](../../models/components/denomination.md) | :heavy_minus_sign: | The unit type for the fee amount. Use 'PERCENTAGE' for a percentage-based fee (e.g., 1.5 means 1.5% of the transaction amount) or 'FIXED' for a fixed token amount (e.g., 0.1 means 0.1 tokens). | PERCENTAGE |
17
+ | Field | Type | Required | Description | Example |
18
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
19
+ | `recipient` | *string* | :heavy_check_mark: | The wallet address that will receive the fee. | |
20
+ | `amount` | *components.FeeAmount* | :heavy_check_mark: | The fee amount. If `denomination` is 'PERCENTAGE', this is a percentage of the transaction amount (e.g., 1.5 for 1.5%). If `denomination` is 'FIXED', this is a fixed amount in token units (e.g., 0.1 for 0.1 tokens). If `denomination` is 'PERFORMANCE', this is a percentage of realized profit calculated using FIFO cost basis (e.g., 10 for 10% of profit). | |
21
+ | `denomination` | [components.Denomination](../../models/components/denomination.md) | :heavy_minus_sign: | The unit type for the fee amount. Use 'PERCENTAGE' for a percentage-based fee (e.g., 1.5 means 1.5% of the transaction amount), 'FIXED' for a fixed token amount (e.g., 0.1 means 0.1 tokens), or 'PERFORMANCE' for a fee based on realized profit using FIFO cost basis (e.g., 10 means 10% of profit). | PERCENTAGE |
@@ -1,6 +1,6 @@
1
1
  # FeeAmount
2
2
 
3
- The fee amount. If `denomination` is 'PERCENTAGE', this is a percentage of the transaction amount (e.g., 1.5 for 1.5%). If `denomination` is 'FIXED', this is a fixed amount in token units (e.g., 0.1 for 0.1 tokens).
3
+ The fee amount. If `denomination` is 'PERCENTAGE', this is a percentage of the transaction amount (e.g., 1.5 for 1.5%). If `denomination` is 'FIXED', this is a fixed amount in token units (e.g., 0.1 for 0.1 tokens). If `denomination` is 'PERFORMANCE', this is a percentage of realized profit calculated using FIFO cost basis (e.g., 10 for 10% of profit).
4
4
 
5
5
 
6
6
  ## Supported Types
@@ -8,7 +8,7 @@ import { PendleGetMarketResponse } from "@compass-labs/api-sdk/models/components
8
8
  let value: PendleGetMarketResponse = {
9
9
  marketAddress: "<value>",
10
10
  impliedApy: "<value>",
11
- maturityDate: new Date("2023-10-18T22:09:52.103Z"),
11
+ maturityDate: new Date("2024-10-17T22:09:52.103Z"),
12
12
  tokens: {
13
13
  underlyingToken: {
14
14
  address: "46793 Schneider Mount",
@@ -10,7 +10,7 @@ let value: PendleListMarketsResponse = {
10
10
  {
11
11
  name: "<value>",
12
12
  address: "9178 Rebeca Burgs",
13
- expiry: new Date("2025-11-13T22:39:31.641Z"),
13
+ expiry: new Date("2026-11-13T22:39:31.641Z"),
14
14
  pt: "<value>",
15
15
  yt: "<value>",
16
16
  sy: "<value>",
@@ -29,7 +29,7 @@ let value: PendleListMarketsResponse = {
29
29
  },
30
30
  isNew: true,
31
31
  isPrime: false,
32
- timestamp: new Date("2024-03-28T12:44:40.088Z"),
32
+ timestamp: new Date("2025-03-28T12:44:40.088Z"),
33
33
  },
34
34
  ],
35
35
  };
@@ -54,7 +54,7 @@ let value: PendleListUserPositionsResponse = {
54
54
  balance: "<value>",
55
55
  },
56
56
  ],
57
- updatedAt: new Date("2024-03-19T22:46:00.938Z"),
57
+ updatedAt: new Date("2025-03-19T22:46:00.938Z"),
58
58
  },
59
59
  ],
60
60
  };
@@ -8,7 +8,7 @@ import { PendleMarket } from "@compass-labs/api-sdk/models/components";
8
8
  let value: PendleMarket = {
9
9
  name: "<value>",
10
10
  address: "22458 Abshire Plains",
11
- expiry: new Date("2023-04-18T01:20:41.264Z"),
11
+ expiry: new Date("2024-04-17T01:20:41.264Z"),
12
12
  pt: "<value>",
13
13
  yt: "<value>",
14
14
  sy: "<value>",
@@ -27,7 +27,7 @@ let value: PendleMarket = {
27
27
  },
28
28
  isNew: true,
29
29
  isPrime: false,
30
- timestamp: new Date("2025-09-13T17:20:16.991Z"),
30
+ timestamp: new Date("2026-09-13T17:20:16.991Z"),
31
31
  };
32
32
  ```
33
33
 
@@ -52,7 +52,7 @@ let value: Position = {
52
52
  balance: "<value>",
53
53
  },
54
54
  ],
55
- updatedAt: new Date("2024-12-17T04:58:12.701Z"),
55
+ updatedAt: new Date("2025-12-17T04:58:12.701Z"),
56
56
  };
57
57
  ```
58
58
 
@@ -0,0 +1,33 @@
1
+ # PositionPnL
2
+
3
+ PnL breakdown for a position.
4
+
5
+ ## Example Usage
6
+
7
+ ```typescript
8
+ import { PositionPnL } from "@compass-labs/api-sdk/models/components";
9
+
10
+ let value: PositionPnL = {
11
+ totalDeposited: "<value>",
12
+ totalWithdrawn: "<value>",
13
+ costBasis: "<value>",
14
+ unrealizedPnl: "<value>",
15
+ realizedPnl: "<value>",
16
+ totalYield: "<value>",
17
+ totalFeesPaid: "<id>",
18
+ };
19
+ ```
20
+
21
+ ## Fields
22
+
23
+ | Field | Type | Required | Description |
24
+ | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- | -------------------------------------------------------------------------- |
25
+ | `totalDeposited` | *string* | :heavy_check_mark: | Total assets deposited over all time |
26
+ | `totalWithdrawn` | *string* | :heavy_check_mark: | Total assets withdrawn over all time |
27
+ | `costBasis` | *string* | :heavy_check_mark: | FIFO cost basis of remaining position |
28
+ | `unrealizedPnl` | *string* | :heavy_check_mark: | current_value - cost_basis |
29
+ | `realizedPnl` | *string* | :heavy_check_mark: | Sum of profits/losses from all withdrawals |
30
+ | `totalYield` | *string* | :heavy_check_mark: | unrealized_pnl + realized_pnl |
31
+ | `totalFeesPaid` | *string* | :heavy_check_mark: | Sum of performance fees paid |
32
+ | `deposits` | [components.DepositEvent](../../models/components/depositevent.md)[] | :heavy_minus_sign: | All deposit events for this position |
33
+ | `withdrawals` | [components.WithdrawalEvent](../../models/components/withdrawalevent.md)[] | :heavy_minus_sign: | All withdrawal events for this position |
@@ -8,7 +8,6 @@
8
8
  ```typescript
9
9
  const value: components.AavePosition = {
10
10
  type: "AAVE",
11
- id: "<id>",
12
11
  amountInUnderlyingToken: "<value>",
13
12
  tokenName: "<value>",
14
13
  };
@@ -20,7 +19,6 @@ const value: components.AavePosition = {
20
19
  const value:
21
20
  components.CompassApiBackendV2ModelsEarnReadResponsePositionsVaultPosition = {
22
21
  type: "VAULT",
23
- id: "<id>",
24
22
  vaultAddress: "<value>",
25
23
  amountInUnderlyingToken: "<value>",
26
24
  tokenName: "<value>",
@@ -0,0 +1,31 @@
1
+ # WithdrawalEvent
2
+
3
+ Historical withdrawal event with realized PnL.
4
+
5
+ ## Example Usage
6
+
7
+ ```typescript
8
+ import { WithdrawalEvent } from "@compass-labs/api-sdk/models/components";
9
+
10
+ let value: WithdrawalEvent = {
11
+ blockNumber: 460436,
12
+ transactionHash: "<value>",
13
+ assetsReceived: "<value>",
14
+ unitsWithdrawn: "<value>",
15
+ costBasisConsumed: "<value>",
16
+ realizedPnl: "<value>",
17
+ feeCharged: "<value>",
18
+ };
19
+ ```
20
+
21
+ ## Fields
22
+
23
+ | Field | Type | Required | Description |
24
+ | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- | -------------------------------------------------- |
25
+ | `blockNumber` | *number* | :heavy_check_mark: | Block number when withdrawal occurred |
26
+ | `transactionHash` | *string* | :heavy_check_mark: | Transaction hash of the withdrawal |
27
+ | `assetsReceived` | *string* | :heavy_check_mark: | Amount of underlying asset received |
28
+ | `unitsWithdrawn` | *string* | :heavy_check_mark: | Shares (vault) or aTokens (Aave) burned |
29
+ | `costBasisConsumed` | *string* | :heavy_check_mark: | FIFO cost basis of units withdrawn |
30
+ | `realizedPnl` | *string* | :heavy_check_mark: | Profit/loss: assets_received - cost_basis_consumed |
31
+ | `feeCharged` | *string* | :heavy_check_mark: | Performance fee charged on this withdrawal |
@@ -10,7 +10,6 @@ let value: V2EarnPositionsRequest = {
10
10
  limit: 100,
11
11
  chain: "base",
12
12
  userAddress: "0x7fD8D98Afe730c9aE9b584f1D815f8dA1B4B4d4c",
13
- days: 30,
14
13
  };
15
14
  ```
16
15
 
@@ -21,5 +20,4 @@ let value: V2EarnPositionsRequest = {
21
20
  | `offset` | *number* | :heavy_minus_sign: | The offset of the first item to return. | 0 |
22
21
  | `limit` | *number* | :heavy_minus_sign: | The number of items to return. | 100 |
23
22
  | `chain` | [operations.V2EarnPositionsChain](../../models/operations/v2earnpositionschain.md) | :heavy_check_mark: | N/A | base |
24
- | `userAddress` | *string* | :heavy_check_mark: | The address of the user to get vault positions for. | 0x7fD8D98Afe730c9aE9b584f1D815f8dA1B4B4d4c |
25
- | `days` | *number* | :heavy_minus_sign: | How many days back from the current time to include in the blockchain scan. | 30 |
23
+ | `userAddress` | *string* | :heavy_check_mark: | The address of the user to get vault positions for. | 0x7fD8D98Afe730c9aE9b584f1D815f8dA1B4B4d4c |
@@ -15,7 +15,7 @@
15
15
 
16
16
  ## earnPositions
17
17
 
18
- This endpoint fetches all Compass Earn positions.
18
+ This endpoint fetches all Compass Earn positions with PnL information.
19
19
 
20
20
  ### Example Usage
21
21
 
@@ -33,7 +33,6 @@ async function run() {
33
33
  limit: 100,
34
34
  chain: "base",
35
35
  userAddress: "0x7fD8D98Afe730c9aE9b584f1D815f8dA1B4B4d4c",
36
- days: 30,
37
36
  });
38
37
 
39
38
  console.log(result);
@@ -62,7 +61,6 @@ async function run() {
62
61
  limit: 100,
63
62
  chain: "base",
64
63
  userAddress: "0x7fD8D98Afe730c9aE9b584f1D815f8dA1B4B4d4c",
65
- days: 30,
66
64
  });
67
65
  if (res.ok) {
68
66
  const { value: result } = res;
@@ -447,7 +445,10 @@ If `DEPOSIT` is selected for `action`, tokens will be deposited into the selecte
447
445
 
448
446
  If `WITHDRAW` is selected for `action`, tokens will be withdrawn from the selected venue address back into the Earn Account associated with the `owner` wallet.
449
447
 
450
- A fee can be configured. This fee is deducted from the total `amount`. It can be expressed as a `FIXED` amount or a `PERCENTAGE` of `amount`.
448
+ A fee can be configured. This fee is deducted from the total `amount`. It can be expressed as:
449
+ - `FIXED`: a fixed token amount (e.g., 0.1 means 0.1 tokens)
450
+ - `PERCENTAGE`: a percentage of the transaction amount (e.g., 1.5 means 1.5%)
451
+ - `PERFORMANCE`: a percentage of realized profit using FIFO cost basis (e.g., 10 means 10% of profit). Only applicable for withdrawals.
451
452
 
452
453
  The transaction can be gas-sponsored by an arbitrary wallet address which will sign, submit and pay the required gas for the transaction. If `gas_sponsorship` is set to `true`, EIP-712 typed data will be returned that must be signed by the `owner` and submitted to the 'Prepare gas-sponsored transaction' endpoint (`/gas_sponsorship/prepare`) where the `sender` of the transaction can be set.
453
454
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@compass-labs/api-sdk",
3
- "version": "2.1.26-rc.0",
3
+ "version": "2.1.26-rc.10",
4
4
  "author": "royalnine",
5
5
  "type": "module",
6
6
  "tshy": {
@@ -41,7 +41,10 @@ import { Result } from "../types/fp.js";
41
41
  *
42
42
  * If `WITHDRAW` is selected for `action`, tokens will be withdrawn from the selected venue address back into the Earn Account associated with the `owner` wallet.
43
43
  *
44
- * A fee can be configured. This fee is deducted from the total `amount`. It can be expressed as a `FIXED` amount or a `PERCENTAGE` of `amount`.
44
+ * A fee can be configured. This fee is deducted from the total `amount`. It can be expressed as:
45
+ * - `FIXED`: a fixed token amount (e.g., 0.1 means 0.1 tokens)
46
+ * - `PERCENTAGE`: a percentage of the transaction amount (e.g., 1.5 means 1.5%)
47
+ * - `PERFORMANCE`: a percentage of realized profit using FIFO cost basis (e.g., 10 means 10% of profit). Only applicable for withdrawals.
45
48
  *
46
49
  * The transaction can be gas-sponsored by an arbitrary wallet address which will sign, submit and pay the required gas for the transaction. If `gas_sponsorship` is set to `true`, EIP-712 typed data will be returned that must be signed by the `owner` and submitted to the 'Prepare gas-sponsored transaction' endpoint (`/gas_sponsorship/prepare`) where the `sender` of the transaction can be set.
47
50
  */
@@ -30,7 +30,7 @@ import { Result } from "../types/fp.js";
30
30
  * List earn positions
31
31
  *
32
32
  * @remarks
33
- * This endpoint fetches all Compass Earn positions.
33
+ * This endpoint fetches all Compass Earn positions with PnL information.
34
34
  */
35
35
  export function earnEarnPositions(
36
36
  client: CompassApiSDKCore,
@@ -93,7 +93,6 @@ async function $do(
93
93
 
94
94
  const query = encodeFormQuery({
95
95
  "chain": payload.chain,
96
- "days": payload.days,
97
96
  "limit": payload.limit,
98
97
  "offset": payload.offset,
99
98
  "user_address": payload.user_address,
package/src/lib/config.ts CHANGED
@@ -62,7 +62,7 @@ export const SDK_METADATA = {
62
62
  language: "typescript",
63
63
  openapiDocVersion: "0.0.1",
64
64
  sdkVersion: "2.0.0",
65
- genVersion: "2.788.7",
65
+ genVersion: "2.788.15",
66
66
  userAgent:
67
- "speakeasy-sdk/typescript 2.0.0 2.788.7 0.0.1 @compass-labs/api-sdk",
67
+ "speakeasy-sdk/typescript 2.0.0 2.788.15 0.0.1 @compass-labs/api-sdk",
68
68
  } as const;
@@ -7,16 +7,13 @@ import { remap as remap$ } from "../../lib/primitives.js";
7
7
  import { safeParse } from "../../lib/schemas.js";
8
8
  import { Result as SafeParseResult } from "../../types/fp.js";
9
9
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+ import { PositionPnL, PositionPnL$inboundSchema } from "./positionpnl.js";
10
11
 
11
12
  export type AavePosition = {
12
13
  /**
13
14
  * The market type discriminator.
14
15
  */
15
16
  type: "AAVE";
16
- /**
17
- * Base64-encoded position identifier.
18
- */
19
- id: string;
20
17
  vaultAddress?: "None" | undefined;
21
18
  /**
22
19
  * The user's position value denominated in the supplied asset.
@@ -27,6 +24,10 @@ export type AavePosition = {
27
24
  */
28
25
  tokenName: string;
29
26
  vaultName?: "None" | undefined;
27
+ /**
28
+ * PnL breakdown with full deposit/withdrawal history.
29
+ */
30
+ pnl?: PositionPnL | null | undefined;
30
31
  };
31
32
 
32
33
  /** @internal */
@@ -36,11 +37,11 @@ export const AavePosition$inboundSchema: z.ZodType<
36
37
  unknown
37
38
  > = z.object({
38
39
  type: z.literal("AAVE"),
39
- id: z.string(),
40
40
  vault_address: z.literal("None").optional(),
41
41
  amount_in_underlying_token: z.string(),
42
42
  token_name: z.string(),
43
43
  vault_name: z.literal("None").optional(),
44
+ pnl: z.nullable(PositionPnL$inboundSchema).optional(),
44
45
  }).transform((v) => {
45
46
  return remap$(v, {
46
47
  "vault_address": "vaultAddress",
@@ -7,16 +7,13 @@ import { remap as remap$ } from "../../lib/primitives.js";
7
7
  import { safeParse } from "../../lib/schemas.js";
8
8
  import { Result as SafeParseResult } from "../../types/fp.js";
9
9
  import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+ import { PositionPnL, PositionPnL$inboundSchema } from "./positionpnl.js";
10
11
 
11
12
  export type CompassApiBackendV2ModelsEarnReadResponsePositionsVaultPosition = {
12
13
  /**
13
14
  * The market type discriminator.
14
15
  */
15
16
  type: "VAULT";
16
- /**
17
- * Base64-encoded position identifier.
18
- */
19
- id: string;
20
17
  /**
21
18
  * The vault address you are depositing to.
22
19
  */
@@ -33,6 +30,10 @@ export type CompassApiBackendV2ModelsEarnReadResponsePositionsVaultPosition = {
33
30
  * Name of the vault token (share token).
34
31
  */
35
32
  vaultName: string;
33
+ /**
34
+ * PnL breakdown with full deposit/withdrawal history.
35
+ */
36
+ pnl?: PositionPnL | null | undefined;
36
37
  };
37
38
 
38
39
  /** @internal */
@@ -43,11 +44,11 @@ export const CompassApiBackendV2ModelsEarnReadResponsePositionsVaultPosition$inb
43
44
  unknown
44
45
  > = z.object({
45
46
  type: z.literal("VAULT"),
46
- id: z.string(),
47
47
  vault_address: z.string(),
48
48
  amount_in_underlying_token: z.string(),
49
49
  token_name: z.string(),
50
50
  vault_name: z.string(),
51
+ pnl: z.nullable(PositionPnL$inboundSchema).optional(),
51
52
  }).transform((v) => {
52
53
  return remap$(v, {
53
54
  "vault_address": "vaultAddress",
@@ -0,0 +1,66 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+
11
+ /**
12
+ * Historical deposit event for position transparency.
13
+ */
14
+ export type DepositEvent = {
15
+ /**
16
+ * Block number when deposit occurred
17
+ */
18
+ blockNumber: number;
19
+ /**
20
+ * Transaction hash of the deposit
21
+ */
22
+ transactionHash: string;
23
+ /**
24
+ * Amount of underlying asset deposited
25
+ */
26
+ assetsDeposited: string;
27
+ /**
28
+ * Shares (vault) or aTokens (Aave) received
29
+ */
30
+ unitsReceived: string;
31
+ /**
32
+ * Cost basis per unit at time of deposit
33
+ */
34
+ costPerUnit: string;
35
+ };
36
+
37
+ /** @internal */
38
+ export const DepositEvent$inboundSchema: z.ZodType<
39
+ DepositEvent,
40
+ z.ZodTypeDef,
41
+ unknown
42
+ > = z.object({
43
+ block_number: z.number().int(),
44
+ transaction_hash: z.string(),
45
+ assets_deposited: z.string(),
46
+ units_received: z.string(),
47
+ cost_per_unit: z.string(),
48
+ }).transform((v) => {
49
+ return remap$(v, {
50
+ "block_number": "blockNumber",
51
+ "transaction_hash": "transactionHash",
52
+ "assets_deposited": "assetsDeposited",
53
+ "units_received": "unitsReceived",
54
+ "cost_per_unit": "costPerUnit",
55
+ });
56
+ });
57
+
58
+ export function depositEventFromJSON(
59
+ jsonString: string,
60
+ ): SafeParseResult<DepositEvent, SDKValidationError> {
61
+ return safeParse(
62
+ jsonString,
63
+ (x) => DepositEvent$inboundSchema.parse(JSON.parse(x)),
64
+ `Failed to parse 'DepositEvent' from JSON`,
65
+ );
66
+ }
@@ -6,19 +6,20 @@ import * as z from "zod/v3";
6
6
  import { ClosedEnum } from "../../types/enums.js";
7
7
 
8
8
  /**
9
- * The fee amount. If `denomination` is 'PERCENTAGE', this is a percentage of the transaction amount (e.g., 1.5 for 1.5%). If `denomination` is 'FIXED', this is a fixed amount in token units (e.g., 0.1 for 0.1 tokens).
9
+ * The fee amount. If `denomination` is 'PERCENTAGE', this is a percentage of the transaction amount (e.g., 1.5 for 1.5%). If `denomination` is 'FIXED', this is a fixed amount in token units (e.g., 0.1 for 0.1 tokens). If `denomination` is 'PERFORMANCE', this is a percentage of realized profit calculated using FIFO cost basis (e.g., 10 for 10% of profit).
10
10
  */
11
11
  export type FeeAmount = number | string;
12
12
 
13
13
  /**
14
- * The unit type for the fee amount. Use 'PERCENTAGE' for a percentage-based fee (e.g., 1.5 means 1.5% of the transaction amount) or 'FIXED' for a fixed token amount (e.g., 0.1 means 0.1 tokens).
14
+ * The unit type for the fee amount. Use 'PERCENTAGE' for a percentage-based fee (e.g., 1.5 means 1.5% of the transaction amount), 'FIXED' for a fixed token amount (e.g., 0.1 means 0.1 tokens), or 'PERFORMANCE' for a fee based on realized profit using FIFO cost basis (e.g., 10 means 10% of profit).
15
15
  */
16
16
  export const Denomination = {
17
17
  Percentage: "PERCENTAGE",
18
18
  Fixed: "FIXED",
19
+ Performance: "PERFORMANCE",
19
20
  } as const;
20
21
  /**
21
- * The unit type for the fee amount. Use 'PERCENTAGE' for a percentage-based fee (e.g., 1.5 means 1.5% of the transaction amount) or 'FIXED' for a fixed token amount (e.g., 0.1 means 0.1 tokens).
22
+ * The unit type for the fee amount. Use 'PERCENTAGE' for a percentage-based fee (e.g., 1.5 means 1.5% of the transaction amount), 'FIXED' for a fixed token amount (e.g., 0.1 means 0.1 tokens), or 'PERFORMANCE' for a fee based on realized profit using FIFO cost basis (e.g., 10 means 10% of profit).
22
23
  */
23
24
  export type Denomination = ClosedEnum<typeof Denomination>;
24
25
 
@@ -28,11 +29,11 @@ export type Fee = {
28
29
  */
29
30
  recipient: string;
30
31
  /**
31
- * The fee amount. If `denomination` is 'PERCENTAGE', this is a percentage of the transaction amount (e.g., 1.5 for 1.5%). If `denomination` is 'FIXED', this is a fixed amount in token units (e.g., 0.1 for 0.1 tokens).
32
+ * The fee amount. If `denomination` is 'PERCENTAGE', this is a percentage of the transaction amount (e.g., 1.5 for 1.5%). If `denomination` is 'FIXED', this is a fixed amount in token units (e.g., 0.1 for 0.1 tokens). If `denomination` is 'PERFORMANCE', this is a percentage of realized profit calculated using FIFO cost basis (e.g., 10 for 10% of profit).
32
33
  */
33
34
  amount: number | string;
34
35
  /**
35
- * The unit type for the fee amount. Use 'PERCENTAGE' for a percentage-based fee (e.g., 1.5 means 1.5% of the transaction amount) or 'FIXED' for a fixed token amount (e.g., 0.1 means 0.1 tokens).
36
+ * The unit type for the fee amount. Use 'PERCENTAGE' for a percentage-based fee (e.g., 1.5 means 1.5% of the transaction amount), 'FIXED' for a fixed token amount (e.g., 0.1 means 0.1 tokens), or 'PERFORMANCE' for a fee based on realized profit using FIFO cost basis (e.g., 10 means 10% of profit).
36
37
  */
37
38
  denomination?: Denomination | undefined;
38
39
  };
@@ -79,6 +79,7 @@ export * from "./compassapibackendv2modelssafetransactresponsebatchedsafeoperati
79
79
  export * from "./cooldownposition.js";
80
80
  export * from "./createaccountrequest.js";
81
81
  export * from "./createaccountresponse.js";
82
+ export * from "./depositevent.js";
82
83
  export * from "./depositforburnrequest.js";
83
84
  export * from "./depositforburnresponse.js";
84
85
  export * from "./details.js";
@@ -168,6 +169,7 @@ export * from "./permittypeddataresponseinput.js";
168
169
  export * from "./permittypeddataresponseoutput.js";
169
170
  export * from "./portfolio.js";
170
171
  export * from "./position.js";
172
+ export * from "./positionpnl.js";
171
173
  export * from "./protocol.js";
172
174
  export * from "./repay.js";
173
175
  export * from "./reserve.js";
@@ -246,6 +248,7 @@ export * from "./vaultwithdrawrequest.js";
246
248
  export * from "./weeklyapys.js";
247
249
  export * from "./wildcatgetmarketresponse.js";
248
250
  export * from "./withdraw.js";
251
+ export * from "./withdrawalevent.js";
249
252
  export * from "./wrapethparams.js";
250
253
  export * from "./wrapethrequest.js";
251
254
  export * from "./yieldrange.js";