Context
Normalized data shapes used across every layer. Every lending protocol (Venus now, Aave / Compound / Morpho later) reduces to the same Position type after the adapter layer, so scanner and executor stay protocol-agnostic.
Scope
Position — borrower, collateral/debt tokens and amounts, health factor, liquidation bonus
LiquidationOpportunity — a profitable, ready-to-execute liquidation
FlashLoanSource — enum: BalancerV2 (0%), AaveV3 (0.05%), UniswapV3 (pool fee)
SwapRoute — planned collateral → debt DEX swap with slippage protection
ProtocolId — enum naming the protocol (Venus for v1)
LiquidationParams — protocol-specific call parameters (Venus variant for v1)
- All types derive
Serialize / Deserialize for config + logging
Acceptance criteria
References
- Delivered in commit
2371853
- PRD section 3a (Core Types)
Context
Normalized data shapes used across every layer. Every lending protocol (Venus now, Aave / Compound / Morpho later) reduces to the same
Positiontype after the adapter layer, so scanner and executor stay protocol-agnostic.Scope
Position— borrower, collateral/debt tokens and amounts, health factor, liquidation bonusLiquidationOpportunity— a profitable, ready-to-execute liquidationFlashLoanSource— enum:BalancerV2(0%),AaveV3(0.05%),UniswapV3(pool fee)SwapRoute— planned collateral → debt DEX swap with slippage protectionProtocolId— enum naming the protocol (Venus for v1)LiquidationParams— protocol-specific call parameters (Venus variant for v1)Serialize/Deserializefor config + loggingAcceptance criteria
charon-core/src/types.rsAddressandU256fromalloy::primitivesused correctlyDebug,Clone,Serialize,Deserializecharon-corecompiles withalloy+serdeas dependenciesReferences
2371853