Skip to content

Commit c33adc9

Browse files
committed
update risk free rate API
1 parent 7e5bd0d commit c33adc9

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

tastytrade/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import logging
22

33
API_URL = "https://api.tastyworks.com"
4-
API_VERSION = "20251026"
4+
API_VERSION = "20251101"
55
CERT_URL = "https://api.cert.tastyworks.com"
66
VAST_URL = "https://vast.tastyworks.com"
7-
VERSION = "11.0.1"
7+
VERSION = "11.0.2"
88

99
__version__ = VERSION
1010
version_str: str = f"tastyware/tastytrade:v{VERSION}"

tastytrade/metrics.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from decimal import Decimal
33

44
from tastytrade.session import Session
5-
from tastytrade.utils import TastytradeData
5+
from tastytrade.utils import TastytradeData, validate_and_parse
66

77

88
class DividendInfo(TastytradeData):
@@ -206,7 +206,12 @@ async def a_get_risk_free_rate(session: Session) -> Decimal:
206206
207207
:param session: active user session to use
208208
"""
209-
data = await session._a_get("/margin-requirements-public-configuration")
209+
request = session.async_client.build_request(
210+
"GET", "/margin-requirements-public-configuration", timeout=30
211+
)
212+
del request.headers["Authorization"]
213+
response = await session.async_client.send(request)
214+
data = validate_and_parse(response)
210215
return Decimal(data["risk-free-rate"])
211216

212217

@@ -216,5 +221,10 @@ def get_risk_free_rate(session: Session) -> Decimal:
216221
217222
:param session: active user session to use
218223
"""
219-
data = session._get("/margin-requirements-public-configuration")
224+
request = session.sync_client.build_request(
225+
"GET", "/margin-requirements-public-configuration", timeout=30
226+
)
227+
del request.headers["Authorization"]
228+
response = session.sync_client.send(request)
229+
data = validate_and_parse(response)
220230
return Decimal(data["risk-free-rate"])

0 commit comments

Comments
 (0)