File size: 1,379 Bytes
115a637
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
"""
modules/execution_types.py — shared execution result type.

ExecutionResult used to live in modules/oracle.py (the Cloudflare Worker
execution-relay client), which local_executor.py's LocalExecutor imported
it from purely for interface compatibility — LocalExecutor never actually
depended on anything else in that module. Now that oracle.py is deleted
(the Worker relay is retired — see modules/local_executor.py's and
bot.py's matching changelog entries), ExecutionResult moves to this small
standalone module so LocalExecutor (the only execute_trade() implementation
left) doesn't need to import a deleted file.
"""

from __future__ import annotations

from dataclasses import dataclass


@dataclass
class ExecutionResult:
    confirmed         : bool
    tx_hash           : str | None = None
    realized_profit_usd: float | None = None
    error             : str | None = None
    status_raw        : str | None = None
    duration_ms       : float = 0.0
    # True only for connect/timeout/read/pool-level failures against the
    # URL that was tried — i.e. "worth retrying against a different URL".
    # False for any real HTTP response (4xx/5xx, bad JSON, non-confirmed
    # status). Kept for interface compatibility with existing callers even
    # though LocalExecutor (on-chain, no HTTP relay) never sets it True.
    network_fail      : bool = False