Skip to content

Commit ce82da0

Browse files
committed
docs
1 parent 49a71de commit ce82da0

File tree

1 file changed

+20
-9
lines changed

1 file changed

+20
-9
lines changed

README.md

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
![maglev logo](docs/maglev.png)
44

5-
Maglev is an Automated Market Maker (AMM) that uses [Euler Vaults](https://docs.euler.finance/euler-vault-kit-white-paper/) as leveraged lending products in order to extend the range of its reserves and thereby improve the capital efficiency of liquidity provisioning.
5+
Maglev is an Automated Market Maker (AMM) that uses [Euler Vaults](https://docs.euler.finance/euler-vault-kit-white-paper/) to *mag*nify capital efficiency using *lev*erage. By borrowing assets as needed, maglev AMMs can extend the range of their reserves and earn fees on trades several times larger than their liquidity outlay.
66

7-
To swappers, it presents a conventional Uniswap2-style interface but internally it supports custom pricing curves and other advanced functionality.
7+
To swappers, maglev presents a conventional Uniswap2-style interface but internally it supports custom pricing curves and other advanced functionality.
88

99
<!-- TOC FOLLOWS -->
1010
<!-- START OF TOC -->
@@ -24,30 +24,41 @@ To swappers, it presents a conventional Uniswap2-style interface but internally
2424

2525
## Concept
2626

27-
Given a fixed size investment, Maglev aims to increase the size of trades that can be serviced, relative to a conventional AMM such as Uniswap. It does this by borrowing the "out token" and collateralising this loan with the received "in token". Later on, when somebody wishes to swap in the reverse direction, the loan can be repaid in exchange for receiving the collateral, unwinding the borrow position.
27+
Given a fixed size investment, Maglev aims to increase the size of trades that can be serviced relative to a conventional AMM such as Uniswap. It does this by borrowing the "out token" and collateralising this loan with the received "in token". Later on, when somebody wishes to swap in the reverse direction, they repay the loan and receive the excess collateral, unwinding the borrow position.
2828

29-
Because the total size of the position can be many times larger than your initial investment (depending on how much LTV/leverage is allowed on the underlying lending pools), the swapping fees earned can be magnified.
29+
Because the total size of the position can be many times larger than the initial investment (depending on how much LTV/leverage is allowed on the underlying lending pools), the swap fees earned can be magnified.
3030

31-
The down-side is that while the AMM holds this leveraged position, it is paying interest on the loan. Fortunately, this is partially compensated by the fact that the AMM is earning interest on the collateral. In addition, points and rewards may be earned on collateral/borrows.
31+
The down-side is that while the AMM holds this leveraged position, it is paying interest on the loan. Fortunately, this is partially compensated by the fact that the AMM is simultaneously earning interest on the collateral. In some cases, this interest rate spread can be reduced further by taking advantage of incentives such as points/rewards.
3232

3333
## Operation
3434

35-
Since the level of acceptable borrowing risk may not be the same for every user, pooled deposits are not yet possible, and each Maglev instance manages funds for a single user (who of course may operate on behalf of pooled funds).
35+
Since the level of acceptable borrowing risk is not be the same for every user, pooled deposits are not supported. Each Maglev instance manages funds for a single entity (who of course may be jointly owned).
3636

3737
Maglev is a contract designed to be used as an [EVC operator](https://evc.wtf/docs/whitepaper/#operators). This means that the user, known as the *holder*, does not give up control over their funds to a smart contract, but instead retains it in their wallet. The holder can be any compatible address, including standard multisig wallets or even an EOA.
3838

39+
FIXME owner
40+
3941
### Usage
4042

4143
The following are the high-level steps required to use Maglev:
4244

43-
* Deposit funds into one or both of the vaults
44-
* Deploy the desired Maglev contract, choosing parameters such as the vaults and the desired `fee`
45-
* Calculate the desired [virtual reserves](#virtual-reserves) and set these values by invoking `setVirtualReserves()`
45+
* Deposit funds into one or both of the vaults in proportion of the initial price
46+
* Deploy the desired Maglev contract, choosing parameters such as the vaults, debt limits, and the desired `fee`
4647
* Install the Maglev contract as an operator for your account
4748
* Invoke the `configure()` function on the Maglev contract
4849

4950
At this point, anyone can invoke `swap()` on the Maglev contract, and this will perform borrowing and transferring activity between the two vaults.
5051

52+
### Reconfiguration
53+
54+
All user-configurable parameters are stored in immutable variables, meaning they cannot be changed after the AMM is deployed. Instead, the AMM should be uninstalled as an EVC operator, and a new Maglev instance should be created and installed in its place.
55+
56+
In order to temporarily disable a Maglev instance, `pause()` and `unpause()`
57+
58+
### Fees
59+
60+
FIXME
61+
5162
### Virtual Reserves
5263

5364
The initial deposits in the vaults represent the initial investment, and are swapped back and forth in response to swapping activity. In a conventional AMM such as Uniswap, these balance are called *reserves*. However, if swapping was constrained to these assets alone, then this would imply a hard limit on the size of swaps that can be serviced. To increase the effective funds, Maglev AMMs are configured with *virtual reserves*. These are typically larger than the size of the conventional reserves, which signifies that not only can all the assets be swapped from one vault to another, but even more assets can be borrowed on the Maglev's account.

0 commit comments

Comments
 (0)