Equations
Staking
deposit = withdrawaldeposit=withdrawal
Swaps between RUG and sRUG during staking and unstaking are always honored 1:1. The amount of RUG deposited into the staking contract will always result in the same amount of sRUG. And the amount of sRUG withdrawn from the staking contract will always result in the same amount of RUG.
rebase = 1 - ( RUGDeposits / sRUG Outstanding )rebase=1βˆ’(RUGDeposits/sRUGOutstanding)
The treasury deposits RUG into the distributor. The distributor then deposits RUG into the staking contract, creating an imbalance between RUG and sRUG. sRUG is rebased to correct this imbalance between RUG deposited and sRUG outstanding. The rebase brings sRUG outstanding back up to parity so that 1 sRUG equals 1 staked RUG.
Bonding
Bonding happens by allowing users to purchase a bond. This bond price is the Bond price.
bond Price = 1 + PremiumbondPrice=1+Premium
RUG has an intrinsic value of 1 MIM, which is roughly equivalent to $1. In order to make a profit from bonding, Rug charges a premium for each bonding action.
Premium = debt Ratio * BCVPremium=debtRatioβˆ—BCV
The premium is derived from the debt ratio of the system and a scaling variable called BCV. BCV allows us to control the rate at which bond prices increase.
The premium determines profit due to the protocol and in turn, stakers. This is because new RUG is bonded from the profit and subsequently distributed among all stakers.
debt Ratio = bondsOutstanding/RUGSupplydebtRatio=bondsOutstanding/RUGSupply
The debt ratio is the total of all RUG promised to bonders divided by the total supply of RUG. This allows us to measure the debt of the system.
bondPayout_{reserveBond} = marketValue_{asset}\ /\ bondPricebondPayoutreserveBond​=marketValueasset​ / bondPrice
Bond payout determines the number of RUG sold to a bonder. For reserve bonds, the market value of the assets supplied by the bonder is used to determine the bond payout. For example, if a user supplies 1000 MIM and the bond price is 250 MIM, the user will be entitled 4 RUG.
bondPayout_{lpBond} = marketValue_{lpToken}\ /\ bondPricebondPayoutlpBond​=marketValuelpToken​ / bondPrice
For liquidity bonds, the market value of the LP tokens supplied by the bonder is used to determine the bond payout. For example, if a user supplies 0.001 RUG-AVAX LP token which is valued at 1000 MIM at the time of bonding, and the bond price is 250 MIM, the user will be entitled 4 RUG.
RUG Supply
RUG_{supplyGrowth} = RUG_{stakers} + RUGE-_{bonders} + RUG_ {DAO}RUGsupplyGrowth​=RUGstakers​+RUGEβˆ’bonders​+RUGDAO​
RUG supply does not have a hard cap. Its supply increases when:
  • RUG is bonded and distributed to the stakers.
  • RUG is bonded for the bonder. This happens whenever someone purchases a bond.
  • RUG is bonded for the DAO. This happens whenever someone purchases a bond. The DAO gets the same number of RUG as the bonder.
RUG_{stakers} = RUG_{totalSupply} * rewardRateRUGstakers​=RUGtotalSupplyβ€‹βˆ—rewardRate
At the end of each epoch, the treasury bonds RUG at a set reward rate. These RUG will be distributed to all the stakers in the protocol.
RUG_{bonders} = bondPayoutRUGbonders​=bondPayout
Whenever someone purchases a bond, a set number of RUG is bonded. These RUG will not be released to the bonder all at once - they are vested to the bonder linearly over time. The bond payout uses a different formula for different types of bonds. Check the Bonding section above to see how it is calculated.
RUG_{DAO} = RUG_{bonders}RUGDAO​=RUGbonders​
The DAO receives the same amount of RUG as the bonder. This represents the DAO profit.
Backing per RUG
RUG_{backing} = treasuryBalance_{stablecoin} + treasuryBalance_{otherAssets}RUGbacking​=treasuryBalancestablecoin​+treasuryBalanceotherAssets​
Every RUG in circulation is backed by the Rug treasury. The assets in the treasury can be divided into two categories: stablecoin and non-stablecoin.
treasuryBalance_{stablecoin} = BackingPerRUG_{reserveBond} + BackingPerRUG_{lpBond}treasuryBalancestablecoin​=BackingPerRUGreserveBond​+BackingPerRUGlpBond​
The stablecoin balance in the treasury grows when bonds are sold. Backing per RUG is calculated differently for different bonds types.
BackingPerRUG_{reserveBond} = assetSuppliedBackingPerRUGreserveBond​=assetSupplied
For reserve bonds such as MIM bonding, the Backing per RUG simply equals to the amount of the underlying asset supplied by the bonder.
BackingPerRUG_{lpBond} = 2sqrt(constantProduct) * (\%\ ownership\ of\ the\ pool)BackingPerRUGlpBond​=2sqrt(constantProduct)βˆ—(% ownership of the pool)
For LP Bonds such as RUG-AVAX Bonding, the RBacking Per RUG is calculated differently because the protocol needs to mark down its value. Why? The LP token pair consists of RUG, and each RUG in circulation will be backed by these LP tokens - there is a cyclical dependency. To safely guarantee all circulating RUG are backed, the protocol marks down the value of these LP tokens.
Copy link