added liquidations code based on event logs
This commit is contained in:
parent
825a10be51
commit
e9aa7b1d6b
File diff suppressed because one or more lines are too long
@ -88,7 +88,7 @@ async def inspect_many_blocks(
|
|||||||
|
|
||||||
count = 0
|
count = 0
|
||||||
arbitrages_payload = []
|
arbitrages_payload = []
|
||||||
async for swaps in get_classified_traces_from_events(w3, after_block_number, before_block_number):
|
async for swaps, liquidations in get_classified_traces_from_events(w3, after_block_number, before_block_number):
|
||||||
arbitrages = get_arbitrages(swaps)
|
arbitrages = get_arbitrages(swaps)
|
||||||
|
|
||||||
|
|
||||||
@ -112,6 +112,9 @@ async def inspect_many_blocks(
|
|||||||
arbitrages_payload = []
|
arbitrages_payload = []
|
||||||
count = 0
|
count = 0
|
||||||
|
|
||||||
|
if len(liquidations) > 0:
|
||||||
|
print(liquidations)
|
||||||
|
|
||||||
# all_blocks: List[Block] = []
|
# all_blocks: List[Block] = []
|
||||||
# all_classified_traces: List[ClassifiedTrace] = []
|
# all_classified_traces: List[ClassifiedTrace] = []
|
||||||
# all_transfers: List[Transfer] = []
|
# all_transfers: List[Transfer] = []
|
||||||
|
@ -67,7 +67,7 @@ class MEVInspector:
|
|||||||
trace_db_session: Optional[orm.Session],
|
trace_db_session: Optional[orm.Session],
|
||||||
after_block: int,
|
after_block: int,
|
||||||
before_block: int,
|
before_block: int,
|
||||||
block_batch_size: int = 10,
|
block_batch_size: int = 300,
|
||||||
):
|
):
|
||||||
tasks = []
|
tasks = []
|
||||||
for block_number in range(after_block, before_block, block_batch_size):
|
for block_number in range(after_block, before_block, block_batch_size):
|
||||||
|
@ -12,7 +12,7 @@ class Liquidation(BaseModel):
|
|||||||
debt_purchase_amount: int
|
debt_purchase_amount: int
|
||||||
received_amount: int
|
received_amount: int
|
||||||
received_token_address: Optional[str]
|
received_token_address: Optional[str]
|
||||||
protocol: Protocol
|
protocol: Optional[Protocol]
|
||||||
transaction_hash: str
|
transaction_hash: str
|
||||||
trace_address: List[int]
|
trace_address: List[int]
|
||||||
block_number: str
|
block_number: str
|
||||||
|
Loading…
x
Reference in New Issue
Block a user