-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflow.go
More file actions
1651 lines (1542 loc) · 66.4 KB
/
flow.go
File metadata and controls
1651 lines (1542 loc) · 66.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
package flashalpha
// Typed models + client methods for the live (simulation-aware) flow surface
// under /v1/flow/*. Two families:
//
// - Analytics (/v1/flow/{levels,pin-risk,summary,oi,gex,dex,dealer-risk,
// live}/{symbol}) — fold today's intraday trade tape onto the settled
// book, so gamma flip / walls / GEX reflect *today's* flow. snake_case
// wire shape; optional expiry=YYYY-MM-DD slices to one expiration cycle.
//
// - Raw flow data (/v1/flow/options/*, /v1/flow/stocks/*) — the underlying
// trade tape: prints, blocks, per-minute history, cumulative net-flow
// series, cross-symbol leaderboards / outliers. Proxied verbatim so wire
// keys are camelCase and timestamps are ISO-8601 UTC strings.
//
// All /v1/flow/* endpoints require the Alpha plan. Every untyped method
// returns map[string]interface{} (consistent with the rest of the client);
// the *Typed wrappers decode into the structs below. Flow gex/dex per-strike
// rows are the same wire shape as /v1/exposure/gex|dex, so they reuse
// GexStrike / DexStrike.
import (
"context"
"net/url"
"strconv"
)
// ── Functional options ───────────────────────────────────────────────────────
// FlowOption configures a flow request. A single option type is shared by all
// flow endpoints; each endpoint reads only the parameters it supports
// (documented on the method). Unsupported options are ignored.
type FlowOption func(*flowConfig)
type flowConfig struct {
expiry string
limit *int
minSize *int
minutes *int
n *int
windowMinutes *int
minTrades *int
minScore *int
intent string
structure string
}
// WithFlowExpiry slices a flow request to a single expiration cycle
// (format "YYYY-MM-DD"). Honoured by the analytics endpoints and the raw
// option endpoints; ignored by the stock endpoints.
func WithFlowExpiry(expiry string) FlowOption {
return func(c *flowConfig) { c.expiry = expiry }
}
// WithFlowLimit sets the max number of trades to return (recent: 1–500).
func WithFlowLimit(limit int) FlowOption {
return func(c *flowConfig) { c.limit = &limit }
}
// WithFlowMinSize sets the minimum trade size that qualifies as a block.
func WithFlowMinSize(minSize int) FlowOption {
return func(c *flowConfig) { c.minSize = &minSize }
}
// WithFlowMinutes sets the lookback window in minutes (1–10080) for the
// history and cumulative endpoints.
func WithFlowMinutes(minutes int) FlowOption {
return func(c *flowConfig) { c.minutes = &minutes }
}
// WithFlowN sets the number of ranked rows per side (1–50) for leaderboards.
func WithFlowN(n int) FlowOption {
return func(c *flowConfig) { c.n = &n }
}
// WithFlowWindowMinutes sets the aggregation window in minutes (1–10080) for
// the leaderboard and outliers endpoints.
func WithFlowWindowMinutes(windowMinutes int) FlowOption {
return func(c *flowConfig) { c.windowMinutes = &windowMinutes }
}
// WithFlowMinTrades sets the minimum trades a symbol needs to qualify for
// the outliers endpoints.
func WithFlowMinTrades(minTrades int) FlowOption {
return func(c *flowConfig) { c.minTrades = &minTrades }
}
// WithFlowMinScore drops signals below this 0–100 threshold on the
// FlowSignals endpoint.
func WithFlowMinScore(minScore int) FlowOption {
return func(c *flowConfig) { c.minScore = &minScore }
}
// WithFlowIntent filters the FlowSignals feed to "bullish", "bearish", or
// "neutral".
func WithFlowIntent(intent string) FlowOption {
return func(c *flowConfig) { c.intent = intent }
}
// WithFlowStructure filters the FlowSignals feed to "block" or "sweep".
func WithFlowStructure(structure string) FlowOption {
return func(c *flowConfig) { c.structure = structure }
}
func flowParams(opts []FlowOption) (*flowConfig, url.Values) {
cfg := &flowConfig{}
for _, o := range opts {
o(cfg)
}
return cfg, url.Values{}
}
// ── Analytics response structs (snake_case) ──────────────────────────────────
// FlowLevelsResponse is the typed body of GET /v1/flow/levels/{symbol}:
// gamma flip / call & put walls / max pain recomputed against the live
// (intraday-flow-adjusted) book. Each level is nil when it can't be located.
type FlowLevelsResponse struct {
// Symbol is the underlying ticker echoed from the request path.
Symbol string `json:"symbol"`
// AsOf is the timestamp this snapshot was computed for (ISO-8601 UTC).
AsOf string `json:"as_of"`
// UnderlyingPrice is the spot mid at AsOf.
UnderlyingPrice *float64 `json:"underlying_price"`
// Expiry is the expiration filter echoed back ("YYYY-MM-DD"), or nil
// when the whole chain was used.
Expiry *string `json:"expiry"`
// LiveGammaFlip is the spot where live net dealer gamma crosses zero.
LiveGammaFlip *float64 `json:"live_gamma_flip"`
// LiveCallWall is the strike of the largest live call-gamma
// concentration (upside magnet).
LiveCallWall *float64 `json:"live_call_wall"`
// LivePutWall is the strike of the largest live put-gamma
// concentration (downside magnet).
LivePutWall *float64 `json:"live_put_wall"`
// LiveMaxPain is the live max-pain strike (most option value expires
// worthless).
LiveMaxPain *float64 `json:"live_max_pain"`
}
// FlowPinRiskBreakdown holds the component scores (0–100) behind the
// LivePinRisk headline.
type FlowPinRiskBreakdown struct {
// OiScore is the open-interest concentration around the magnet strike.
OiScore *int `json:"oi_score"`
// ProximityScore is how close spot is to the magnet strike.
ProximityScore *int `json:"proximity_score"`
// TimeScore is the time-to-close weighting (pin pressure rises into
// the cash close).
TimeScore *int `json:"time_score"`
// GammaScore is the dealer-gamma intensity at the magnet strike.
GammaScore *int `json:"gamma_score"`
}
// FlowPinRiskResponse is the typed body of GET /v1/flow/pin-risk/{symbol}:
// a 0–100 composite pin-risk score plus the magnet strike and breakdown.
type FlowPinRiskResponse struct {
// Symbol is the underlying ticker echoed from the request path.
Symbol string `json:"symbol"`
// AsOf is the timestamp this snapshot was computed for (ISO-8601 UTC).
AsOf string `json:"as_of"`
// UnderlyingPrice is the spot mid at AsOf.
UnderlyingPrice *float64 `json:"underlying_price"`
// Expiry is the expiration filter echoed back, or nil.
Expiry *string `json:"expiry"`
// LivePinRisk is the composite 0–100 pin-risk score (higher = stronger
// pin pull).
LivePinRisk *int `json:"live_pin_risk"`
// MagnetStrike is the strike acting as the pin magnet
// (argmax|net gamma|), or nil when there is no dominant strike.
MagnetStrike *float64 `json:"magnet_strike"`
// DistanceToMagnetPct is the signed % distance from spot to the magnet
// strike.
DistanceToMagnetPct *float64 `json:"distance_to_magnet_pct"`
// TimeToCloseHours is the hours remaining until the regular-session
// cash close.
TimeToCloseHours *float64 `json:"time_to_close_hours"`
// Breakdown holds the four component scores behind LivePinRisk.
Breakdown FlowPinRiskBreakdown `json:"breakdown"`
}
// FlowSummaryResponse is the typed body of GET /v1/flow/summary/{symbol}:
// an at-a-glance read on whether today's tape has shifted the dealer book.
type FlowSummaryResponse struct {
// Symbol is the underlying ticker echoed from the request path.
Symbol string `json:"symbol"`
// AsOf is the timestamp this snapshot was computed for (ISO-8601 UTC).
AsOf string `json:"as_of"`
// UnderlyingPrice is the spot mid at AsOf.
UnderlyingPrice *float64 `json:"underlying_price"`
// Expiry is the expiration filter echoed back, or nil.
Expiry *string `json:"expiry"`
// FlowDirection is the net classified direction of intraday flow
// (e.g. "bullish", "bearish", "neutral").
FlowDirection string `json:"flow_direction"`
// IntradayOiDelta is the net change in simulated open interest since
// the open (contracts).
IntradayOiDelta *int64 `json:"intraday_oi_delta"`
// ContractsWithFlow is the number of contracts that have printed at
// least one trade today.
ContractsWithFlow *int `json:"contracts_with_flow"`
// ContractsTotal is the total contracts tracked for the underlying.
ContractsTotal *int `json:"contracts_total"`
// LiveGex is the live (flow-adjusted) net GEX in dollars per 1% spot.
LiveGex *float64 `json:"live_gex"`
// FlowGexPctShift is the % shift in net GEX caused by today's flow vs
// the settled book; nil when the settled baseline is zero.
FlowGexPctShift *float64 `json:"flow_gex_pct_shift"`
}
// FlowOiResponse is the typed body of GET /v1/flow/oi/{symbol}: the settled
// (official) OI vs the intraday simulated OI. This endpoint does NOT return
// underlying_price.
type FlowOiResponse struct {
// Symbol is the underlying ticker echoed from the request path.
Symbol string `json:"symbol"`
// AsOf is the timestamp this snapshot was computed for (ISO-8601 UTC).
AsOf string `json:"as_of"`
// Expiry is the expiration filter echoed back, or nil.
Expiry *string `json:"expiry"`
// OfficialOi is the official exchange OI from the settled snapshot
// (sum across the chain).
OfficialOi *int64 `json:"official_oi"`
// SimulatedOi is the intraday simulated OI (official + estimated
// open/close from the tape).
SimulatedOi *int64 `json:"simulated_oi"`
// IntradayOiDelta is SimulatedOi - OfficialOi (signed).
IntradayOiDelta *int64 `json:"intraday_oi_delta"`
// OiDeltaConfidence is the confidence 0–1 in the intraday OI estimate
// (trade-tape coverage).
OiDeltaConfidence *float64 `json:"oi_delta_confidence"`
// EffectiveOi is the OI actually used by the live analytics (blended).
EffectiveOi *int64 `json:"effective_oi"`
// ContractsTotal is the total contracts tracked for the underlying.
ContractsTotal *int `json:"contracts_total"`
// ContractsWithFlow is the contracts that printed at least one trade.
ContractsWithFlow *int `json:"contracts_with_flow"`
}
// FlowGexResponse is the typed body of GET /v1/flow/gex/{symbol}: the live
// (flow-adjusted) GEX with the same per-strike shape as /v1/exposure/gex.
type FlowGexResponse struct {
// Symbol is the underlying ticker echoed from the request path.
Symbol string `json:"symbol"`
// AsOf is the timestamp this snapshot was computed for (ISO-8601 UTC).
AsOf string `json:"as_of"`
// UnderlyingPrice is the spot mid at AsOf.
UnderlyingPrice *float64 `json:"underlying_price"`
// Expiry is the expiration filter echoed back, or nil.
Expiry *string `json:"expiry"`
// LiveNetGex is the live net GEX across the chain (dollars per 1% spot).
LiveNetGex *float64 `json:"live_net_gex"`
// LiveNetGexLabel is a categorical regime label (e.g. "positive",
// "negative"). Safe to surface verbatim.
LiveNetGexLabel string `json:"live_net_gex_label"`
// LiveGammaFlip is the live gamma-flip spot, or nil if no sign change.
LiveGammaFlip *float64 `json:"live_gamma_flip"`
// Strikes is the per-strike breakdown (identical schema to settled GEX).
Strikes []GexStrike `json:"strikes"`
}
// FlowDexResponse is the typed body of GET /v1/flow/dex/{symbol}: the live
// (flow-adjusted) DEX with the same per-strike shape as /v1/exposure/dex.
type FlowDexResponse struct {
// Symbol is the underlying ticker echoed from the request path.
Symbol string `json:"symbol"`
// AsOf is the timestamp this snapshot was computed for (ISO-8601 UTC).
AsOf string `json:"as_of"`
// UnderlyingPrice is the spot mid at AsOf.
UnderlyingPrice *float64 `json:"underlying_price"`
// Expiry is the expiration filter echoed back, or nil.
Expiry *string `json:"expiry"`
// LiveNetDex is the live net DEX across the chain (dollars).
LiveNetDex *float64 `json:"live_net_dex"`
// Strikes is the per-strike DEX breakdown.
Strikes []DexStrike `json:"strikes"`
}
// FlowDealerRiskResponse is the typed body of
// GET /v1/flow/dealer-risk/{symbol}: a side-by-side of the settled snapshot
// and the live flow-adjusted book, with the adjustment today's tape produced.
type FlowDealerRiskResponse struct {
// Symbol is the underlying ticker echoed from the request path.
Symbol string `json:"symbol"`
// AsOf is the timestamp this snapshot was computed for (ISO-8601 UTC).
AsOf string `json:"as_of"`
// UnderlyingPrice is the spot mid at AsOf.
UnderlyingPrice *float64 `json:"underlying_price"`
// Expiry is the expiration filter echoed back, or nil.
Expiry *string `json:"expiry"`
// SettledNetGex is the net GEX from the settled (prior close) snapshot.
SettledNetGex *float64 `json:"settled_net_gex"`
// LiveNetGex is the net GEX from the live flow-adjusted book.
LiveNetGex *float64 `json:"live_net_gex"`
// FlowGexAdjustment is LiveNetGex - SettledNetGex (dollars).
FlowGexAdjustment *float64 `json:"flow_gex_adjustment"`
// FlowGexPctShift is the % GEX shift from flow; nil when the settled
// baseline is zero.
FlowGexPctShift *float64 `json:"flow_gex_pct_shift"`
// SettledNetDex is the net DEX from the settled snapshot.
SettledNetDex *float64 `json:"settled_net_dex"`
// LiveNetDex is the net DEX from the live flow-adjusted book.
LiveNetDex *float64 `json:"live_net_dex"`
// FlowDexAdjustment is LiveNetDex - SettledNetDex (dollars).
FlowDexAdjustment *float64 `json:"flow_dex_adjustment"`
// FlowDexPctShift is the % DEX shift from flow; nil when baseline zero.
FlowDexPctShift *float64 `json:"flow_dex_pct_shift"`
// TotalAbsDeltaContracts is the absolute delta-weighted contracts
// traded today (flow magnitude).
TotalAbsDeltaContracts *int64 `json:"total_abs_delta_contracts"`
// ContractsWithFlow is the contracts that printed at least one trade.
ContractsWithFlow *int `json:"contracts_with_flow"`
// FlowDirection is the net classified flow direction.
FlowDirection string `json:"flow_direction"`
// Description is a plain-English summary of whether flow has moved the
// dealer book. Safe to surface verbatim.
Description string `json:"description"`
}
// FlowAdjustedDealerRisk is the nested dealer-risk block inside
// FlowLiveResponse. Identical to FlowDealerRiskResponse minus
// ContractsWithFlow (carried on the parent live envelope instead).
type FlowAdjustedDealerRisk struct {
// SettledNetGex is the net GEX from the settled snapshot.
SettledNetGex *float64 `json:"settled_net_gex"`
// LiveNetGex is the net GEX from the live flow-adjusted book.
LiveNetGex *float64 `json:"live_net_gex"`
// FlowGexAdjustment is LiveNetGex - SettledNetGex (dollars).
FlowGexAdjustment *float64 `json:"flow_gex_adjustment"`
// FlowGexPctShift is the % GEX shift from flow; nil when baseline zero.
FlowGexPctShift *float64 `json:"flow_gex_pct_shift"`
// SettledNetDex is the net DEX from the settled snapshot.
SettledNetDex *float64 `json:"settled_net_dex"`
// LiveNetDex is the net DEX from the live flow-adjusted book.
LiveNetDex *float64 `json:"live_net_dex"`
// FlowDexAdjustment is LiveNetDex - SettledNetDex (dollars).
FlowDexAdjustment *float64 `json:"flow_dex_adjustment"`
// FlowDexPctShift is the % DEX shift from flow; nil when baseline zero.
FlowDexPctShift *float64 `json:"flow_dex_pct_shift"`
// TotalAbsDeltaContracts is the absolute delta-weighted contracts
// traded today (flow magnitude).
TotalAbsDeltaContracts *int64 `json:"total_abs_delta_contracts"`
// FlowDirection is the net classified flow direction.
FlowDirection string `json:"flow_direction"`
// Description is a plain-English summary. Safe to surface verbatim.
Description string `json:"description"`
}
// FlowLiveResponse is the typed body of GET /v1/flow/live/{symbol}: an
// everything-at-once convenience bundle (OI simulator state + live exposure
// + live levels + pin risk + nested dealer-risk block).
type FlowLiveResponse struct {
// Symbol is the underlying ticker echoed from the request path.
Symbol string `json:"symbol"`
// AsOf is the timestamp this snapshot was computed for (ISO-8601 UTC).
AsOf string `json:"as_of"`
// UnderlyingPrice is the spot mid at AsOf.
UnderlyingPrice *float64 `json:"underlying_price"`
// Expiry is the expiration filter echoed back, or nil.
Expiry *string `json:"expiry"`
// Contracts is the total contracts tracked for the underlying.
Contracts *int `json:"contracts"`
// ContractsWithFlow is the contracts that printed at least one trade.
ContractsWithFlow *int `json:"contracts_with_flow"`
// OfficialOi is the official exchange OI from the settled snapshot.
OfficialOi *int64 `json:"official_oi"`
// SimulatedOi is the intraday simulated OI.
SimulatedOi *int64 `json:"simulated_oi"`
// IntradayOiDelta is SimulatedOi - OfficialOi (signed).
IntradayOiDelta *int64 `json:"intraday_oi_delta"`
// OiDeltaConfidence is the confidence 0–1 in the intraday OI estimate.
OiDeltaConfidence *float64 `json:"oi_delta_confidence"`
// EffectiveOi is the OI actually used by the live analytics (blended).
EffectiveOi *int64 `json:"effective_oi"`
// LiveGex is the live net GEX (dollars per 1% spot move).
LiveGex *float64 `json:"live_gex"`
// LiveGexDelta is the live net DEX (dollars). Named live_gex_delta on
// the wire.
LiveGexDelta *float64 `json:"live_gex_delta"`
// LiveGammaFlip is the live gamma-flip spot, or nil.
LiveGammaFlip *float64 `json:"live_gamma_flip"`
// LiveCallWall is the live call wall strike, or nil.
LiveCallWall *float64 `json:"live_call_wall"`
// LivePutWall is the live put wall strike, or nil.
LivePutWall *float64 `json:"live_put_wall"`
// LiveMaxPain is the live max-pain strike, or nil.
LiveMaxPain *float64 `json:"live_max_pain"`
// LivePinRisk is the composite 0–100 pin-risk score.
LivePinRisk *int `json:"live_pin_risk"`
// FlowAdjustedDealerRisk is the nested settled-vs-live dealer block.
FlowAdjustedDealerRisk FlowAdjustedDealerRisk `json:"flow_adjusted_dealer_risk"`
}
// ── Raw flow data structs (camelCase wire keys) ──────────────────────────────
// FlowOptionTrade is a single option trade print (a trades[] element).
type FlowOptionTrade struct {
// Ts is the trade timestamp (ISO-8601 UTC).
Ts string `json:"ts"`
// InstrumentID is the OPRA instrument id of the contract.
InstrumentID *int64 `json:"instrumentId"`
// Expiry is the contract expiration ("YYYY-MM-DD").
Expiry string `json:"expiry"`
// Strike is the contract strike price.
Strike *float64 `json:"strike"`
// Right is "C" (call) or "P" (put).
Right string `json:"right"`
// Price is the trade price.
Price *float64 `json:"price"`
// Size is the trade size in contracts.
Size *int `json:"size"`
// Side is the trade-side classification vs the NBBO at print
// ("buy"/"sell"/"mid").
Side string `json:"side"`
// IsBlock is true when the print is at/above the block-size threshold.
IsBlock *bool `json:"isBlock"`
// Bid is the NBBO bid at the moment of the trade.
Bid *float64 `json:"bid"`
// Ask is the NBBO ask at the moment of the trade.
Ask *float64 `json:"ask"`
}
// FlowOptionRecentResponse is the typed body of
// GET /v1/flow/options/{symbol}/recent: a newest-first option trade tape.
// Expiry is echoed only when the filter is supplied.
type FlowOptionRecentResponse struct {
// Symbol is the underlying ticker echoed from the request path.
Symbol string `json:"symbol"`
// Expiry is the expiration filter echoed back when supplied, else nil.
Expiry *string `json:"expiry"`
// Count is the number of trades returned (capped by the limit).
Count *int `json:"count"`
// TotalAvailable is the unclamped total trade count.
TotalAvailable *int `json:"totalAvailable"`
// Trades is the newest-first list of trade prints.
Trades []FlowOptionTrade `json:"trades"`
}
// FlowOptionSummaryResponse is the typed body of
// GET /v1/flow/options/{symbol}/summary: per-underlying option-flow aggregates.
type FlowOptionSummaryResponse struct {
// Symbol is the underlying ticker echoed from the request path.
Symbol string `json:"symbol"`
// Expiry is the expiration filter echoed back when supplied, else nil.
Expiry *string `json:"expiry"`
// ContractsWithTrades is the distinct contracts that printed a trade.
ContractsWithTrades *int `json:"contractsWithTrades"`
// TotalTrades is the total number of trade prints.
TotalTrades *int `json:"totalTrades"`
// BuyVolume is the buy-classified contract volume.
BuyVolume *int64 `json:"buyVolume"`
// SellVolume is the sell-classified contract volume.
SellVolume *int64 `json:"sellVolume"`
// MidVolume is the volume classified at the mid (uninformed).
MidVolume *int64 `json:"midVolume"`
// NetVolume is BuyVolume - SellVolume.
NetVolume *int64 `json:"netVolume"`
// BiggestSingleTrade is the largest single trade size.
BiggestSingleTrade *int `json:"biggestSingleTrade"`
// LastTradeUtc is the timestamp of the most recent print; nil when
// there are no trades.
LastTradeUtc *string `json:"lastTradeUtc"`
}
// FlowOptionBlock is a single large option print (a blocks[] element).
type FlowOptionBlock struct {
// Ts is the trade timestamp (ISO-8601 UTC).
Ts string `json:"ts"`
// Expiry is the contract expiration ("YYYY-MM-DD").
Expiry string `json:"expiry"`
// Strike is the contract strike price.
Strike *float64 `json:"strike"`
// Right is "C" (call) or "P" (put).
Right string `json:"right"`
// Price is the trade price.
Price *float64 `json:"price"`
// Size is the trade size in contracts.
Size *int `json:"size"`
// Side is the trade-side classification ("buy"/"sell"/"mid").
Side string `json:"side"`
}
// FlowOptionBlocksResponse is the typed body of
// GET /v1/flow/options/{symbol}/blocks: all trades with size >= minSize.
type FlowOptionBlocksResponse struct {
// Symbol is the underlying ticker echoed from the request path.
Symbol string `json:"symbol"`
// Expiry is the expiration filter echoed back when supplied, else nil.
Expiry *string `json:"expiry"`
// MinSize is the minimum trade size that qualified as a block (echoed).
MinSize *int `json:"minSize"`
// Count is the number of blocks returned.
Count *int `json:"count"`
// Blocks is the newest-first list of large prints.
Blocks []FlowOptionBlock `json:"blocks"`
}
// FlowHistoryBucket is one per-minute option-flow bucket (a buckets[]
// element of the option history endpoint).
type FlowHistoryBucket struct {
// Ts is the bucket start (ISO-8601 UTC, minute-aligned).
Ts string `json:"ts"`
// BuyVolume is the buy-classified volume in the bucket.
BuyVolume *int64 `json:"buyVolume"`
// SellVolume is the sell-classified volume in the bucket.
SellVolume *int64 `json:"sellVolume"`
// MidVolume is the mid-classified volume in the bucket.
MidVolume *int64 `json:"midVolume"`
// NetVolume is BuyVolume - SellVolume.
NetVolume *int64 `json:"netVolume"`
// TradeCount is the number of trades in the bucket.
TradeCount *int `json:"tradeCount"`
// BiggestTrade is the largest single trade size in the bucket.
BiggestTrade *int `json:"biggestTrade"`
// Vwap is the volume-weighted average trade price across the bucket.
Vwap *float64 `json:"vwap"`
// High is the highest trade price in the bucket.
High *float64 `json:"high"`
// Low is the lowest trade price in the bucket.
Low *float64 `json:"low"`
}
// FlowOptionHistoryResponse is the typed body of
// GET /v1/flow/options/{symbol}/history: newest-first per-minute buckets.
type FlowOptionHistoryResponse struct {
// Symbol is the underlying ticker echoed from the request path.
Symbol string `json:"symbol"`
// Expiry is the expiration filter echoed back when supplied, else nil.
Expiry *string `json:"expiry"`
// Minutes is the lookback window in minutes (echoed back).
Minutes *int `json:"minutes"`
// Count is the number of buckets returned.
Count *int `json:"count"`
// Buckets is the newest-first list of per-minute aggregates.
Buckets []FlowHistoryBucket `json:"buckets"`
}
// FlowCumulativePoint is one point of a cumulative net-flow series (a
// points[] element). Shared by the option and stock cumulative endpoints.
type FlowCumulativePoint struct {
// Ts is the bucket start (ISO-8601 UTC, minute-aligned).
Ts string `json:"ts"`
// NetVolume is the net volume in this minute bucket.
NetVolume *int64 `json:"netVolume"`
// Cumulative is the running sum of NetVolume from the start of the
// window (the "HIRO-style" cumulative line).
Cumulative *int64 `json:"cumulative"`
// Vwap is the volume-weighted average price in the bucket.
Vwap *float64 `json:"vwap"`
// TradeCount is the number of trades in the bucket.
TradeCount *int `json:"tradeCount"`
}
// FlowOptionCumulativeResponse is the typed body of
// GET /v1/flow/options/{symbol}/cumulative.
type FlowOptionCumulativeResponse struct {
// Symbol is the underlying ticker echoed from the request path.
Symbol string `json:"symbol"`
// Expiry is the expiration filter echoed back when supplied, else nil.
Expiry *string `json:"expiry"`
// Minutes is the lookback window in minutes (echoed back).
Minutes *int `json:"minutes"`
// Count is the number of points returned.
Count *int `json:"count"`
// Points is the chronological cumulative net-flow series.
Points []FlowCumulativePoint `json:"points"`
}
// FlowStockTrade is a single stock trade print (a trades[] element).
type FlowStockTrade struct {
// Ts is the trade timestamp (ISO-8601 UTC).
Ts string `json:"ts"`
// Price is the trade price.
Price *float64 `json:"price"`
// Size is the trade size in shares.
Size *int `json:"size"`
// Side is the trade-side classification ("buy"/"sell"/"mid").
Side string `json:"side"`
// IsBlock is true when the print is at/above the block-size threshold.
IsBlock *bool `json:"isBlock"`
// Bid is the NBBO bid at the moment of the trade.
Bid *float64 `json:"bid"`
// Ask is the NBBO ask at the moment of the trade.
Ask *float64 `json:"ask"`
}
// FlowStockRecentResponse is the typed body of
// GET /v1/flow/stocks/{symbol}/recent: a newest-first stock trade tape.
type FlowStockRecentResponse struct {
// Symbol is the underlying ticker echoed from the request path.
Symbol string `json:"symbol"`
// Count is the number of trades returned (capped by the limit).
Count *int `json:"count"`
// TotalAvailable is the unclamped total trade count.
TotalAvailable *int `json:"totalAvailable"`
// Trades is the newest-first list of trade prints.
Trades []FlowStockTrade `json:"trades"`
}
// FlowStockSummaryResponse is the typed body of
// GET /v1/flow/stocks/{symbol}/summary: per-symbol stock-flow aggregates.
type FlowStockSummaryResponse struct {
// Symbol is the underlying ticker echoed from the request path.
Symbol string `json:"symbol"`
// TotalTrades is the total number of trade prints.
TotalTrades *int `json:"totalTrades"`
// BuyVolume is the buy-classified share volume.
BuyVolume *int64 `json:"buyVolume"`
// SellVolume is the sell-classified share volume.
SellVolume *int64 `json:"sellVolume"`
// MidVolume is the volume classified at the mid (uninformed).
MidVolume *int64 `json:"midVolume"`
// NetVolume is BuyVolume - SellVolume.
NetVolume *int64 `json:"netVolume"`
// BiggestSingleTrade is the largest single trade size.
BiggestSingleTrade *int `json:"biggestSingleTrade"`
// LastTradeUtc is the timestamp of the most recent print; nil when
// there are no trades.
LastTradeUtc *string `json:"lastTradeUtc"`
}
// FlowStockBlock is a single large stock print (a blocks[] element).
type FlowStockBlock struct {
// Ts is the trade timestamp (ISO-8601 UTC).
Ts string `json:"ts"`
// Price is the trade price.
Price *float64 `json:"price"`
// Size is the trade size in shares.
Size *int `json:"size"`
// Side is the trade-side classification ("buy"/"sell"/"mid").
Side string `json:"side"`
// Bid is the NBBO bid at the moment of the trade.
Bid *float64 `json:"bid"`
// Ask is the NBBO ask at the moment of the trade.
Ask *float64 `json:"ask"`
}
// FlowStockBlocksResponse is the typed body of
// GET /v1/flow/stocks/{symbol}/blocks: all trades with size >= minSize.
type FlowStockBlocksResponse struct {
// Symbol is the underlying ticker echoed from the request path.
Symbol string `json:"symbol"`
// MinSize is the minimum trade size that qualified as a block (echoed).
MinSize *int `json:"minSize"`
// Count is the number of blocks returned.
Count *int `json:"count"`
// Blocks is the newest-first list of large prints.
Blocks []FlowStockBlock `json:"blocks"`
}
// FlowStockHistoryBucket is one per-minute stock-flow bucket. Like
// FlowHistoryBucket but also carries OHLC of the print price.
type FlowStockHistoryBucket struct {
// Ts is the bucket start (ISO-8601 UTC, minute-aligned).
Ts string `json:"ts"`
// BuyVolume is the buy-classified volume in the bucket.
BuyVolume *int64 `json:"buyVolume"`
// SellVolume is the sell-classified volume in the bucket.
SellVolume *int64 `json:"sellVolume"`
// MidVolume is the mid-classified volume in the bucket.
MidVolume *int64 `json:"midVolume"`
// NetVolume is BuyVolume - SellVolume.
NetVolume *int64 `json:"netVolume"`
// TradeCount is the number of trades in the bucket.
TradeCount *int `json:"tradeCount"`
// BiggestTrade is the largest single trade size in the bucket.
BiggestTrade *int `json:"biggestTrade"`
// Vwap is the volume-weighted average trade price across the bucket.
Vwap *float64 `json:"vwap"`
// Open is the first trade price in the bucket.
Open *float64 `json:"open"`
// Close is the last trade price in the bucket.
Close *float64 `json:"close"`
// High is the highest trade price in the bucket.
High *float64 `json:"high"`
// Low is the lowest trade price in the bucket.
Low *float64 `json:"low"`
}
// FlowStockHistoryResponse is the typed body of
// GET /v1/flow/stocks/{symbol}/history: newest-first per-minute buckets.
type FlowStockHistoryResponse struct {
// Symbol is the underlying ticker echoed from the request path.
Symbol string `json:"symbol"`
// Minutes is the lookback window in minutes (echoed back).
Minutes *int `json:"minutes"`
// Count is the number of buckets returned.
Count *int `json:"count"`
// Buckets is the newest-first list of per-minute aggregates.
Buckets []FlowStockHistoryBucket `json:"buckets"`
}
// FlowStockCumulativeResponse is the typed body of
// GET /v1/flow/stocks/{symbol}/cumulative.
type FlowStockCumulativeResponse struct {
// Symbol is the underlying ticker echoed from the request path.
Symbol string `json:"symbol"`
// Minutes is the lookback window in minutes (echoed back).
Minutes *int `json:"minutes"`
// Count is the number of points returned.
Count *int `json:"count"`
// Points is the chronological cumulative net-flow series.
Points []FlowCumulativePoint `json:"points"`
}
// FlowOptionLeaderRow is one ranked underlying in the option-flow
// leaderboard. Option rows carry AvgPremium; the stock leaderboard uses
// Vwap instead.
type FlowOptionLeaderRow struct {
// Symbol is the ranked underlying.
Symbol string `json:"symbol"`
// NetVolume is net contracts (BuyVolume - SellVolume).
NetVolume *int64 `json:"netVolume"`
// NetNotional is the net dollar option flow (≈ net contracts × avg
// premium × 100).
NetNotional *float64 `json:"netNotional"`
// BuyVolume is the buy-classified contract volume.
BuyVolume *int64 `json:"buyVolume"`
// SellVolume is the sell-classified contract volume.
SellVolume *int64 `json:"sellVolume"`
// AvgPremium is the volume-weighted average option premium.
AvgPremium *float64 `json:"avgPremium"`
// TradeCount is the number of trades over the window.
TradeCount *int `json:"tradeCount"`
// LastTradeUtc is the timestamp of the most recent print.
LastTradeUtc string `json:"lastTradeUtc"`
}
// FlowOptionLeaderboardResponse is the typed body of
// GET /v1/flow/options/leaderboard: top-N net-dollar buyers and sellers.
type FlowOptionLeaderboardResponse struct {
// GeneratedUtc is when the cached snapshot was generated (ISO-8601 UTC).
GeneratedUtc string `json:"generatedUtc"`
// N is the number of ranked rows requested per side.
N *int `json:"n"`
// WindowMinutes is the aggregation window in minutes.
WindowMinutes *int `json:"windowMinutes"`
// Buyers is the top net-dollar buyers.
Buyers []FlowOptionLeaderRow `json:"buyers"`
// Sellers is the top net-dollar sellers.
Sellers []FlowOptionLeaderRow `json:"sellers"`
}
// FlowOutlierRow is one flagged underlying in an outliers table (shared by
// the option and stock outliers endpoints).
type FlowOutlierRow struct {
// Symbol is the flagged underlying.
Symbol string `json:"symbol"`
// TradeCount is the number of trades over the window.
TradeCount *int `json:"tradeCount"`
// BuyVolume is the buy-classified volume.
BuyVolume *int64 `json:"buyVolume"`
// SellVolume is the sell-classified volume.
SellVolume *int64 `json:"sellVolume"`
// MidVolume is the mid-classified volume.
MidVolume *int64 `json:"midVolume"`
// NetVolume is BuyVolume - SellVolume.
NetVolume *int64 `json:"netVolume"`
// ImbalancePct is |buy-sell| / (buy+sell) × 100: 0 = balanced,
// 100 = one-sided.
ImbalancePct *float64 `json:"imbalancePct"`
// Skew is a tiered skew label (FLAT/MILD_BUY/BUY/STRONG_BUY/…).
Skew string `json:"skew"`
// Notional is the gross traded notional over the window (dollars).
Notional *float64 `json:"notional"`
// NetNotional is the net (signed) traded notional over the window.
NetNotional *float64 `json:"netNotional"`
// BiggestTrade is the largest single trade size.
BiggestTrade *int `json:"biggestTrade"`
// BiggestTradeUtc is the timestamp of the biggest print; nil if none.
BiggestTradeUtc *string `json:"biggestTradeUtc"`
// BiggestAgeSec is the age of the biggest print in seconds; -1 if none.
BiggestAgeSec *int `json:"biggestAgeSec"`
// LastVwap is the VWAP of the most recent activity.
LastVwap *float64 `json:"lastVwap"`
// LastTradeUtc is the timestamp of the last print; nil if none.
LastTradeUtc *string `json:"lastTradeUtc"`
// LastTradeAgeSec is the age of the last print in seconds; -1 if none.
LastTradeAgeSec *int `json:"lastTradeAgeSec"`
}
// FlowOptionOutliersResponse is the typed body of
// GET /v1/flow/options/outliers.
type FlowOptionOutliersResponse struct {
// GeneratedUtc is when the cached snapshot was generated (ISO-8601 UTC).
GeneratedUtc string `json:"generatedUtc"`
// WindowMinutes is the aggregation window in minutes.
WindowMinutes *int `json:"windowMinutes"`
// Tracked is the number of symbols evaluated.
Tracked *int `json:"tracked"`
// Qualified is the symbols that met minTrades and had non-zero volume.
Qualified *int `json:"qualified"`
// Limit is the max rows requested.
Limit *int `json:"limit"`
// Outliers is the imbalance-ranked flagged underlyings.
Outliers []FlowOutlierRow `json:"outliers"`
}
// FlowStockLeaderRow is one ranked symbol in the stock-flow leaderboard.
// Stock rows carry Vwap; the option leaderboard uses AvgPremium instead.
type FlowStockLeaderRow struct {
// Symbol is the ranked symbol.
Symbol string `json:"symbol"`
// NetVolume is net shares (BuyVolume - SellVolume).
NetVolume *int64 `json:"netVolume"`
// NetNotional is the net dollar flow (net shares × VWAP).
NetNotional *float64 `json:"netNotional"`
// BuyVolume is the buy-classified share volume.
BuyVolume *int64 `json:"buyVolume"`
// SellVolume is the sell-classified share volume.
SellVolume *int64 `json:"sellVolume"`
// Vwap is the volume-weighted average trade price over the window.
Vwap *float64 `json:"vwap"`
// TradeCount is the number of trades over the window.
TradeCount *int `json:"tradeCount"`
// LastTradeUtc is the timestamp of the most recent print.
LastTradeUtc string `json:"lastTradeUtc"`
}
// FlowStockLeaderboardResponse is the typed body of
// GET /v1/flow/stocks/leaderboard: top-N net-dollar buyers and sellers.
type FlowStockLeaderboardResponse struct {
// GeneratedUtc is when the cached snapshot was generated (ISO-8601 UTC).
GeneratedUtc string `json:"generatedUtc"`
// N is the number of ranked rows requested per side.
N *int `json:"n"`
// WindowMinutes is the aggregation window in minutes.
WindowMinutes *int `json:"windowMinutes"`
// Buyers is the top net-dollar buyers.
Buyers []FlowStockLeaderRow `json:"buyers"`
// Sellers is the top net-dollar sellers.
Sellers []FlowStockLeaderRow `json:"sellers"`
}
// FlowStockOutliersResponse is the typed body of
// GET /v1/flow/stocks/outliers.
type FlowStockOutliersResponse struct {
// GeneratedUtc is when the cached snapshot was generated (ISO-8601 UTC).
GeneratedUtc string `json:"generatedUtc"`
// WindowMinutes is the aggregation window in minutes.
WindowMinutes *int `json:"windowMinutes"`
// Tracked is the number of symbols evaluated.
Tracked *int `json:"tracked"`
// Qualified is the symbols that met minTrades and had non-zero volume.
Qualified *int `json:"qualified"`
// Limit is the max rows requested.
Limit *int `json:"limit"`
// Outliers is the imbalance-ranked flagged symbols.
Outliers []FlowOutlierRow `json:"outliers"`
}
// ── Flow signals (unusual-flow feed, Alpha+) ─────────────────────────────────
//
// Per-underlying scored/classified unusual-flow signals. Snake_case wire
// shape (analytics family). Both endpoints reuse FlowSignal.
// FlowSignalsChain is the settled-chain reference levels echoed alongside the
// signals. Computed once per request from the settled snapshot — independent
// of the live flow surface. All fields are nil when the chain snapshot is
// unavailable.
type FlowSignalsChain struct {
// CallWall is the strike with the largest settled call GEX —
// upside dealer-defended level.
CallWall *float64 `json:"call_wall"`
// PutWall is the strike with the largest settled put GEX —
// downside dealer-defended level.
PutWall *float64 `json:"put_wall"`
// MaxPain is the strike where total option-holder loss is maximized
// at expiry.
MaxPain *float64 `json:"max_pain"`
// GammaFlip is the settled gamma-flip strike (sign change of net
// GEX across the chain).
GammaFlip *float64 `json:"gamma_flip"`
}
// FlowSignalScoreBreakdown is the component contributions that sum to the
// headline Score. Weights are server-tunable so absolute values may shift,
// but the ordering of components is stable.
type FlowSignalScoreBreakdown struct {
// Premium is the premium-size contribution (the larger the dollar
// premium, the more points).
Premium *int `json:"premium"`
// SizeVsOi is the print size contribution relative to the
// contract's open interest.
SizeVsOi *int `json:"size_vs_oi"`
// Aggressor is the NBBO aggressor-strength contribution —
// above-ask / at-ask earn more than mid.
Aggressor *int `json:"aggressor"`
// Sweep is the sweep boost (≥2 same-side prints on one contract
// within ~500ms).
Sweep *int `json:"sweep"`
// OpeningBias is the OI-simulator opening-bias contribution.
OpeningBias *int `json:"opening_bias"`
// Tenor is the DTE contribution — short-dated prints score
// differently than long-dated.
Tenor *int `json:"tenor"`
}
// FlowSignalEnrichment is the chain-derived context attached to a signal.
// All numeric fields are nil and Moneyness is "unknown" when the contract
// isn't in the settled chain snapshot.
type FlowSignalEnrichment struct {
// Iv is the contract implied vol (decimal, e.g. 0.62 = 62%).
Iv *float64 `json:"iv"`
// Delta is the contract delta (signed; positive for calls, negative
// for puts).
Delta *float64 `json:"delta"`
// Gamma is the contract gamma (per-share).
Gamma *float64 `json:"gamma"`
// IvVsAtm is IV minus the nearest ATM IV (signed).
IvVsAtm *float64 `json:"iv_vs_atm"`
// Moneyness is "OTM" / "ATM" / "ITM" / "unknown".
Moneyness string `json:"moneyness"`
// EstimatedDeltaNotional is the estimated dollar delta-notional of this
// print.
EstimatedDeltaNotional *float64 `json:"estimated_delta_notional"`
// HypotheticalGexImpactIfOpening is the standalone gamma-$ this print
// would add if it were opening and fully dealer-absorbed. NOT applied to
// the live chain — don't sum it against /v1/flow/gex.
HypotheticalGexImpactIfOpening *float64 `json:"hypothetical_gex_impact_if_opening"`
}
// FlowSignal is one scored unusual-flow signal — a coalesced view of one
// notable (block-sized) print on a single contract. Same shape across
// GET /v1/flow/signals/{symbol} and the TopSignals array of
// GET /v1/flow/signals/{symbol}/summary.
type FlowSignal struct {
// Ts is the trade timestamp (ISO-8601 UTC).
Ts string `json:"ts"`
// Expiry is the contract expiry (YYYY-MM-DD).
Expiry string `json:"expiry"`
// Strike is the contract strike price.
Strike *float64 `json:"strike"`
// Right is "C" (call) or "P" (put).
Right string `json:"right"`
// Side is the upstream buy/sell/mid aggressor classification (distinct
// from the NBBO Aggressor label).
Side string `json:"side"`
// Price is the trade price.
Price *float64 `json:"price"`
// Size is the trade size in contracts.
Size *int64 `json:"size"`
// Premium is the dollar premium of this print: Price * Size * 100.
Premium *float64 `json:"premium"`
// Dte is days to expiry at trade time.
Dte *int `json:"dte"`
// Structure is "block" (lone block-sized print) or "sweep" (≥2
// same-side prints on one contract within ~500ms).
Structure string `json:"structure"`
// Aggressor is the NBBO position at trade: "above_ask" / "at_ask" /
// "mid" / "at_bid" / "below_bid".
Aggressor string `json:"aggressor"`
// OpenCloseBias is a contract-level OI-simulator inference:
// "opening_bias" / "closing_bias" / "unknown". Not a per-print label.
OpenCloseBias string `json:"open_close_bias"`
// OpenCloseConfidence is the simulator confidence weight for the bias
// above.
OpenCloseConfidence *float64 `json:"open_close_confidence"`
// ContractNetOiDelta is the signed simulator estimate of contracts
// opened (+) or closed (−) today on this contract.
ContractNetOiDelta *int64 `json:"contract_net_oi_delta"`
// Intent is "bullish" / "bearish" / "neutral". Neutral whenever
// OpenCloseBias == "closing_bias" (can't attribute on unwinds) or
// Side == "mid".
Intent string `json:"intent"`
// Score is the 0–100 composite (ScoreBreakdown components sum to this).
Score *int `json:"score"`
// Conviction is "low" / "medium" / "high".
Conviction string `json:"conviction"`
// Tags is a subset of "sweep", "block", "opening", "closing", "0dte",
// "whale" (premium ≥ $1M), "golden" (top decile in this response set
// AND score ≥ 70 absolute).
Tags []string `json:"tags"`
// ScoreBreakdown is the score component contributions — they sum
// to Score.
ScoreBreakdown *FlowSignalScoreBreakdown `json:"score_breakdown"`
// Enrichment is the chain-derived context (greeks, moneyness,
// estimated delta-notional).
Enrichment *FlowSignalEnrichment `json:"enrichment"`
}
// FlowSignalsResponse is the typed body of GET /v1/flow/signals/{symbol}:
// the scored, classified unusual-flow feed. Each notable print in the
// look-back window is coalesced into a signal, scored 0–100, and ranked
// highest score first. Requires the Alpha plan.
type FlowSignalsResponse struct {
// Symbol is the underlying ticker echoed from the request path.
Symbol string `json:"symbol"`
// AsOf is the timestamp this snapshot was computed for (ISO-8601 UTC).
AsOf string `json:"as_of"`
// WindowMinutes is the look-back window applied (minutes).
WindowMinutes *int `json:"window_minutes"`
// Expiry is the expiration filter echoed back, or nil.
Expiry *string `json:"expiry"`
// UnderlyingPrice is the spot mid at the snapshot time.
UnderlyingPrice *float64 `json:"underlying_price"`
// Chain is the settled-chain reference levels (computed once per
// request).
Chain *FlowSignalsChain `json:"chain"`
// Count is the number of signals returned after server-side filtering.