@compass-labs/api-sdk 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/FUNCTIONS.md +3 -4
- package/README.md +19 -25
- package/bin/mcp-server.js +13 -12
- package/bin/mcp-server.js.map +11 -11
- package/dist/commonjs/funcs/aaveV3AvgRate.d.ts +2 -2
- package/dist/commonjs/funcs/aaveV3AvgRate.js +2 -2
- package/dist/commonjs/funcs/aaveV3Rate.d.ts +1 -1
- package/dist/commonjs/funcs/aaveV3Rate.js +1 -1
- package/dist/commonjs/funcs/aaveV3StdRate.d.ts +3 -2
- package/dist/commonjs/funcs/aaveV3StdRate.d.ts.map +1 -1
- package/dist/commonjs/funcs/aaveV3StdRate.js +3 -2
- package/dist/commonjs/funcs/aaveV3StdRate.js.map +1 -1
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- package/dist/commonjs/mcp-server/mcp-server.js +1 -1
- package/dist/commonjs/mcp-server/server.js +3 -3
- package/dist/commonjs/mcp-server/server.js.map +1 -1
- package/dist/commonjs/mcp-server/tools/aaveV3AvgRate.js +2 -2
- package/dist/commonjs/mcp-server/tools/aaveV3AvgRate.js.map +1 -1
- package/dist/commonjs/mcp-server/tools/aaveV3Rate.js +1 -1
- package/dist/commonjs/mcp-server/tools/aaveV3StdRate.d.ts.map +1 -1
- package/dist/commonjs/mcp-server/tools/aaveV3StdRate.js +3 -2
- package/dist/commonjs/mcp-server/tools/aaveV3StdRate.js.map +1 -1
- package/dist/commonjs/sdk/aavev3.d.ts +26 -25
- package/dist/commonjs/sdk/aavev3.d.ts.map +1 -1
- package/dist/commonjs/sdk/aavev3.js +29 -28
- package/dist/commonjs/sdk/aavev3.js.map +1 -1
- package/dist/esm/funcs/aaveV3AvgRate.d.ts +2 -2
- package/dist/esm/funcs/aaveV3AvgRate.js +2 -2
- package/dist/esm/funcs/aaveV3Rate.d.ts +1 -1
- package/dist/esm/funcs/aaveV3Rate.js +1 -1
- package/dist/esm/funcs/aaveV3StdRate.d.ts +3 -2
- package/dist/esm/funcs/aaveV3StdRate.d.ts.map +1 -1
- package/dist/esm/funcs/aaveV3StdRate.js +3 -2
- package/dist/esm/funcs/aaveV3StdRate.js.map +1 -1
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- package/dist/esm/mcp-server/mcp-server.js +1 -1
- package/dist/esm/mcp-server/server.js +3 -3
- package/dist/esm/mcp-server/server.js.map +1 -1
- package/dist/esm/mcp-server/tools/aaveV3AvgRate.js +2 -2
- package/dist/esm/mcp-server/tools/aaveV3AvgRate.js.map +1 -1
- package/dist/esm/mcp-server/tools/aaveV3Rate.js +1 -1
- package/dist/esm/mcp-server/tools/aaveV3StdRate.d.ts.map +1 -1
- package/dist/esm/mcp-server/tools/aaveV3StdRate.js +3 -2
- package/dist/esm/mcp-server/tools/aaveV3StdRate.js.map +1 -1
- package/dist/esm/sdk/aavev3.d.ts +26 -25
- package/dist/esm/sdk/aavev3.d.ts.map +1 -1
- package/dist/esm/sdk/aavev3.js +29 -28
- package/dist/esm/sdk/aavev3.js.map +1 -1
- package/docs/sdks/aavev3/README.md +49 -48
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/aaveV3AvgRate.ts +2 -2
- package/src/funcs/aaveV3Rate.ts +1 -1
- package/src/funcs/aaveV3StdRate.ts +3 -2
- package/src/lib/config.ts +2 -2
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +3 -3
- package/src/mcp-server/tools/aaveV3AvgRate.ts +2 -2
- package/src/mcp-server/tools/aaveV3Rate.ts +1 -1
- package/src/mcp-server/tools/aaveV3StdRate.ts +3 -2
- package/src/sdk/aavev3.ts +38 -37
package/src/mcp-server/server.ts
CHANGED
|
@@ -89,7 +89,7 @@ export function createMCPServer(deps: {
|
|
|
89
89
|
}) {
|
|
90
90
|
const server = new McpServer({
|
|
91
91
|
name: "CompassApiSDK",
|
|
92
|
-
version: "0.1.
|
|
92
|
+
version: "0.1.3",
|
|
93
93
|
});
|
|
94
94
|
|
|
95
95
|
const client = new CompassApiSDKCore({
|
|
@@ -119,10 +119,10 @@ export function createMCPServer(deps: {
|
|
|
119
119
|
const register = { tool, resource, resourceTemplate, prompt };
|
|
120
120
|
void register; // suppress unused warnings
|
|
121
121
|
|
|
122
|
-
tool(tool$
|
|
122
|
+
tool(tool$aaveV3Rate);
|
|
123
123
|
tool(tool$aaveV3AvgRate);
|
|
124
|
+
tool(tool$aaveV3StdRate);
|
|
124
125
|
tool(tool$aaveV3ReserveOverview);
|
|
125
|
-
tool(tool$aaveV3Rate);
|
|
126
126
|
tool(tool$aaveV3TokenPrice);
|
|
127
127
|
tool(tool$aaveV3LiquidityChange);
|
|
128
128
|
tool(tool$aaveV3UserPositionSummary);
|
|
@@ -12,9 +12,9 @@ const args = {
|
|
|
12
12
|
|
|
13
13
|
export const tool$aaveV3AvgRate: ToolDefinition<typeof args> = {
|
|
14
14
|
name: "aave-v3-avg-rate",
|
|
15
|
-
description: `
|
|
15
|
+
description: `Interest Rates: time average
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
Provides time-weighted averages of deposit and borrow rates for Aave reserves.`,
|
|
18
18
|
args,
|
|
19
19
|
tool: async (client, args, ctx) => {
|
|
20
20
|
const [result, apiCall] = await aaveV3AvgRate(
|
|
@@ -12,7 +12,7 @@ const args = {
|
|
|
12
12
|
|
|
13
13
|
export const tool$aaveV3Rate: ToolDefinition<typeof args> = {
|
|
14
14
|
name: "aave-v3-rate",
|
|
15
|
-
description: `Interest
|
|
15
|
+
description: `Interest Rates: now
|
|
16
16
|
|
|
17
17
|
Returns the latest APY and APR rates for a specified token on Aave, for both
|
|
18
18
|
deposits and loans.
|
|
@@ -12,9 +12,10 @@ const args = {
|
|
|
12
12
|
|
|
13
13
|
export const tool$aaveV3StdRate: ToolDefinition<typeof args> = {
|
|
14
14
|
name: "aave-v3-std-rate",
|
|
15
|
-
description: `
|
|
15
|
+
description: `Interest Rates: standard deviation
|
|
16
16
|
|
|
17
|
-
Returns the standard deviation of
|
|
17
|
+
Returns the historical standard deviation of lending and borrowing rates for Aave
|
|
18
|
+
reserves, illustrating market volatility.`,
|
|
18
19
|
args,
|
|
19
20
|
tool: async (client, args, ctx) => {
|
|
20
21
|
const [result, apiCall] = await aaveV3StdRate(
|
package/src/sdk/aavev3.ts
CHANGED
|
@@ -22,16 +22,29 @@ import { unwrapAsync } from "../types/fp.js";
|
|
|
22
22
|
|
|
23
23
|
export class AaveV3 extends ClientSDK {
|
|
24
24
|
/**
|
|
25
|
-
*
|
|
25
|
+
* Interest Rates: now
|
|
26
26
|
*
|
|
27
27
|
* @remarks
|
|
28
|
-
* Returns the
|
|
28
|
+
* Returns the latest APY and APR rates for a specified token on Aave, for both
|
|
29
|
+
* deposits and loans.
|
|
30
|
+
*
|
|
31
|
+
* **Annual percentage yield (APY)** is the yearly return/cost after continuous
|
|
32
|
+
* compounding of the per-second rate stored on-chain. This value is the same value as
|
|
33
|
+
* seen the on [app.aave.com](
|
|
34
|
+
* https://app.aave.com/)
|
|
35
|
+
* but more up-to-date as it is taken directly from the
|
|
36
|
+
* blockchain every time this endpoint is called.
|
|
37
|
+
*
|
|
38
|
+
* **Annual percentage rate (APR)** is the yearly simple interest rate (no
|
|
39
|
+
* compounding).
|
|
40
|
+
*
|
|
41
|
+
* For APY/APR on loans Aave offers both stable and fixed rates on certain tokens.
|
|
29
42
|
*/
|
|
30
|
-
async
|
|
31
|
-
request: operations.
|
|
43
|
+
async rate(
|
|
44
|
+
request: operations.AaveRateRequest,
|
|
32
45
|
options?: RequestOptions,
|
|
33
|
-
): Promise<components.
|
|
34
|
-
return unwrapAsync(
|
|
46
|
+
): Promise<components.AaveRateResponse> {
|
|
47
|
+
return unwrapAsync(aaveV3Rate(
|
|
35
48
|
this,
|
|
36
49
|
request,
|
|
37
50
|
options,
|
|
@@ -39,10 +52,10 @@ export class AaveV3 extends ClientSDK {
|
|
|
39
52
|
}
|
|
40
53
|
|
|
41
54
|
/**
|
|
42
|
-
*
|
|
55
|
+
* Interest Rates: time average
|
|
43
56
|
*
|
|
44
57
|
* @remarks
|
|
45
|
-
*
|
|
58
|
+
* Provides time-weighted averages of deposit and borrow rates for Aave reserves.
|
|
46
59
|
*/
|
|
47
60
|
async avgRate(
|
|
48
61
|
request: operations.AaveAvgRateRequest,
|
|
@@ -56,21 +69,17 @@ export class AaveV3 extends ClientSDK {
|
|
|
56
69
|
}
|
|
57
70
|
|
|
58
71
|
/**
|
|
59
|
-
*
|
|
72
|
+
* Interest Rates: standard deviation
|
|
60
73
|
*
|
|
61
74
|
* @remarks
|
|
62
|
-
* Returns
|
|
63
|
-
*
|
|
64
|
-
* - Total Borrowed in USD
|
|
65
|
-
* - Utilization Ratio
|
|
66
|
-
*
|
|
67
|
-
* See below for more info:
|
|
75
|
+
* Returns the historical standard deviation of lending and borrowing rates for Aave
|
|
76
|
+
* reserves, illustrating market volatility.
|
|
68
77
|
*/
|
|
69
|
-
async
|
|
70
|
-
request: operations.
|
|
78
|
+
async stdRate(
|
|
79
|
+
request: operations.AaveStdRateRequest,
|
|
71
80
|
options?: RequestOptions,
|
|
72
|
-
): Promise<components.
|
|
73
|
-
return unwrapAsync(
|
|
81
|
+
): Promise<components.AaveSTDRateResponse> {
|
|
82
|
+
return unwrapAsync(aaveV3StdRate(
|
|
74
83
|
this,
|
|
75
84
|
request,
|
|
76
85
|
options,
|
|
@@ -78,29 +87,21 @@ export class AaveV3 extends ClientSDK {
|
|
|
78
87
|
}
|
|
79
88
|
|
|
80
89
|
/**
|
|
81
|
-
*
|
|
90
|
+
* Reserve overview
|
|
82
91
|
*
|
|
83
92
|
* @remarks
|
|
84
|
-
* Returns
|
|
85
|
-
*
|
|
86
|
-
*
|
|
87
|
-
*
|
|
88
|
-
* compounding of the per-second rate stored on-chain. This value is the same value as
|
|
89
|
-
* seen the on [app.aave.com](
|
|
90
|
-
* https://app.aave.com/)
|
|
91
|
-
* but more up-to-date as it is taken directly from the
|
|
92
|
-
* blockchain every time this endpoint is called.
|
|
93
|
-
*
|
|
94
|
-
* **Annual percentage rate (APR)** is the yearly simple interest rate (no
|
|
95
|
-
* compounding).
|
|
93
|
+
* Returns key metrics for Aave Reserves:
|
|
94
|
+
* - Total Supplied (TVL) in USD
|
|
95
|
+
* - Total Borrowed in USD
|
|
96
|
+
* - Utilization Ratio
|
|
96
97
|
*
|
|
97
|
-
*
|
|
98
|
+
* See below for more info:
|
|
98
99
|
*/
|
|
99
|
-
async
|
|
100
|
-
request: operations.
|
|
100
|
+
async reserveOverview(
|
|
101
|
+
request: operations.AaveReserveOverviewRequest,
|
|
101
102
|
options?: RequestOptions,
|
|
102
|
-
): Promise<components.
|
|
103
|
-
return unwrapAsync(
|
|
103
|
+
): Promise<components.AaveReserveOverviewResponse> {
|
|
104
|
+
return unwrapAsync(aaveV3ReserveOverview(
|
|
104
105
|
this,
|
|
105
106
|
request,
|
|
106
107
|
options,
|