extract_order_key_from_receipt

Documentation for eth_defi.gmx.events.extract_order_key_from_receipt function.

extract_order_key_from_receipt(web3, receipt)

Extract order key from OrderCreated or OrderExecuted event in receipt.

This function handles both GMX order execution models:

  • Two-phase orders (limit orders): Look for OrderCreated event, order is pending until keeper executes it in a separate transaction.

  • Single-phase orders (market orders): Look for OrderExecuted event, order is created and executed atomically in the same transaction.

Parameters
  • web3 (web3.main.Web3) – Web3 instance

  • receipt (dict) – Transaction receipt from order creation/execution

Returns

The 32-byte order key

Raises

ValueError – If no OrderCreated or OrderExecuted event found in receipt

Return type

bytes