consolidating classifier related modules
This commit is contained in:
parent
8f554d90da
commit
d4d2fb0359
4
mev_inspect/classifiers/specs/__init__.py
Normal file
4
mev_inspect/classifiers/specs/__init__.py
Normal 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
|
@ -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]
|
@ -118,7 +118,7 @@ WETH_SPEC = ClassifierSpec(
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
CLASSIFIER_SPECS = [
|
UNISWAP_CLASSIFIER_SPECS = [
|
||||||
*UNISWAP_V3_CONTRACT_SPECS,
|
*UNISWAP_V3_CONTRACT_SPECS,
|
||||||
*UNISWAPPY_V2_CONTRACT_SPECS,
|
*UNISWAPPY_V2_CONTRACT_SPECS,
|
||||||
WETH_SPEC,
|
WETH_SPEC,
|
@ -8,10 +8,10 @@ from mev_inspect.crud.classified_traces import (
|
|||||||
delete_classified_traces_for_block,
|
delete_classified_traces_for_block,
|
||||||
write_classified_traces,
|
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.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
|
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}")
|
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)
|
classified_traces = trace_clasifier.classify(block_data.traces)
|
||||||
print(f"Returned {len(classified_traces)} classified traces")
|
print(f"Returned {len(classified_traces)} classified traces")
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user