consolidating classifier related modules

This commit is contained in:
Patrick Daly 2021-07-31 14:03:11 -07:00
parent 8f554d90da
commit d4d2fb0359
5 changed files with 10 additions and 6 deletions

View File

@ -0,0 +1,4 @@
from .uniswap import UNISWAP_CLASSIFIER_SPECS
from .curve import CURVE_CLASSIFIER_SPECS
ALL_CLASSIFIER_SPECS = UNISWAP_CLASSIFIER_SPECS + CURVE_CLASSIFIER_SPECS

View File

@ -241,4 +241,4 @@ CURVE_LIQUIDITY_GAUGES = [
),
]
CLASSIFIER_SPECS = [*CURVE_BASE_POOLS, *CURVE_META_POOLS, *CURVE_LIQUIDITY_GAUGES]
CURVE_CLASSIFIER_SPECS = [*CURVE_BASE_POOLS, *CURVE_META_POOLS, *CURVE_LIQUIDITY_GAUGES]

View File

@ -118,7 +118,7 @@ WETH_SPEC = ClassifierSpec(
)
CLASSIFIER_SPECS = [
UNISWAP_CLASSIFIER_SPECS = [
*UNISWAP_V3_CONTRACT_SPECS,
*UNISWAPPY_V2_CONTRACT_SPECS,
WETH_SPEC,

View File

@ -8,10 +8,10 @@ from mev_inspect.crud.classified_traces import (
delete_classified_traces_for_block,
write_classified_traces,
)
from mev_inspect.db import get_session
from mev_inspect.classifier_specs import CLASSIFIER_SPECS
from mev_inspect.trace_classifier import TraceClassifier
from mev_inspect.arbitrage import get_arbitrages
from mev_inspect.classifiers.specs import ALL_CLASSIFIER_SPECS
from mev_inspect.classifiers.trace import TraceClassifier
from mev_inspect.db import get_session
from mev_inspect.swaps import get_swaps
@ -32,7 +32,7 @@ def inspect_block(block_number: int, rpc: str):
)
print(f"Total transactions: {total_transactions}")
trace_clasifier = TraceClassifier(CLASSIFIER_SPECS)
trace_clasifier = TraceClassifier(ALL_CLASSIFIER_SPECS)
classified_traces = trace_clasifier.classify(block_data.traces)
print(f"Returned {len(classified_traces)} classified traces")