LatestPrice
Python pydantic class corresponding to json type `latest.price`
.
- class gwatn.types.LatestPrice(*, FromGNodeAlias, FromGNodeInstanceId, PriceTimes1000, PriceUnit, MarketSlotName, IrlTimeUtc=None, MessageId=None, TypeName='latest.price', Version='000')
Latest Price for a MarketType, sent by a MarketMaker.
The price of the current MarketSlot [More info](https://gridworks.readthedocs.io/en/latest/market-slot.html).
- Parameters:
FromGNodeAlias (str) –
FromGNodeInstanceId (str) –
PriceTimes1000 (int) –
PriceUnit (MarketPriceUnit) –
MarketSlotName (str) –
IrlTimeUtc (str | None) –
MessageId (str | None) –
TypeName (Literal['latest.price']) –
Version (str) –
- FromGNodeAlias:
Description:
Format: LeftRightDot
- FromGNodeInstanceId:
Description:
Format: UuidCanonicalTextual
- PriceTimes1000:
Description:
- PriceUnit:
Description:
- MarketSlotName:
Description:
Format: MarketSlotNameLrdFormat
- IrlTimeUtc:
Description:
Format: IsoFormat
- MessageId:
Description:
Format: UuidCanonicalTextual
- class gwatn.types.latest_price.check_is_uuid_canonical_textual(v)
UuidCanonicalTextual format: A string of hex words separated by hyphens of length 8-4-4-4-12.
- Raises:
ValueError – if not UuidCanonicalTextual format
- Parameters:
v (str) –
- class gwatn.types.latest_price.check_is_iso_format(v)
- Parameters:
v (str) –
- class gwatn.types.latest_price.check_is_left_right_dot(v)
LeftRightDot format: Lowercase alphanumeric words separated by periods, most significant word (on the left) starting with an alphabet character.
- Raises:
ValueError – if not LeftRightDot format
- Parameters:
v (str) –
- class gwatn.types.latest_price.check_is_market_slot_name_lrd_format(v)
- MaketSlotNameLrdFormat: the format of a MarketSlotName.
The first word must be a MarketTypeName
The last word (unix time of market slot start) must
be a 10-digit integer divisible by 300 (i.e. all MarketSlots start at the top of 5 minutes) - More strictly, the last word must be the start of a MarketSlot for that MarketType (i.e. divisible by 3600 for hourly markets) - The middle words have LeftRightDot format (GNodeAlias of the MarketMaker)
Example: rt60gate5.d1.isone.ver.keene.1673539200
- Parameters:
v (str) –
- class gwatn.types.LatestPrice_Maker(from_g_node_alias, from_g_node_instance_id, price_times1000, price_unit, market_slot_name, irl_time_utc, message_id)
- Parameters:
from_g_node_alias (str) –
from_g_node_instance_id (str) –
price_times1000 (int) –
price_unit (MarketPriceUnit) –
market_slot_name (str) –
irl_time_utc (str | None) –
message_id (str | None) –
- classmethod tuple_to_type(tuple)
Given a Python class object, returns the serialized JSON type object
- Parameters:
tuple (LatestPrice) –
- Return type:
str
- classmethod type_to_tuple(t)
Given a serialized JSON type object, returns the Python class object
- Parameters:
t (str) –
- Return type: