Roles & Access Control

Every role in the Kasu system, system-wide and per pool, what each one may call, and how KasuController grants and revokes them.

All roles are managed through the KasuController contract using OpenZeppelin's AccessControl. Each address can hold multiple roles, and a single address may fill several roles for a given lending pool.

System Roles#

RoleScopeDescription
Kasu Contract UpgraderSystemOwner of per-proxy ProxyAdmin contracts. Can upgrade all contract implementations.
Kasu AdminSystemDEFAULT_ADMIN_ROLE. Manages system-wide settings, grants/revokes all roles, manages allowlist, pauses the system.
Pool CreatorSystemROLE_LENDING_POOL_CREATOR. Creates new lending pools via LendingPoolManager.createPool(). Acts as Pool Admin at creation time.
Protocol Fee ClaimerSystemROLE_PROTOCOL_FEE_CLAIMER. Claims accrued protocol fees from the Fee Manager.

Lending Pool Roles#

These roles are granted per lending pool by the Pool Admin via KasuController.grantLendingPoolRole().

RoleHashDescription
Pool Admin0xa1ae6eec...Grants pool-specific roles (Pool Manager, Pool Funds Manager, Pool Clearing Manager). Sets Draw Recipient.
Pool Manager0x3e891da8...Manages pool parameters: tranche ratios, interest rates, draw amounts, deposit limits, excess liquidity. Can force withdrawals, cancel requests, and stop the pool.
Pool Funds Manager0x3329bd6c...Manages pool finances: repays owed funds, reports/repays losses, deposits/withdraws First Loss Capital.
Pool Clearing Manager0xe9bdd900...Executes clearing for the lending pool each epoch via LendingPoolManager.doClearing().

User Roles#

RoleRequirementsFunctions
Liquidity ProviderMust pass KYC or be manually allowlistedrequestDeposit, cancelDepositRequest, requestWithdrawal, cancelWithdrawalRequest, claimLoss, requestFixedTermDepositWithdrawal
KSU LockerNo KYC required. Must hold KSU tokensKSULocking.lock, lockWithPermit, unlock, claimFees

Public Functions#

Anyone can call these functions:

FunctionContractPurpose
updateKsuEpochTokenPrice()SystemVariablesUpdate KSU token price for the current epoch from oracle
batchCalculateUserLoyaltyLevels()UserManagerCalculate loyalty levels for all users for the current epoch
batchMintLossTokens()LendingPoolTrancheMint unrealized loss tokens to affected LPs after a loss is reported
emitFees()KSULockingDistribute accrued ecosystem fees to KSU lockers

Kasu Admin Functions#

FunctionContractPurpose
grantRole() / revokeRole()KasuControllerGrant or revoke system roles
pause() / unpause()KasuControllerPause or unpause the entire Kasu system
allowUser() / disallowUser()KasuAllowListManually add/remove addresses from the KYC allowlist
blockUser() / unblockUser()KasuAllowListBlock/unblock addresses (overrides allowlist)
setPerformanceFee()SystemVariablesSet the performance fee percentage
setFeeRates()SystemVariablesSet the ecosystem/protocol fee split
setLoyaltyThresholds()SystemVariablesSet loyalty level thresholds
setMaxTrancheInterestRate()SystemVariablesSet maximum allowed tranche interest rate
setDefaultTrancheInterestChangeEpochDelay()SystemVariablesSet default delay for interest rate changes
setUserCanOnlyDepositToJuniorTrancheWhenHeHasRKSU()SystemVariablesRequire rKSU for Junior tranche deposits
updateTrancheInterestRateChangeEpochDelay()LendingPoolManagerOverride interest rate change delay for a pool
addLockPeriod()KSULockingAdd new lock period with multipliers
setKSULockBonus()KSULockingSet the bonus KSU wallet for the locking program
emergencyWithdraw()KSULockingForcibly unlock all users' KSU positions