You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Trait has 4 methods: id, fetch_positions, get_liquidation_params, build_liquidation_calldata. Missing:
async fn get_health_factor(&self, borrower: Address, block: BlockNumberOrTag) -> Result<U256> — scanner 3-bucket HF classifier (PR feat(scanner): 3-bucket DashMap health-factor scanner #34) is the gating layer; cannot compute without this.
fn get_close_factor(&self, market: Address) -> U256 — Venus close factor is 50% default but configurable per-market. Required for repay_amount bound check.
fn get_liquidation_incentive(&self, collateral_market: Address) -> Result<U256> — per-market on Venus (e.g., 10% default, asset-specific overrides). Profit calculator (PR feat(core): gas-aware profit calculator + profit-ordered OpportunityQueue #40) needs this to estimate seized collateral before calldata build.
Impact: Scanner and profit calculator have no protocol-agnostic query surface. Either they reach into Venus-specific adapter state (breaks abstraction) or duplicate math in every crate.
Fix: Add the three methods above to the trait. Keep them narrowly typed (no struct bag) so Aave / Compound impls can map directly onto their equivalents.
PR: #28 (feat/03-lending-protocol-trait)
File: crates/charon-core/src/traits.rs
Trait has 4 methods:
id,fetch_positions,get_liquidation_params,build_liquidation_calldata. Missing:async fn get_health_factor(&self, borrower: Address, block: BlockNumberOrTag) -> Result<U256>— scanner 3-bucket HF classifier (PR feat(scanner): 3-bucket DashMap health-factor scanner #34) is the gating layer; cannot compute without this.fn get_close_factor(&self, market: Address) -> U256— Venus close factor is 50% default but configurable per-market. Required forrepay_amountbound check.fn get_liquidation_incentive(&self, collateral_market: Address) -> Result<U256>— per-market on Venus (e.g., 10% default, asset-specific overrides). Profit calculator (PR feat(core): gas-aware profit calculator + profit-ordered OpportunityQueue #40) needs this to estimate seized collateral before calldata build.Impact: Scanner and profit calculator have no protocol-agnostic query surface. Either they reach into Venus-specific adapter state (breaks abstraction) or duplicate math in every crate.
Fix: Add the three methods above to the trait. Keep them narrowly typed (no struct bag) so Aave / Compound impls can map directly onto their equivalents.