@fullstackcraftllc/floe 0.0.5 → 0.0.6
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
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
Zero-dependency TypeScript functions for options flow: Black-Scholes, Greeks, and dealer exposures, and more, with a clean, type-safe API. Built for use in trading platforms and fintech applications.
|
|
6
6
|
|
|
7
|
-
The same library that is used in Full Stack Craft's various fintech products including [The Wheel Screener](https://wheelscreener.com), [LEAPS Screener](https://leapsscreener.com), [Option Screener](https://option-screener.com), [AMT JOY](https://amtjoy.com), and [VannaCharm](https://vannacharm.com).
|
|
7
|
+
The same library that is used in [Full Stack Craft's](https://fullstackcraft.com) various fintech products including [The Wheel Screener](https://wheelscreener.com), [LEAPS Screener](https://leapsscreener.com), [Option Screener](https://option-screener.com), [AMT JOY](https://amtjoy.com), and [VannaCharm](https://vannacharm.com).
|
|
8
8
|
|
|
9
9
|
## Quick Start / Documentation / Examples
|
|
10
10
|
|
|
@@ -23,12 +23,15 @@ The same library that is used in Full Stack Craft's various fintech products inc
|
|
|
23
23
|
|
|
24
24
|
## Features
|
|
25
25
|
|
|
26
|
-
-
|
|
27
|
-
-
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
26
|
+
- **Black-Scholes Pricing** - Fast, accurate options pricing
|
|
27
|
+
- **Greeks Calculations** - Delta, gamma, theta, vega, rho
|
|
28
|
+
- **Dealer Exposure Metrics** - GEX, VEX, and CEX exposures
|
|
29
|
+
- **Implied Volatility & Surfaces** - Calculate IV from market prices and build volatility surfaces
|
|
30
|
+
- **Implied PDF** - Risk-neutral probability density functions
|
|
31
|
+
- **Real-Time Data** - Stream normalized options data from multiple brokers
|
|
32
|
+
- **Broker-Agnostic** - Normalize data from any broker
|
|
33
|
+
- **Type-Safe** - Full TypeScript support
|
|
34
|
+
- **Zero Dependencies** - Lightweight and fast
|
|
32
35
|
|
|
33
36
|
## Broker Support Roadmap
|
|
34
37
|
|
|
@@ -119,7 +119,7 @@ export declare class FloeClient {
|
|
|
119
119
|
* Establishes a connection to a broker's API.
|
|
120
120
|
*
|
|
121
121
|
* @param broker - The broker to connect to (e.g., Broker.TRADIER)
|
|
122
|
-
* @param
|
|
122
|
+
* @param authToken - The API authentication token for the broker
|
|
123
123
|
*
|
|
124
124
|
* @throws {Error} Throws if the specified broker is not supported
|
|
125
125
|
*
|
|
@@ -132,7 +132,7 @@ export declare class FloeClient {
|
|
|
132
132
|
* await client.connect(Broker.TRADIER, 'your-tradier-api-key');
|
|
133
133
|
* ```
|
|
134
134
|
*/
|
|
135
|
-
connect(broker: Broker,
|
|
135
|
+
connect(broker: Broker, authToken: string): Promise<void>;
|
|
136
136
|
/**
|
|
137
137
|
* Disconnects from the current broker.
|
|
138
138
|
*
|
|
@@ -104,7 +104,7 @@ class FloeClient {
|
|
|
104
104
|
* Establishes a connection to a broker's API.
|
|
105
105
|
*
|
|
106
106
|
* @param broker - The broker to connect to (e.g., Broker.TRADIER)
|
|
107
|
-
* @param
|
|
107
|
+
* @param authToken - The API authentication token for the broker
|
|
108
108
|
*
|
|
109
109
|
* @throws {Error} Throws if the specified broker is not supported
|
|
110
110
|
*
|
|
@@ -117,12 +117,12 @@ class FloeClient {
|
|
|
117
117
|
* await client.connect(Broker.TRADIER, 'your-tradier-api-key');
|
|
118
118
|
* ```
|
|
119
119
|
*/
|
|
120
|
-
async connect(broker,
|
|
120
|
+
async connect(broker, authToken) {
|
|
121
121
|
this.currentBroker = broker;
|
|
122
|
-
// Connection logic to the broker's API using the
|
|
122
|
+
// Connection logic to the broker's API using the authToken
|
|
123
123
|
switch (broker.toLowerCase()) {
|
|
124
124
|
case Broker.TRADIER:
|
|
125
|
-
this.tradierClient = new TradierClient_1.TradierClient(
|
|
125
|
+
this.tradierClient = new TradierClient_1.TradierClient(authToken, { verbose: this.verbose });
|
|
126
126
|
// Wire up TradierClient events to FloeClient events
|
|
127
127
|
this.tradierClient.on('tickerUpdate', (ticker) => {
|
|
128
128
|
this.emit('tickerUpdate', ticker);
|
|
@@ -140,9 +140,9 @@ class FloeClient {
|
|
|
140
140
|
await this.tradierClient.connect();
|
|
141
141
|
break;
|
|
142
142
|
case Broker.TASTYTRADE:
|
|
143
|
-
// For TastyTrade,
|
|
143
|
+
// For TastyTrade, authToken is the session token
|
|
144
144
|
this.tastyTradeClient = new TastyTradeClient_1.TastyTradeClient({
|
|
145
|
-
sessionToken:
|
|
145
|
+
sessionToken: authToken,
|
|
146
146
|
verbose: this.verbose,
|
|
147
147
|
});
|
|
148
148
|
// Wire up TastyTradeClient events to FloeClient events
|
|
@@ -162,9 +162,9 @@ class FloeClient {
|
|
|
162
162
|
await this.tastyTradeClient.connect();
|
|
163
163
|
break;
|
|
164
164
|
case Broker.TRADESTATION:
|
|
165
|
-
// For TradeStation,
|
|
165
|
+
// For TradeStation, authToken is the OAuth access token
|
|
166
166
|
this.tradeStationClient = new TradeStationClient_1.TradeStationClient({
|
|
167
|
-
accessToken:
|
|
167
|
+
accessToken: authToken,
|
|
168
168
|
verbose: this.verbose,
|
|
169
169
|
});
|
|
170
170
|
// Wire up TradeStationClient events to FloeClient events
|
|
@@ -184,9 +184,9 @@ class FloeClient {
|
|
|
184
184
|
await this.tradeStationClient.connect();
|
|
185
185
|
break;
|
|
186
186
|
case Broker.SCHWAB:
|
|
187
|
-
// For Schwab,
|
|
187
|
+
// For Schwab, authToken is the OAuth access token
|
|
188
188
|
this.schwabClient = new SchwabClient_1.SchwabClient({
|
|
189
|
-
accessToken:
|
|
189
|
+
accessToken: authToken,
|
|
190
190
|
verbose: this.verbose,
|
|
191
191
|
});
|
|
192
192
|
// Wire up SchwabClient events to FloeClient events
|
|
@@ -107,7 +107,7 @@ type TradierEventListener<T> = (data: T) => void;
|
|
|
107
107
|
*/
|
|
108
108
|
export declare class TradierClient {
|
|
109
109
|
/** Tradier API authentication token */
|
|
110
|
-
private
|
|
110
|
+
private authToken;
|
|
111
111
|
/** Current streaming session */
|
|
112
112
|
private streamSession;
|
|
113
113
|
/** WebSocket connection */
|
|
@@ -152,11 +152,11 @@ export declare class TradierClient {
|
|
|
152
152
|
/**
|
|
153
153
|
* Creates a new TradierClient instance.
|
|
154
154
|
*
|
|
155
|
-
* @param
|
|
155
|
+
* @param authToken - Tradier API auth token
|
|
156
156
|
* @param options - Optional configuration options
|
|
157
157
|
* @param options.verbose - Whether to log verbose debug information (default: false)
|
|
158
158
|
*/
|
|
159
|
-
constructor(
|
|
159
|
+
constructor(authToken: string, options?: {
|
|
160
160
|
verbose?: boolean;
|
|
161
161
|
});
|
|
162
162
|
/**
|
|
@@ -33,11 +33,11 @@ class TradierClient {
|
|
|
33
33
|
/**
|
|
34
34
|
* Creates a new TradierClient instance.
|
|
35
35
|
*
|
|
36
|
-
* @param
|
|
36
|
+
* @param authToken - Tradier API auth token
|
|
37
37
|
* @param options - Optional configuration options
|
|
38
38
|
* @param options.verbose - Whether to log verbose debug information (default: false)
|
|
39
39
|
*/
|
|
40
|
-
constructor(
|
|
40
|
+
constructor(authToken, options) {
|
|
41
41
|
/** Current streaming session */
|
|
42
42
|
this.streamSession = null;
|
|
43
43
|
/** WebSocket connection */
|
|
@@ -77,7 +77,7 @@ class TradierClient {
|
|
|
77
77
|
this.apiBaseUrl = 'https://api.tradier.com/v1';
|
|
78
78
|
/** Tradier WebSocket URL */
|
|
79
79
|
this.wsUrl = 'wss://ws.tradier.com/v1/markets/events';
|
|
80
|
-
this.
|
|
80
|
+
this.authToken = authToken;
|
|
81
81
|
this.verbose = options?.verbose ?? false;
|
|
82
82
|
// Initialize event listener maps
|
|
83
83
|
this.eventListeners.set('tickerUpdate', new Set());
|
|
@@ -176,7 +176,7 @@ class TradierClient {
|
|
|
176
176
|
const response = await fetch(url, {
|
|
177
177
|
method: 'GET',
|
|
178
178
|
headers: {
|
|
179
|
-
'Authorization': `Bearer ${this.
|
|
179
|
+
'Authorization': `Bearer ${this.authToken}`,
|
|
180
180
|
'Accept': 'application/json',
|
|
181
181
|
},
|
|
182
182
|
});
|
|
@@ -354,7 +354,7 @@ class TradierClient {
|
|
|
354
354
|
const response = await fetch(`${this.apiBaseUrl}/markets/events/session`, {
|
|
355
355
|
method: 'POST',
|
|
356
356
|
headers: {
|
|
357
|
-
'Authorization': `Bearer ${this.
|
|
357
|
+
'Authorization': `Bearer ${this.authToken}`,
|
|
358
358
|
'Accept': 'application/json',
|
|
359
359
|
},
|
|
360
360
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fullstackcraftllc/floe",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"description": "Production-ready options analytics toolkit. Normalize broker data structures and calculate Black-Scholes, Greeks, and exposures with a clean, type-safe API. Built for trading platforms and fintech applications.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|