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_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. The order may be unfilled or partially filled.
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. It may be unfilled or partially filled.
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. The order may be unfilled or partially filled.
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_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. The order may be unfilled or partially filled.
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.
frequenz.api.electricity_trading.v1.electricity_trading_pb2.TRADE_STATE_ACTIVE
module-attribute
¤
ACTIVE: The trade has been executed in the market.
frequenz.api.electricity_trading.v1.electricity_trading_pb2.TRADE_STATE_APPROVAL_REQUESTED
module-attribute
¤
APPROVAL: An approval has been requested.
frequenz.api.electricity_trading.v1.electricity_trading_pb2.TRADE_STATE_CANCELED
module-attribute
¤
CANCELED: The trade 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.TRADE_STATE_CANCEL_REJECTED
module-attribute
¤
CANCEL_REJECTED: The trade cancellation request was rejected.
frequenz.api.electricity_trading.v1.electricity_trading_pb2.TRADE_STATE_CANCEL_REQUESTED
module-attribute
¤
CANCEL_REQUESTED: A cancellation request for the trade has been submitted.
frequenz.api.electricity_trading.v1.electricity_trading_pb2.TRADE_STATE_RECALLED
module-attribute
¤
RECALL: The trade 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.TRADE_STATE_RECALL_REJECTED
module-attribute
¤
RECALL_REJECTED: The trade recall request was rejected.
frequenz.api.electricity_trading.v1.electricity_trading_pb2.TRADE_STATE_RECALL_REQUESTED
module-attribute
¤
RECALL_REQUESTED: A recall request for the trade has been submitted.
frequenz.api.electricity_trading.v1.electricity_trading_pb2.TRADE_STATE_UNSPECIFIED
module-attribute
¤
UNSPECIFIED: The state is not known.
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¤
frequenz.api.electricity_trading.v1.electricity_trading_pb2.GridpoolTradeFilter ¤
Bases: Message
Parameters for filtering Gridpool trades.
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 trades on the buy side of the market.
frequenz.api.electricity_trading.v1.electricity_trading_pb2.ListGridpoolOrdersRequest ¤
Bases: Message
Request to retrieve a list of orders for a specific Gridpool.
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.ListGridpoolTradesRequest ¤
Bases: Message
Request to retrieve a list of trades for a specific Gridpool.
frequenz.api.electricity_trading.v1.electricity_trading_pb2.ListGridpoolTradesResponse ¤
Bases: Message
Response from listing trades for a given Gridpool.
frequenz.api.electricity_trading.v1.electricity_trading_pb2.ListPublicTradesRequest ¤
Bases: Message
Request to list all historic public trades with optional filters. This method allows for querying historical data, useful for various analytics tasks.
frequenz.api.electricity_trading.v1.electricity_trading_pb2.ListPublicTradesResponse ¤
Bases: Message
ListPublicTradesResponse is a message that contains a list of historic public trades. This dataset is vital for tasks such as training machine learning models, backtesting trading strategies, and conducting market analysis.
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
¤
Optional; 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", "mw": 1.0 }, { "microgrid_id": "2", "mw": 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
¤
Optional; 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.
side
instance-attribute
¤
Indicates if the order is on the Buy or Sell side of the market.
stop_price
property
¤
Optional; 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
¤
Optional; 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¤
modification_time
property
¤
UTC Timestamp of the last update to the order.
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 order was deactivated.
instance-attribute
¤The order was fully executed.
instance-attribute
¤An iceberg slice was added.
instance-attribute
¤The order was partially executed.
instance-attribute
¤A quote was fully executed.
instance-attribute
¤A quote was partially executed.
instance-attribute
¤The state of the order is unknown.
instance-attribute
¤The order failed validation.
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 restriction behavior for the execution
of an order. These options provide control on how an order is handled in the
market.
If no OrderExecutionOption is set, the order remains open until it's fully
fulfilled, cancelled by the client, valid_until
timestamp is reached, or
the end of the trading session.
Source code in 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.PublicTrade ¤
Bases: Message
Represents a public trade in the market.
Each trade
within this response message represents two orders that were
previously active in the public order book and matched, along with its key
attributes and final state.
Note
A trade
refers to the event where a buy order and a sell order are
matched and executed, representing the final state of those orders.
While "executed" or "filled" orders pertain to the completion of
individual buy or sell orders, a "trade" signifies the actual
transaction where both types of orders (buy and sell) are successfully
matched and carried out. This distinction is crucial, as a trade is the
broader occurrence resulting from the execution of both sides of the
transaction, although post-trade processes like settlement may still
follow. The term 'trade' is sometimes used interchangeably with
'executed order' in trading platforms, but it technically encompasses
the completion of both a buy and a sell order.
Attributes¤
frequenz.api.electricity_trading.v1.electricity_trading_pb2.PublicTradeFilter ¤
Bases: Message
Parameters for filtering historic public trades.
Note
In some countries or regions the buy and sell delivery area can be different. This is usually referred to as cross bid.
Note
Multiple filters can be used in combination to narrow down the returned results. For example, you can apply both state and delivery area filters simultaneously to list only the trades that occurred at a certain time in a specific delivery area.
Attributes¤
buy_delivery_area
property
¤
Optional; If set, only trades in this buy delivery area are returned.
delivery_period
property
¤
Optional; If set, only trades with this delivery period are returned.
sell_delivery_area
property
¤
Optional; If set, only trades in this sell delivery area are returned.
states
property
¤
If set, only trades 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.ReceiveGridpoolTradesStreamRequest ¤
Bases: Message
Subscribe to the stream of gridpool trades. This method provides real-time updates on newly executed gridpool trades, making it useful dynamic analytics and real-time decision-making.
frequenz.api.electricity_trading.v1.electricity_trading_pb2.ReceiveGridpoolTradesStreamResponse ¤
frequenz.api.electricity_trading.v1.electricity_trading_pb2.ReceivePublicTradesStreamRequest ¤
Bases: Message
Subscribe to the stream of public trades. This method provides real-time updates on newly executed public trades, making it useful dynamic analytics and real-time decision-making.
frequenz.api.electricity_trading.v1.electricity_trading_pb2.ReceivePublicTradesStreamResponse ¤
Bases: Message
Response to a subscription request for a stream of public trades. Real-time information on public trades is pushed through this response.
frequenz.api.electricity_trading.v1.electricity_trading_pb2.Trade ¤
Bases: Message
Represents a private trade in the electricity market.
Note
This represents either the buy or sell side of a trade which is different to public trade information which always represents both sides of a market.
frequenz.api.electricity_trading.v1.electricity_trading_pb2.TradeState ¤
Bases: _TradeState
Enum for the state of a trade.
frequenz.api.electricity_trading.v1.electricity_trading_pb2.UpdateGridpoolOrderRequest ¤
Bases: Message
Request to update an existing order for a given Gridpool.
Attributes¤
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
¤Optional; Applicable for ICEBERG orders. This is the updated quantity of the order to be displayed in the order book.
instance-attribute
¤Optional; Updated execution options such as All or None, Fill or Kill, etc.
property
¤Optional; Updated user-defined payload individual to a specific order. This can be any data that the user wants to associate with the order.
property
¤Optional; Applicable for ICEBERG orders. This is the updated price difference between the peak price and the limit price.
property
¤Optional; 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
¤Optional; The updated quantity of the contract being traded, specified in MW.
property
¤Optional; Applicable for STOP_LIMIT orders. This is the updated stop price that triggers the limit order.
property
¤Optional; This is an updated timestamp defining the time after which the order should be cancelled if not filled. The timestamp is in UTC.