TradeExecutionResult
Documentation for eth_defi.gmx.gas_monitor.TradeExecutionResult Python class.
- class TradeExecutionResult
Bases:
objectResult 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
successstatusreasontx_hashreceiptorder_resultgas_checkgas_usedgas_cost_nativegas_cost_usderror_messageMethods 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
success (bool) –
status (str) –
reason (str | None) –
tx_hash (str | None) –
receipt (dict | None) –
order_result (OrderResult | None) –
gas_check (eth_defi.gmx.gas_monitor.GasCheckResult | None) –
gas_used (int | None) –
gas_cost_native (decimal.Decimal | None) –
gas_cost_usd (float | None) –
error_message (str | None) –
- Return type
None