Context
The flash-loan source router picks the cheapest available source for each liquidation. BSC does not have Balancer V2 deployed — so Aave V3 (0.05% fee) is the primary choice. The router still speaks the full abstraction so multi-source selection just works once other chains ship.
Scope
- New
crates/charon-flashloan/ crate
FlashLoanRouter struct with pick_source(token, chain_id, amount) -> FlashLoanSource
- Per-chain source registry loaded from config (
[flashloan.<name>])
- v0.1 logic: always returns
FlashLoanSource::AaveV3 for BSC (only configured source)
- Shape scaffolding for future Balancer / Uniswap fallbacks (commented stubs)
- Returns
Option<FlashLoanSource> (None = skip the liquidation — no source available)
Acceptance criteria
References
- PRD section 5a (Flash Loan Router)
- PRD Diagram 05 (Flash Loan Source Selection)
Context
The flash-loan source router picks the cheapest available source for each liquidation. BSC does not have Balancer V2 deployed — so Aave V3 (0.05% fee) is the primary choice. The router still speaks the full abstraction so multi-source selection just works once other chains ship.
Scope
crates/charon-flashloan/crateFlashLoanRouterstruct withpick_source(token, chain_id, amount) -> FlashLoanSource[flashloan.<name>])FlashLoanSource::AaveV3for BSC (only configured source)Option<FlashLoanSource>(None = skip the liquidation — no source available)Acceptance criteria
charon-flashloancrate compiles independentlypick_sourcereturnsSome(AaveV3)for BSC/any common tokenNonefor an unconfigured chainReferences