Overview
MakxYieldVault is an ERC-20 contract that holds ETH and lends it to MakxYieldPad. Depositors receive METH shares. YieldPad borrows ETH for token launches and pays interest back. Interest raises the share price, benefiting all depositors proportionally.
All interest accrual logic is owned by YieldPad — the vault simply receives ETH via repay() and depositInterest().
State
| Variable | Type | Description |
|---|---|---|
yieldPad | address | Address of the authorized MakxYieldPad |
totalBondedETH | uint256 | ETH currently lent out (accounting marker, not physical balance) |
withdrawalCooldown | uint24 | Seconds between withdrawal request and redemption |
feeBps | uint256 | Protocol fee in BPS on deposit and redeem (max 1000) |
withdrawalRequests | mapping(address => WithdrawalRequest) | Pending withdrawal requests |
Depositor functions
deposit()
collectInterest() on YieldPad first. Deducts feeBps if non-zero.
requestWithdrawal(uint256 shares)
cancelWithdrawal()
redeem()
feeBps from output.
Lending interface (YieldPad only)
borrow(uint256 amount)
totalBondedETH. Reverts if amount > address(this).balance.
repay()
totalBondedETH by msg.value.
View functions
totalAssets()
address(this).balance + totalBondedETH. This is the full ETH value backing all METH shares.
sharePrice()
1e18 if supply is zero.
Owner functions
configure(address _yieldPad, uint24 _withdrawalCooldown)
Sets the authorized YieldPad address and withdrawal cooldown.
setFeeBps(uint256 _feeBps)
Sets the protocol fee on deposit/redeem. Capped at 1000 (10%).
Events
| Event | Emitted when |
|---|---|
Deposited(user, ethAmount, shares) | ETH deposited |
WithdrawalRequested(user, shares, requestedAt) | Withdrawal request started |
WithdrawalCancelled(user) | Request cancelled |
Redeemed(user, shares, ethOut) | Shares redeemed for ETH |
Borrowed(amount) | ETH lent to YieldPad |
Repaid(amount) | ETH returned from YieldPad |
FeeBpsUpdated(feeBps) | Protocol fee updated |
Errors
| Error | Condition |
|---|---|
ZeroAmount | Zero ETH deposit or zero shares |
InsufficientShares | Caller has fewer shares than requested |
InsufficientAvailableETH | Vault idle balance too low to lend |
NoWithdrawalPending | No active request to redeem or cancel |
CooldownNotElapsed | Cooldown period not yet passed |
NotYieldPad | Caller is not the authorized YieldPad |
TransferFailed | ETH transfer reverted |
FeeTooHigh | feeBps > 1000 |