Architecture
Smart Lending AI (SLAI) is powered by a modular, secure, and upgradeable set of smart contracts. Each component is built to handle a specific part of the lending lifecycle β from collateral management to loan issuance, liquidation, and token eligibility.
Below is an in-depth breakdown of the architecture.
π Contract Overview
CollateralVault
Stores and manages locked ERC-20 token collateral
LendingEngine
Calculates loan amount and disburses ETH
LiquidationModule
Monitors collateral value and enforces liquidation
oscAIAdapter
Interfaces with oscAI for token verification
SLAIToken
Native token with staking and utility logic
StakingModule
Tracks SLAI staking and unlocks 0% interest benefit
π CollateralVault
Receives and locks ERC-20 tokens from users
Tracks who deposited what, how much, and when
Prevents double-borrowing or withdrawal before repayment
Security: Uses access control to ensure only LendingEngine can unlock funds.
πΈ LendingEngine
Core logic for loan value calculation
Uses on-chain WETH pool data to determine token price
Applies risk-adjusted Loan-to-Value (LTV) ratios
Transfers ETH to borrower wallet
Key Feature: Borrowed ETH is tracked per user with timestamps for monitoring duration and eligibility.
π₯ LiquidationModule
Constantly compares token value (WETH pair) with loan threshold
If price drops by 40% or more, triggers liquidation
Liquidation may involve selling tokens to recover ETH
Protects protocol solvency
Trigger Mechanism: Can be automated via keeper bots or transaction hooks.
π‘ oscAIAdapter
Pulls token approval status from OSCAβs audit system
Ensures only pre-vetted tokens can be used as collateral
Regularly syncs whitelist updates
Logic: Loan function reverts if token is not approved via oscAI.
πͺ SLAIToken
Native ERC-20 token of the SLAI ecosystem
Required for interest-free lending (β₯50,000 tokens staked)
π StakingModule
Allows SLAI holders to stake tokens
Tracks user staking balance
Enables 0% interest tier for qualifying users
Emits staking events for frontend tracking
Design: Optimized for gas efficiency and batch staking.
π§© Extensibility & Upgradeability
All core contracts are designed to be modular and upgradeable via proxy architecture (e.g. OpenZeppelin UUPS or Transparent Proxy). This allows:
Feature expansion
Integration with new collateral types
Security patches without contract redeployment
π Security Considerations
Access controls via Ownable or AccessControl
Reentrancy protection
Price manipulation resistance
Full audits before mainnet deployment
SLAIβs architecture is designed with one goal: capital-efficient, secure, and scalable on-chain lending for every trader.
Last updated