messari / subgraphs

Standardized subgraphs for blockchain data
MIT License
512 stars 241 forks source link

fix(#patch); aave-v3-forks; fix liquidation protocol fee calculation #2516

Closed dhruv-chauhan closed 8 months ago

dhruv-chauhan commented 8 months ago
// Earlier, 

liquidationProtocolFee = liquidationPenalty * liquidationProtocolFeePercentage * liquidatedCollateralAmount / (1 + liquidationPenalty - liquidationPenalty*liquidationProtocolFeePercentage)

// Changed,
// From the BalanceTransfer events sent on LiquidationCall https://github.com/aave/aave-v3-core/blob/724a9ef43adf139437ba87dcbab63462394d4601/contracts/protocol/tokenization/AToken.sol#L117

liquidationProtocolFee = balanceTransfer.value * (balanceTransfer.param_index / 10^27)

Test deployments,