compass_api_sdk 0.3.2__py3-none-any.whl → 0.3.4__py3-none-any.whl

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.

Potentially problematic release.


This version of compass_api_sdk might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: compass_api_sdk
3
- Version: 0.3.2
3
+ Version: 0.3.4
4
4
  Summary: Compass API Python SDK
5
5
  Author: royalnine
6
6
  Requires-Python: >=3.9.2
@@ -134,7 +134,7 @@ with CompassAPISDK(
134
134
  api_key_auth="<YOUR_API_KEY_HERE>",
135
135
  ) as compass_api_sdk:
136
136
 
137
- res = compass_api_sdk.aave_v3.reserve_overview(chain=models.AaveReserveOverviewChain.ARBITRUM_MAINNET, token=models.AaveReserveOverviewToken.USDC)
137
+ res = compass_api_sdk.aave_v3.std_rate(chain=models.AaveStdRateChain.ETHEREUM_MAINNET, token=models.AaveStdRateToken.USDC, days=7)
138
138
 
139
139
  # Handle response
140
140
  print(res)
@@ -154,7 +154,7 @@ async def main():
154
154
  api_key_auth="<YOUR_API_KEY_HERE>",
155
155
  ) as compass_api_sdk:
156
156
 
157
- res = await compass_api_sdk.aave_v3.reserve_overview_async(chain=models.AaveReserveOverviewChain.ARBITRUM_MAINNET, token=models.AaveReserveOverviewToken.USDC)
157
+ res = await compass_api_sdk.aave_v3.std_rate_async(chain=models.AaveStdRateChain.ETHEREUM_MAINNET, token=models.AaveStdRateToken.USDC, days=7)
158
158
 
159
159
  # Handle response
160
160
  print(res)
@@ -183,7 +183,7 @@ with CompassAPISDK(
183
183
  api_key_auth="<YOUR_API_KEY_HERE>",
184
184
  ) as compass_api_sdk:
185
185
 
186
- res = compass_api_sdk.aave_v3.reserve_overview(chain=models.AaveReserveOverviewChain.ARBITRUM_MAINNET, token=models.AaveReserveOverviewToken.USDC)
186
+ res = compass_api_sdk.aave_v3.std_rate(chain=models.AaveStdRateChain.ETHEREUM_MAINNET, token=models.AaveStdRateToken.USDC, days=7)
187
187
 
188
188
  # Handle response
189
189
  print(res)
@@ -199,6 +199,8 @@ with CompassAPISDK(
199
199
 
200
200
  ### [aave_v3](https://github.com/CompassLabs/mono/blob/master/docs/sdks/aavev3/README.md)
201
201
 
202
+ * [std_rate](https://github.com/CompassLabs/mono/blob/master/docs/sdks/aavev3/README.md#std_rate) - Standard deviation of interest rates
203
+ * [avg_rate](https://github.com/CompassLabs/mono/blob/master/docs/sdks/aavev3/README.md#avg_rate) - Average interest rates
202
204
  * [reserve_overview](https://github.com/CompassLabs/mono/blob/master/docs/sdks/aavev3/README.md#reserve_overview) - Reserve overview
203
205
  * [rate](https://github.com/CompassLabs/mono/blob/master/docs/sdks/aavev3/README.md#rate) - Interest rates
204
206
  * [token_price](https://github.com/CompassLabs/mono/blob/master/docs/sdks/aavev3/README.md#token_price) - Token prices
@@ -299,7 +301,7 @@ with CompassAPISDK(
299
301
  api_key_auth="<YOUR_API_KEY_HERE>",
300
302
  ) as compass_api_sdk:
301
303
 
302
- res = compass_api_sdk.aave_v3.reserve_overview(chain=models.AaveReserveOverviewChain.ARBITRUM_MAINNET, token=models.AaveReserveOverviewToken.USDC,
304
+ res = compass_api_sdk.aave_v3.std_rate(chain=models.AaveStdRateChain.ETHEREUM_MAINNET, token=models.AaveStdRateToken.USDC, days=7,
303
305
  RetryConfig("backoff", BackoffStrategy(1, 50, 1.1, 100), False))
304
306
 
305
307
  # Handle response
@@ -318,7 +320,7 @@ with CompassAPISDK(
318
320
  api_key_auth="<YOUR_API_KEY_HERE>",
319
321
  ) as compass_api_sdk:
320
322
 
321
- res = compass_api_sdk.aave_v3.reserve_overview(chain=models.AaveReserveOverviewChain.ARBITRUM_MAINNET, token=models.AaveReserveOverviewToken.USDC)
323
+ res = compass_api_sdk.aave_v3.std_rate(chain=models.AaveStdRateChain.ETHEREUM_MAINNET, token=models.AaveStdRateToken.USDC, days=7)
322
324
 
323
325
  # Handle response
324
326
  print(res)
@@ -340,7 +342,7 @@ By default, an API error will raise a errors.APIError exception, which has the f
340
342
  | `.raw_response` | *httpx.Response* | The raw HTTP response |
341
343
  | `.body` | *str* | The response content |
342
344
 
343
- When custom error responses are specified for an operation, the SDK may also raise their associated exceptions. You can refer to respective *Errors* tables in SDK docs for more details on possible exception types for each operation. For example, the `reserve_overview_async` method may raise the following exceptions:
345
+ When custom error responses are specified for an operation, the SDK may also raise their associated exceptions. You can refer to respective *Errors* tables in SDK docs for more details on possible exception types for each operation. For example, the `std_rate_async` method may raise the following exceptions:
344
346
 
345
347
  | Error Type | Status Code | Content Type |
346
348
  | -------------------------- | ----------- | ---------------- |
@@ -359,7 +361,7 @@ with CompassAPISDK(
359
361
  res = None
360
362
  try:
361
363
 
362
- res = compass_api_sdk.aave_v3.reserve_overview(chain=models.AaveReserveOverviewChain.ARBITRUM_MAINNET, token=models.AaveReserveOverviewToken.USDC)
364
+ res = compass_api_sdk.aave_v3.std_rate(chain=models.AaveStdRateChain.ETHEREUM_MAINNET, token=models.AaveStdRateToken.USDC, days=7)
363
365
 
364
366
  # Handle response
365
367
  print(res)
@@ -388,7 +390,7 @@ with CompassAPISDK(
388
390
  api_key_auth="<YOUR_API_KEY_HERE>",
389
391
  ) as compass_api_sdk:
390
392
 
391
- res = compass_api_sdk.aave_v3.reserve_overview(chain=models.AaveReserveOverviewChain.ARBITRUM_MAINNET, token=models.AaveReserveOverviewToken.USDC)
393
+ res = compass_api_sdk.aave_v3.std_rate(chain=models.AaveStdRateChain.ETHEREUM_MAINNET, token=models.AaveStdRateToken.USDC, days=7)
392
394
 
393
395
  # Handle response
394
396
  print(res)
@@ -2,22 +2,25 @@ compassapisdk/__init__.py,sha256=w2u919V3Tzv4zEPQ-OYJ79gQ_4_SyW7GOFFoHtqXDFA,401
2
2
  compassapisdk/_hooks/__init__.py,sha256=p5J13DeYuISQyQWirjJAObHIf2VtIlOtFqnIpvjjVwk,118
3
3
  compassapisdk/_hooks/sdkhooks.py,sha256=kiWg7ywp9SXriA5uvAnxmFLFcDREJjDWtccd7Fo6LJI,2501
4
4
  compassapisdk/_hooks/types.py,sha256=vkJdvFkHgRiCPz2IDtGma15FzU2YxIlrqxk1zWUDJTM,2816
5
- compassapisdk/_version.py,sha256=gFNU4uumnOHZMGSQ_ZDS0k_mNCai9hi-f3vsU1RL54Q,472
6
- compassapisdk/aave_v3.py,sha256=xxPi6z_3ZahRtNI6rKWU-uH1YMZk1Xdu0tAqOTBtCYw,106740
5
+ compassapisdk/_version.py,sha256=47VLiS74SKb6xqQx-QyRs3tTAZJy9TUdh5qNrFwHugQ,472
6
+ compassapisdk/aave_v3.py,sha256=zL975CcxY15V-2osx7PJIb2eXeWVlucOKvgFpHxgUYA,123300
7
7
  compassapisdk/aerodrome_slipstream.py,sha256=0Vw7syYZGOl8rXOD6pjiZx0PIsZRDkMk6_BxQp1jG5I,82959
8
8
  compassapisdk/basesdk.py,sha256=jeaXGkGBhWBQ288Xjctv30WbB5pxBCYgb42Ezyj6GgU,12130
9
9
  compassapisdk/errors/__init__.py,sha256=f8nyj2IhW5h_xtEeg6cfKgByLkqowLv0Fxm0hUofQPs,257
10
10
  compassapisdk/errors/apierror.py,sha256=9mTyJSyvUAOnSfW_1HWt9dGl8IDlpQ68DebwYsDNdug,528
11
11
  compassapisdk/errors/httpvalidationerror.py,sha256=04VFnAPBDed4UQh3ar7i7PoqLXppLpv57B8Uv8SPRs0,665
12
12
  compassapisdk/httpclient.py,sha256=Eu73urOAiZQtdUIyOUnPccxCiBbWEKrXG-JrRG3SLM4,3946
13
- compassapisdk/models/__init__.py,sha256=khOnM61xQtP9DcwqrAMFtOpxQrPyo2xK3r8tcsZOHHE,48568
13
+ compassapisdk/models/__init__.py,sha256=neKsGQg30uMSYG0-aTsKEPpOol5NSIH2ljKGZLpmT4Y,49346
14
+ compassapisdk/models/aave_avg_rateop.py,sha256=K4egaYvgCrMRpNGrf4UeYbL39zMgeByxu65C4cZ-T7I,2432
14
15
  compassapisdk/models/aave_historical_transactionsop.py,sha256=pDjCayatpXSc7HzT0xirwowecGTFCUoNMoR0VC8n_m8,1785
15
16
  compassapisdk/models/aave_liquidity_changeop.py,sha256=GMvgWl55yL_VCfOCHTQ4gPIasFEsEYXl5UrJzcMJtSM,2781
16
17
  compassapisdk/models/aave_rateop.py,sha256=mST4ddicQ1D_mblAuh2TSeJOnLYyD7gKAy8yZaMUXio,2149
17
18
  compassapisdk/models/aave_reserve_overviewop.py,sha256=23_Vxc-VxplznUlyxS5z3XnPv7HeJwh6EUgG2sOX_gE,2195
19
+ compassapisdk/models/aave_std_rateop.py,sha256=8Ptt0HKvW4jCiNCRy_wMyiT876fOeQYFnM2RrgubIQM,2432
18
20
  compassapisdk/models/aave_token_priceop.py,sha256=xj9nMlHOpV52jIn1aXar2k9ToAm3AX6ZNYp0tyFi9bo,2187
19
21
  compassapisdk/models/aave_user_position_per_tokenop.py,sha256=2tXIQaXYdjW-pQl3SslC6f9DykKL8DQ2kJ1ZKafHnpU,2601
20
22
  compassapisdk/models/aave_user_position_summaryop.py,sha256=2mQZSABiymK3DBKZswyAJLGT6lxEm521-g7CIGXIV_o,1154
23
+ compassapisdk/models/aaveavgrateresponse.py,sha256=09G8R9X0u_dgYzj5mIvgxtL5DeY_FcztamQ1NDA7FZI,1328
21
24
  compassapisdk/models/aaveborrowparams.py,sha256=xqhJBwkYSOpnAqbeuh4LUp8dyW2GBH18XjdlbCBpq2Q,2868
22
25
  compassapisdk/models/aaveborrowrequest.py,sha256=EDcVWuBUTlse0W_SlLAmlk06iDsqRSGD3a4uND7FS4U,3127
23
26
  compassapisdk/models/aavehistoricaltransactionsresponse.py,sha256=NNbc0_LpuXlL3sJcwvD1Zp2rPZkJ35cP_KuIFCmda_s,2500
@@ -27,6 +30,7 @@ compassapisdk/models/aaverateresponse.py,sha256=vag9BK7tx5HHyZfk3jdTFdXJv-OCGq_j
27
30
  compassapisdk/models/aaverepayparams.py,sha256=h11eYnzwMZLclcrSui-LibrMitFpZRyYlAVePEstgUM,2856
28
31
  compassapisdk/models/aaverepayrequest.py,sha256=AtGiwrrEAmWbeILdlLMKY8-ALiXWgIJto2fAgTpTMFs,3115
29
32
  compassapisdk/models/aavereserveoverviewresponse.py,sha256=cEoJaVLHFU2MX1aEjoi41_iNhmvBlmml9BgG63R7PCM,1211
33
+ compassapisdk/models/aavestdrateresponse.py,sha256=vM_jmRFmd0HsM6MoMITPpTcKN7_oFfk8cUjvY1lwfMM,1496
30
34
  compassapisdk/models/aavesupplyparams.py,sha256=8aYauQJ0gWYTlpW6mX2nQNJN5al7-h-uy4k41PZ1EZM,2562
31
35
  compassapisdk/models/aavesupplyrequest.py,sha256=4zQWQnCK3ZbRElW29MFdaEz4GHFmImVAUrCp7Y6P35Y,2821
32
36
  compassapisdk/models/aavetokenpriceresponse.py,sha256=o0vhHgO6jPfXYBP0KKief7wGz1m8NWWY4kaoYDs_Xgg,399
@@ -186,6 +190,6 @@ compassapisdk/utils/security.py,sha256=ktep3HKwbFs-MLxUYTM8Jd4v-ZBum5_Z0u1PFIdYB
186
190
  compassapisdk/utils/serializers.py,sha256=hiHBXM1AY8_N2Z_rvFfNSYwvLBkSQlPGFp8poasdU4s,5986
187
191
  compassapisdk/utils/url.py,sha256=BgGPgcTA6MRK4bF8fjP2dUopN3NzEzxWMXPBVg8NQUA,5254
188
192
  compassapisdk/utils/values.py,sha256=CcaCXEa3xHhkUDROyXZocN8f0bdITftv9Y0P9lTf0YM,3517
189
- compass_api_sdk-0.3.2.dist-info/METADATA,sha256=lOguDGeJZHAgMptA0YKFbs9Qpets2AkDNYjMigyk0dQ,24826
190
- compass_api_sdk-0.3.2.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
191
- compass_api_sdk-0.3.2.dist-info/RECORD,,
193
+ compass_api_sdk-0.3.4.dist-info/METADATA,sha256=8n7qBrLx4igWuQH0EpYktrCzj_m3-KR5QPpF1q6MYMo,24966
194
+ compass_api_sdk-0.3.4.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
195
+ compass_api_sdk-0.3.4.dist-info/RECORD,,
compassapisdk/_version.py CHANGED
@@ -3,10 +3,10 @@
3
3
  import importlib.metadata
4
4
 
5
5
  __title__: str = "compass_api_sdk"
6
- __version__: str = "0.3.2"
6
+ __version__: str = "0.3.4"
7
7
  __openapi_doc_version__: str = "0.0.1"
8
8
  __gen_version__: str = "2.604.2"
9
- __user_agent__: str = "speakeasy-sdk/python 0.3.2 2.604.2 0.0.1 compass_api_sdk"
9
+ __user_agent__: str = "speakeasy-sdk/python 0.3.4 2.604.2 0.0.1 compass_api_sdk"
10
10
 
11
11
  try:
12
12
  if __package__ is not None:
compassapisdk/aave_v3.py CHANGED
@@ -8,6 +8,418 @@ from typing import Any, Mapping, Optional, Union
8
8
 
9
9
 
10
10
  class AaveV3(BaseSDK):
11
+ def std_rate(
12
+ self,
13
+ *,
14
+ chain: models.AaveStdRateChain = models.AaveStdRateChain.ETHEREUM_MAINNET,
15
+ token: models.AaveStdRateToken = models.AaveStdRateToken.USDC,
16
+ days: int = 7,
17
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
18
+ server_url: Optional[str] = None,
19
+ timeout_ms: Optional[int] = None,
20
+ http_headers: Optional[Mapping[str, str]] = None,
21
+ ) -> models.AaveSTDRateResponse:
22
+ r"""Standard deviation of interest rates
23
+
24
+ Returns the standard deviation of Interest Rates for Aave Reserves over time:
25
+
26
+ :param chain: The chain to use.
27
+ :param token: The symbol of the asset to fetch the user's position on..
28
+ :param days: The number of days to fetch the user's position on.
29
+ :param retries: Override the default retry configuration for this method
30
+ :param server_url: Override the default server URL for this method
31
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
32
+ :param http_headers: Additional headers to set or replace on requests.
33
+ """
34
+ base_url = None
35
+ url_variables = None
36
+ if timeout_ms is None:
37
+ timeout_ms = self.sdk_configuration.timeout_ms
38
+
39
+ if server_url is not None:
40
+ base_url = server_url
41
+ else:
42
+ base_url = self._get_url(base_url, url_variables)
43
+
44
+ request = models.AaveStdRateRequest(
45
+ chain=chain,
46
+ token=token,
47
+ days=days,
48
+ )
49
+
50
+ req = self._build_request(
51
+ method="GET",
52
+ path="/v0/aave/std_rate/get",
53
+ base_url=base_url,
54
+ url_variables=url_variables,
55
+ request=request,
56
+ request_body_required=False,
57
+ request_has_path_params=False,
58
+ request_has_query_params=True,
59
+ user_agent_header="user-agent",
60
+ accept_header_value="application/json",
61
+ http_headers=http_headers,
62
+ security=self.sdk_configuration.security,
63
+ timeout_ms=timeout_ms,
64
+ )
65
+
66
+ if retries == UNSET:
67
+ if self.sdk_configuration.retry_config is not UNSET:
68
+ retries = self.sdk_configuration.retry_config
69
+
70
+ retry_config = None
71
+ if isinstance(retries, utils.RetryConfig):
72
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
73
+
74
+ http_res = self.do_request(
75
+ hook_ctx=HookContext(
76
+ base_url=base_url or "",
77
+ operation_id="aave_std_rate",
78
+ oauth2_scopes=[],
79
+ security_source=self.sdk_configuration.security,
80
+ ),
81
+ request=req,
82
+ error_status_codes=["422", "4XX", "5XX"],
83
+ retry_config=retry_config,
84
+ )
85
+
86
+ response_data: Any = None
87
+ if utils.match_response(http_res, "200", "application/json"):
88
+ return utils.unmarshal_json(http_res.text, models.AaveSTDRateResponse)
89
+ if utils.match_response(http_res, "422", "application/json"):
90
+ response_data = utils.unmarshal_json(
91
+ http_res.text, errors.HTTPValidationErrorData
92
+ )
93
+ raise errors.HTTPValidationError(data=response_data)
94
+ if utils.match_response(http_res, "4XX", "*"):
95
+ http_res_text = utils.stream_to_text(http_res)
96
+ raise errors.APIError(
97
+ "API error occurred", http_res.status_code, http_res_text, http_res
98
+ )
99
+ if utils.match_response(http_res, "5XX", "*"):
100
+ http_res_text = utils.stream_to_text(http_res)
101
+ raise errors.APIError(
102
+ "API error occurred", http_res.status_code, http_res_text, http_res
103
+ )
104
+
105
+ content_type = http_res.headers.get("Content-Type")
106
+ http_res_text = utils.stream_to_text(http_res)
107
+ raise errors.APIError(
108
+ f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
109
+ http_res.status_code,
110
+ http_res_text,
111
+ http_res,
112
+ )
113
+
114
+ async def std_rate_async(
115
+ self,
116
+ *,
117
+ chain: models.AaveStdRateChain = models.AaveStdRateChain.ETHEREUM_MAINNET,
118
+ token: models.AaveStdRateToken = models.AaveStdRateToken.USDC,
119
+ days: int = 7,
120
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
121
+ server_url: Optional[str] = None,
122
+ timeout_ms: Optional[int] = None,
123
+ http_headers: Optional[Mapping[str, str]] = None,
124
+ ) -> models.AaveSTDRateResponse:
125
+ r"""Standard deviation of interest rates
126
+
127
+ Returns the standard deviation of Interest Rates for Aave Reserves over time:
128
+
129
+ :param chain: The chain to use.
130
+ :param token: The symbol of the asset to fetch the user's position on..
131
+ :param days: The number of days to fetch the user's position on.
132
+ :param retries: Override the default retry configuration for this method
133
+ :param server_url: Override the default server URL for this method
134
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
135
+ :param http_headers: Additional headers to set or replace on requests.
136
+ """
137
+ base_url = None
138
+ url_variables = None
139
+ if timeout_ms is None:
140
+ timeout_ms = self.sdk_configuration.timeout_ms
141
+
142
+ if server_url is not None:
143
+ base_url = server_url
144
+ else:
145
+ base_url = self._get_url(base_url, url_variables)
146
+
147
+ request = models.AaveStdRateRequest(
148
+ chain=chain,
149
+ token=token,
150
+ days=days,
151
+ )
152
+
153
+ req = self._build_request_async(
154
+ method="GET",
155
+ path="/v0/aave/std_rate/get",
156
+ base_url=base_url,
157
+ url_variables=url_variables,
158
+ request=request,
159
+ request_body_required=False,
160
+ request_has_path_params=False,
161
+ request_has_query_params=True,
162
+ user_agent_header="user-agent",
163
+ accept_header_value="application/json",
164
+ http_headers=http_headers,
165
+ security=self.sdk_configuration.security,
166
+ timeout_ms=timeout_ms,
167
+ )
168
+
169
+ if retries == UNSET:
170
+ if self.sdk_configuration.retry_config is not UNSET:
171
+ retries = self.sdk_configuration.retry_config
172
+
173
+ retry_config = None
174
+ if isinstance(retries, utils.RetryConfig):
175
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
176
+
177
+ http_res = await self.do_request_async(
178
+ hook_ctx=HookContext(
179
+ base_url=base_url or "",
180
+ operation_id="aave_std_rate",
181
+ oauth2_scopes=[],
182
+ security_source=self.sdk_configuration.security,
183
+ ),
184
+ request=req,
185
+ error_status_codes=["422", "4XX", "5XX"],
186
+ retry_config=retry_config,
187
+ )
188
+
189
+ response_data: Any = None
190
+ if utils.match_response(http_res, "200", "application/json"):
191
+ return utils.unmarshal_json(http_res.text, models.AaveSTDRateResponse)
192
+ if utils.match_response(http_res, "422", "application/json"):
193
+ response_data = utils.unmarshal_json(
194
+ http_res.text, errors.HTTPValidationErrorData
195
+ )
196
+ raise errors.HTTPValidationError(data=response_data)
197
+ if utils.match_response(http_res, "4XX", "*"):
198
+ http_res_text = await utils.stream_to_text_async(http_res)
199
+ raise errors.APIError(
200
+ "API error occurred", http_res.status_code, http_res_text, http_res
201
+ )
202
+ if utils.match_response(http_res, "5XX", "*"):
203
+ http_res_text = await utils.stream_to_text_async(http_res)
204
+ raise errors.APIError(
205
+ "API error occurred", http_res.status_code, http_res_text, http_res
206
+ )
207
+
208
+ content_type = http_res.headers.get("Content-Type")
209
+ http_res_text = await utils.stream_to_text_async(http_res)
210
+ raise errors.APIError(
211
+ f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
212
+ http_res.status_code,
213
+ http_res_text,
214
+ http_res,
215
+ )
216
+
217
+ def avg_rate(
218
+ self,
219
+ *,
220
+ chain: models.AaveAvgRateChain = models.AaveAvgRateChain.ETHEREUM_MAINNET,
221
+ token: models.AaveAvgRateToken = models.AaveAvgRateToken.USDC,
222
+ days: int = 7,
223
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
224
+ server_url: Optional[str] = None,
225
+ timeout_ms: Optional[int] = None,
226
+ http_headers: Optional[Mapping[str, str]] = None,
227
+ ) -> models.AaveAvgRateResponse:
228
+ r"""Average interest rates
229
+
230
+ Returns time averaged Interest Rates for Aave Reserves:
231
+
232
+ :param chain: The chain to use.
233
+ :param token: The symbol of the asset to fetch the user's position on..
234
+ :param days: The number of days to fetch the user's position on.
235
+ :param retries: Override the default retry configuration for this method
236
+ :param server_url: Override the default server URL for this method
237
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
238
+ :param http_headers: Additional headers to set or replace on requests.
239
+ """
240
+ base_url = None
241
+ url_variables = None
242
+ if timeout_ms is None:
243
+ timeout_ms = self.sdk_configuration.timeout_ms
244
+
245
+ if server_url is not None:
246
+ base_url = server_url
247
+ else:
248
+ base_url = self._get_url(base_url, url_variables)
249
+
250
+ request = models.AaveAvgRateRequest(
251
+ chain=chain,
252
+ token=token,
253
+ days=days,
254
+ )
255
+
256
+ req = self._build_request(
257
+ method="GET",
258
+ path="/v0/aave/avg_rate/get",
259
+ base_url=base_url,
260
+ url_variables=url_variables,
261
+ request=request,
262
+ request_body_required=False,
263
+ request_has_path_params=False,
264
+ request_has_query_params=True,
265
+ user_agent_header="user-agent",
266
+ accept_header_value="application/json",
267
+ http_headers=http_headers,
268
+ security=self.sdk_configuration.security,
269
+ timeout_ms=timeout_ms,
270
+ )
271
+
272
+ if retries == UNSET:
273
+ if self.sdk_configuration.retry_config is not UNSET:
274
+ retries = self.sdk_configuration.retry_config
275
+
276
+ retry_config = None
277
+ if isinstance(retries, utils.RetryConfig):
278
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
279
+
280
+ http_res = self.do_request(
281
+ hook_ctx=HookContext(
282
+ base_url=base_url or "",
283
+ operation_id="aave_avg_rate",
284
+ oauth2_scopes=[],
285
+ security_source=self.sdk_configuration.security,
286
+ ),
287
+ request=req,
288
+ error_status_codes=["422", "4XX", "5XX"],
289
+ retry_config=retry_config,
290
+ )
291
+
292
+ response_data: Any = None
293
+ if utils.match_response(http_res, "200", "application/json"):
294
+ return utils.unmarshal_json(http_res.text, models.AaveAvgRateResponse)
295
+ if utils.match_response(http_res, "422", "application/json"):
296
+ response_data = utils.unmarshal_json(
297
+ http_res.text, errors.HTTPValidationErrorData
298
+ )
299
+ raise errors.HTTPValidationError(data=response_data)
300
+ if utils.match_response(http_res, "4XX", "*"):
301
+ http_res_text = utils.stream_to_text(http_res)
302
+ raise errors.APIError(
303
+ "API error occurred", http_res.status_code, http_res_text, http_res
304
+ )
305
+ if utils.match_response(http_res, "5XX", "*"):
306
+ http_res_text = utils.stream_to_text(http_res)
307
+ raise errors.APIError(
308
+ "API error occurred", http_res.status_code, http_res_text, http_res
309
+ )
310
+
311
+ content_type = http_res.headers.get("Content-Type")
312
+ http_res_text = utils.stream_to_text(http_res)
313
+ raise errors.APIError(
314
+ f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
315
+ http_res.status_code,
316
+ http_res_text,
317
+ http_res,
318
+ )
319
+
320
+ async def avg_rate_async(
321
+ self,
322
+ *,
323
+ chain: models.AaveAvgRateChain = models.AaveAvgRateChain.ETHEREUM_MAINNET,
324
+ token: models.AaveAvgRateToken = models.AaveAvgRateToken.USDC,
325
+ days: int = 7,
326
+ retries: OptionalNullable[utils.RetryConfig] = UNSET,
327
+ server_url: Optional[str] = None,
328
+ timeout_ms: Optional[int] = None,
329
+ http_headers: Optional[Mapping[str, str]] = None,
330
+ ) -> models.AaveAvgRateResponse:
331
+ r"""Average interest rates
332
+
333
+ Returns time averaged Interest Rates for Aave Reserves:
334
+
335
+ :param chain: The chain to use.
336
+ :param token: The symbol of the asset to fetch the user's position on..
337
+ :param days: The number of days to fetch the user's position on.
338
+ :param retries: Override the default retry configuration for this method
339
+ :param server_url: Override the default server URL for this method
340
+ :param timeout_ms: Override the default request timeout configuration for this method in milliseconds
341
+ :param http_headers: Additional headers to set or replace on requests.
342
+ """
343
+ base_url = None
344
+ url_variables = None
345
+ if timeout_ms is None:
346
+ timeout_ms = self.sdk_configuration.timeout_ms
347
+
348
+ if server_url is not None:
349
+ base_url = server_url
350
+ else:
351
+ base_url = self._get_url(base_url, url_variables)
352
+
353
+ request = models.AaveAvgRateRequest(
354
+ chain=chain,
355
+ token=token,
356
+ days=days,
357
+ )
358
+
359
+ req = self._build_request_async(
360
+ method="GET",
361
+ path="/v0/aave/avg_rate/get",
362
+ base_url=base_url,
363
+ url_variables=url_variables,
364
+ request=request,
365
+ request_body_required=False,
366
+ request_has_path_params=False,
367
+ request_has_query_params=True,
368
+ user_agent_header="user-agent",
369
+ accept_header_value="application/json",
370
+ http_headers=http_headers,
371
+ security=self.sdk_configuration.security,
372
+ timeout_ms=timeout_ms,
373
+ )
374
+
375
+ if retries == UNSET:
376
+ if self.sdk_configuration.retry_config is not UNSET:
377
+ retries = self.sdk_configuration.retry_config
378
+
379
+ retry_config = None
380
+ if isinstance(retries, utils.RetryConfig):
381
+ retry_config = (retries, ["429", "500", "502", "503", "504"])
382
+
383
+ http_res = await self.do_request_async(
384
+ hook_ctx=HookContext(
385
+ base_url=base_url or "",
386
+ operation_id="aave_avg_rate",
387
+ oauth2_scopes=[],
388
+ security_source=self.sdk_configuration.security,
389
+ ),
390
+ request=req,
391
+ error_status_codes=["422", "4XX", "5XX"],
392
+ retry_config=retry_config,
393
+ )
394
+
395
+ response_data: Any = None
396
+ if utils.match_response(http_res, "200", "application/json"):
397
+ return utils.unmarshal_json(http_res.text, models.AaveAvgRateResponse)
398
+ if utils.match_response(http_res, "422", "application/json"):
399
+ response_data = utils.unmarshal_json(
400
+ http_res.text, errors.HTTPValidationErrorData
401
+ )
402
+ raise errors.HTTPValidationError(data=response_data)
403
+ if utils.match_response(http_res, "4XX", "*"):
404
+ http_res_text = await utils.stream_to_text_async(http_res)
405
+ raise errors.APIError(
406
+ "API error occurred", http_res.status_code, http_res_text, http_res
407
+ )
408
+ if utils.match_response(http_res, "5XX", "*"):
409
+ http_res_text = await utils.stream_to_text_async(http_res)
410
+ raise errors.APIError(
411
+ "API error occurred", http_res.status_code, http_res_text, http_res
412
+ )
413
+
414
+ content_type = http_res.headers.get("Content-Type")
415
+ http_res_text = await utils.stream_to_text_async(http_res)
416
+ raise errors.APIError(
417
+ f"Unexpected response received (code: {http_res.status_code}, type: {content_type})",
418
+ http_res.status_code,
419
+ http_res_text,
420
+ http_res,
421
+ )
422
+
11
423
  def reserve_overview(
12
424
  self,
13
425
  *,
@@ -1,5 +1,11 @@
1
1
  """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
2
 
3
+ from .aave_avg_rateop import (
4
+ AaveAvgRateChain,
5
+ AaveAvgRateRequest,
6
+ AaveAvgRateRequestTypedDict,
7
+ AaveAvgRateToken,
8
+ )
3
9
  from .aave_historical_transactionsop import (
4
10
  AaveHistoricalTransactionsChain,
5
11
  AaveHistoricalTransactionsRequest,
@@ -23,6 +29,12 @@ from .aave_reserve_overviewop import (
23
29
  AaveReserveOverviewRequestTypedDict,
24
30
  AaveReserveOverviewToken,
25
31
  )
32
+ from .aave_std_rateop import (
33
+ AaveStdRateChain,
34
+ AaveStdRateRequest,
35
+ AaveStdRateRequestTypedDict,
36
+ AaveStdRateToken,
37
+ )
26
38
  from .aave_token_priceop import (
27
39
  AaveTokenPriceChain,
28
40
  AaveTokenPriceRequest,
@@ -40,6 +52,7 @@ from .aave_user_position_summaryop import (
40
52
  AaveUserPositionSummaryRequest,
41
53
  AaveUserPositionSummaryRequestTypedDict,
42
54
  )
55
+ from .aaveavgrateresponse import AaveAvgRateResponse, AaveAvgRateResponseTypedDict
43
56
  from .aaveborrowparams import (
44
57
  AaveBorrowParams,
45
58
  AaveBorrowParamsAmount,
@@ -85,6 +98,7 @@ from .aavereserveoverviewresponse import (
85
98
  AaveReserveOverviewResponse,
86
99
  AaveReserveOverviewResponseTypedDict,
87
100
  )
101
+ from .aavestdrateresponse import AaveSTDRateResponse, AaveSTDRateResponseTypedDict
88
102
  from .aavesupplyparams import (
89
103
  AaveSupplyParams,
90
104
  AaveSupplyParamsAmount,
@@ -727,6 +741,12 @@ from .wrapethrequest import (
727
741
 
728
742
 
729
743
  __all__ = [
744
+ "AaveAvgRateChain",
745
+ "AaveAvgRateRequest",
746
+ "AaveAvgRateRequestTypedDict",
747
+ "AaveAvgRateResponse",
748
+ "AaveAvgRateResponseTypedDict",
749
+ "AaveAvgRateToken",
730
750
  "AaveBorrowParams",
731
751
  "AaveBorrowParamsAmount",
732
752
  "AaveBorrowParamsAmountTypedDict",
@@ -768,6 +788,12 @@ __all__ = [
768
788
  "AaveReserveOverviewResponse",
769
789
  "AaveReserveOverviewResponseTypedDict",
770
790
  "AaveReserveOverviewToken",
791
+ "AaveSTDRateResponse",
792
+ "AaveSTDRateResponseTypedDict",
793
+ "AaveStdRateChain",
794
+ "AaveStdRateRequest",
795
+ "AaveStdRateRequestTypedDict",
796
+ "AaveStdRateToken",
771
797
  "AaveSupplyParams",
772
798
  "AaveSupplyParamsAmount",
773
799
  "AaveSupplyParamsAmountTypedDict",
@@ -0,0 +1,96 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from compassapisdk.types import BaseModel
5
+ from compassapisdk.utils import FieldMetadata, QueryParamMetadata
6
+ from enum import Enum
7
+ from typing_extensions import Annotated, TypedDict
8
+
9
+
10
+ class AaveAvgRateChain(str, Enum):
11
+ r"""The chain to use."""
12
+
13
+ BASE_MAINNET = "base:mainnet"
14
+ ETHEREUM_MAINNET = "ethereum:mainnet"
15
+ ARBITRUM_MAINNET = "arbitrum:mainnet"
16
+
17
+
18
+ class AaveAvgRateToken(str, Enum):
19
+ r"""A class representing the token.
20
+
21
+ This class is used to represent the token in the system. Notice individual
22
+ endpoints' documentation where per chain tokens are presented.
23
+ """
24
+
25
+ ONE_INCH = "1INCH"
26
+ AAVE = "AAVE"
27
+ BAL = "BAL"
28
+ CB_BTC = "cbBTC"
29
+ CB_ETH = "cbETH"
30
+ CRV = "CRV"
31
+ CRV_USD = "crvUSD"
32
+ DAI = "DAI"
33
+ ENS = "ENS"
34
+ ET_HX = "ETHx"
35
+ FRAX = "FRAX"
36
+ FXS = "FXS"
37
+ GHO = "GHO"
38
+ KNC = "KNC"
39
+ LDO = "LDO"
40
+ LINK = "LINK"
41
+ LUSD = "LUSD"
42
+ MKR = "MKR"
43
+ OS_ETH = "osETH"
44
+ PYUSD = "PYUSD"
45
+ R_ETH = "rETH"
46
+ RPL = "RPL"
47
+ RS_ETH = "rsETH"
48
+ S_DAI = "sDAI"
49
+ SNX = "SNX"
50
+ STG = "STG"
51
+ S_US_DE = "sUSDe"
52
+ T_BTC = "tBTC"
53
+ UNI = "UNI"
54
+ USDC = "USDC"
55
+ US_DE = "USDe"
56
+ USDS = "USDS"
57
+ USDT = "USDT"
58
+ WBTC = "WBTC"
59
+ WE_ETH = "weETH"
60
+ WETH = "WETH"
61
+ WST_ETH = "wstETH"
62
+ ARB = "ARB"
63
+ EURS = "EURS"
64
+ MAI = "MAI"
65
+ USD_CE = "USDCe"
66
+ AERO = "AERO"
67
+ EUR = "EUR"
68
+ VIRTUAL = "VIRTUAL"
69
+
70
+
71
+ class AaveAvgRateRequestTypedDict(TypedDict):
72
+ chain: AaveAvgRateChain
73
+ r"""The chain to use."""
74
+ token: AaveAvgRateToken
75
+ r"""The symbol of the asset to fetch the user's position on.."""
76
+ days: int
77
+ r"""The number of days to fetch the user's position on."""
78
+
79
+
80
+ class AaveAvgRateRequest(BaseModel):
81
+ chain: Annotated[
82
+ AaveAvgRateChain,
83
+ FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
84
+ ] = AaveAvgRateChain.ETHEREUM_MAINNET
85
+ r"""The chain to use."""
86
+
87
+ token: Annotated[
88
+ AaveAvgRateToken,
89
+ FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
90
+ ] = AaveAvgRateToken.USDC
91
+ r"""The symbol of the asset to fetch the user's position on.."""
92
+
93
+ days: Annotated[
94
+ int, FieldMetadata(query=QueryParamMetadata(style="form", explode=True))
95
+ ] = 7
96
+ r"""The number of days to fetch the user's position on."""
@@ -0,0 +1,96 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from compassapisdk.types import BaseModel
5
+ from compassapisdk.utils import FieldMetadata, QueryParamMetadata
6
+ from enum import Enum
7
+ from typing_extensions import Annotated, TypedDict
8
+
9
+
10
+ class AaveStdRateChain(str, Enum):
11
+ r"""The chain to use."""
12
+
13
+ BASE_MAINNET = "base:mainnet"
14
+ ETHEREUM_MAINNET = "ethereum:mainnet"
15
+ ARBITRUM_MAINNET = "arbitrum:mainnet"
16
+
17
+
18
+ class AaveStdRateToken(str, Enum):
19
+ r"""A class representing the token.
20
+
21
+ This class is used to represent the token in the system. Notice individual
22
+ endpoints' documentation where per chain tokens are presented.
23
+ """
24
+
25
+ ONE_INCH = "1INCH"
26
+ AAVE = "AAVE"
27
+ BAL = "BAL"
28
+ CB_BTC = "cbBTC"
29
+ CB_ETH = "cbETH"
30
+ CRV = "CRV"
31
+ CRV_USD = "crvUSD"
32
+ DAI = "DAI"
33
+ ENS = "ENS"
34
+ ET_HX = "ETHx"
35
+ FRAX = "FRAX"
36
+ FXS = "FXS"
37
+ GHO = "GHO"
38
+ KNC = "KNC"
39
+ LDO = "LDO"
40
+ LINK = "LINK"
41
+ LUSD = "LUSD"
42
+ MKR = "MKR"
43
+ OS_ETH = "osETH"
44
+ PYUSD = "PYUSD"
45
+ R_ETH = "rETH"
46
+ RPL = "RPL"
47
+ RS_ETH = "rsETH"
48
+ S_DAI = "sDAI"
49
+ SNX = "SNX"
50
+ STG = "STG"
51
+ S_US_DE = "sUSDe"
52
+ T_BTC = "tBTC"
53
+ UNI = "UNI"
54
+ USDC = "USDC"
55
+ US_DE = "USDe"
56
+ USDS = "USDS"
57
+ USDT = "USDT"
58
+ WBTC = "WBTC"
59
+ WE_ETH = "weETH"
60
+ WETH = "WETH"
61
+ WST_ETH = "wstETH"
62
+ ARB = "ARB"
63
+ EURS = "EURS"
64
+ MAI = "MAI"
65
+ USD_CE = "USDCe"
66
+ AERO = "AERO"
67
+ EUR = "EUR"
68
+ VIRTUAL = "VIRTUAL"
69
+
70
+
71
+ class AaveStdRateRequestTypedDict(TypedDict):
72
+ chain: AaveStdRateChain
73
+ r"""The chain to use."""
74
+ token: AaveStdRateToken
75
+ r"""The symbol of the asset to fetch the user's position on.."""
76
+ days: int
77
+ r"""The number of days to fetch the user's position on."""
78
+
79
+
80
+ class AaveStdRateRequest(BaseModel):
81
+ chain: Annotated[
82
+ AaveStdRateChain,
83
+ FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
84
+ ] = AaveStdRateChain.ETHEREUM_MAINNET
85
+ r"""The chain to use."""
86
+
87
+ token: Annotated[
88
+ AaveStdRateToken,
89
+ FieldMetadata(query=QueryParamMetadata(style="form", explode=True)),
90
+ ] = AaveStdRateToken.USDC
91
+ r"""The symbol of the asset to fetch the user's position on.."""
92
+
93
+ days: Annotated[
94
+ int, FieldMetadata(query=QueryParamMetadata(style="form", explode=True))
95
+ ] = 7
96
+ r"""The number of days to fetch the user's position on."""
@@ -0,0 +1,40 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from compassapisdk.types import BaseModel
5
+ from typing_extensions import TypedDict
6
+
7
+
8
+ class AaveAvgRateResponseTypedDict(TypedDict):
9
+ supply_apy_variable_rate: float
10
+ r"""Mean of the variable rate APY for deposits."""
11
+ supply_apr_variable_rate: float
12
+ r"""Mean of the variable rate APR for deposits."""
13
+ borrow_apy_variable_rate: float
14
+ r"""Mean of the variable rate APY for loans."""
15
+ borrow_apr_variable_rate: float
16
+ r"""Mean of the variable rate APR for loans."""
17
+ borrow_apy_fixed_rate: float
18
+ r"""Mean of the fixed rate APY for loans."""
19
+ borrow_apr_fixed_rate: float
20
+ r"""Mean of the fixed rate APR for loans."""
21
+
22
+
23
+ class AaveAvgRateResponse(BaseModel):
24
+ supply_apy_variable_rate: float
25
+ r"""Mean of the variable rate APY for deposits."""
26
+
27
+ supply_apr_variable_rate: float
28
+ r"""Mean of the variable rate APR for deposits."""
29
+
30
+ borrow_apy_variable_rate: float
31
+ r"""Mean of the variable rate APY for loans."""
32
+
33
+ borrow_apr_variable_rate: float
34
+ r"""Mean of the variable rate APR for loans."""
35
+
36
+ borrow_apy_fixed_rate: float
37
+ r"""Mean of the fixed rate APY for loans."""
38
+
39
+ borrow_apr_fixed_rate: float
40
+ r"""Mean of the fixed rate APR for loans."""
@@ -0,0 +1,40 @@
1
+ """Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
2
+
3
+ from __future__ import annotations
4
+ from compassapisdk.types import BaseModel
5
+ from typing_extensions import TypedDict
6
+
7
+
8
+ class AaveSTDRateResponseTypedDict(TypedDict):
9
+ supply_apy_variable_rate: float
10
+ r"""Standard deviation of the variable rate APY for deposits."""
11
+ supply_apr_variable_rate: float
12
+ r"""Standard deviation of the variable rate APR for deposits."""
13
+ borrow_apy_variable_rate: float
14
+ r"""Standard deviation of the variable rate APY for loans."""
15
+ borrow_apr_variable_rate: float
16
+ r"""Standard deviation of the variable rate APR for loans."""
17
+ borrow_apy_fixed_rate: float
18
+ r"""Standard deviation of the fixed rate APY for loans."""
19
+ borrow_apr_fixed_rate: float
20
+ r"""Standard deviation of the fixed rate APR for loans."""
21
+
22
+
23
+ class AaveSTDRateResponse(BaseModel):
24
+ supply_apy_variable_rate: float
25
+ r"""Standard deviation of the variable rate APY for deposits."""
26
+
27
+ supply_apr_variable_rate: float
28
+ r"""Standard deviation of the variable rate APR for deposits."""
29
+
30
+ borrow_apy_variable_rate: float
31
+ r"""Standard deviation of the variable rate APY for loans."""
32
+
33
+ borrow_apr_variable_rate: float
34
+ r"""Standard deviation of the variable rate APR for loans."""
35
+
36
+ borrow_apy_fixed_rate: float
37
+ r"""Standard deviation of the fixed rate APY for loans."""
38
+
39
+ borrow_apr_fixed_rate: float
40
+ r"""Standard deviation of the fixed rate APR for loans."""