Bug fixes, changed underlying to reserve
This commit is contained in:
parent
0311b715ce
commit
31ffc20a52
@ -44,8 +44,8 @@ def liquidations(traces: List[ClassifiedTrace]):
|
|||||||
collateral_type = trace.inputs[i]
|
collateral_type = trace.inputs[i]
|
||||||
print(f"\tType: {collateral_type}")
|
print(f"\tType: {collateral_type}")
|
||||||
elif (i == '_reserve'):
|
elif (i == '_reserve'):
|
||||||
underlying = trace.inputs[i]
|
reserve = trace.inputs[i]
|
||||||
print(f"\tUnderlying: {underlying}")
|
print(f"\tUnderlying: {reserve}")
|
||||||
elif(i == '_user'):
|
elif(i == '_user'):
|
||||||
liquidated_usr = trace.inputs[i]
|
liquidated_usr = trace.inputs[i]
|
||||||
print(f"\tLiquidated: {liquidated_usr}")
|
print(f"\tLiquidated: {liquidated_usr}")
|
||||||
@ -57,18 +57,14 @@ def liquidations(traces: List[ClassifiedTrace]):
|
|||||||
amount_received = tx.inputs['amount']
|
amount_received = tx.inputs['amount']
|
||||||
print(f"Transfer to liquidator {liquidator}: \nAmount in received token: {tx.inputs['amount']} \nTransaction: {tx.transaction_hash}")
|
print(f"Transfer to liquidator {liquidator}: \nAmount in received token: {tx.inputs['amount']} \nTransaction: {tx.transaction_hash}")
|
||||||
|
|
||||||
#Calculate profit
|
|
||||||
else:
|
|
||||||
# Add gas used*price and coinbase check
|
|
||||||
# Tag liquidation
|
# Tag liquidation
|
||||||
result.append(Liquidation(strategy=StrategyType.liquidation,
|
result.append(Liquidation(strategy=StrategyType.liquidation,
|
||||||
traces=[trace, next],
|
traces=[trace, next],
|
||||||
protocols=[trace.protocol],
|
protocols=[trace.protocol],
|
||||||
collateral_type=collateral_type,
|
collateral_type=collateral_type,
|
||||||
collateral_amount=liquidation_amount,
|
collateral_amount=liquidation_amount,
|
||||||
underlying=underlying,
|
reserve=reserve,
|
||||||
collateral_source="",
|
collateral_source="",))
|
||||||
profit=profit))
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
rpc = 'http://162.55.96.141:8546/'
|
rpc = 'http://162.55.96.141:8546/'
|
||||||
|
@ -16,4 +16,4 @@ class Liquidation(Strategy):
|
|||||||
collateral_type: str
|
collateral_type: str
|
||||||
collateral_amount: int
|
collateral_amount: int
|
||||||
collateral_source: str
|
collateral_source: str
|
||||||
underlying: str
|
reserve: str
|
||||||
|
Loading…
x
Reference in New Issue
Block a user