tastytrade.account¶
-
pydantic model tastytrade.account.Account(*, account_number: str, opened_at: datetime, nickname: str, account_type_name: str, is_closed: bool, day_trader_status: str | bool, is_firm_error: bool, is_firm_proprietary: bool, is_futures_approved: bool, is_test_drive: bool =
False, margin_or_cash: str, is_foreign: bool, created_at: datetime, external_id: str | None =None, closed_at: str | None =None, funding_date: date | None =None, investment_objective: str | None =None, liquidity_needs: str | None =None, risk_tolerance: str | None =None, investment_time_horizon: str | None =None, futures_account_purpose: str | None =None, external_fdid: str | None =None, suitable_options_level: str | None =None, submitting_user_id: str | None =None)¶ Bases:
TastytradeDataDataclass that represents a Tastytrade account object, containing methods for retrieving information about the account, placing orders, and retrieving past transactions.
Show JSON schema
{ "title": "Account", "description": "Dataclass that represents a Tastytrade account object, containing\nmethods for retrieving information about the account, placing orders,\nand retrieving past transactions.", "type": "object", "properties": { "account-number": { "title": "Account-Number", "type": "string" }, "opened-at": { "format": "date-time", "title": "Opened-At", "type": "string" }, "nickname": { "title": "Nickname", "type": "string" }, "account-type-name": { "title": "Account-Type-Name", "type": "string" }, "is-closed": { "title": "Is-Closed", "type": "boolean" }, "day-trader-status": { "anyOf": [ { "type": "string" }, { "type": "boolean" } ], "title": "Day-Trader-Status" }, "is-firm-error": { "title": "Is-Firm-Error", "type": "boolean" }, "is-firm-proprietary": { "title": "Is-Firm-Proprietary", "type": "boolean" }, "is-futures-approved": { "title": "Is-Futures-Approved", "type": "boolean" }, "is-test-drive": { "default": false, "title": "Is-Test-Drive", "type": "boolean" }, "margin-or-cash": { "title": "Margin-Or-Cash", "type": "string" }, "is-foreign": { "title": "Is-Foreign", "type": "boolean" }, "created-at": { "format": "date-time", "title": "Created-At", "type": "string" }, "external-id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "External-Id" }, "closed-at": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Closed-At" }, "funding-date": { "anyOf": [ { "format": "date", "type": "string" }, { "type": "null" } ], "default": null, "title": "Funding-Date" }, "investment-objective": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Investment-Objective" }, "liquidity-needs": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Liquidity-Needs" }, "risk-tolerance": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Risk-Tolerance" }, "investment-time-horizon": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Investment-Time-Horizon" }, "futures-account-purpose": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Futures-Account-Purpose" }, "external-fdid": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "External-Fdid" }, "suitable-options-level": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Suitable-Options-Level" }, "submitting-user-id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Submitting-User-Id" } }, "required": [ "account-number", "opened-at", "nickname", "account-type-name", "is-closed", "day-trader-status", "is-firm-error", "is-firm-proprietary", "is-futures-approved", "margin-or-cash", "is-foreign", "created-at" ] }- Fields:¶
-
async classmethod get(session: Session, *, include_closed: bool =
False) list[Self]¶ - async classmethod get(session: Session, account_number: str) Self
Gets all trading accounts associated with the Tastytrade user, or a specific one if given an account ID.
-
async get_balance_snapshots(session: Session, per_page: int =
250, page_offset: int | None =0, currency: str ='USD', end_date: date | None =None, start_date: date | None =None, snapshot_date: date | None =None, time_of_day: 'BOD' | 'EOD' ='EOD') list[AccountBalanceSnapshot]¶ Returns a list of balance snapshots. This list will just have a few snapshots if you don’t pass a start date; otherwise, it will be each day’s balances in the given range.
- Parameters:¶
- session: Session¶
the session to use for the request.
- per_page: int =
250¶ the number of results to return per page.
- page_offset: int | None =
0¶ provide a specific page to get; if None, get all pages
- currency: str =
'USD'¶ the currency to show balances in.
- start_date: date | None =
None¶ the starting date of the range.
- end_date: date | None =
None¶ the ending date of the range.
- snapshot_date: date | None =
None¶ the date of the snapshot to get.
- time_of_day: 'BOD' | 'EOD' =
'EOD'¶ the time of day of the snapshots to get, either ‘EOD’ (End Of Day) or ‘BOD’ (Beginning Of Day).
-
async get_balances(session: Session, currency: str =
'USD') AccountBalance¶ Get the current balances of the account.
- async get_complex_order(session: Session, order_id: int) PlacedComplexOrder¶
Gets a complex order with the given ID.
-
async get_complex_order_history(session: Session, per_page: int =
50, page_offset: int | None =0) list[PlacedComplexOrder]¶ Get order history of the account.
-
async get_history(session: Session, per_page: int =
250, page_offset: int | None =0, sort: 'Asc' | 'Desc' ='Desc', type: str | None =None, types: Iterable[str] | None =None, sub_types: Iterable[str] | None =None, start_date: date | None =None, end_date: date | None =None, instrument_type: InstrumentType | None =None, symbol: str | None =None, underlying_symbol: str | None =None, action: str | None =None, partition_key: str | None =None, futures_symbol: str | None =None, start_at: datetime | None =None, end_at: datetime | None =None) list[Transaction]¶ Get transaction history of the account.
- Parameters:¶
- session: Session¶
the session to use for the request.
- per_page: int =
250¶ the number of results to return per page.
- page_offset: int | None =
0¶ provide a specific page to get; if None, get all pages
- sort: 'Asc' | 'Desc' =
'Desc'¶ the order to sort results in, either ‘Desc’ or ‘Asc’.
- type: str | None =
None¶ the type of transaction.
- types: Iterable[str] | None =
None¶ a list of transaction types to filter by.
- sub_types: Iterable[str] | None =
None¶ an array of transaction subtypes to filter by.
- start_date: date | None =
None¶ the start date of transactions to query.
- end_date: date | None =
None¶ the end date of transactions to query.
- instrument_type: InstrumentType | None =
None¶ the type of instrument.
- symbol: str | None =
None¶ a single symbol.
- underlying_symbol: str | None =
None¶ the underlying symbol.
- action: str | None =
None¶ the action of the transaction: ‘Sell to Open’, ‘Sell to Close’, ‘Buy to Open’, ‘Buy to Close’, ‘Sell’ or ‘Buy’.
- partition_key: str | None =
None¶ account partition key.
- futures_symbol: str | None =
None¶ the full TW Future Symbol, e.g. /ESZ9, /NGZ19.
- start_at: datetime | None =
None¶ datetime start range for filtering transactions in full date-time.
- end_at: datetime | None =
None¶ datetime end range for filtering transactions in full date-time.
- async get_live_complex_orders(session: Session) list[PlacedComplexOrder]¶
Get complex orders placed today for the account.
- async get_live_orders(session: Session) list[PlacedOrder]¶
Get orders placed today for the account.
- async get_margin_requirements(session: Session) MarginReport¶
Get the margin report for the account, with total margin requirements as well as a breakdown per symbol/instrument.
-
async get_net_liquidating_value_history(session: Session, time_back: str | None =
None, start_time: datetime | None =None) list[NetLiqOhlc]¶ Returns a list of account net liquidating value snapshots over the specified time period.
- Parameters:¶
- session: Session¶
the session to use for the request, can’t be certification.
- time_back: str | None =
None¶ the time period to get net liquidating value snapshots for. This param is required if start_time is not given. Possible values are: ‘1d’, ‘1m’, ‘3m’, ‘6m’, ‘1y’, ‘all’.
- start_time: datetime | None =
None¶ the start point for the query. This param is required is time-back is not given. If given, will take precedence over time-back.
- async get_order_buying_power_effect(session: Session, order: NewOrder) BuyingPowerEffect¶
Calculate the buying power effect for the given order.
-
async get_order_history(session: Session, per_page: int =
50, page_offset: int | None =0, start_date: date | None =None, end_date: date | None =None, underlying_symbol: str | None =None, statuses: Iterable[OrderStatus] | None =None, futures_symbol: str | None =None, underlying_instrument_type: InstrumentType | None =None, sort: 'Asc' | 'Desc' | None =None, start_at: datetime | None =None, end_at: datetime | None =None) list[PlacedOrder]¶ Get order history of the account.
- Parameters:¶
- session: Session¶
the session to use for the request.
- per_page: int =
50¶ the number of results to return per page.
- page_offset: int | None =
0¶ provide a specific page to get; if None, get all pages
- start_date: date | None =
None¶ the start date of orders to query.
- end_date: date | None =
None¶ the end date of orders to query.
- underlying_symbol: str | None =
None¶ underlying symbol to filter by.
- statuses: Iterable[OrderStatus] | None =
None¶ a list of statuses to filter by.
- futures_symbol: str | None =
None¶ Tastytrade future symbol for futures and future options.
- underlying_instrument_type: InstrumentType | None =
None¶ the type of instrument to filter by
- sort: 'Asc' | 'Desc' | None =
None¶ the order to sort results in, either ‘Desc’ or ‘Asc’.
- start_at: datetime | None =
None¶ datetime start range for filtering transactions in full date-time.
- end_at: datetime | None =
None¶ datetime end range for filtering transactions in full date-time.
-
async get_positions(session: Session, underlying_symbols: Iterable[str] | None =
None, symbol: str | None =None, instrument_type: InstrumentType | None =None, include_closed: bool | None =None, underlying_product_code: str | None =None, partition_keys: Iterable[str] | None =None, net_positions: bool | None =None, include_marks: bool | None =None) list[CurrentPosition]¶ Get the current positions of the account.
- Parameters:¶
- session: Session¶
the session to use for the request.
- underlying_symbols: Iterable[str] | None =
None¶ an array of underlying symbols for positions.
- symbol: str | None =
None¶ a single symbol.
- instrument_type: InstrumentType | None =
None¶ the type of instrument.
- include_closed: bool | None =
None¶ if closed positions should be included in the query.
- underlying_product_code: str | None =
None¶ the underlying future’s product code.
- partition_keys: Iterable[str] | None =
None¶ account partition keys.
- net_positions: bool | None =
None¶ returns net positions grouped by instrument type and symbol.
- include_marks: bool | None =
None¶ include current quote mark (note: can decrease performance).
-
async get_total_fees(session: Session, day: date | None =
None) FeesInfo¶ Get the total fees for a given date.
- async get_trading_status(session: Session) TradingStatus¶
Get the trading status of the account.
-
async place_complex_order(session: Session, order: NewComplexOrder, dry_run: bool =
True) PlacedComplexOrderResponse¶ Place the given order.
-
async place_order(session: Session, order: NewOrder, dry_run: bool =
True) PlacedOrderResponse¶ Place the given order.
- async replace_order(session: Session, old_order_id: int, new_order: NewOrder) PlacedOrder¶
Replace an order with a new order with different characteristics (but same legs).
-
pydantic model tastytrade.account.AccountBalance(*, account_number: str, cash_balance: Decimal, long_equity_value: Decimal, short_equity_value: Decimal, long_derivative_value: Decimal, short_derivative_value: Decimal, long_futures_value: Decimal, short_futures_value: Decimal, long_futures_derivative_value: Decimal, short_futures_derivative_value: Decimal, long_margineable_value: Decimal, short_margineable_value: Decimal, margin_equity: Decimal, equity_buying_power: Decimal, derivative_buying_power: Decimal, day_trading_buying_power: Decimal, futures_margin_requirement: Decimal, available_trading_funds: Decimal, maintenance_requirement: Decimal, maintenance_call_value: Decimal, reg_t_call_value: Decimal, day_trading_call_value: Decimal, day_equity_call_value: Decimal, net_liquidating_value: Decimal, cash_available_to_withdraw: Decimal, day_trade_excess: Decimal, pending_cash: Decimal, long_cryptocurrency_value: Decimal, short_cryptocurrency_value: Decimal, cryptocurrency_margin_requirement: Decimal, unsettled_cryptocurrency_fiat_amount: Decimal, closed_loop_available_balance: Decimal, equity_offering_margin_requirement: Decimal, long_bond_value: Decimal, bond_margin_requirement: Decimal, used_derivative_buying_power: Decimal, snapshot_date: date, reg_t_margin_requirement: Decimal, futures_overnight_margin_requirement: Decimal, futures_intraday_margin_requirement: Decimal, maintenance_excess: Decimal, pending_margin_interest: Decimal, effective_cryptocurrency_buying_power: Decimal, updated_at: datetime, apex_starting_day_margin_equity: Decimal | None =
None, buying_power_adjustment: Decimal | None =None, time_of_day: str | None =None)¶ Bases:
TastytradeDataDataclass containing account balance information.
Show JSON schema
{ "title": "AccountBalance", "description": "Dataclass containing account balance information.", "type": "object", "properties": { "account-number": { "title": "Account-Number", "type": "string" }, "cash-balance": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Cash-Balance" }, "long-equity-value": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Long-Equity-Value" }, "short-equity-value": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Short-Equity-Value" }, "long-derivative-value": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Long-Derivative-Value" }, "short-derivative-value": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Short-Derivative-Value" }, "long-futures-value": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Long-Futures-Value" }, "short-futures-value": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Short-Futures-Value" }, "long-futures-derivative-value": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Long-Futures-Derivative-Value" }, "short-futures-derivative-value": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Short-Futures-Derivative-Value" }, "long-margineable-value": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Long-Margineable-Value" }, "short-margineable-value": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Short-Margineable-Value" }, "margin-equity": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Margin-Equity" }, "equity-buying-power": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Equity-Buying-Power" }, "derivative-buying-power": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Derivative-Buying-Power" }, "day-trading-buying-power": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Day-Trading-Buying-Power" }, "futures-margin-requirement": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Futures-Margin-Requirement" }, "available-trading-funds": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Available-Trading-Funds" }, "maintenance-requirement": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Maintenance-Requirement" }, "maintenance-call-value": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Maintenance-Call-Value" }, "reg-t-call-value": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Reg-T-Call-Value" }, "day-trading-call-value": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Day-Trading-Call-Value" }, "day-equity-call-value": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Day-Equity-Call-Value" }, "net-liquidating-value": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Net-Liquidating-Value" }, "cash-available-to-withdraw": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Cash-Available-To-Withdraw" }, "day-trade-excess": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Day-Trade-Excess" }, "pending-cash": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Pending-Cash" }, "long-cryptocurrency-value": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Long-Cryptocurrency-Value" }, "short-cryptocurrency-value": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Short-Cryptocurrency-Value" }, "cryptocurrency-margin-requirement": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Cryptocurrency-Margin-Requirement" }, "unsettled-cryptocurrency-fiat-amount": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Unsettled-Cryptocurrency-Fiat-Amount" }, "closed-loop-available-balance": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Closed-Loop-Available-Balance" }, "equity-offering-margin-requirement": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Equity-Offering-Margin-Requirement" }, "long-bond-value": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Long-Bond-Value" }, "bond-margin-requirement": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Bond-Margin-Requirement" }, "used-derivative-buying-power": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Used-Derivative-Buying-Power" }, "snapshot-date": { "format": "date", "title": "Snapshot-Date", "type": "string" }, "reg-t-margin-requirement": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Reg-T-Margin-Requirement" }, "futures-overnight-margin-requirement": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Futures-Overnight-Margin-Requirement" }, "futures-intraday-margin-requirement": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Futures-Intraday-Margin-Requirement" }, "maintenance-excess": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Maintenance-Excess" }, "pending-margin-interest": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Pending-Margin-Interest" }, "effective-cryptocurrency-buying-power": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Effective-Cryptocurrency-Buying-Power" }, "updated-at": { "format": "date-time", "title": "Updated-At", "type": "string" }, "apex-starting-day-margin-equity": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" }, { "type": "null" } ], "default": null, "title": "Apex-Starting-Day-Margin-Equity" }, "buying-power-adjustment": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" }, { "type": "null" } ], "default": null, "title": "Buying-Power-Adjustment" }, "time-of-day": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Time-Of-Day" } }, "required": [ "account-number", "cash-balance", "long-equity-value", "short-equity-value", "long-derivative-value", "short-derivative-value", "long-futures-value", "short-futures-value", "long-futures-derivative-value", "short-futures-derivative-value", "long-margineable-value", "short-margineable-value", "margin-equity", "equity-buying-power", "derivative-buying-power", "day-trading-buying-power", "futures-margin-requirement", "available-trading-funds", "maintenance-requirement", "maintenance-call-value", "reg-t-call-value", "day-trading-call-value", "day-equity-call-value", "net-liquidating-value", "cash-available-to-withdraw", "day-trade-excess", "pending-cash", "long-cryptocurrency-value", "short-cryptocurrency-value", "cryptocurrency-margin-requirement", "unsettled-cryptocurrency-fiat-amount", "closed-loop-available-balance", "equity-offering-margin-requirement", "long-bond-value", "bond-margin-requirement", "used-derivative-buying-power", "snapshot-date", "reg-t-margin-requirement", "futures-overnight-margin-requirement", "futures-intraday-margin-requirement", "maintenance-excess", "pending-margin-interest", "effective-cryptocurrency-buying-power", "updated-at" ] }- Fields:¶
- Validators:¶
validate_price_effects»all fields
-
field apex_starting_day_margin_equity : Decimal | None =
None(alias 'apex-starting-day-margin-equity')¶ - Validated by:¶
- field available_trading_funds : Decimal [Required] (alias 'available-trading-funds')¶
- Validated by:¶
- field bond_margin_requirement : Decimal [Required] (alias 'bond-margin-requirement')¶
- Validated by:¶
-
field buying_power_adjustment : Decimal | None =
None(alias 'buying-power-adjustment')¶ - Validated by:¶
- field cash_available_to_withdraw : Decimal [Required] (alias 'cash-available-to-withdraw')¶
- Validated by:¶
- field closed_loop_available_balance : Decimal [Required] (alias 'closed-loop-available-balance')¶
- Validated by:¶
- field cryptocurrency_margin_requirement : Decimal [Required] (alias 'cryptocurrency-margin-requirement')¶
- Validated by:¶
- field day_trading_buying_power : Decimal [Required] (alias 'day-trading-buying-power')¶
- Validated by:¶
- field derivative_buying_power : Decimal [Required] (alias 'derivative-buying-power')¶
- Validated by:¶
- field effective_cryptocurrency_buying_power : Decimal [Required] (alias 'effective-cryptocurrency-buying-power')¶
- Validated by:¶
- field equity_offering_margin_requirement : Decimal [Required] (alias 'equity-offering-margin-requirement')¶
- Validated by:¶
- field futures_intraday_margin_requirement : Decimal [Required] (alias 'futures-intraday-margin-requirement')¶
- Validated by:¶
- field futures_margin_requirement : Decimal [Required] (alias 'futures-margin-requirement')¶
- Validated by:¶
- field futures_overnight_margin_requirement : Decimal [Required] (alias 'futures-overnight-margin-requirement')¶
- Validated by:¶
- field long_cryptocurrency_value : Decimal [Required] (alias 'long-cryptocurrency-value')¶
- Validated by:¶
- field long_futures_derivative_value : Decimal [Required] (alias 'long-futures-derivative-value')¶
- Validated by:¶
- field maintenance_requirement : Decimal [Required] (alias 'maintenance-requirement')¶
- Validated by:¶
- field pending_margin_interest : Decimal [Required] (alias 'pending-margin-interest')¶
- Validated by:¶
- field reg_t_margin_requirement : Decimal [Required] (alias 'reg-t-margin-requirement')¶
- Validated by:¶
- field short_cryptocurrency_value : Decimal [Required] (alias 'short-cryptocurrency-value')¶
- Validated by:¶
- field short_futures_derivative_value : Decimal [Required] (alias 'short-futures-derivative-value')¶
- Validated by:¶
- field short_margineable_value : Decimal [Required] (alias 'short-margineable-value')¶
- Validated by:¶
- field unsettled_cryptocurrency_fiat_amount : Decimal [Required] (alias 'unsettled-cryptocurrency-fiat-amount')¶
- Validated by:¶
- field used_derivative_buying_power : Decimal [Required] (alias 'used-derivative-buying-power')¶
- Validated by:¶
- validator validate_price_effects » all fields¶
-
pydantic model tastytrade.account.AccountBalanceSnapshot(*, account_number: str, cash_balance: Decimal, long_equity_value: Decimal, short_equity_value: Decimal, long_derivative_value: Decimal, short_derivative_value: Decimal, long_futures_value: Decimal, short_futures_value: Decimal, long_futures_derivative_value: Decimal, short_futures_derivative_value: Decimal, long_margineable_value: Decimal, short_margineable_value: Decimal, margin_equity: Decimal, equity_buying_power: Decimal, derivative_buying_power: Decimal, day_trading_buying_power: Decimal, futures_margin_requirement: Decimal, available_trading_funds: Decimal, maintenance_requirement: Decimal, maintenance_call_value: Decimal, reg_t_call_value: Decimal, day_trading_call_value: Decimal, day_equity_call_value: Decimal, net_liquidating_value: Decimal, cash_available_to_withdraw: Decimal, day_trade_excess: Decimal, pending_cash: Decimal, snapshot_date: date, time_of_day: str | None =
None, long_cryptocurrency_value: Decimal | None =None, short_cryptocurrency_value: Decimal | None =None, cryptocurrency_margin_requirement: Decimal | None =None, unsettled_cryptocurrency_fiat_amount: Decimal | None =None, closed_loop_available_balance: Decimal | None =None, equity_offering_margin_requirement: Decimal | None =None, long_bond_value: Decimal | None =None, bond_margin_requirement: Decimal | None =None, used_derivative_buying_power: Decimal | None =None)¶ Bases:
TastytradeDataDataclass containing account balance for a moment in time (snapshot).
Show JSON schema
{ "title": "AccountBalanceSnapshot", "description": "Dataclass containing account balance for a moment in time (snapshot).", "type": "object", "properties": { "account-number": { "title": "Account-Number", "type": "string" }, "cash-balance": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Cash-Balance" }, "long-equity-value": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Long-Equity-Value" }, "short-equity-value": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Short-Equity-Value" }, "long-derivative-value": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Long-Derivative-Value" }, "short-derivative-value": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Short-Derivative-Value" }, "long-futures-value": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Long-Futures-Value" }, "short-futures-value": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Short-Futures-Value" }, "long-futures-derivative-value": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Long-Futures-Derivative-Value" }, "short-futures-derivative-value": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Short-Futures-Derivative-Value" }, "long-margineable-value": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Long-Margineable-Value" }, "short-margineable-value": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Short-Margineable-Value" }, "margin-equity": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Margin-Equity" }, "equity-buying-power": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Equity-Buying-Power" }, "derivative-buying-power": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Derivative-Buying-Power" }, "day-trading-buying-power": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Day-Trading-Buying-Power" }, "futures-margin-requirement": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Futures-Margin-Requirement" }, "available-trading-funds": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Available-Trading-Funds" }, "maintenance-requirement": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Maintenance-Requirement" }, "maintenance-call-value": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Maintenance-Call-Value" }, "reg-t-call-value": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Reg-T-Call-Value" }, "day-trading-call-value": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Day-Trading-Call-Value" }, "day-equity-call-value": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Day-Equity-Call-Value" }, "net-liquidating-value": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Net-Liquidating-Value" }, "cash-available-to-withdraw": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Cash-Available-To-Withdraw" }, "day-trade-excess": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Day-Trade-Excess" }, "pending-cash": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Pending-Cash" }, "snapshot-date": { "format": "date", "title": "Snapshot-Date", "type": "string" }, "time-of-day": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Time-Of-Day" }, "long-cryptocurrency-value": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" }, { "type": "null" } ], "default": null, "title": "Long-Cryptocurrency-Value" }, "short-cryptocurrency-value": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" }, { "type": "null" } ], "default": null, "title": "Short-Cryptocurrency-Value" }, "cryptocurrency-margin-requirement": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" }, { "type": "null" } ], "default": null, "title": "Cryptocurrency-Margin-Requirement" }, "unsettled-cryptocurrency-fiat-amount": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" }, { "type": "null" } ], "default": null, "title": "Unsettled-Cryptocurrency-Fiat-Amount" }, "closed-loop-available-balance": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" }, { "type": "null" } ], "default": null, "title": "Closed-Loop-Available-Balance" }, "equity-offering-margin-requirement": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" }, { "type": "null" } ], "default": null, "title": "Equity-Offering-Margin-Requirement" }, "long-bond-value": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" }, { "type": "null" } ], "default": null, "title": "Long-Bond-Value" }, "bond-margin-requirement": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" }, { "type": "null" } ], "default": null, "title": "Bond-Margin-Requirement" }, "used-derivative-buying-power": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" }, { "type": "null" } ], "default": null, "title": "Used-Derivative-Buying-Power" } }, "required": [ "account-number", "cash-balance", "long-equity-value", "short-equity-value", "long-derivative-value", "short-derivative-value", "long-futures-value", "short-futures-value", "long-futures-derivative-value", "short-futures-derivative-value", "long-margineable-value", "short-margineable-value", "margin-equity", "equity-buying-power", "derivative-buying-power", "day-trading-buying-power", "futures-margin-requirement", "available-trading-funds", "maintenance-requirement", "maintenance-call-value", "reg-t-call-value", "day-trading-call-value", "day-equity-call-value", "net-liquidating-value", "cash-available-to-withdraw", "day-trade-excess", "pending-cash", "snapshot-date" ] }- Fields:¶
- Validators:¶
validate_price_effects»all fields
- field available_trading_funds : Decimal [Required] (alias 'available-trading-funds')¶
- Validated by:¶
-
field bond_margin_requirement : Decimal | None =
None(alias 'bond-margin-requirement')¶ - Validated by:¶
- field cash_available_to_withdraw : Decimal [Required] (alias 'cash-available-to-withdraw')¶
- Validated by:¶
-
field closed_loop_available_balance : Decimal | None =
None(alias 'closed-loop-available-balance')¶ - Validated by:¶
-
field cryptocurrency_margin_requirement : Decimal | None =
None(alias 'cryptocurrency-margin-requirement')¶ - Validated by:¶
- field day_trading_buying_power : Decimal [Required] (alias 'day-trading-buying-power')¶
- Validated by:¶
- field derivative_buying_power : Decimal [Required] (alias 'derivative-buying-power')¶
- Validated by:¶
-
field equity_offering_margin_requirement : Decimal | None =
None(alias 'equity-offering-margin-requirement')¶ - Validated by:¶
- field futures_margin_requirement : Decimal [Required] (alias 'futures-margin-requirement')¶
- Validated by:¶
-
field long_cryptocurrency_value : Decimal | None =
None(alias 'long-cryptocurrency-value')¶ - Validated by:¶
- field long_futures_derivative_value : Decimal [Required] (alias 'long-futures-derivative-value')¶
- Validated by:¶
- field maintenance_requirement : Decimal [Required] (alias 'maintenance-requirement')¶
- Validated by:¶
-
field short_cryptocurrency_value : Decimal | None =
None(alias 'short-cryptocurrency-value')¶ - Validated by:¶
- field short_futures_derivative_value : Decimal [Required] (alias 'short-futures-derivative-value')¶
- Validated by:¶
- field short_margineable_value : Decimal [Required] (alias 'short-margineable-value')¶
- Validated by:¶
-
field unsettled_cryptocurrency_fiat_amount : Decimal | None =
None(alias 'unsettled-cryptocurrency-fiat-amount')¶ - Validated by:¶
-
field used_derivative_buying_power : Decimal | None =
None(alias 'used-derivative-buying-power')¶ - Validated by:¶
- validator validate_price_effects » all fields¶
-
pydantic model tastytrade.account.CurrentPosition(*, account_number: str, symbol: str, instrument_type: InstrumentType, underlying_symbol: str, quantity: Decimal, quantity_direction: str, close_price: Decimal, average_open_price: Decimal, multiplier: Decimal, cost_effect: str, is_suppressed: bool, is_frozen: bool, realized_day_gain: Decimal, realized_today: Decimal, created_at: datetime, updated_at: datetime, mark: Decimal | None =
None, mark_price: Decimal | None =None, restricted_quantity: Decimal | None =None, expires_at: datetime | None =None, fixing_price: Decimal | None =None, deliverable_type: str | None =None, average_yearly_market_close_price: Decimal | None =None, average_daily_market_close_price: Decimal | None =None, realized_day_gain_date: date | None =None, realized_today_date: date | None =None)¶ Bases:
TastytradeDataDataclass containing imformation about an individual position in a portfolio.
Show JSON schema
{ "title": "CurrentPosition", "description": "Dataclass containing imformation about an individual position in a\nportfolio.", "type": "object", "properties": { "account-number": { "title": "Account-Number", "type": "string" }, "symbol": { "title": "Symbol", "type": "string" }, "instrument-type": { "$ref": "#/$defs/InstrumentType" }, "underlying-symbol": { "title": "Underlying-Symbol", "type": "string" }, "quantity": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Quantity" }, "quantity-direction": { "title": "Quantity-Direction", "type": "string" }, "close-price": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Close-Price" }, "average-open-price": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Average-Open-Price" }, "multiplier": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Multiplier" }, "cost-effect": { "title": "Cost-Effect", "type": "string" }, "is-suppressed": { "title": "Is-Suppressed", "type": "boolean" }, "is-frozen": { "title": "Is-Frozen", "type": "boolean" }, "realized-day-gain": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Realized-Day-Gain" }, "realized-today": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Realized-Today" }, "created-at": { "format": "date-time", "title": "Created-At", "type": "string" }, "updated-at": { "format": "date-time", "title": "Updated-At", "type": "string" }, "mark": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" }, { "type": "null" } ], "default": null, "title": "Mark" }, "mark-price": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" }, { "type": "null" } ], "default": null, "title": "Mark-Price" }, "restricted-quantity": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" }, { "type": "null" } ], "default": null, "title": "Restricted-Quantity" }, "expires-at": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "default": null, "title": "Expires-At" }, "fixing-price": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" }, { "type": "null" } ], "default": null, "title": "Fixing-Price" }, "deliverable-type": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Deliverable-Type" }, "average-yearly-market-close-price": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" }, { "type": "null" } ], "default": null, "title": "Average-Yearly-Market-Close-Price" }, "average-daily-market-close-price": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" }, { "type": "null" } ], "default": null, "title": "Average-Daily-Market-Close-Price" }, "realized-day-gain-date": { "anyOf": [ { "format": "date", "type": "string" }, { "type": "null" } ], "default": null, "title": "Realized-Day-Gain-Date" }, "realized-today-date": { "anyOf": [ { "format": "date", "type": "string" }, { "type": "null" } ], "default": null, "title": "Realized-Today-Date" } }, "$defs": { "InstrumentType": { "description": "Contains the valid types of instruments and their representation in the API.", "enum": [ "Bond", "Cryptocurrency", "Currency Pair", "Equity", "Equity Offering", "Equity Option", "Fixed Income Security", "Future", "Future Option", "Index", "Liquidity Pool", "Unknown", "Warrant" ], "title": "InstrumentType", "type": "string" } }, "required": [ "account-number", "symbol", "instrument-type", "underlying-symbol", "quantity", "quantity-direction", "close-price", "average-open-price", "multiplier", "cost-effect", "is-suppressed", "is-frozen", "realized-day-gain", "realized-today", "created-at", "updated-at" ] }- Fields:¶
- Validators:¶
validate_price_effects»all fields
-
field average_daily_market_close_price : Decimal | None =
None(alias 'average-daily-market-close-price')¶ - Validated by:¶
-
field average_yearly_market_close_price : Decimal | None =
None(alias 'average-yearly-market-close-price')¶ - Validated by:¶
- field instrument_type : InstrumentType [Required] (alias 'instrument-type')¶
- Validated by:¶
- validator validate_price_effects » all fields¶
- pydantic model tastytrade.account.EmptyDict¶
Bases:
BaseModelShow JSON schema
{ "title": "EmptyDict", "type": "object", "properties": {}, "additionalProperties": false }
- pydantic model tastytrade.account.FeesInfo(*, total_fees: Decimal)¶
Bases:
TastytradeDataShow JSON schema
{ "title": "FeesInfo", "type": "object", "properties": { "total-fees": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Total-Fees" } }, "required": [ "total-fees" ] }- Fields:¶
- Validators:¶
validate_price_effects»all fields
- validator validate_price_effects » all fields¶
- pydantic model tastytrade.account.Lot(*, id: str, transaction_id: int, quantity: Decimal, price: Decimal, quantity_direction: str, executed_at: datetime, transaction_date: date)¶
Bases:
TastytradeDataDataclass containing information about the lot of a position.
Show JSON schema
{ "title": "Lot", "description": "Dataclass containing information about the lot of a position.", "type": "object", "properties": { "id": { "title": "Id", "type": "string" }, "transaction-id": { "title": "Transaction-Id", "type": "integer" }, "quantity": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Quantity" }, "price": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Price" }, "quantity-direction": { "title": "Quantity-Direction", "type": "string" }, "executed-at": { "format": "date-time", "title": "Executed-At", "type": "string" }, "transaction-date": { "format": "date", "title": "Transaction-Date", "type": "string" } }, "required": [ "id", "transaction-id", "quantity", "price", "quantity-direction", "executed-at", "transaction-date" ] }- Fields:¶
-
pydantic model tastytrade.account.MarginReport(*, account_number: str, description: str, margin_calculation_type: str, option_level: str, margin_requirement: Decimal, maintenance_requirement: Decimal, margin_equity: Decimal, option_buying_power: Decimal, reg_t_margin_requirement: Decimal, reg_t_option_buying_power: Decimal, maintenance_excess: Decimal, last_state_timestamp: int, groups: list[MarginReportEntry | EmptyDict], initial_requirement: Decimal | None =
None)¶ Bases:
TastytradeDataDataclass containing an overall portfolio margin report.
Show JSON schema
{ "title": "MarginReport", "description": "Dataclass containing an overall portfolio margin report.", "type": "object", "properties": { "account-number": { "title": "Account-Number", "type": "string" }, "description": { "title": "Description", "type": "string" }, "margin-calculation-type": { "title": "Margin-Calculation-Type", "type": "string" }, "option-level": { "title": "Option-Level", "type": "string" }, "margin-requirement": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Margin-Requirement" }, "maintenance-requirement": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Maintenance-Requirement" }, "margin-equity": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Margin-Equity" }, "option-buying-power": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Option-Buying-Power" }, "reg-t-margin-requirement": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Reg-T-Margin-Requirement" }, "reg-t-option-buying-power": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Reg-T-Option-Buying-Power" }, "maintenance-excess": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Maintenance-Excess" }, "last-state-timestamp": { "title": "Last-State-Timestamp", "type": "integer" }, "groups": { "items": { "anyOf": [ { "$ref": "#/$defs/MarginReportEntry" }, { "$ref": "#/$defs/EmptyDict" } ] }, "title": "Groups", "type": "array" }, "initial-requirement": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" }, { "type": "null" } ], "default": null, "title": "Initial-Requirement" } }, "$defs": { "EmptyDict": { "additionalProperties": false, "properties": {}, "title": "EmptyDict", "type": "object" }, "MarginReportEntry": { "description": "Dataclass containing an individual entry (relating to a specific position)\nas part of the overall margin report.", "properties": { "description": { "title": "Description", "type": "string" }, "code": { "title": "Code", "type": "string" }, "buying-power": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Buying-Power" }, "margin-calculation-type": { "title": "Margin-Calculation-Type", "type": "string" }, "margin-requirement": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Margin-Requirement" }, "expected-price-range-up-percent": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" }, { "type": "null" } ], "default": null, "title": "Expected-Price-Range-Up-Percent" }, "expected-price-range-down-percent": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" }, { "type": "null" } ], "default": null, "title": "Expected-Price-Range-Down-Percent" }, "groups": { "anyOf": [ { "items": { "additionalProperties": true, "type": "object" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Groups" }, "initial-requirement": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" }, { "type": "null" } ], "default": null, "title": "Initial-Requirement" }, "maintenance-requirement": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" }, { "type": "null" } ], "default": null, "title": "Maintenance-Requirement" }, "point-of-no-return-percent": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" }, { "type": "null" } ], "default": null, "title": "Point-Of-No-Return-Percent" }, "price-increase-percent": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" }, { "type": "null" } ], "default": null, "title": "Price-Increase-Percent" }, "price-decrease-percent": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" }, { "type": "null" } ], "default": null, "title": "Price-Decrease-Percent" }, "underlying-symbol": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Underlying-Symbol" }, "underlying-type": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Underlying-Type" } }, "required": [ "description", "code", "buying-power", "margin-calculation-type", "margin-requirement" ], "title": "MarginReportEntry", "type": "object" } }, "required": [ "account-number", "description", "margin-calculation-type", "option-level", "margin-requirement", "maintenance-requirement", "margin-equity", "option-buying-power", "reg-t-margin-requirement", "reg-t-option-buying-power", "maintenance-excess", "last-state-timestamp", "groups" ] }- Fields:¶
- Validators:¶
validate_price_effects»all fields
- field groups : list[MarginReportEntry | EmptyDict] [Required]¶
- Validated by:¶
- field maintenance_requirement : Decimal [Required] (alias 'maintenance-requirement')¶
- Validated by:¶
- field reg_t_margin_requirement : Decimal [Required] (alias 'reg-t-margin-requirement')¶
- Validated by:¶
- field reg_t_option_buying_power : Decimal [Required] (alias 'reg-t-option-buying-power')¶
- Validated by:¶
- validator validate_price_effects » all fields¶
-
pydantic model tastytrade.account.MarginReportEntry(*, description: str, code: str, buying_power: Decimal, margin_calculation_type: str, margin_requirement: Decimal, expected_price_range_up_percent: Decimal | None =
None, expected_price_range_down_percent: Decimal | None =None, groups: list[dict[str, Any]] | None =None, initial_requirement: Decimal | None =None, maintenance_requirement: Decimal | None =None, point_of_no_return_percent: Decimal | None =None, price_increase_percent: Decimal | None =None, price_decrease_percent: Decimal | None =None, underlying_symbol: str | None =None, underlying_type: str | None =None)¶ Bases:
TastytradeDataDataclass containing an individual entry (relating to a specific position) as part of the overall margin report.
Show JSON schema
{ "title": "MarginReportEntry", "description": "Dataclass containing an individual entry (relating to a specific position)\nas part of the overall margin report.", "type": "object", "properties": { "description": { "title": "Description", "type": "string" }, "code": { "title": "Code", "type": "string" }, "buying-power": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Buying-Power" }, "margin-calculation-type": { "title": "Margin-Calculation-Type", "type": "string" }, "margin-requirement": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Margin-Requirement" }, "expected-price-range-up-percent": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" }, { "type": "null" } ], "default": null, "title": "Expected-Price-Range-Up-Percent" }, "expected-price-range-down-percent": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" }, { "type": "null" } ], "default": null, "title": "Expected-Price-Range-Down-Percent" }, "groups": { "anyOf": [ { "items": { "additionalProperties": true, "type": "object" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Groups" }, "initial-requirement": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" }, { "type": "null" } ], "default": null, "title": "Initial-Requirement" }, "maintenance-requirement": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" }, { "type": "null" } ], "default": null, "title": "Maintenance-Requirement" }, "point-of-no-return-percent": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" }, { "type": "null" } ], "default": null, "title": "Point-Of-No-Return-Percent" }, "price-increase-percent": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" }, { "type": "null" } ], "default": null, "title": "Price-Increase-Percent" }, "price-decrease-percent": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" }, { "type": "null" } ], "default": null, "title": "Price-Decrease-Percent" }, "underlying-symbol": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Underlying-Symbol" }, "underlying-type": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Underlying-Type" } }, "required": [ "description", "code", "buying-power", "margin-calculation-type", "margin-requirement" ] }- Fields:¶
- Validators:¶
validate_price_effects»all fields
-
field expected_price_range_down_percent : Decimal | None =
None(alias 'expected-price-range-down-percent')¶ - Validated by:¶
-
field expected_price_range_up_percent : Decimal | None =
None(alias 'expected-price-range-up-percent')¶ - Validated by:¶
-
field maintenance_requirement : Decimal | None =
None(alias 'maintenance-requirement')¶ - Validated by:¶
-
field point_of_no_return_percent : Decimal | None =
None(alias 'point-of-no-return-percent')¶ - Validated by:¶
-
field price_decrease_percent : Decimal | None =
None(alias 'price-decrease-percent')¶ - Validated by:¶
-
field price_increase_percent : Decimal | None =
None(alias 'price-increase-percent')¶ - Validated by:¶
- validator validate_price_effects » all fields¶
- pydantic model tastytrade.account.NetLiqOhlc(*, open: Decimal, high: Decimal, low: Decimal, close: Decimal, pending_cash_open: Decimal, pending_cash_high: Decimal, pending_cash_low: Decimal, pending_cash_close: Decimal, total_open: Decimal, total_high: Decimal, total_low: Decimal, total_close: Decimal, time: str)¶
Bases:
TastytradeDataDataclass containing historical net liquidation data in OHLC format (open, high, low, close), with a timestamp.
Show JSON schema
{ "title": "NetLiqOhlc", "description": "Dataclass containing historical net liquidation data in OHLC format\n(open, high, low, close), with a timestamp.", "type": "object", "properties": { "open": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Open" }, "high": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "High" }, "low": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Low" }, "close": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Close" }, "pending-cash-open": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Pending-Cash-Open" }, "pending-cash-high": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Pending-Cash-High" }, "pending-cash-low": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Pending-Cash-Low" }, "pending-cash-close": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Pending-Cash-Close" }, "total-open": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Total-Open" }, "total-high": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Total-High" }, "total-low": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Total-Low" }, "total-close": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Total-Close" }, "time": { "title": "Time", "type": "string" } }, "required": [ "open", "high", "low", "close", "pending-cash-open", "pending-cash-high", "pending-cash-low", "pending-cash-close", "total-open", "total-high", "total-low", "total-close", "time" ] }- Fields:¶
-
pydantic model tastytrade.account.TradingStatus(*, account_number: str, equities_margin_calculation_type: str, fee_schedule_name: str, futures_margin_rate_multiplier: Decimal, has_intraday_equities_margin: bool, id: int, is_aggregated_at_clearing: bool, is_closed: bool, is_closing_only: bool, is_cryptocurrency_enabled: bool, is_frozen: bool, is_full_equity_margin_required: bool, is_futures_closing_only: bool, is_futures_intra_day_enabled: bool, is_futures_enabled: bool, is_in_day_trade_equity_maintenance_call: bool, is_in_margin_call: bool, is_pattern_day_trader: bool, is_small_notional_futures_intra_day_enabled: bool, is_roll_the_day_forward_enabled: bool, are_far_otm_net_options_restricted: bool, options_level: str, short_calls_enabled: bool, small_notional_futures_margin_rate_multiplier: Decimal, is_equity_offering_enabled: bool, is_equity_offering_closing_only: bool, updated_at: datetime, is_portfolio_margin_enabled: bool | None =
None, is_risk_reducing_only: bool | None =None, day_trade_count: int | None =None, autotrade_account_type: str | None =None, clearing_account_number: str | None =None, clearing_aggregation_identifier: str | None =None, is_cryptocurrency_closing_only: bool | None =None, pdt_reset_on: date | None =None, cmta_override: int | None =None, enhanced_fraud_safeguards_enabled_at: datetime | None =None)¶ Bases:
TastytradeDataDataclass containing information about an account’s trading status, such as what types of trades are allowed (e.g. margin, crypto, futures)
Show JSON schema
{ "title": "TradingStatus", "description": "Dataclass containing information about an account's trading status, such\nas what types of trades are allowed (e.g. margin, crypto, futures)", "type": "object", "properties": { "account-number": { "title": "Account-Number", "type": "string" }, "equities-margin-calculation-type": { "title": "Equities-Margin-Calculation-Type", "type": "string" }, "fee-schedule-name": { "title": "Fee-Schedule-Name", "type": "string" }, "futures-margin-rate-multiplier": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Futures-Margin-Rate-Multiplier" }, "has-intraday-equities-margin": { "title": "Has-Intraday-Equities-Margin", "type": "boolean" }, "id": { "title": "Id", "type": "integer" }, "is-aggregated-at-clearing": { "title": "Is-Aggregated-At-Clearing", "type": "boolean" }, "is-closed": { "title": "Is-Closed", "type": "boolean" }, "is-closing-only": { "title": "Is-Closing-Only", "type": "boolean" }, "is-cryptocurrency-enabled": { "title": "Is-Cryptocurrency-Enabled", "type": "boolean" }, "is-frozen": { "title": "Is-Frozen", "type": "boolean" }, "is-full-equity-margin-required": { "title": "Is-Full-Equity-Margin-Required", "type": "boolean" }, "is-futures-closing-only": { "title": "Is-Futures-Closing-Only", "type": "boolean" }, "is-futures-intra-day-enabled": { "title": "Is-Futures-Intra-Day-Enabled", "type": "boolean" }, "is-futures-enabled": { "title": "Is-Futures-Enabled", "type": "boolean" }, "is-in-day-trade-equity-maintenance-call": { "title": "Is-In-Day-Trade-Equity-Maintenance-Call", "type": "boolean" }, "is-in-margin-call": { "title": "Is-In-Margin-Call", "type": "boolean" }, "is-pattern-day-trader": { "title": "Is-Pattern-Day-Trader", "type": "boolean" }, "is-small-notional-futures-intra-day-enabled": { "title": "Is-Small-Notional-Futures-Intra-Day-Enabled", "type": "boolean" }, "is-roll-the-day-forward-enabled": { "title": "Is-Roll-The-Day-Forward-Enabled", "type": "boolean" }, "are-far-otm-net-options-restricted": { "title": "Are-Far-Otm-Net-Options-Restricted", "type": "boolean" }, "options-level": { "title": "Options-Level", "type": "string" }, "short-calls-enabled": { "title": "Short-Calls-Enabled", "type": "boolean" }, "small-notional-futures-margin-rate-multiplier": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Small-Notional-Futures-Margin-Rate-Multiplier" }, "is-equity-offering-enabled": { "title": "Is-Equity-Offering-Enabled", "type": "boolean" }, "is-equity-offering-closing-only": { "title": "Is-Equity-Offering-Closing-Only", "type": "boolean" }, "updated-at": { "format": "date-time", "title": "Updated-At", "type": "string" }, "is-portfolio-margin-enabled": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": null, "title": "Is-Portfolio-Margin-Enabled" }, "is-risk-reducing-only": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": null, "title": "Is-Risk-Reducing-Only" }, "day-trade-count": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Day-Trade-Count" }, "autotrade-account-type": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Autotrade-Account-Type" }, "clearing-account-number": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Clearing-Account-Number" }, "clearing-aggregation-identifier": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Clearing-Aggregation-Identifier" }, "is-cryptocurrency-closing-only": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": null, "title": "Is-Cryptocurrency-Closing-Only" }, "pdt-reset-on": { "anyOf": [ { "format": "date", "type": "string" }, { "type": "null" } ], "default": null, "title": "Pdt-Reset-On" }, "cmta-override": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Cmta-Override" }, "enhanced-fraud-safeguards-enabled-at": { "anyOf": [ { "format": "date-time", "type": "string" }, { "type": "null" } ], "default": null, "title": "Enhanced-Fraud-Safeguards-Enabled-At" } }, "required": [ "account-number", "equities-margin-calculation-type", "fee-schedule-name", "futures-margin-rate-multiplier", "has-intraday-equities-margin", "id", "is-aggregated-at-clearing", "is-closed", "is-closing-only", "is-cryptocurrency-enabled", "is-frozen", "is-full-equity-margin-required", "is-futures-closing-only", "is-futures-intra-day-enabled", "is-futures-enabled", "is-in-day-trade-equity-maintenance-call", "is-in-margin-call", "is-pattern-day-trader", "is-small-notional-futures-intra-day-enabled", "is-roll-the-day-forward-enabled", "are-far-otm-net-options-restricted", "options-level", "short-calls-enabled", "small-notional-futures-margin-rate-multiplier", "is-equity-offering-enabled", "is-equity-offering-closing-only", "updated-at" ] }- Fields:¶
- field are_far_otm_net_options_restricted : bool [Required] (alias 'are-far-otm-net-options-restricted')¶
-
field clearing_aggregation_identifier : str | None =
None(alias 'clearing-aggregation-identifier')¶
-
field enhanced_fraud_safeguards_enabled_at : datetime | None =
None(alias 'enhanced-fraud-safeguards-enabled-at')¶
- field is_in_day_trade_equity_maintenance_call : bool [Required] (alias 'is-in-day-trade-equity-maintenance-call')¶
- field is_small_notional_futures_intra_day_enabled : bool [Required] (alias 'is-small-notional-futures-intra-day-enabled')¶
-
pydantic model tastytrade.account.Transaction(*, id: int, account_number: str, transaction_type: str, transaction_sub_type: str, description: str, executed_at: datetime, transaction_date: date, value: Decimal, net_value: Decimal, is_estimated_fee: bool, symbol: str | None =
None, instrument_type: InstrumentType | None =None, underlying_symbol: str | None =None, action: OrderAction | None =None, quantity: Decimal | None =None, price: Decimal | None =None, regulatory_fees: Decimal | None =None, clearing_fees: Decimal | None =None, commission: Decimal | None =None, proprietary_index_option_fees: Decimal | None =None, ext_exchange_order_number: str | None =None, ext_global_order_number: int | None =None, ext_group_id: str | None =None, ext_group_fill_id: str | None =None, ext_exec_id: str | None =None, exec_id: str | None =None, exchange: str | None =None, order_id: int | None =None, exchange_affiliation_identifier: str | None =None, leg_count: int | None =None, destination_venue: str | None =None, other_charge: Decimal | None =None, other_charge_description: str | None =None, reverses_id: int | None =None, cost_basis_reconciliation_date: date | None =None, lots: list[Lot] | None =None, agency_price: Decimal | None =None, principal_price: Decimal | None =None)¶ Bases:
TastytradeDataDataclass containing information about a past transaction.
Show JSON schema
{ "title": "Transaction", "description": "Dataclass containing information about a past transaction.", "type": "object", "properties": { "id": { "title": "Id", "type": "integer" }, "account-number": { "title": "Account-Number", "type": "string" }, "transaction-type": { "title": "Transaction-Type", "type": "string" }, "transaction-sub-type": { "title": "Transaction-Sub-Type", "type": "string" }, "description": { "title": "Description", "type": "string" }, "executed-at": { "format": "date-time", "title": "Executed-At", "type": "string" }, "transaction-date": { "format": "date", "title": "Transaction-Date", "type": "string" }, "value": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Value" }, "net-value": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Net-Value" }, "is-estimated-fee": { "title": "Is-Estimated-Fee", "type": "boolean" }, "symbol": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Symbol" }, "instrument-type": { "anyOf": [ { "$ref": "#/$defs/InstrumentType" }, { "type": "null" } ], "default": null }, "underlying-symbol": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Underlying-Symbol" }, "action": { "anyOf": [ { "$ref": "#/$defs/OrderAction" }, { "type": "null" } ], "default": null }, "quantity": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" }, { "type": "null" } ], "default": null, "title": "Quantity" }, "price": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" }, { "type": "null" } ], "default": null, "title": "Price" }, "regulatory-fees": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" }, { "type": "null" } ], "default": null, "title": "Regulatory-Fees" }, "clearing-fees": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" }, { "type": "null" } ], "default": null, "title": "Clearing-Fees" }, "commission": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" }, { "type": "null" } ], "default": null, "title": "Commission" }, "proprietary-index-option-fees": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" }, { "type": "null" } ], "default": null, "title": "Proprietary-Index-Option-Fees" }, "ext-exchange-order-number": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Ext-Exchange-Order-Number" }, "ext-global-order-number": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Ext-Global-Order-Number" }, "ext-group-id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Ext-Group-Id" }, "ext-group-fill-id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Ext-Group-Fill-Id" }, "ext-exec-id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Ext-Exec-Id" }, "exec-id": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Exec-Id" }, "exchange": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Exchange" }, "order-id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Order-Id" }, "exchange-affiliation-identifier": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Exchange-Affiliation-Identifier" }, "leg-count": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Leg-Count" }, "destination-venue": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Destination-Venue" }, "other-charge": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" }, { "type": "null" } ], "default": null, "title": "Other-Charge" }, "other-charge-description": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Other-Charge-Description" }, "reverses-id": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "title": "Reverses-Id" }, "cost-basis-reconciliation-date": { "anyOf": [ { "format": "date", "type": "string" }, { "type": "null" } ], "default": null, "title": "Cost-Basis-Reconciliation-Date" }, "lots": { "anyOf": [ { "items": { "$ref": "#/$defs/Lot" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Lots" }, "agency-price": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" }, { "type": "null" } ], "default": null, "title": "Agency-Price" }, "principal-price": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" }, { "type": "null" } ], "default": null, "title": "Principal-Price" } }, "$defs": { "InstrumentType": { "description": "Contains the valid types of instruments and their representation in the API.", "enum": [ "Bond", "Cryptocurrency", "Currency Pair", "Equity", "Equity Offering", "Equity Option", "Fixed Income Security", "Future", "Future Option", "Index", "Liquidity Pool", "Unknown", "Warrant" ], "title": "InstrumentType", "type": "string" }, "Lot": { "description": "Dataclass containing information about the lot of a position.", "properties": { "id": { "title": "Id", "type": "string" }, "transaction-id": { "title": "Transaction-Id", "type": "integer" }, "quantity": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Quantity" }, "price": { "anyOf": [ { "type": "number" }, { "pattern": "^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$", "type": "string" } ], "title": "Price" }, "quantity-direction": { "title": "Quantity-Direction", "type": "string" }, "executed-at": { "format": "date-time", "title": "Executed-At", "type": "string" }, "transaction-date": { "format": "date", "title": "Transaction-Date", "type": "string" } }, "required": [ "id", "transaction-id", "quantity", "price", "quantity-direction", "executed-at", "transaction-date" ], "title": "Lot", "type": "object" }, "OrderAction": { "description": "Contains the valid order actions.", "enum": [ "Buy to Open", "Buy to Close", "Sell to Open", "Sell to Close", "Buy", "Sell" ], "title": "OrderAction", "type": "string" } }, "required": [ "id", "account-number", "transaction-type", "transaction-sub-type", "description", "executed-at", "transaction-date", "value", "net-value", "is-estimated-fee" ] }- Fields:¶
- Validators:¶
validate_price_effects»all fields
-
field action : OrderAction | None =
None¶ - Validated by:¶
-
field cost_basis_reconciliation_date : date | None =
None(alias 'cost-basis-reconciliation-date')¶ - Validated by:¶
-
field exchange_affiliation_identifier : str | None =
None(alias 'exchange-affiliation-identifier')¶ - Validated by:¶
-
field ext_exchange_order_number : str | None =
None(alias 'ext-exchange-order-number')¶ - Validated by:¶
-
field instrument_type : InstrumentType | None =
None(alias 'instrument-type')¶ - Validated by:¶
-
field other_charge_description : str | None =
None(alias 'other-charge-description')¶ - Validated by:¶
-
field proprietary_index_option_fees : Decimal | None =
None(alias 'proprietary-index-option-fees')¶ - Validated by:¶
- validator validate_price_effects » all fields¶