77
88@modelclass
99class MinuteSnapshot :
10- "Most recent minute bar."
10+ """Most recent minute bar."""
11+
1112 accumulated_volume : Optional [float ] = None
1213 open : Optional [float ] = None
1314 high : Optional [float ] = None
@@ -18,20 +19,24 @@ class MinuteSnapshot:
1819 otc : Optional [bool ] = None
1920 timestamp : Optional [int ] = None
2021 transactions : Optional [int ] = None
22+ fractional_volume : Optional [str ] = None
23+ fractional_accumulated_volume : Optional [str ] = None
2124
2225 @staticmethod
2326 def from_dict (d ):
2427 return MinuteSnapshot (
25- d .get ("av" , None ),
26- d .get ("o" , None ),
27- d .get ("h" , None ),
28- d .get ("l" , None ),
29- d .get ("c" , None ),
30- d .get ("v" , None ),
31- d .get ("vw" , None ),
32- d .get ("otc" , None ),
33- d .get ("t" , None ),
34- d .get ("n" , None ),
28+ accumulated_volume = d .get ("av" ),
29+ open = d .get ("o" ),
30+ high = d .get ("h" ),
31+ low = d .get ("l" ),
32+ close = d .get ("c" ),
33+ volume = d .get ("v" ),
34+ vwap = d .get ("vw" ),
35+ otc = d .get ("otc" ),
36+ timestamp = d .get ("t" ),
37+ transactions = d .get ("n" ),
38+ fractional_volume = d .get ("dv" ),
39+ fractional_accumulated_volume = d .get ("dav" ),
3540 )
3641
3742
@@ -318,10 +323,32 @@ class UniversalSnapshotSession:
318323 low : Optional [float ] = None
319324 previous_close : Optional [float ] = None
320325 volume : Optional [float ] = None
326+ vwap : Optional [float ] = None
327+ last_updated : Optional [int ] = None
328+ fractional_volume : Optional [str ] = None
321329
322330 @staticmethod
323331 def from_dict (d ):
324- return UniversalSnapshotSession (** d )
332+ return UniversalSnapshotSession (
333+ price = d .get ("price" ),
334+ change = d .get ("change" ),
335+ change_percent = d .get ("change_percent" ),
336+ early_trading_change = d .get ("early_trading_change" ),
337+ early_trading_change_percent = d .get ("early_trading_change_percent" ),
338+ regular_trading_change = d .get ("regular_trading_change" ),
339+ regular_trading_change_percent = d .get ("regular_trading_change_percent" ),
340+ late_trading_change = d .get ("late_trading_change" ),
341+ late_trading_change_percent = d .get ("late_trading_change_percent" ),
342+ open = d .get ("open" ),
343+ close = d .get ("close" ),
344+ high = d .get ("high" ),
345+ low = d .get ("low" ),
346+ previous_close = d .get ("previous_close" ),
347+ volume = d .get ("volume" ),
348+ vwap = d .get ("vwap" ),
349+ last_updated = d .get ("last_updated" ),
350+ fractional_volume = d .get ("decimal_volume" ),
351+ )
325352
326353
327354@modelclass
@@ -330,16 +357,29 @@ class UniversalSnapshotLastQuote:
330357
331358 ask : Optional [float ] = None
332359 ask_size : Optional [float ] = None
360+ ask_exchange : Optional [int ] = None
333361 bid : Optional [float ] = None
334362 bid_size : Optional [float ] = None
363+ bid_exchange : Optional [int ] = None
335364 midpoint : Optional [float ] = None
336365 exchange : Optional [int ] = None
337366 timeframe : Optional [str ] = None
338367 last_updated : Optional [int ] = None
339368
340369 @staticmethod
341370 def from_dict (d ):
342- return UniversalSnapshotLastQuote (** d )
371+ return UniversalSnapshotLastQuote (
372+ ask = d .get ("ask" ),
373+ ask_size = d .get ("ask_size" ),
374+ ask_exchange = d .get ("ask_exchange" ),
375+ bid = d .get ("bid" ),
376+ bid_size = d .get ("bid_size" ),
377+ bid_exchange = d .get ("bid_exchange" ),
378+ midpoint = d .get ("midpoint" ),
379+ exchange = d .get ("exchange" ),
380+ timeframe = d .get ("timeframe" ),
381+ last_updated = d .get ("last_updated" ),
382+ )
343383
344384
345385@modelclass
@@ -355,10 +395,51 @@ class UniversalSnapshotLastTrade:
355395 last_updated : Optional [int ] = None
356396 participant_timestamp : Optional [int ] = None
357397 sip_timestamp : Optional [int ] = None
398+ fractional_size : Optional [str ] = None
399+
400+ @staticmethod
401+ def from_dict (d ):
402+ return UniversalSnapshotLastTrade (
403+ id = d .get ("id" ),
404+ price = d .get ("price" ),
405+ size = d .get ("size" ),
406+ exchange = d .get ("exchange" ),
407+ conditions = d .get ("conditions" ),
408+ timeframe = d .get ("timeframe" ),
409+ last_updated = d .get ("last_updated" ),
410+ participant_timestamp = d .get ("participant_timestamp" ),
411+ sip_timestamp = d .get ("sip_timestamp" ),
412+ fractional_size = d .get ("decimal_size" ),
413+ )
414+
415+
416+ @modelclass
417+ class UniversalSnapshotLastMinute :
418+ """Contains the most recent minute-level aggregate for the asset."""
419+
420+ open : Optional [float ] = None
421+ close : Optional [float ] = None
422+ high : Optional [float ] = None
423+ low : Optional [float ] = None
424+ volume : Optional [float ] = None
425+ vwap : Optional [float ] = None
426+ transactions : Optional [int ] = None
427+ last_updated : Optional [int ] = None
428+ fractional_volume : Optional [str ] = None
358429
359430 @staticmethod
360431 def from_dict (d ):
361- return UniversalSnapshotLastTrade (** d )
432+ return UniversalSnapshotLastMinute (
433+ open = d .get ("open" ),
434+ close = d .get ("close" ),
435+ high = d .get ("high" ),
436+ low = d .get ("low" ),
437+ volume = d .get ("volume" ),
438+ vwap = d .get ("vwap" ),
439+ transactions = d .get ("transactions" ),
440+ last_updated = d .get ("last_updated" ),
441+ fractional_volume = d .get ("decimal_volume" ),
442+ )
362443
363444
364445@modelclass
@@ -374,7 +455,14 @@ class UniversalSnapshotUnderlyingAsset:
374455
375456 @staticmethod
376457 def from_dict (d ):
377- return UniversalSnapshotUnderlyingAsset (** d )
458+ return UniversalSnapshotUnderlyingAsset (
459+ ticker = d .get ("ticker" ),
460+ price = d .get ("price" ),
461+ value = d .get ("value" ),
462+ change_to_break_even = d .get ("change_to_break_even" ),
463+ timeframe = d .get ("timeframe" ),
464+ last_updated = d .get ("last_updated" ),
465+ )
378466
379467
380468@modelclass
@@ -389,18 +477,25 @@ class UniversalSnapshotDetails:
389477
390478 @staticmethod
391479 def from_dict (d ):
392- return UniversalSnapshotDetails (** d )
480+ return UniversalSnapshotDetails (
481+ contract_type = d .get ("contract_type" ),
482+ exercise_style = d .get ("exercise_style" ),
483+ expiration_date = d .get ("expiration_date" ),
484+ shares_per_contract = d .get ("shares_per_contract" ),
485+ strike_price = d .get ("strike_price" ),
486+ )
393487
394488
395489@modelclass
396490class UniversalSnapshot :
397- """Contains snapshot data for an asset."""
491+ """Contains snapshot data for an asset (stocks, options, indices, fx, crypto) ."""
398492
399493 ticker : Optional [str ] = None
400494 type : Optional [str ] = None
401495 session : Optional [UniversalSnapshotSession ] = None
402496 last_quote : Optional [UniversalSnapshotLastQuote ] = None
403497 last_trade : Optional [UniversalSnapshotLastTrade ] = None
498+ last_minute : Optional [UniversalSnapshotLastMinute ] = None
404499 greeks : Optional [Greeks ] = None
405500 underlying_asset : Optional [UniversalSnapshotUnderlyingAsset ] = None
406501 details : Optional [UniversalSnapshotDetails ] = None
@@ -412,12 +507,15 @@ class UniversalSnapshot:
412507 fair_market_value : Optional [float ] = None
413508 error : Optional [str ] = None
414509 message : Optional [str ] = None
510+ value : Optional [float ] = None
511+ last_updated : Optional [int ] = None
512+ timeframe : Optional [str ] = None
415513
416514 @staticmethod
417515 def from_dict (d ):
418516 return UniversalSnapshot (
419- ticker = d .get ("ticker" , None ),
420- type = d .get ("type" , None ),
517+ ticker = d .get ("ticker" ),
518+ type = d .get ("type" ),
421519 session = (
422520 None
423521 if "session" not in d
@@ -433,7 +531,12 @@ def from_dict(d):
433531 if "last_trade" not in d
434532 else UniversalSnapshotLastTrade .from_dict (d ["last_trade" ])
435533 ),
436- greeks = None if "greeks" not in d else Greeks .from_dict (d ["greeks" ]),
534+ last_minute = (
535+ None
536+ if "last_minute" not in d
537+ else UniversalSnapshotLastMinute .from_dict (d ["last_minute" ])
538+ ),
539+ greeks = (None if "greeks" not in d else Greeks .from_dict (d ["greeks" ])),
437540 underlying_asset = (
438541 None
439542 if "underlying_asset" not in d
@@ -444,12 +547,15 @@ def from_dict(d):
444547 if "details" not in d
445548 else UniversalSnapshotDetails .from_dict (d ["details" ])
446549 ),
447- break_even_price = d .get ("break_even_price" , None ),
448- implied_volatility = d .get ("implied_volatility" , None ),
449- open_interest = d .get ("open_interest" , None ),
450- market_status = d .get ("market_status" , None ),
451- name = d .get ("name" , None ),
452- fair_market_value = d .get ("fmv" , None ),
453- error = d .get ("error" , None ),
454- message = d .get ("message" , None ),
550+ break_even_price = d .get ("break_even_price" ),
551+ implied_volatility = d .get ("implied_volatility" ),
552+ open_interest = d .get ("open_interest" ),
553+ market_status = d .get ("market_status" ),
554+ name = d .get ("name" ),
555+ fair_market_value = d .get ("fmv" ),
556+ error = d .get ("error" ),
557+ message = d .get ("message" ),
558+ value = d .get ("value" ),
559+ last_updated = d .get ("last_updated" ),
560+ timeframe = d .get ("timeframe" ),
455561 )
0 commit comments