-
Notifications
You must be signed in to change notification settings - Fork 0
[core] LendingProtocol async trait #4
Copy link
Copy link
Closed
Labels
layer:rustRust crates (core / scanner / protocols / executor / cli)Rust crates (core / scanner / protocols / executor / cli)priority:p1-coreCore MVP scopeCore MVP scopestatus:readyScoped and ready to pick upScoped and ready to pick uptype:featureNew capability or deliverableNew capability or deliverable
Milestone
Metadata
Metadata
Assignees
Labels
layer:rustRust crates (core / scanner / protocols / executor / cli)Rust crates (core / scanner / protocols / executor / cli)priority:p1-coreCore MVP scopeCore MVP scopestatus:readyScoped and ready to pick upScoped and ready to pick uptype:featureNew capability or deliverableNew capability or deliverable
Context
The main protocol-adapter boundary. Scanner and executor consume this trait without caring which lending protocol sits behind it — that's how we'll add Aave / Compound / Morpho later without touching the scanning or execution logic.
Scope
LendingProtocoltrait incharon-core/src/traits.rsfn id() -> ProtocolIdasync fn fetch_positions(borrowers: &[Address]) -> Result<Vec<Position>>fn get_liquidation_params(position: &Position) -> Result<LiquidationParams>fn build_liquidation_calldata(params: &LiquidationParams) -> Result<Vec<u8>>#[async_trait]so the trait isdyn-compatible forBox<dyn LendingProtocol>registriesAcceptance criteria
charon-core/src/traits.rsSend + Sync-bounded for tokio multi-threadingasync-traitdependencyReferences
07bf907