LogoLogo
  • Smart Lending AI
    • Introduction
  • Vision
  • Lending
    • How it works
    • Uses cases
    • Architecture
    • Loan lifecycle
  • General
    • Roadmap
    • FAQ
    • Disclaimer
Powered by GitBook
On this page
  • πŸ— Contract Overview
  • πŸ”’ CollateralVault
  • πŸ’Έ LendingEngine
  • πŸ”₯ LiquidationModule
  • πŸ›‘ oscAIAdapter
  • πŸͺ™ SLAIToken
  • πŸ“Š StakingModule
  • 🧩 Extensibility & Upgradeability
  • πŸ” Security Considerations
Export as PDF
  1. Lending

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

Contract Name
Responsibility

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.

PreviousUses casesNextLoan lifecycle

Last updated 3 days ago