PR: #33 (feat/08-venus-adapter)
File: crates/charon-protocols/src/venus.rs
Lines: 312, 36-110 (ABI block)
Problem: liquidation_bonus_bps hardcoded to 1000 (10%) at line 312, comment defers real fetch to "Part E". ABI block does not include liquidationIncentiveMantissa() from Comptroller. Venus governance can and does change this value — currently 1.1e18 (10%) but live governance parameter.
Impact: Position.liquidation_bonus_bps consumed downstream by profit estimator to decide whether to attempt liquidation and size flash loan. Hardcoded value → bot attempts liquidations with incorrect expected profit, potentially executing loss trades (if real incentive lower) or missing trades (if thresholds relative to this field). Governance change mid-deployment = silently wrong economics, no alert.
Fix: Add to ABI block:
function liquidationIncentiveMantissa() external view returns (uint256);
Fetch in connect() alongside closeFactorMantissa, convert to bps ((mantissa - 1e18) / 1e14), store on adapter. Use stored value in fetch_position_inner instead of literal 1000.
PR: #33 (feat/08-venus-adapter)
File: crates/charon-protocols/src/venus.rs
Lines: 312, 36-110 (ABI block)
Problem:
liquidation_bonus_bpshardcoded to1000(10%) at line 312, comment defers real fetch to "Part E". ABI block does not includeliquidationIncentiveMantissa()from Comptroller. Venus governance can and does change this value — currently 1.1e18 (10%) but live governance parameter.Impact:
Position.liquidation_bonus_bpsconsumed downstream by profit estimator to decide whether to attempt liquidation and size flash loan. Hardcoded value → bot attempts liquidations with incorrect expected profit, potentially executing loss trades (if real incentive lower) or missing trades (if thresholds relative to this field). Governance change mid-deployment = silently wrong economics, no alert.Fix: Add to ABI block:
Fetch in
connect()alongsidecloseFactorMantissa, convert to bps((mantissa - 1e18) / 1e14), store on adapter. Use stored value infetch_position_innerinstead of literal1000.