TradeExecutionResult

Documentation for eth_defi.gmx.gas_monitor.TradeExecutionResult Python class.

class TradeExecutionResult

Bases: object

Result of a trade execution attempt.

Provides comprehensive information about trade outcome, including success/failure status, gas costs, and any error information. This allows graceful handling of failures without crashing.

Parameters
  • success – Whether the trade was executed successfully

  • status – Status code - ‘executed’, ‘failed’, or ‘rejected’

  • reason – Failure reason if not successful - ‘out_of_gas’, ‘reverted’, ‘critical_balance’, etc.

  • tx_hash – Transaction hash if submitted (None if rejected before submission)

  • receipt – Transaction receipt if confirmed (None otherwise)

  • order_result – The original OrderResult that was attempted

  • gas_check – Pre-trade gas balance check result

  • gas_used – Actual gas used (from receipt, None if not executed)

  • gas_cost_native – Actual gas cost in native token (None if not executed)

  • gas_cost_usd – Actual gas cost in USD (None if not executed or price unavailable)

  • error_message – Detailed error message if failed

Attributes summary

success

status

reason

tx_hash

receipt

order_result

gas_check

gas_used

gas_cost_native

gas_cost_usd

error_message

Methods summary

__init__(success, status, reason, tx_hash, ...)

__init__(success, status, reason, tx_hash, receipt, order_result, gas_check, gas_used, gas_cost_native, gas_cost_usd, error_message)
Parameters
Return type

None