spot
spot copied to clipboard
The Balancer
-
Balancer: New module to orchestrate all external interactions with perp/vault systems and holds all the fee logic. (The current fee policy evolves into the balancer). Balancer allows for operations on both perp and vault both individually as well as simultaneously (mint2, redeem2 and rebalance).
-
All Perp operations now run through the balancer. We also move away from the lazy state update model (previously we used to call
updateState
before every action). The absolute supply caps have been removed. The naming convention for all read interface functions have been updated (previously they were prepended with "get", to indicate a lazy state update before reading). -
All vault operations now run through the balancer. We allow the balancer to deposit Z tranches from the current deposit bond to mint vault notes (used by mint2). The updated swap logic limits the vault liquidity from getting too high or too low based on the maximum capital required to rollover the entire spot supply. The rollover vault also handles an edge case that arises from redeeming a bond fully before maturity.
-
The latest version of the tranche contracts expose a
bond.collateralBalance()
method on the button-wood bonds. This method accounts for the total collateral which is deposited into the bond through the deposit function and discounts any collateral which is transferred directly into the bond (erroneously or maliciously). We update all instances where we calculate the bond's collateral balance to usecollateralBalance
method instead oftoken.balanceOf(bond)