Tools · SDK
SDK
Generated statically from the registry — TypeScript .ts and Python .py type hints for every schema. Drop into your project.
TypeScript · options-schema.ts
// OptionsSchema v0.1.1 — generated types
// Regenerate from https://rebeltrade.com/options-schema/sdk
export type Ticker = string;
export type Mic = string;
export type Isin = string;
export type OptionSymbol = string;
export type Money = {
amount: number;
currency: string;
precision?: number;
};
export type Percent = number;
export type Bps = number;
export type Timestamp = string;
export type MarketSession = "PRE" | "REGULAR" | "POST" | "CLOSED" | "FUTURES";
export type Greeks = {
delta: number;
gamma: number;
theta: number;
vega: number;
rho?: number;
vanna?: number;
charm?: number;
computation_basis?: {
model?: "BLACK_SCHOLES" | "BINOMIAL" | "BJERKSUND_STENSLAND" | "MC";
iv?: number;
rate?: number;
div_yield?: number;
as_of?: unknown;
};
};
export type OrderType = "MARKET" | "LIMIT" | "STOP" | "STOP_LIMIT" | "MOC" | "LOC" | "PEG";
export type Tif = "DAY" | "GTC" | "IOC" | "FOK" | "GTD" | "OPG" | "CLS";
export type ExerciseStyle = "AMERICAN" | "EUROPEAN" | "BERMUDAN";
export type Settlement = "PHYSICAL" | "CASH";
/** Unusual Options Activity Alert — uoa-alert@0.1.0 */
export type UoaAlert = {
ticker: string;
side: "CALL" | "PUT";
contract: {
strike: number;
expiry: string;
};
premium_usd: number;
volume?: number;
open_interest?: number;
aggressor?: "BID" | "ASK" | "MID";
detected_at: string;
};
/** Gamma Exposure Snapshot — gamma-snapshot@0.1.0 */
export type GammaSnapshot = {
ticker: string;
as_of: string;
spot?: number;
strikes: Array<{
strike: number;
gex: number;
}>;
};
/** Vertical Spread — vertical-spread@0.1.0 */
export type VerticalSpread = {
ticker: string;
side: "CALL" | "PUT";
direction?: "DEBIT" | "CREDIT";
expiry: string;
long_strike: number;
short_strike: number;
quantity: number;
net_price?: number;
};
/** Iron Condor — iron-condor@0.1.0 */
export type IronCondor = {
ticker: string;
expiry: string;
put_long: number;
put_short: number;
call_short: number;
call_long: number;
quantity: number;
net_credit?: number;
};
/** Options Order — options-order@0.1.0 */
export type OptionsOrder = {
legs: Array<{
ticker: string;
side: "CALL" | "PUT";
action: "BUY_TO_OPEN" | "SELL_TO_OPEN" | "BUY_TO_CLOSE" | "SELL_TO_CLOSE";
strike: number;
expiry: string;
quantity: number;
}>;
order_type: "MARKET" | "LIMIT" | "STOP" | "STOP_LIMIT";
limit_price?: number;
time_in_force: "DAY" | "GTC" | "IOC" | "FOK";
};
/** Broker Route — broker-route@0.1.0 */
export type BrokerRoute = {
broker: "ETRADE" | "SCHWAB" | "TASTYTRADE" | "FIDELITY" | "IBKR" | "VELOCITY";
method: "DEEP_LINK" | "API" | "FIX";
environment?: "LIVE" | "PAPER" | "SANDBOX";
idempotency_key?: string;
};
/** Rebel Verdict — rebel-verdict@0.1.0 */
export type RebelVerdict = {
ticker: string;
verdict: "BUY" | "SELL" | "WAIT";
confidence: number;
target_price?: number;
stop_price?: number;
horizon?: "INTRADAY" | "SWING" | "POSITION";
rationale?: string;
as_of: string;
};
/** Probability of Profit — probability-score@0.1.0 */
export type ProbabilityScore = {
pop: number;
max_profit: number;
max_loss: number;
expected_value?: number;
breakevens?: Array<number>;
};
/** Chart Analysis Result — chart-analysis@0.1.0 */
export type ChartAnalysis = {
bias: "BULLISH" | "BEARISH" | "NEUTRAL";
patterns: Array<string>;
support?: Array<number>;
resistance?: Array<number>;
};
/** Quote Tick — quote-tick@0.1.0 */
export type QuoteTick = {
ticker: string;
price: number;
change?: number;
change_pct?: number;
session: "PRE" | "REGULAR" | "POST" | "CLOSED" | "FUTURES";
as_of: string;
};
/** Multi-Leg Strategy — strategy.multileg@0.1.1 */
export type StrategyMultileg = {
underlying: unknown;
strategy_name?: string;
legs: Array<{
side: "CALL" | "PUT";
action: "BUY_TO_OPEN" | "SELL_TO_OPEN" | "BUY_TO_CLOSE" | "SELL_TO_CLOSE";
strike: number;
expiry: string;
ratio: number;
role?: "LONG_WING" | "SHORT_WING" | "LONG_BODY" | "SHORT_BODY" | "CALENDAR_FRONT" | "CALENDAR_BACK";
}>;
quantity: number;
direction?: "DEBIT" | "CREDIT";
net_price: number;
breakevens?: Array<number>;
};
/** Greeks Bundle — quote.greeks-bundle@0.1.1 */
export type QuoteGreeksBundle = {
option_symbol: unknown;
underlying: unknown;
quote: {
bid: number;
ask: number;
mid: number;
};
greeks: unknown;
iv?: number;
as_of: unknown;
};
/** Implied Vol Surface Point — surface.iv-point@0.1.1 */
export type SurfaceIvPoint = {
underlying: unknown;
strike: number;
expiry: string;
side: "CALL" | "PUT";
iv: number;
model?: "BLACK_SCHOLES" | "BINOMIAL" | "BJERKSUND_STENSLAND";
source?: string;
as_of: unknown;
};
/** Assignment / Exercise Event — event.assignment@0.1.1 */
export type EventAssignment = {
option_symbol: unknown;
kind: "ASSIGNMENT" | "EXERCISE" | "EXPIRATION";
quantity: number;
settlement?: unknown;
shares_delivered?: number;
cash_settled_amount?: unknown;
occurred_at: unknown;
};
/** Order Lifecycle — order.lifecycle@0.1.1 */
export type OrderLifecycle = {
order_id: string;
broker_order_id?: string;
symbol?: string;
events: Array<{
state: "NEW" | "ROUTED" | "PARTIAL" | "FILLED" | "CANCELLED" | "REJECTED" | "ASSIGNED" | "EXPIRED";
at: unknown;
filled_qty?: number;
avg_price?: number;
reason?: string;
}>;
};
/** Risk Envelope — risk.envelope@0.1.1 */
export type RiskEnvelope = {
max_loss: unknown;
max_gain: unknown;
breakevens: Array<number>;
margin_requirement?: unknown;
buying_power_effect?: unknown;
regulation?: "REG_T" | "PORTFOLIO_MARGIN";
};
/** Corporate Action Adjustment — event.corp-action@0.1.1 */
export type EventCorpAction = {
underlying: unknown;
action_type: "SPLIT" | "REVERSE_SPLIT" | "SPECIAL_DIV" | "SYMBOL_CHANGE" | "MERGER" | "SPINOFF";
effective_date: string;
ratio_from?: number;
ratio_to?: number;
new_symbol?: string;
strike_adjustment?: number;
multiplier_adjustment?: number;
occ_memo_id?: string;
};
Python · options_schema.py
# OptionsSchema v0.1.1 — generated Python type hints
# from https://rebeltrade.com/options-schema/sdk
from typing import TypedDict, List, Literal, Optional
class UoaAlert(TypedDict, total=False):
"""Unusual Options Activity Alert — uoa-alert@0.1.0"""
ticker: str
side: Literal["CALL", "PUT"]
contract: dict
premium_usd: float
volume: Optional[int]
open_interest: Optional[int]
aggressor: Optional[Literal["BID", "ASK", "MID"]]
detected_at: str
class GammaSnapshot(TypedDict, total=False):
"""Gamma Exposure Snapshot — gamma-snapshot@0.1.0"""
ticker: str
as_of: str
spot: Optional[float]
strikes: List[dict]
class VerticalSpread(TypedDict, total=False):
"""Vertical Spread — vertical-spread@0.1.0"""
ticker: str
side: Literal["CALL", "PUT"]
direction: Optional[Literal["DEBIT", "CREDIT"]]
expiry: str
long_strike: float
short_strike: float
quantity: int
net_price: Optional[float]
class IronCondor(TypedDict, total=False):
"""Iron Condor — iron-condor@0.1.0"""
ticker: str
expiry: str
put_long: float
put_short: float
call_short: float
call_long: float
quantity: int
net_credit: Optional[float]
class OptionsOrder(TypedDict, total=False):
"""Options Order — options-order@0.1.0"""
legs: List[dict]
order_type: Literal["MARKET", "LIMIT", "STOP", "STOP_LIMIT"]
limit_price: Optional[float]
time_in_force: Literal["DAY", "GTC", "IOC", "FOK"]
class BrokerRoute(TypedDict, total=False):
"""Broker Route — broker-route@0.1.0"""
broker: Literal["ETRADE", "SCHWAB", "TASTYTRADE", "FIDELITY", "IBKR", "VELOCITY"]
method: Literal["DEEP_LINK", "API", "FIX"]
environment: Optional[Literal["LIVE", "PAPER", "SANDBOX"]]
idempotency_key: Optional[str]
class RebelVerdict(TypedDict, total=False):
"""Rebel Verdict — rebel-verdict@0.1.0"""
ticker: str
verdict: Literal["BUY", "SELL", "WAIT"]
confidence: float
target_price: Optional[float]
stop_price: Optional[float]
horizon: Optional[Literal["INTRADAY", "SWING", "POSITION"]]
rationale: Optional[str]
as_of: str
class ProbabilityScore(TypedDict, total=False):
"""Probability of Profit — probability-score@0.1.0"""
pop: float
max_profit: float
max_loss: float
expected_value: Optional[float]
breakevens: Optional[List[float]]
class ChartAnalysis(TypedDict, total=False):
"""Chart Analysis Result — chart-analysis@0.1.0"""
bias: Literal["BULLISH", "BEARISH", "NEUTRAL"]
patterns: List[str]
support: Optional[List[float]]
resistance: Optional[List[float]]
class QuoteTick(TypedDict, total=False):
"""Quote Tick — quote-tick@0.1.0"""
ticker: str
price: float
change: Optional[float]
change_pct: Optional[float]
session: Literal["PRE", "REGULAR", "POST", "CLOSED", "FUTURES"]
as_of: str
class StrategyMultileg(TypedDict, total=False):
"""Multi-Leg Strategy — strategy.multileg@0.1.1"""
underlying: object
strategy_name: Optional[str]
legs: List[dict]
quantity: int
direction: Optional[Literal["DEBIT", "CREDIT"]]
net_price: float
breakevens: Optional[List[float]]
class QuoteGreeksBundle(TypedDict, total=False):
"""Greeks Bundle — quote.greeks-bundle@0.1.1"""
option_symbol: object
underlying: object
quote: dict
greeks: object
iv: Optional[float]
as_of: object
class SurfaceIvPoint(TypedDict, total=False):
"""Implied Vol Surface Point — surface.iv-point@0.1.1"""
underlying: object
strike: float
expiry: str
side: Literal["CALL", "PUT"]
iv: float
model: Optional[Literal["BLACK_SCHOLES", "BINOMIAL", "BJERKSUND_STENSLAND"]]
source: Optional[str]
as_of: object
class EventAssignment(TypedDict, total=False):
"""Assignment / Exercise Event — event.assignment@0.1.1"""
option_symbol: object
kind: Literal["ASSIGNMENT", "EXERCISE", "EXPIRATION"]
quantity: int
settlement: Optional[object]
shares_delivered: Optional[int]
cash_settled_amount: Optional[object]
occurred_at: object
class OrderLifecycle(TypedDict, total=False):
"""Order Lifecycle — order.lifecycle@0.1.1"""
order_id: str
broker_order_id: Optional[str]
symbol: Optional[str]
events: List[dict]
class RiskEnvelope(TypedDict, total=False):
"""Risk Envelope — risk.envelope@0.1.1"""
max_loss: object
max_gain: object
breakevens: List[float]
margin_requirement: Optional[object]
buying_power_effect: Optional[object]
regulation: Optional[Literal["REG_T", "PORTFOLIO_MARGIN"]]
class EventCorpAction(TypedDict, total=False):
"""Corporate Action Adjustment — event.corp-action@0.1.1"""
underlying: object
action_type: Literal["SPLIT", "REVERSE_SPLIT", "SPECIAL_DIV", "SYMBOL_CHANGE", "MERGER", "SPINOFF"]
effective_date: str
ratio_from: Optional[float]
ratio_to: Optional[float]
new_symbol: Optional[str]
strike_adjustment: Optional[float]
multiplier_adjustment: Optional[int]
occ_memo_id: Optional[str]
