Sun
The MelonFarm peg maintenance mechanism requires a protocol-native timekeeping mechanism and regular code execution on the blockchain. The Sun keeps time on the Farm in Seasons and incentive cost-efficient and timely calling of the sunrise
function.
MelonFarm adjusts itself to return the Melon price to its value peg at the beginning of every Season. Each Season is one hour long.
The exact beginning of each Season may vary as Seasons do not begin until the sunrise function has been called through a blockchain transaction. The first transaction that successfully calls the gm function after the top of each hour UTC begins a new Season. Melonfarm only accepts one gm function call per Season.
Anyone can become a timekeeper and call the sunrise
function on MelonFarm. MelonFarm covers the cost of the transaction by rewarding the sender who accepted the sunrise
function call with newly minted Melons. The reward amount is fixed at 1% newly minted Melons (capped at 100 Melons) or 1 (One) Melon in case no Melons are minted in that season.
Upon acceptance of the sunrise
call, the Sun:
Increments the Season number;
Calculate delta supply, the sum of the time and liquidity-weighted average shortage or excess Melons across liquidity pools on the Melon Oracle;
Calculate the Temperature and mint new Soils if necessary.
Mint new Melons if necessary; and
Rewards Melons to the address that successfully called the sunrise function.
The Weather
The Weather maintains the primary Melon-ETH liquidity pool and calculates the delta supply at the beginning of every season. It is managed and called by the Sun only, no other internal or external components can trigger it.
The delta supply at every Season will be calculated as below:
Delta Supply - can be positive or negative, if it is positive, the Melon's demand is high, mint new Melons. Otherwise, the supply is high, we don't mint new Melons.
Melon Supply - the total Melon supply was ever minted, the value of the
totalSupply
function in the Melon ERC20 contract.Melon Price - the current price of Melon in USD was calculated and fetched from the Oracle using the Melon-ETH liquidity pool.
If Delta Supply is positive, the Weather is Rainy, we mint new Melons. Otherwise, the Weather is Sunny, we don't mint new Melons.
Last updated