Smart Contracts
All contracts are written in Solidity 0.8.23, use OpenZeppelin v5 upgradeable proxies, and follow the TransparentUpgradeableProxy pattern (each proxy has its own ProxyAdmin).
Core Contracts
LendingPoolManager.sol
Entry point for all lending pool interactions (deposits, withdrawals, clearing, configuration)
LendingPoolFactory.sol
Creates new lending pools using the beacon proxy pattern
LendingPool.sol
Ledger of pool balances. Also an ERC-20 token representing total pool value relative to USDC
PendingPool.sol
ERC-721 contract managing pending deposit/withdrawal requests (D-NFTs and W-NFTs)
LendingPoolTranche.sol
ERC-4626 vault for tranche shares. Also handles ERC-1155 unrealized loss tokens
LendingPoolTrancheLoss.sol
Handles loss reporting, ERC-1155 loss token minting, and loss recovery claims
FixedTermDeposit.sol
Manages fixed-duration deposits with guaranteed interest rates
Clearing Contracts
ClearingCoordinator.sol
Orchestrates the 5-step clearing process for all lending pools
ClearingSteps.sol
Abstract contract extended by PendingPool for clearing execution
PendingRequestsPriorityCalculation.sol
Step 2: Calculates request priority by loyalty level
AcceptedRequestsCalculation.sol
Step 3: Calculates accepted deposit/withdrawal amounts
AcceptedRequestsExecution.sol
Step 4: Executes accepted requests
System Contracts
SystemVariables.sol
Global configuration: epoch timing, KSU price, performance fee, loyalty thresholds, fee rates
UserManager.sol
Calculates user loyalty levels based on rKSU-to-deposit ratio
UserLoyaltyRewards.sol
KSU token rewards for LPs based on active liquidity and loyalty level
FeeManager.sol
Collects and distributes performance fees (ecosystem fees to rKSU holders, protocol fees to claimers)
KasuAllowList.sol
KYC verification via Compilot/NexeraID signatures, manual allowlisting, and blocklisting
KsuPrice.sol
Fetches KSU token price from the Chainsight oracle
Swapper.sol
Manages an allowlist of approved exchange addresses for token swaps
KasuPoolExternalTVL.sol
ERC-1155 contract for tracking off-chain TVL per lending pool
Token & Locking Contracts
KSU.sol
ERC-20 KSU token with permit and burn (symbol: KSU, supply: 1B)
rKSU.sol
Non-transferable receipt token for locked KSU
KSULocking.sol
KSU token locking with proportional fee distribution, extends rKSU
KSULockBonus.sol
Holds and distributes bonus KSU tokens for the locking program
Access Control
KasuController.sol
System administration, role management, pause/unpause
Roles.sol
Role constant definitions
Deployment Modes
Full
Base
All contracts
Active
Active
Lite
Plume, XDC
Lite variants (*Lite.sol)
Disabled
Disabled
Lite deployments use override contracts (KsuPriceLite, UserManagerLite, UserLoyaltyRewardsLite, ProtocolFeeManagerLite, KSULockingLite) that disable token-dependent functionality while maintaining the same interface for KYC, deposits, and clearing.
Last updated