electricity_trading_pb2
frequenz.api.electricity_trading.v1.electricity_trading_pb2 ¤
Generated protocol buffer code.
Attributes¤
frequenz.api.electricity_trading.v1.electricity_trading_pb2.MARKET_SIDE_BUY
module-attribute
¤
BUY: Order to purchase electricity. This is referred to as a 'bid' in the order book.
frequenz.api.electricity_trading.v1.electricity_trading_pb2.MARKET_SIDE_SELL
module-attribute
¤
SELL: Order to sell electricity. This is referred to as an 'ask' or 'offer' in the order book.
frequenz.api.electricity_trading.v1.electricity_trading_pb2.MARKET_SIDE_UNSPECIFIED
module-attribute
¤
UNSPECIFIED: The side of the market has not been set.
frequenz.api.electricity_trading.v1.electricity_trading_pb2.ORDER_EXECUTION_OPTION_AON
module-attribute
¤
All or None: Order must be executed in its entirety, or not executed at all.
frequenz.api.electricity_trading.v1.electricity_trading_pb2.ORDER_EXECUTION_OPTION_FOK
module-attribute
¤
Fill or Kill: Order must be executed immediately in its entirety, or not at all.
frequenz.api.electricity_trading.v1.electricity_trading_pb2.ORDER_EXECUTION_OPTION_IOC
module-attribute
¤
Immediate or Cancel: Any portion of an order that cannot be filled immediately will be cancelled.
frequenz.api.electricity_trading.v1.electricity_trading_pb2.ORDER_EXECUTION_OPTION_NONE
module-attribute
¤
Order remains open until it's fully fulfilled, cancelled by the client,
valid_until
timestamp is reached, or the end of the trading session.
frequenz.api.electricity_trading.v1.electricity_trading_pb2.ORDER_EXECUTION_OPTION_UNSPECIFIED
module-attribute
¤
UNSPECIFIED: The order execution option has not been set.
frequenz.api.electricity_trading.v1.electricity_trading_pb2.ORDER_STATE_ACTIVE
module-attribute
¤
ACTIVE: The order has been confirmed and is open in the market. It may be unfilled or partially filled.
frequenz.api.electricity_trading.v1.electricity_trading_pb2.ORDER_STATE_CANCELED
module-attribute
¤
CANCELED: The order has been cancelled. This can occur due to a cancellation request by the market participant, system, or market operator.
frequenz.api.electricity_trading.v1.electricity_trading_pb2.ORDER_STATE_CANCEL_REJECTED
module-attribute
¤
CANCEL_REJECTED: The order cancellation request was rejected, likely due to it having already been filled or expired.
frequenz.api.electricity_trading.v1.electricity_trading_pb2.ORDER_STATE_CANCEL_REQUESTED
module-attribute
¤
CANCEL_REQUESTED: A cancellation request for the order has been submitted but the order is not yet removed from the order book.
frequenz.api.electricity_trading.v1.electricity_trading_pb2.ORDER_STATE_EXPIRED
module-attribute
¤
EXPIRED: The order has not been filled within the defined duration and has expired.
frequenz.api.electricity_trading.v1.electricity_trading_pb2.ORDER_STATE_FAILED
module-attribute
¤
FAILED: The order submission failed and was unable to be placed on the order book, usually due to a validation error or system issue.
frequenz.api.electricity_trading.v1.electricity_trading_pb2.ORDER_STATE_FILLED
module-attribute
¤
FILLED: The order has been completely filled and there are no remaining quantities on the order.
frequenz.api.electricity_trading.v1.electricity_trading_pb2.ORDER_STATE_HIBERNATE
module-attribute
¤
HIBERNATE: The order has been entered into the system but is not currently exposed to the market. This could be due to certain conditions not yet being met.
frequenz.api.electricity_trading.v1.electricity_trading_pb2.ORDER_STATE_PENDING
module-attribute
¤
PENDING: The order has been sent to the marketplace but has not yet been confirmed. This can be due to awaiting validation or system processing.
frequenz.api.electricity_trading.v1.electricity_trading_pb2.ORDER_STATE_RECALL
module-attribute
¤
RECALL: The order has been recalled. This could be due to a system issue or a request from the market participant or market operator.
frequenz.api.electricity_trading.v1.electricity_trading_pb2.ORDER_STATE_UNSPECIFIED
module-attribute
¤
UNSPECIFIED: The order state is not known. This is usually the default state of a newly created order object before any operations have been applied.
frequenz.api.electricity_trading.v1.electricity_trading_pb2.ORDER_TYPE_BALANCE
module-attribute
¤
BALANCE: (Not yet supported) Balance order aims to balance supply and demand, usually at a specific location or within a system.
frequenz.api.electricity_trading.v1.electricity_trading_pb2.ORDER_TYPE_BLOCK
module-attribute
¤
BLOCK: (Not yet supported) User defined block order, generally a large quantity order filled all at once.
frequenz.api.electricity_trading.v1.electricity_trading_pb2.ORDER_TYPE_ICEBERG
module-attribute
¤
ICEBERG: A large order divided into smaller lots to hide the actual order quantity. Only the visible part of the order is shown in the order book.
frequenz.api.electricity_trading.v1.electricity_trading_pb2.ORDER_TYPE_LIMIT
module-attribute
¤
LIMIT: Order to buy or sell at a specific price or better. It remains active until it is filled, cancelled, or expired.
frequenz.api.electricity_trading.v1.electricity_trading_pb2.ORDER_TYPE_PREARRANGED
module-attribute
¤
PRE: (Not yet supported) On exchange prearranged trade, a trade that has been privately negotiated and then submitted to the exchange.
frequenz.api.electricity_trading.v1.electricity_trading_pb2.ORDER_TYPE_PRIVATE
module-attribute
¤
PRIVATE: (Not yet supported) Private and confidential trade, not visible in the public order book and has no market impact.
frequenz.api.electricity_trading.v1.electricity_trading_pb2.ORDER_TYPE_STOP_LIMIT
module-attribute
¤
STOP_LIMIT: An order that will be executed at a specified price, or better, after a given stop price has been reached.
frequenz.api.electricity_trading.v1.electricity_trading_pb2.ORDER_TYPE_UNSPECIFIED
module-attribute
¤
UNSPECIFIED: The order type has not been set.
Classes¤
frequenz.api.electricity_trading.v1.electricity_trading_pb2.CancelAllGridpoolOrdersRequest ¤
frequenz.api.electricity_trading.v1.electricity_trading_pb2.CancelAllGridpoolOrdersResponse ¤
frequenz.api.electricity_trading.v1.electricity_trading_pb2.CancelGridpoolOrderRequest ¤
frequenz.api.electricity_trading.v1.electricity_trading_pb2.CancelGridpoolOrderResponse ¤
frequenz.api.electricity_trading.v1.electricity_trading_pb2.CreateGridpoolOrderRequest ¤
Bases: Message
Represents a request to create a new order for a specific Gridpool.
A Gridpool is a collection of microgrids that can span multiple delivery areas. It's important to note that when submitting an order for a Gridpool, you must group microgrids by their respective delivery areas. This means you should submit separate orders for each delivery area within the Gridpool. Failing to do so could lead to inaccuracies in the bidding process and may not fully represent the capabilities or constraints of the microgrids in different delivery areas. However, in most countries only one delivery area exists, exceptions are countries like e.g. Australia, Germany and the US.
Caution
If a Gridpool contains microgrids in both Delivery Area A and Delivery Area B, you should submit one order for Delivery Area A and another for Delivery Area B, specifying the details for each.
frequenz.api.electricity_trading.v1.electricity_trading_pb2.CreateGridpoolOrderResponse ¤
Bases: Message
Represents the server's response after a new order has been successfully created for a specific Gridpool.
This response provides essential details about the newly created order, such as the unique order ID and the state of the order. By receiving this response, users can be sure that their order has been placed successfully for the designated Gridpool.
frequenz.api.electricity_trading.v1.electricity_trading_pb2.GetGridpoolOrderRequest ¤
frequenz.api.electricity_trading.v1.electricity_trading_pb2.GetGridpoolOrderResponse ¤
frequenz.api.electricity_trading.v1.electricity_trading_pb2.GridpoolOrderFilter ¤
Bases: Message
Parameters for filtering Gridpool orders.
Note
Multiple filters can be used in combination to narrow down the returned results. For example, you can apply both state and side filters simultaneously to list only the open orders on the buy side of the market.
Attributes¤
delivery_area
property
¤
Optional filter for delivery area.
delivery_period
property
¤
Optional filter for delivery period.
states
property
¤
states: google.protobuf.internal.containers.RepeatedScalarFieldContainer[
global___OrderState.ValueType
]
Optional filter for order state.
tag
instance-attribute
¤
Optional filters the listed orders by their associated tag.
frequenz.api.electricity_trading.v1.electricity_trading_pb2.ListGridpoolOrdersRequest ¤
frequenz.api.electricity_trading.v1.electricity_trading_pb2.ListGridpoolOrdersResponse ¤
Bases: Message
Response from listing orders for a given Gridpool.
frequenz.api.electricity_trading.v1.electricity_trading_pb2.ListPublicOrdersRequest ¤
Bases: Message
Request to list all executed public orders with optional filters. This method allows for querying historical data, useful for various analytics tasks.
frequenz.api.electricity_trading.v1.electricity_trading_pb2.ListPublicOrdersResponse ¤
Bases: Message
ListPublicOrdersResponse is a message that contains a list of historic executed public orders. This dataset is vital for tasks such as training machine learning models, backtesting trading strategies, and conducting market analysis.
Attributes¤
pagination_info
property
¤
Metadata for pagination, including token for next page to retrieve.
public_order_lists
property
¤
public_order_lists: google.protobuf.internal.containers.RepeatedCompositeFieldContainer[
global___PublicOrder
]
List of all public orders that met the specified filtering criteria.
frequenz.api.electricity_trading.v1.electricity_trading_pb2.MarketSide ¤
Bases: _MarketSide
Enum for the side of the market that the order is on.
frequenz.api.electricity_trading.v1.electricity_trading_pb2.Order ¤
Bases: Message
Represents an order in the electricity market.
Attributes¤
delivery_area
property
¤
The delivery area where the contract is to be delivered. The representation of the delivery area may vary by jurisdiction.
delivery_period
property
¤
The delivery period for the contract, specified as a start and end timestamp in UTC. It represents the period during which the contract is expected to be fulfilled.
display_quantity
property
¤
Applicable for ICEBERG orders. This is the quantity of the order to be displayed in the order book.
execution_option
instance-attribute
¤
Optional execution options such as All or None, Fill or Kill, etc.
payload
property
¤
Optional user-defined payload individual to a specific order. This can be any data that needs to be associated with the order.
The field can store e.g. JSON objects containing details involved in the order. This feature can simplify application development by eliminating the need for complicated state management to remember the specifics of each order.
By embedding this "state" within the order itself, you can include specifics like which microgrids consume or provide how much power. This makes it easier to manage complex orders and can simplify the logic required in applications.
Example JSON payload: { "microgrids": [ { "microgrid_id": "1", "mwh": 1.0 }, { "microgrid_id": "2", "mwh": 0.5 } ] }
In this example, if the order is exectuted, these microgrids might consume the electricity mentioned in the example JSON payload.
peak_price_delta
property
¤
Applicable for ICEBERG orders. This is the price difference between the peak price and the limit price.
price
property
¤
The limit price at which the contract is to be traded. This is the maximum price for a BUY order or the minimum price for a SELL order.
quantity
property
¤
The quantity of the contract being traded, specified in MWh.
side
instance-attribute
¤
Indicates if the order is on the Buy or Sell side of the market.
stop_price
property
¤
Applicable for STOP_LIMIT orders. This is the stop price that triggers the limit order.
type
instance-attribute
¤
The type of order, such as LIMIT, STOP_LIMIT, ICEBERG etc. This determines how the order is to be executed in the market.
valid_until
property
¤
Do not use if ExecutionOption is set to FOK or IOC. This is an optional UTC timestamp defining the time after which the order should be cancelled if not filled.
frequenz.api.electricity_trading.v1.electricity_trading_pb2.OrderDetail ¤
Bases: Message
Represents an order with full details, including its ID, state and associated UTC timestamps.
Attributes¤
create_time
property
¤
UTC Timestamp when the order was created.
filled_quantity
property
¤
Filled quantity for this order.
modification_time
property
¤
UTC Timestamp of the last update to the order.
open_quantity
property
¤
Remaining open quantity for this order.
state_detail
property
¤
Details of the order's current state.
Classes¤
StateDetail ¤
Bases: Message
Inner message providing details about the current state of the order.
instance-attribute
¤The market operator was the actor.
instance-attribute
¤The system was the actor.
instance-attribute
¤The user was the actor.
instance-attribute
¤The order was added.
instance-attribute
¤The order was deactivated.
instance-attribute
¤The order was deleted.
instance-attribute
¤The order was fully executed.
instance-attribute
¤An iceberg slice was added.
instance-attribute
¤The order was modified.
instance-attribute
¤The order was partially executed.
instance-attribute
¤A quote was added.
instance-attribute
¤A quote was fully executed.
instance-attribute
¤A quote was partially executed.
instance-attribute
¤The order was rejected.
instance-attribute
¤The state of the order is unknown.
instance-attribute
¤The order failed validation.
instance-attribute
¤Actor responsible for the current state.
instance-attribute
¤Reason for the current state.
Bases: _MarketActor
Enum describing the actor responsible for an order state change.
Bases: _StateReason
Enum describing the action that led to the state change.
frequenz.api.electricity_trading.v1.electricity_trading_pb2.OrderExecutionOption ¤
Bases: _OrderExecutionOption
OrderExecutionOption defines specific behavior for the execution of an order. These options provide control on how an order is handled in the market.
Source code in py/frequenz/api/electricity_trading/v1/electricity_trading_pb2.py
frequenz.api.electricity_trading.v1.electricity_trading_pb2.OrderState ¤
Bases: _OrderState
Enum for the state of an order.
frequenz.api.electricity_trading.v1.electricity_trading_pb2.OrderType ¤
Bases: _OrderType
Enum for the order types that can be specified for an order.
frequenz.api.electricity_trading.v1.electricity_trading_pb2.PublicOrder ¤
Bases: Message
Represents a public order in the market.
Each PublicOrder within this response message represents an order that was previously active in the public order book, along with its key attributes and final state.
Attributes¤
buy_delivery_area
property
¤
Delivery area code of the buy side.
delivery_period
property
¤
The delivery period for the contract.
modification_time
property
¤
UTC Timestamp of the last order update or matching.
price
property
¤
The limit price at which the contract is to be traded.
public_order_id
instance-attribute
¤
ID of the order from the public order book.
quantity
property
¤
The quantity of the contract being traded in MWh.
sell_delivery_area
property
¤
Delivery area code of the sell side.
frequenz.api.electricity_trading.v1.electricity_trading_pb2.PublicOrderFilter ¤
Bases: Message
Parameters for filtering the historic, publicly executed orders (trades).
Attributes¤
buy_delivery_area
property
¤
If set, only orders in this buy delivery area are returned.
delivery_period
property
¤
If set, only orders with this delivery period are returned.
sell_delivery_area
property
¤
If set, only orders in this sell delivery area are returned.
states
property
¤
states: google.protobuf.internal.containers.RepeatedScalarFieldContainer[
global___OrderState.ValueType
]
If set, only orders in this state are returned.
frequenz.api.electricity_trading.v1.electricity_trading_pb2.ReceiveGridpoolOrdersStreamRequest ¤
Bases: Message
Subscribe to Gridpool order stream. This method provides real-time updates on Gridpool orders, making it useful for dynamic analytics and real-time decision-making.
frequenz.api.electricity_trading.v1.electricity_trading_pb2.ReceiveGridpoolOrdersStreamResponse ¤
frequenz.api.electricity_trading.v1.electricity_trading_pb2.ReceivePublicOrdersStreamRequest ¤
Bases: Message
Subscribe to public order stream. This method provides real-time updates on newly executed public orders, making it useful for dynamic analytics and real-time decision-making.
frequenz.api.electricity_trading.v1.electricity_trading_pb2.ReceivePublicOrdersStreamResponse ¤
Bases: Message
Response to a subscription request for a stream of public orders. Real-time information on public orders is pushed through this response.
frequenz.api.electricity_trading.v1.electricity_trading_pb2.UpdateGridpoolOrderRequest ¤
Bases: Message
Request to update an existing order for a given Gridpool.
Attributes¤
update_mask
property
¤
Field mask specifying which fields should be updated
update_order_fields
property
¤
The fields that can be updated
Classes¤
UpdateOrder ¤
Bases: Message
Represents the order properties that can be updated after an order has been placed. At least one of the optional fields must be set for an update to take place.
property
¤Applicable for ICEBERG orders. This is the updated quantity of the order to be displayed in the order book.
instance-attribute
¤Updated execution options such as All or None, Fill or Kill, etc.
property
¤Updated user-defined payload individual to a specific order. This can be any data that the user wants to associate with the order.
property
¤Applicable for ICEBERG orders. This is the updated price difference between the peak price and the limit price.
property
¤The updated limit price at which the contract is to be traded. This is the maximum price for a BUY order or the minimum price for a SELL order.
property
¤The updated quantity of the contract being traded, specified in MWh.
property
¤Applicable for STOP_LIMIT orders. This is the updated stop price that triggers the limit order.
property
¤This is an updated timestamp defining the time after which the order should be cancelled if not filled. The timestamp is in UTC.