Skip to content

[PR #33] vBNB market silently skipped — BNB-collateral borrowers never scanned #99

@obchain

Description

@obchain

PR: #33 (feat/08-venus-adapter)
File: crates/charon-protocols/src/venus.rs
Lines: 144-146, 180-194, 254-255

Problem: connect() builds vtoken_to_underlying by calling underlying() on every vToken. vBNB (0xA07c5b74C9B40447a954e1466938b865b6BBea36) does not implement underlying() and reverts. Adapter silently debug!-logs skip at lines 186-193, omits vBNB from map. Guard at line 254 (self.vtoken_to_underlying.get(vtoken)) returns None for vBNB, asset dropped via continue. No warning emitted at scan time. No follow-up issue opened.

Impact: vBNB is the largest Venus market by TVL on BSC. Any borrower whose primary collateral is BNB is invisible to scanner. Positions never flagged for liquidation regardless of HF — direct missed revenue and systemic risk if large BNB-collateral accounts go underwater.

Fix: Special-case vBNB in connect():

const VBNB: Address = address!("A07c5b74C9B40447a954e1466938b865b6BBea36");
const WBNB: Address = address!("bb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c");

if vtoken == VBNB {
    underlying_to_vtoken.insert(WBNB, VBNB);
    vtoken_to_underlying.insert(VBNB, WBNB);
    continue;
}

Emit warn! (not debug!) when any vToken skipped at scan time.

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