OrderExecutionResult

Documentation for eth_defi.gmx.events.OrderExecutionResult Python class.

class OrderExecutionResult

Bases: object

Result of GMX order execution.

This dataclass aggregates information from order execution events (OrderExecuted, OrderFrozen, OrderCancelled) and position events (PositionIncrease, PositionDecrease).

Attributes summary

order_key

The order key (32-byte identifier)

status

Execution status

account

Account address that owns the order

execution_price

Execution price (30 decimal precision)

size_delta_usd

Size delta in USD (30 decimal precision)

size_delta_in_tokens

Size delta in tokens

collateral_delta

Collateral delta amount (can be negative for decreases)

pnl_usd

Realised PnL in USD (30 decimal precision, for decrease orders)

price_impact_usd

Price impact in USD (30 decimal precision)

fees

Execution fees

reason

Error reason string (for frozen/cancelled orders)

reason_bytes

Raw error reason bytes (for frozen/cancelled orders)

decoded_error

Decoded error message from reason_bytes

position_key

Position key (if position was modified)

is_long

Whether the position is long

Methods summary

__init__(order_key, status[, account, ...])

order_key: bytes

The order key (32-byte identifier)

status: Literal['executed', 'frozen', 'cancelled']

Execution status

account: Optional[eth_typing.evm.HexAddress]

Account address that owns the order

execution_price: int | None

Execution price (30 decimal precision)

size_delta_usd: int | None

Size delta in USD (30 decimal precision)

size_delta_in_tokens: int | None

Size delta in tokens

collateral_delta: int | None

Collateral delta amount (can be negative for decreases)

pnl_usd: int | None

Realised PnL in USD (30 decimal precision, for decrease orders)

price_impact_usd: int | None

Price impact in USD (30 decimal precision)

fees: eth_defi.gmx.events.OrderFees | None

Execution fees

reason: str | None

Error reason string (for frozen/cancelled orders)

reason_bytes: bytes | None

Raw error reason bytes (for frozen/cancelled orders)

decoded_error: str | None

Decoded error message from reason_bytes

position_key: bytes | None

Position key (if position was modified)

is_long: bool | None

Whether the position is long

__init__(order_key, status, account=None, execution_price=None, size_delta_usd=None, size_delta_in_tokens=None, collateral_delta=None, pnl_usd=None, price_impact_usd=None, fees=None, reason=None, reason_bytes=None, decoded_error=None, position_key=None, is_long=None)
Parameters
Return type

None