Tastytrade

Latest version: v9.11

Safety actively analyzes 722491 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 8

9.11

What's Changed
* added refresh_interval to subscribe method by CosmicTrader in https://github.com/tastyware/tastytrade/pull/221

Frequency of streamed events can now be changed on a per-event basis:
python
await streamer.subscribe(Quote, ['AAPL', 'MSFT'], refresh_interval=0.5)

* added a new session, `OAuthSession`, for users who have been granted Tastytrade OAuth access

python
from tastytrade.session import OAuthSession
session = OAuthSession('provider_secret', 'refresh_token')

This session can be used in most of the same places as a normal session, allowing you to manage connected user accounts.
* fixes bug in 222 due to tastytrade changing their account streamer API

New Contributors
* CosmicTrader made their first contribution in https://github.com/tastyware/tastytrade/pull/221

**Full Changelog**: https://github.com/tastyware/tastytrade/compare/v9.10...v9.11

9.10

What's Changed
* Feature/market sessions by JBlohm in https://github.com/tastyware/tastytrade/pull/215

Adds a new module, `market_sessions` to the SDK which implements the new API endpoints used for checking exchange status and market calendars. This is an alternative to some of the utility functions in `tastytrade.utils` which uses Tastytrade endpoints. Check out the new docs page [here](https://tastyworks-api.readthedocs.io/en/latest/market-sessions.html)!

* add proxies by Graeme22 in https://github.com/tastyware/tastytrade/pull/216

This adds a new optional parameter, `proxy`, to the `Session` class to proxy all requests through a proxy server. Proxies will also apply to all web socket connections (so `DXLinkStreamer` and `AlertStreamer`) created with that session.
python
session = Session('username', 'password', proxy="http://user:pass127.0.0.1:8080")
accounts = Account.get_accounts(session) proxied!
async with DXLinkStreamer(session) as streamer: proxied!
...


* sessions now have a context manager, which can be used like this:
python
with Session('username', 'password') as session:
...

which is equivalent to:
python
session = Session('username', 'password')
session.destroy()


**Full Changelog**: https://github.com/tastyware/tastytrade/compare/v9.9...v9.10

9.9

What's Changed
* Added missing: `used_derivative_buying_power` data field by JBlohm in https://github.com/tastyware/tastytrade/pull/210. This allows you to calculate buying power usage in the same way Tasty does it. This can be accessed as `AccountBalance.used_derivative_buying_power` and `AccountBalanceSnapshot.used_derivative_buying_power`.
* add streamer refresh interval by Graeme22 in https://github.com/tastyware/tastytrade/pull/212, many thanks to bonkzwonil for opening #211!
Previously, the dubiously named "acceptAggregationPeriod" parameter to newly created DXLink channels was hardcoded to 10 seconds. This resulted in events like Quote being updated only once every 10 seconds, a far cry from live streaming! Now this value is adjustable as a new parameter to `DXLinkStreamer`, but it defaults to 0.1 which should be close to live for most use cases.

Example usage:
python
streamer = await DXLinkStreamer(session, refresh_interval=5)

Since the new default is 0.1, most users should immediately see a benefit without making any changes at all.

New Contributors
* JBlohm made their first contribution in https://github.com/tastyware/tastytrade/pull/210

**Full Changelog**: https://github.com/tastyware/tastytrade/compare/v9.8...v9.9

9.8

What's Changed
* notional orders support by Graeme22 in https://github.com/tastyware/tastytrade/pull/207, thanks to vadimtk for opening #206 and noticing this issue!
You can now place notional market orders like so:
python
symbol = Equity.get_equity(session, 'AAPL')
order = NewOrder(
time_in_force=OrderTimeInForce.DAY,
order_type=OrderType.NOTIONAL_MARKET,
value=Decimal(-10), $10 debit, this will result in fractional shares
legs=[
symbol.build_leg(None, OrderAction.BUY_TO_OPEN),
]
)
resp = account.place_order(session, order, dry_run=False)

* Streamer shutdown bug fixed in 7928e9b, see 194, 205. Thanks to militantwalrus for helping identify the issue!
* Add note about using is_test and remember_token for additional sessions by danstever in https://github.com/tastyware/tastytrade/pull/203
* order source field is now present for placed orders, detected by salamad in 204
* unit tests are now fully annotated for type safety
* renames three internal utility functions, `_set_sign_for`, `_get_sign`, and `_validate_response` to not use a leading underscore in utils.py, since they are used in various modules.

New Contributors
* danstever made their first contribution in https://github.com/tastyware/tastytrade/pull/203

**Full Changelog**: https://github.com/tastyware/tastytrade/compare/v9.7...v9.8

9.7

What's Changed
* [BREAKING] Update instruments.py by Quenos in https://github.com/tastyware/tastytrade/pull/192
This PR changes the signature of the `NestedOptionChain.get_chain` (and `NestedOptionChain.a_get_chain`) functions. Certain symbols, like VIX and SPX, may have more than one root symbol (eg SPX and SPXW), which are parsed as different chains in the API. Previously, some of that data was being thrown away, but now these functions return `list[NestedOptionChain]` instead of a single `NestedOptionChain`.

* add serialization for sessions by Graeme22 in https://github.com/tastyware/tastytrade/pull/197
This PR adds new functions to the `tastytrade.Session` class, `serialize` and `deserialize`, which allow for safely and easily storing sessions for later use. Example usage:
python
session = Session('username', 'password')
...
data = session.serialize()
redis.set("session", data)
...
session = Session.deserialize(redis.get("session"))


**Full Changelog**: https://github.com/tastyware/tastytrade/compare/v9.6...v9.7

9.6

What's Changed
Tiny release to make sure the `Account` class keeps working for everybody!

* Fix the wrong usage in the example by steven5538 in https://github.com/tastyware/tastytrade/pull/189
* Gives the field `Account.is_test_drive` a default value of `False` as it may not always be present

New Contributors
* steven5538 made their first contribution in https://github.com/tastyware/tastytrade/pull/189

**Full Changelog**: https://github.com/tastyware/tastytrade/compare/v9.5...v9.6

Page 1 of 8

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.