@fullstackcraftllc/floe 0.0.17 → 0.0.19
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.
- package/README.md +6 -11
- package/dist/apiclient/index.d.ts +204 -0
- package/dist/apiclient/index.js +721 -0
- package/dist/client/FloeClient.d.ts +4 -0
- package/dist/client/FloeClient.js +50 -0
- package/dist/client/brokers/WebullClient.d.ts +53 -0
- package/dist/client/brokers/WebullClient.js +290 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +15 -1
- package/dist/volresponse/index.d.ts +42 -0
- package/dist/volresponse/index.js +251 -0
- package/dist/volresponse/types.d.ts +75 -0
- package/dist/volresponse/types.js +2 -0
- package/package.json +1 -3
package/README.md
CHANGED
|
@@ -42,8 +42,11 @@ Due to the overwhelming variety of how broker APIs structure their data (and how
|
|
|
42
42
|
| Tradier (via WebSocket) | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
|
|
43
43
|
| Tastytrade (via WebSocket - DXLink Streamer) | ✅ | ✅ | ✅ | ✅ | ✅ | Not yet tested |
|
|
44
44
|
| TradeStation (via HTTP Streaming) | ✅ | ✅ | ✅ | ✅ | ✅ | Not yet tested |
|
|
45
|
+
| Webull (via HTTP Snapshots) | ✅ | ✅ | ✅ | Not supported | ✅ | Not supported |
|
|
45
46
|
| Schwab (via WebSocket) | ✅ | ✅ | ✅ | ✅ | ✅ | Not yet tested |
|
|
46
|
-
| Interactive Brokers (via WebSocket) |
|
|
47
|
+
| Interactive Brokers (via WebSocket) | Not currently planned* | Not currently planned* | Not currently planned* | Not currently planned* | Not currently planned* | Not currently planned* |
|
|
48
|
+
|
|
49
|
+
*Due to the high capital requirements for an Interactive Brokers integration, no integration with them is currently planned.
|
|
47
50
|
|
|
48
51
|
Ideally all aspects of `floe` will be available for all brokers, but this will take time to determine as we work through the various data structures and formats that each broker provides.
|
|
49
52
|
|
|
@@ -78,18 +81,10 @@ See [LICENSE.md](LICENSE.md) for full details.
|
|
|
78
81
|
|
|
79
82
|
## Contributing
|
|
80
83
|
|
|
81
|
-
Contributions welcome! Please open an issue or PR.
|
|
84
|
+
Contributions are welcome! Please open an issue or PR.
|
|
82
85
|
|
|
83
86
|
By contributing, you agree that your contributions will be licensed under the same dual-license terms.
|
|
84
87
|
|
|
85
|
-
## TODOs
|
|
86
|
-
|
|
87
|
-
- [X] Implied PDF calculations
|
|
88
|
-
- [X] Tradier integration
|
|
89
|
-
- [X] TradeStation integration
|
|
90
|
-
- [ ] Interactive Brokers integration
|
|
91
|
-
- [ ] Trading functionality with all brokers
|
|
92
|
-
|
|
93
88
|
## Credits
|
|
94
89
|
|
|
95
|
-
Copyright © 2025 Built with ❤️ by [Full Stack Craft LLC](https://fullstackcraft.com)
|
|
90
|
+
Copyright © 2025 Built with ❤️ by [Full Stack Craft LLC](https://fullstackcraft.com)
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
export type FetchLike = (input: string, init?: RequestInit) => Promise<Response>;
|
|
2
|
+
export interface ApiContext {
|
|
3
|
+
signal?: AbortSignal;
|
|
4
|
+
}
|
|
5
|
+
export type CtxEquivalent = ApiContext | AbortSignal | null | undefined;
|
|
6
|
+
export interface HindsightDataRequest {
|
|
7
|
+
start_date: string;
|
|
8
|
+
end_date: string;
|
|
9
|
+
country?: string;
|
|
10
|
+
min_volatility?: number;
|
|
11
|
+
event?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface DealerMinuteSurfacesRequest {
|
|
14
|
+
symbol: string;
|
|
15
|
+
trade_date: string;
|
|
16
|
+
}
|
|
17
|
+
export interface AMTRequest {
|
|
18
|
+
symbol: string;
|
|
19
|
+
session_id: string;
|
|
20
|
+
}
|
|
21
|
+
export interface HindsightEvent {
|
|
22
|
+
id: number;
|
|
23
|
+
event_id: string;
|
|
24
|
+
date: string;
|
|
25
|
+
time: string;
|
|
26
|
+
timezone: string;
|
|
27
|
+
country: string;
|
|
28
|
+
country_code: string;
|
|
29
|
+
event_name: string;
|
|
30
|
+
volatility: number;
|
|
31
|
+
actual: string | null;
|
|
32
|
+
forecast: string | null;
|
|
33
|
+
previous: string | null;
|
|
34
|
+
created_at: Date | null;
|
|
35
|
+
updated_at: Date | null;
|
|
36
|
+
}
|
|
37
|
+
export interface SurfacePoint {
|
|
38
|
+
strike?: number;
|
|
39
|
+
value?: number;
|
|
40
|
+
x?: number;
|
|
41
|
+
y?: number;
|
|
42
|
+
}
|
|
43
|
+
export interface MinuteSurface {
|
|
44
|
+
gamma: SurfacePoint[];
|
|
45
|
+
vanna: SurfacePoint[];
|
|
46
|
+
charm: SurfacePoint[];
|
|
47
|
+
iv: SurfacePoint[];
|
|
48
|
+
}
|
|
49
|
+
export interface DealerMinuteSurface {
|
|
50
|
+
id: string;
|
|
51
|
+
run_at: Date | null;
|
|
52
|
+
symbol: string;
|
|
53
|
+
trade_date: string;
|
|
54
|
+
minute_ts: Date | null;
|
|
55
|
+
session_minute: number;
|
|
56
|
+
spot: number;
|
|
57
|
+
vix: number;
|
|
58
|
+
surfaces: MinuteSurface;
|
|
59
|
+
metadata: Record<string, unknown>;
|
|
60
|
+
}
|
|
61
|
+
export interface AMTSessionStatsRow {
|
|
62
|
+
symbol: string;
|
|
63
|
+
session_id: string;
|
|
64
|
+
session_data: Record<string, unknown>;
|
|
65
|
+
}
|
|
66
|
+
export interface AMTEventsRow {
|
|
67
|
+
symbol: string;
|
|
68
|
+
session_id: string;
|
|
69
|
+
events: Array<Record<string, unknown>>;
|
|
70
|
+
}
|
|
71
|
+
/** Event categories for filtering AMT minute events. */
|
|
72
|
+
export declare const AMTEventCategory: {
|
|
73
|
+
readonly TPO: "TPO";
|
|
74
|
+
readonly Price: "Price";
|
|
75
|
+
readonly Volume: "Volume";
|
|
76
|
+
readonly Session: "Session";
|
|
77
|
+
readonly Overnight: "Overnight";
|
|
78
|
+
};
|
|
79
|
+
export type AMTEventCategory = (typeof AMTEventCategory)[keyof typeof AMTEventCategory];
|
|
80
|
+
/** Typed event codes emitted by the AMT pipeline (66 codes across 5 categories). */
|
|
81
|
+
export declare const AMTEventCode: {
|
|
82
|
+
readonly TPONewPrint: "TPO_NEW_PRINT";
|
|
83
|
+
readonly TPOPeriodFirstPrint: "TPO_PERIOD_FIRST_PRINT";
|
|
84
|
+
readonly TPOFirst3Wide: "TPO_FIRST_3WIDE";
|
|
85
|
+
readonly TPOFirst4Wide: "TPO_FIRST_4WIDE";
|
|
86
|
+
readonly TPOFirst5Wide: "TPO_FIRST_5WIDE";
|
|
87
|
+
readonly TPOSinglePrintCreated: "TPO_SINGLE_PRINT_CREATED";
|
|
88
|
+
readonly TPOSinglePrintFilled: "TPO_SINGLE_PRINT_FILLED";
|
|
89
|
+
readonly TPOPoorHigh: "TPO_POOR_HIGH";
|
|
90
|
+
readonly TPOPoorLow: "TPO_POOR_LOW";
|
|
91
|
+
readonly TPOExcessHigh: "TPO_EXCESS_HIGH";
|
|
92
|
+
readonly TPOExcessLow: "TPO_EXCESS_LOW";
|
|
93
|
+
readonly PriceNHOD: "PRICE_NHOD";
|
|
94
|
+
readonly PriceNLOD: "PRICE_NLOD";
|
|
95
|
+
readonly PriceCrossHBUp: "PRICE_CROSS_HB_UP";
|
|
96
|
+
readonly PriceCrossHBDown: "PRICE_CROSS_HB_DOWN";
|
|
97
|
+
readonly PriceCrossTPOCUp: "PRICE_CROSS_TPOC_UP";
|
|
98
|
+
readonly PriceCrossTPOCDown: "PRICE_CROSS_TPOC_DOWN";
|
|
99
|
+
readonly PriceCrossVPOCUp: "PRICE_CROSS_VPOC_UP";
|
|
100
|
+
readonly PriceCrossVPOCDown: "PRICE_CROSS_VPOC_DOWN";
|
|
101
|
+
readonly PriceCrossVAHUp: "PRICE_CROSS_VAH_UP";
|
|
102
|
+
readonly PriceCrossVAHDown: "PRICE_CROSS_VAH_DOWN";
|
|
103
|
+
readonly PriceCrossVALUp: "PRICE_CROSS_VAL_UP";
|
|
104
|
+
readonly PriceCrossVALDown: "PRICE_CROSS_VAL_DOWN";
|
|
105
|
+
readonly PriceCrossORHighUp: "PRICE_CROSS_OR_HIGH_UP";
|
|
106
|
+
readonly PriceCrossORHighDown: "PRICE_CROSS_OR_HIGH_DOWN";
|
|
107
|
+
readonly PriceCrossORLowUp: "PRICE_CROSS_OR_LOW_UP";
|
|
108
|
+
readonly PriceCrossORLowDown: "PRICE_CROSS_OR_LOW_DOWN";
|
|
109
|
+
readonly PriceCrossIBHighUp: "PRICE_CROSS_IB_HIGH_UP";
|
|
110
|
+
readonly PriceCrossIBHighDown: "PRICE_CROSS_IB_HIGH_DOWN";
|
|
111
|
+
readonly PriceCrossIBLowUp: "PRICE_CROSS_IB_LOW_UP";
|
|
112
|
+
readonly PriceCrossIBLowDown: "PRICE_CROSS_IB_LOW_DOWN";
|
|
113
|
+
readonly PriceCrossPHODUp: "PRICE_CROSS_PHOD_UP";
|
|
114
|
+
readonly PriceCrossPHODDown: "PRICE_CROSS_PHOD_DOWN";
|
|
115
|
+
readonly PriceCrossPLODUp: "PRICE_CROSS_PLOD_UP";
|
|
116
|
+
readonly PriceCrossPLODDown: "PRICE_CROSS_PLOD_DOWN";
|
|
117
|
+
readonly PriceCrossPrevCloseUp: "PRICE_CROSS_PREV_CLOSE_UP";
|
|
118
|
+
readonly PriceCrossPrevCloseDown: "PRICE_CROSS_PREV_CLOSE_DOWN";
|
|
119
|
+
readonly PriceCrossPrevOpenUp: "PRICE_CROSS_PREV_OPEN_UP";
|
|
120
|
+
readonly PriceCrossPrevOpenDown: "PRICE_CROSS_PREV_OPEN_DOWN";
|
|
121
|
+
readonly PriceCrossONHUp: "PRICE_CROSS_ONH_UP";
|
|
122
|
+
readonly PriceCrossONHDown: "PRICE_CROSS_ONH_DOWN";
|
|
123
|
+
readonly PriceCrossONLUp: "PRICE_CROSS_ONL_UP";
|
|
124
|
+
readonly PriceCrossONLDown: "PRICE_CROSS_ONL_DOWN";
|
|
125
|
+
readonly PriceCrossVWAPUp: "PRICE_CROSS_VWAP_UP";
|
|
126
|
+
readonly PriceCrossVWAPDown: "PRICE_CROSS_VWAP_DOWN";
|
|
127
|
+
readonly PriceCrossVWAPSD1Up: "PRICE_CROSS_VWAP_SD1_UP";
|
|
128
|
+
readonly PriceCrossVWAPSD1Down: "PRICE_CROSS_VWAP_SD1_DOWN";
|
|
129
|
+
readonly PriceCrossVWAPSD2Up: "PRICE_CROSS_VWAP_SD2_UP";
|
|
130
|
+
readonly PriceCrossVWAPSD2Down: "PRICE_CROSS_VWAP_SD2_DOWN";
|
|
131
|
+
readonly VolVPOCShiftUp: "VOL_VPOC_SHIFT_UP";
|
|
132
|
+
readonly VolVPOCShiftDown: "VOL_VPOC_SHIFT_DOWN";
|
|
133
|
+
readonly VolVAMigrationUp: "VOL_VA_MIGRATION_UP";
|
|
134
|
+
readonly VolVAMigrationDown: "VOL_VA_MIGRATION_DOWN";
|
|
135
|
+
readonly VolVAExpanding: "VOL_VA_EXPANDING";
|
|
136
|
+
readonly VolVAContracting: "VOL_VA_CONTRACTING";
|
|
137
|
+
readonly SessionPeriodTransition: "SESSION_PERIOD_TRANSITION";
|
|
138
|
+
readonly SessionOREstablished: "SESSION_OR_ESTABLISHED";
|
|
139
|
+
readonly SessionIBEstablished: "SESSION_IB_ESTABLISHED";
|
|
140
|
+
readonly SessionIBExtensionUp: "SESSION_IB_EXTENSION_UP";
|
|
141
|
+
readonly SessionIBExtensionDown: "SESSION_IB_EXTENSION_DOWN";
|
|
142
|
+
readonly SessionORExtensionUp: "SESSION_OR_EXTENSION_UP";
|
|
143
|
+
readonly SessionORExtensionDown: "SESSION_OR_EXTENSION_DOWN";
|
|
144
|
+
readonly SessionGapFill: "SESSION_GAP_FILL";
|
|
145
|
+
readonly SessionGlobexGapFill: "SESSION_GLOBEX_GAP_FILL";
|
|
146
|
+
readonly SessionHalfbackReached: "SESSION_HALFBACK_REACHED";
|
|
147
|
+
readonly ONAsiaOpen: "ON_ASIA_OPEN";
|
|
148
|
+
readonly ONAsiaClose: "ON_ASIA_CLOSE";
|
|
149
|
+
readonly ONEUOpen: "ON_EU_OPEN";
|
|
150
|
+
readonly ONEUClose: "ON_EU_CLOSE";
|
|
151
|
+
readonly ONNewHigh: "ON_NEW_HIGH";
|
|
152
|
+
readonly ONNewLow: "ON_NEW_LOW";
|
|
153
|
+
};
|
|
154
|
+
export type AMTEventCode = (typeof AMTEventCode)[keyof typeof AMTEventCode];
|
|
155
|
+
export interface OptionsScreenerRequest {
|
|
156
|
+
strategy: string;
|
|
157
|
+
search?: string;
|
|
158
|
+
page?: number;
|
|
159
|
+
page_size?: number;
|
|
160
|
+
order_by?: string;
|
|
161
|
+
order_direction?: string;
|
|
162
|
+
/** Additional query params for range filters (min_score, max_score, etc.) and multi-value filters (sector, exclude_industry, etc.). */
|
|
163
|
+
extra_params?: Record<string, string>;
|
|
164
|
+
}
|
|
165
|
+
export interface OptionsScreenerResponse {
|
|
166
|
+
data: Record<string, unknown>[];
|
|
167
|
+
total: number;
|
|
168
|
+
page: number;
|
|
169
|
+
page_size: number;
|
|
170
|
+
}
|
|
171
|
+
export declare class APIError extends Error {
|
|
172
|
+
readonly StatusCode: number;
|
|
173
|
+
readonly Message: string;
|
|
174
|
+
readonly SubscriptionEnd: string;
|
|
175
|
+
readonly RawBody: string;
|
|
176
|
+
constructor(params: {
|
|
177
|
+
StatusCode: number;
|
|
178
|
+
Message: string;
|
|
179
|
+
SubscriptionEnd?: string;
|
|
180
|
+
RawBody?: string;
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
export declare class ApiClient {
|
|
184
|
+
private readonly apiKey;
|
|
185
|
+
private readonly httpClient;
|
|
186
|
+
private readonly hindsightBaseURL;
|
|
187
|
+
private readonly dealerBaseURL;
|
|
188
|
+
private readonly amtBaseURL;
|
|
189
|
+
private readonly wheelScreenerBaseURL;
|
|
190
|
+
private readonly leapsScreenerBaseURL;
|
|
191
|
+
private readonly optionScreenerBaseURL;
|
|
192
|
+
constructor(apiKey: string, httpClient?: FetchLike);
|
|
193
|
+
GetHindsightData(ctx: CtxEquivalent, req: HindsightDataRequest): Promise<HindsightEvent[]>;
|
|
194
|
+
GetHindsightSample(ctx?: CtxEquivalent): Promise<HindsightEvent[]>;
|
|
195
|
+
GetDealerMinuteSurfaces(ctx: CtxEquivalent, req: DealerMinuteSurfacesRequest): Promise<DealerMinuteSurface[]>;
|
|
196
|
+
GetAMTSessionStats(ctx: CtxEquivalent, req: AMTRequest): Promise<AMTSessionStatsRow[]>;
|
|
197
|
+
GetAMTEvents(ctx: CtxEquivalent, req: AMTRequest): Promise<AMTEventsRow[]>;
|
|
198
|
+
GetWheelScreenerData(ctx: CtxEquivalent, req: OptionsScreenerRequest): Promise<OptionsScreenerResponse>;
|
|
199
|
+
GetLeapsScreenerData(ctx: CtxEquivalent, req: OptionsScreenerRequest): Promise<OptionsScreenerResponse>;
|
|
200
|
+
GetOptionScreenerData(ctx: CtxEquivalent, req: OptionsScreenerRequest): Promise<OptionsScreenerResponse>;
|
|
201
|
+
private getOptionsScreenerData;
|
|
202
|
+
private getRaw;
|
|
203
|
+
}
|
|
204
|
+
export declare function NewApiClient(apiKey: string, httpClient?: FetchLike): ApiClient;
|