The BAMM is a borrowing/lending module built on top of Fraxswap. Unlike other borrowing lending modules, the BAMM does not need an outside oracle or external liquidity to function safely. [1] [6]
With the BAMM, borrowing lending services can be created for pairs that were previously impossible, because they did not have a solid oracles or sufficient liquidity.
Borrowers rent liquidity provided by lenders to automatically leverage up and down, such that they can stay solvent even in the case of high volatility. This means borrowers can not experience sudden liquidations, so there is also no need to pay high liquidation fees to liquidators, creating a better deal for both borrowers and lenders.
Each BAMM pool is build on top of a single Fraxswap pool that holds two tokens. Borrowers can safely long and short each token without fear of sudden liquidation. [6]
Lenders lend their full range liquidity LP tokens from Fraxswap to the BAMM lending pool. The amount lend is calculated used the following formula: sqrt(X×Y). Where X and Y are the number of the two tokens in the pool. Lenders earn trading fees from Fraxswap and interest rate from borrowers that rent their liquidity. [6]
Each borrower has its own vault where they put in their collateral, rent liquidity from the liquidity pool and withdraw tokens. Rented liquidity LP tokens are burned when rented and the underlying tokens are put in the users vault to act as collateral.
The user can also withdraw tokens from their vault, but they must remain solvent. A user is solvent when the rented liquidity amount is less than 98% of the sqrt(X×Y) of their vault. Note that for both the amount of the rented LP and the assets in the vault, the sqrt(X×Y) is used to calculate solvency. These values are unchanged when there are price movements, so the borrower can not get insolvent when prices change. The borrowers debt slowly increases over time due to interest rate payments, so borrowers should periodically check their position to avoid liquidation. The interest rate for the rented liquidity is calculated using a dynamic interest rate model that is used in Fraxlend as well. [6]
The difference between Borrow AMM and other AMMs is as follows:
- Liquidity providers are not allowed to swap their tokens, they provide Fraxswap LP tokens, which an AMM like Uniswap v2. Others users can swap tokens in that pool, this means that the ratio of the tokens that are lend change with the market price.
- Liquidity providers cannot set their own fees. Liquidity providers earn interest from borrowers that use their LP tokens and also earn swap fees from Fraxswap for LP tokens that are not utilised.
- For lenders the main difference compared to other AMMs is that their LP tokens are sometimes used for borrowing and that they are not available to withdraw. When utilisation is high, interest rate go up, such that lenders are then compensated for this inconvenience.
- For borrowers the main difference compared to using other lending products, is that they cannot get liquidated. This is because under the hood, they are borrowing LP tokens and the token ratios inside the LP tokens change with the market price. The BAMM makes sure that at no market price the users position is under water. The user will experience this as soft/un-liquidation where they sell some collateral when the price goes down and buy more collateral when the price goes up.
- There is no fixed term lending/borrowing in the BAMM.
Borrow AMM is a relatively new concept in the DeFi space, and there are not many crypto finances or companies that provide it. Notable players like Frax Finance, GammaSwapLabs, infinitypool, Timeswap, SushiSwap, and Panoptic_xyz are already making strides in this space.
- Frax Finance: Frax Finance is a fractional-algorithmic stablecoin protocol that aims to create a more capital-efficient and innovative stablecoin ecosystem. Frax Finance is planning and actively coding to launch Borrow AMM (BAMM) in 2023, which will be integrated with frxETH V2, a liquid staking token that enables users to run validators in a decentralized and permissionless way. BAMM built by the core team of Frax Finance allows users to use leverage on any token without the need of oracles. By now adding the ability to borrow from an LP pool in a safe manner, BAMM is the first instance of a primitive that encompasses all parts of The DeFi Trinity in a truly decentralized manner that anyone can tap into. The BAMM is more complex compared to other lending platforms. The risk for lenders are different and are now the same as liquidity providers in AMMs, so they take on price risk, compared to lending in a lending platform like Aave. [1][2][3]
- Timeswap: Timeswap is an AMM-based lending and borrowing protocol that operates on Ethereum, Arbitrum, Polygon, and other networks. It offers fixed maturity and non-fungible loans, similar to Borrow AMM. Timeswap claims to be the first AMM to enable fixed-term lending and borrowing.
- SushiSwap: SushiSwap is a popular AMM and decentralized exchange that operates on multiple blockchains. SushiSwap is developing a new feature called Kashi, which will allow users to create custom lending and borrowing markets with any pair of tokens. Kashi will use a novel AMM design called BentoBox, which will enable isolated risk, flexible fees, and leverage.