Core System Contract
Treasury Contract
0x1Ee7E501039E0bd75475DD9da69EE744951CaB8BThe Treasury Contract determines the expansion and contraction status of the round and plays a central role like the central bank, such as the issuance of new KAI and redemption of bKAI.
[Main role]
Determination of expansion/contraction status according to the price of KAI provided by PriceOracle
Determination of airdrop ratio based on expansion/contraction/boost result
New issuance and distribution of KAI in the expanded state
bHolding and paying KAI for bKAI redemption
The following is the code to mint for additional KAI issuance in the expanded state.
function allocateSeigniorage() external onlyOneBlock checkCondition checkEpoch checkOperator {
_updateKAIPrice();
previousRoundKAIPrice = getKAIPrice(); // KAI 가격을 얻어옴
uint256 kaiSupply = IERC20(kai).totalSupply().sub(seigniorageSaved);
if (round < bootstrapRounds) { // 초기 21라운드는 3% 고정
_sendToBoardRoom(kaiSupply.mul(bootstrapSupplyExpansionPercent).div(10000));
} else {
if (previousRoundKAIPrice > kaiPriceOne) { // KAI 가격이 $1 초과하면 확장
uint256 bkaiSupply = IERC20(bkai).totalSupply();
uint256 _percentage = previousRoundKAIPrice.sub(kaiPriceOne).mul(seigniorageExpansionRate).div(10000);
uint256 _savedForBKAI;
uint256 _savedForBoardRoom;
// bKAI 의 발행량 이상으로 Treasury 가 KAI 를 보유한 경우 일반적인 확장 진행
if (seigniorageSaved >= bkaiSupply.mul(bkaiDepletionFloorPercent).div(10000))
uint256 _mse = maxSupplyExpansionPercent.mul(1e14);
if (_percentage > _mse) {
_percentage = _mse;
}
_savedForBoardRoom = kaiSupply.mul(_percentage).div(1e18);
} else {
// bKAI 의 발행량 만큼 Treasury 가 보유하고 있지 않다면, 이는 Debt Phase 로 전환되어 더 많은 KAI 가 Treasury 에 적립됨
_percentage = maxSupplyExpansionPercentInDebtPhase.mul(1e14);
uint256 _seigniorage = kaiSupply.mul(_percentage).div(1e18);
_savedForBoardRoom = _seigniorage.mul(seigniorageExpansionFloorPercent).div(10000);
_savedForBKAI = _seigniorage.sub(_savedForBoardRoom);
if (mintingFactorForPayingDebt > 0) {
_savedForBKAI = _savedForBKAI.mul(mintingFactorForPayingDebt).div(10000);
}
}
if (_savedForBoardRoom > 0) {
// 보드룸으로 KAI 생성 요청
_sendToBoardRoom(_savedForBoardRoom);
}
if (_savedForBKAI > 0) {
seigniorageSaved = seigniorageSaved.add(_savedForBKAI);
IKAIAsset(kai).mint(address(this), _savedForBKAI);
emit TreasuryFunded(now, _savedForBKAI);
}
}
}
// 바이백 펀드 KAI 생성
if (previousRoundKAIPrice > kaiPriceOne) {
uint256 _buyBackRate = previousRoundKAIPrice.sub(kaiPriceOne).mul(buyBackFundExpansionRate).div(10000);
uint256 _maxBuyBackRate = maxBuyBackFundExpansion.mul(1e14);
if (_buyBackRate > _maxBuyBackRate) {
_buyBackRate = _maxBuyBackRate;
}
uint256 _savedForBuyBackFund = kaiSupply.mul(_buyBackRate).div(1e18);
if (_savedForBuyBackFund > 0) {
IKAIAsset(kai).mint(address(buyBackFund), _savedForBuyBackFund);
emit BuyBackFunded(now, _savedForBuyBackFund);
}
}
if (allocateSeigniorageSalary > 0) {
IKAIAsset(kai).mint(address(admin), allocateSeigniorageSalary);
}
}
After mint, KAI is distributed to Boardroom Contract and Team Fund through the _sendToBoardRoom function.
Boardroom Contract
Boardroom Contract acts like a general bank that manages sKAI deposit(Stake) and distributes KAI received from Treasury Contract to sKAI deposit users in the expanded state.
[Main role]
Stake sKAI
Distribution of additional minted KAI
Distributed minted vKAI
BBFund Contract - Buyback Fund
A complementary device to KAI's $1 pegging algorithm through bKAI can stabilize the price by backing up KAI when the estimated price (TWAP) for the next round is less than $1. Depending on KAI distribution and the status of buyback funds, buyback KAI may be incinerated.
The creation of the buyback fund will be carried out through KAI and vKAI, and it will be converted into KUSDT and KDAI and accumulated.
[Main role]
KAI -> KUSDT or KAI -> KDAI exchange when KAI price is over $1
KUSDT -> KAI or KDAI -> KAI exchange when KAI price is less than $1
The Buyback Fund Contract does not have a transfer function and consists only of Sell, Buy, and Burn functions to maintain the KAI price.
Last updated
Was this helpful?