This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+ - - - - - - - - - + | |
| num_liquidations | | |
+ - - - - - - - - - + | |
| 87 | | |
+ - - - - - - - - - + |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.8.13; | |
// from ... | |
uint256 internal constant LIQUIDATION_CLOSE_FACTOR_PERCENT = 5000; | |
function liquidationCall( | |
address collateralAsset, | |
address debtAsset, | |
address user, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
➜ ~ cast call -b 13522070 0xA50ba011c48153De246E5192C8f9258A2ba79Ca9 "getAssetPrice(address)" 0x0F5D2fB29fb7d3CFeE444a200298f468908cC942 | |
0x00000000000000000000000000000000000000000000000000031015cc1da8f2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
parse_user_account_data('0x000000000000000000000000000000000000000000000000085b5b5e846685f4000000000000000000000000000000000000000000000002743544e203a3e4ae00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001f710000000000000000000000000000000000000000 | |
000000000000000000001d9500000000000000000000000000000000000000000000000000260a45667b706b') | |
UserAccountData(totalCollateralETH=602175436690458100, totalDebtETH=45267162967098778798, availableBorrowsETH=0, currentLiquidationThreshold=8049, ltv=7573, healthFactor=10707342303391851) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
➜ ~ cast call -b 13522070 0x7d2768dE32b0b80b7a3454c06BdAc94A69DDc7A9 "getUserAccountData(address)" 0x227cAa7eF6D955A92F483dB2BD01172997A1a623 | |
0x000000000000000000000000000000000000000000000000085b5b5e846685f4000000000000000000000000000000000000000000000002743544e203a3e4ae00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001f710000000000000000000000000000000000000000000000000000000000001d9500000000000000000000000000000000000000000000000000260a45667b706b |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from io import BytesIO | |
from binascii import unhexlify | |
from dataclasses import dataclass | |
@dataclass(frozen=True) | |
class UserAccountData: | |
totalCollateralETH: int | |
totalDebtETH: int | |
availableBorrowsETH: int |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
➜ ~ cast call -b 13517657 0xA50ba011c48153De246E5192C8f9258A2ba79Ca9 "getAssetPrice(address)" 0x0F5D2fB29fb7d3CFeE444a200298f468908cC942 | |
0x000000000000000000000000000000000000000000000000000131d14dce4400 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select | |
SUM(liquidatedCollateralAmount) as amountSeized, | |
collateralAsset | |
from | |
aave_v2_ethereum.LendingPool_evt_LiquidationCall | |
where | |
user = from_hex('0x227cAa7eF6D955A92F483dB2BD01172997A1a623') | |
and evt_block_number <= 13522070 and evt_block_number >= 13520838 | |
group by collateralAsset |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select | |
count(*) as num_liquidations | |
from | |
aave_v2_ethereum.LendingPool_evt_LiquidationCall | |
where | |
user = from_hex('0x227cAa7eF6D955A92F483dB2BD01172997A1a623') | |
and evt_block_number <= 13522070 and evt_block_number >= 13520838 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select | |
evt_block_number, | |
collateralAsset, | |
debtAsset, | |
debtToCover, | |
liquidatedCollateralAmount, | |
liquidator | |
from | |
aave_v2_ethereum.LendingPool_evt_LiquidationCall | |
where |
NewerOlder