Skip to main content

almanak_library.metrics.metrics_logger

traceback

uuid

ActionType

ExecutionStatus

METRICS_DB_CONNECTION_STRING

MetricActionType

MetricsActionHandler

MetricsActionTable

Action

ActionBundle

get_logger

logger

MetricsLogger Objects

class MetricsLogger()

unique identifier of metrics table: (metric_type, strategy_id, action_id)

__init__

def __init__()

should_log_metrics_for_action

def should_log_metrics_for_action(action_bundle: ActionBundle,
action_id: uuid.UUID) -> bool

TODO: Add support for partial execution within an action if an action has multiple transactions.

log_metrics

def log_metrics(action_bundle: ActionBundle)

log_tx_gas_cost

def log_tx_gas_cost(action: Action, strategy_id: str, wallet_address: str)

log_lp_fees

def log_lp_fees(fees0: int, fees1: int, strategy_id: str, wallet_address: str,
action_id: uuid.UUID, bundle_id: uuid.UUID, block_number: int)

log_wrap_metrics

def log_wrap_metrics(strategy_id: str, action: Action)

log_unwrap_metrics

def log_unwrap_metrics(strategy_id: str, action: Action)

log_approve_metrics

def log_approve_metrics(strategy_id: str, action: Action)

log_swap_metrics

def log_swap_metrics(strategy_id: str, action: Action)

log_open_position_metrics

def log_open_position_metrics(strategy_id: str, action: Action)

log_close_position_metrics

def log_close_position_metrics(strategy_id: str, action: Action)