Overview
MakxYieldPad is the core orchestrator of the Makx protocol. It borrows ETH from MakxYieldVault for each token launch, manages Uniswap V4 LP positions, tracks rental state per launch, accrues interest on outstanding bonds, and handles liquidations.
Constants
| Constant | Value | Description |
|---|---|---|
TOTAL_TOKEN_SUPPLY | 1_000_000_000 ether | Fixed supply for every launched token |
TICK_SPACING | 60 | Uniswap V4 tick spacing for all pools |
Launch state
Each launch is stored in aLaunchConfig struct:
launches[launchId]— by numeric IDtokenToLaunchId[tokenAddress]— by token addresspoolIdToLaunchId[poolId]— by Uniswap pool ID
Creator functions
createToken()
msg.value = rentalPayment + devBuyETH. Borrows bondAmount from vault, mints 1B tokens, creates full-range Uniswap V4 LP, executes dev buy. duration must be ≥ minRentalDuration.
depositRent(uint256 launchId)
adminPayRentFeeBps is deducted.
repayBond(uint256 launchId)
bondAmount and feePerSecond. If bondAmount reaches zero, status transitions to Repaid.
claimFees(uint256 launchId)
adminFeeBps cut goes to protocol.
collectLPFees(uint256 launchId)
adminCollectLpFeeBps cut goes to protocol.
setHookFee(uint256 launchId, uint16 bps)
maxHookFeeBps.
Liquidation
liquidate(uint256 launchId)
status == Active AND prepaidUntil ≤ block.timestamp + liquidationThreshold.
Sequence:
- Withdraw LP NFT → receive ETH + tokens
- Repay
bondAmountto vault - Send surplus ETH to liquidator (minus
adminLiquidationFeeBps) - Send
launchFeeBalanceto liquidator - Send all tokens to liquidator
- Set
status = Liquidated
Interest accrual
collectInterest()
Hook interface
getPoolConfig(bytes32 poolId)
recordHookFee(bytes32 poolId, uint256 amount)
Owner configuration
configure(...)
Sets hook address, minRentalDuration, adminFeeBps, maxHookFeeBps, gracePeriod, liquidationThreshold, minBondAmount, maxBondAmount, and interestRatePerSecond.
setFeeRate(uint16 _feeRateBps)
Updates the rental fee rate.
setAdminFees(uint16 lpFeeBps, uint16 rentFeeBps, uint16 liquidationFeeBps)
Updates the three non-hook admin fee parameters.
Events
| Event | Emitted when |
|---|---|
TokenLaunched | New token created |
RentalExtended | Rent deposited |
FeesClaimed | Hook fees claimed by creator |
LPFeesCollected | LP fees collected |
Liquidated | Launch liquidated |
HookFeeReceived | Hook fee recorded |
HookFeeUpdated | Creator changed hook fee |
BondRepaid | Bond partially or fully repaid |
InterestCollected | Interest pushed to vault |
FeeRateUpdated | Rental fee rate changed |
Key errors
| Error | Condition |
|---|---|
InsufficientPayment | msg.value too low for rental duration |
BondAmountOutOfRange | bondAmount outside [minBond, maxBond] |
InvalidDuration | duration < minRentalDuration |
NotLiquidatable | Not yet in liquidation zone |
InGracePeriod | Action blocked during grace period |
InLiquidationZone | depositRent blocked (already liquidatable) |
NotCreator | Caller is not the launch creator |
HookFeeTooHigh | hookFeeBps > maxHookFeeBps |