Skip to content

[PR #33] liquidation_bonus_bps hardcoded 1000 — must fetch liquidationIncentiveMantissa from Comptroller #100

@obchain

Description

@obchain

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    layer:rustRust crates (core / scanner / protocols / executor / cli)pr-reviewFindings from PR review processpriority:p1-coreCore MVP scope

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions