tastytrade 11.0.0__tar.gz → 11.0.2__tar.gz
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.
- {tastytrade-11.0.0 → tastytrade-11.0.2}/PKG-INFO +1 -1
- {tastytrade-11.0.0 → tastytrade-11.0.2}/docs/orders.rst +3 -3
- {tastytrade-11.0.0 → tastytrade-11.0.2}/tastytrade/__init__.py +2 -2
- {tastytrade-11.0.0 → tastytrade-11.0.2}/tastytrade/metrics.py +13 -3
- {tastytrade-11.0.0 → tastytrade-11.0.2}/tastytrade/utils.py +6 -2
- {tastytrade-11.0.0 → tastytrade-11.0.2}/.github/CONTRIBUTING.md +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/.github/FUNDING.yml +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/.github/pull_request_template.md +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/.github/workflows/python-app.yml +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/.github/workflows/python-publish-test.yml +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/.github/workflows/python-publish.yml +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/.gitignore +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/.python-version +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/.readthedocs.yaml +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/LICENSE +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/Makefile +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/README.md +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/docs/Makefile +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/docs/account-streamer.rst +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/docs/accounts.rst +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/docs/api/account.rst +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/docs/api/dxfeed.rst +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/docs/api/instruments.rst +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/docs/api/market-data.rst +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/docs/api/market-sessions.rst +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/docs/api/metrics.rst +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/docs/api/order.rst +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/docs/api/search.rst +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/docs/api/session.rst +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/docs/api/streamer.rst +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/docs/api/utils.rst +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/docs/api/watchlists.rst +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/docs/conf.py +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/docs/data-streamer.rst +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/docs/img/netliq.png +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/docs/index.rst +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/docs/installation.rst +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/docs/instruments.rst +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/docs/make.bat +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/docs/market-data.rst +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/docs/market-sessions.rst +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/docs/sessions.rst +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/docs/sync-async.rst +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/docs/watchlists.rst +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/pyproject.toml +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/tastytrade/account.py +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/tastytrade/dxfeed/__init__.py +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/tastytrade/dxfeed/candle.py +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/tastytrade/dxfeed/event.py +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/tastytrade/dxfeed/greeks.py +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/tastytrade/dxfeed/profile.py +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/tastytrade/dxfeed/quote.py +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/tastytrade/dxfeed/summary.py +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/tastytrade/dxfeed/theoprice.py +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/tastytrade/dxfeed/timeandsale.py +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/tastytrade/dxfeed/trade.py +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/tastytrade/dxfeed/underlying.py +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/tastytrade/instruments.py +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/tastytrade/market_data.py +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/tastytrade/market_sessions.py +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/tastytrade/oauth.py +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/tastytrade/order.py +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/tastytrade/py.typed +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/tastytrade/search.py +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/tastytrade/session.py +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/tastytrade/streamer.py +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/tastytrade/watchlists.py +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/tests/__init__.py +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/tests/conftest.py +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/tests/test_account.py +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/tests/test_dxfeed.py +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/tests/test_instruments.py +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/tests/test_market_data.py +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/tests/test_market_sessions.py +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/tests/test_metrics.py +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/tests/test_search.py +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/tests/test_session.py +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/tests/test_streamer.py +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/tests/test_utils.py +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/tests/test_watchlists.py +0 -0
- {tastytrade-11.0.0 → tastytrade-11.0.2}/uv.lock +0 -0
|
@@ -146,10 +146,10 @@ Notional orders are slightly different from normal orders. Since the market will
|
|
|
146
146
|
)
|
|
147
147
|
resp = account.place_order(session, order, dry_run=False)
|
|
148
148
|
|
|
149
|
-
Cryptocurrency orders
|
|
150
|
-
|
|
149
|
+
Cryptocurrency market orders
|
|
150
|
+
----------------------------
|
|
151
151
|
|
|
152
|
-
Cryptocurrency orders should use the special ``IOC`` TIF:
|
|
152
|
+
Cryptocurrency market orders should use the special ``IOC`` TIF:
|
|
153
153
|
|
|
154
154
|
.. code-block:: python
|
|
155
155
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import logging
|
|
2
2
|
|
|
3
3
|
API_URL = "https://api.tastyworks.com"
|
|
4
|
-
API_VERSION = "
|
|
4
|
+
API_VERSION = "20251101"
|
|
5
5
|
CERT_URL = "https://api.cert.tastyworks.com"
|
|
6
6
|
VAST_URL = "https://vast.tastyworks.com"
|
|
7
|
-
VERSION = "11.0.
|
|
7
|
+
VERSION = "11.0.2"
|
|
8
8
|
|
|
9
9
|
__version__ = VERSION
|
|
10
10
|
version_str: str = f"tastyware/tastytrade:v{VERSION}"
|
|
@@ -2,7 +2,7 @@ from datetime import date, datetime
|
|
|
2
2
|
from decimal import Decimal
|
|
3
3
|
|
|
4
4
|
from tastytrade.session import Session
|
|
5
|
-
from tastytrade.utils import TastytradeData
|
|
5
|
+
from tastytrade.utils import TastytradeData, validate_and_parse
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
class DividendInfo(TastytradeData):
|
|
@@ -206,7 +206,12 @@ async def a_get_risk_free_rate(session: Session) -> Decimal:
|
|
|
206
206
|
|
|
207
207
|
:param session: active user session to use
|
|
208
208
|
"""
|
|
209
|
-
|
|
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)
|
|
210
215
|
return Decimal(data["risk-free-rate"])
|
|
211
216
|
|
|
212
217
|
|
|
@@ -216,5 +221,10 @@ def get_risk_free_rate(session: Session) -> Decimal:
|
|
|
216
221
|
|
|
217
222
|
:param session: active user session to use
|
|
218
223
|
"""
|
|
219
|
-
|
|
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)
|
|
220
230
|
return Decimal(data["risk-free-rate"])
|
|
@@ -344,9 +344,11 @@ def paginate(
|
|
|
344
344
|
json = response.json()
|
|
345
345
|
res.extend([model(**i) for i in json["data"]["items"]])
|
|
346
346
|
# handle pagination
|
|
347
|
+
pagination = json.get("pagination")
|
|
347
348
|
if (
|
|
348
|
-
|
|
349
|
+
not pagination
|
|
349
350
|
or not paginate
|
|
351
|
+
or pagination["page-offset"] >= pagination["total-pages"] - 1
|
|
350
352
|
):
|
|
351
353
|
break
|
|
352
354
|
params["page-offset"] += 1
|
|
@@ -382,9 +384,11 @@ async def a_paginate(
|
|
|
382
384
|
json = response.json()
|
|
383
385
|
res.extend([model(**i) for i in json["data"]["items"]])
|
|
384
386
|
# handle pagination
|
|
387
|
+
pagination = json.get("pagination")
|
|
385
388
|
if (
|
|
386
|
-
|
|
389
|
+
not pagination
|
|
387
390
|
or not paginate
|
|
391
|
+
or pagination["page-offset"] >= pagination["total-pages"] - 1
|
|
388
392
|
):
|
|
389
393
|
break
|
|
390
394
|
params["page-offset"] += 1
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|