Skip to content

Commit 978a931

Browse files
committed
rename to euler-swap in white paper and readme
1 parent aa4711b commit 978a931

File tree

4 files changed

+52
-58
lines changed

4 files changed

+52
-58
lines changed

README.md

Lines changed: 24 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,67 @@
1-
# Euler Maglev
1+
# Euler Swap
22

3-
![maglev logo](docs/maglev.png)
4-
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.
3+
EulerSwap 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.
64

75
To swappers, it presents a conventional Uniswap2-style interface but internally it supports custom pricing curves and other advanced functionality.
86

97
<!-- TOC FOLLOWS -->
108
<!-- START OF TOC -->
119
<!-- DO NOT EDIT! Auto-generated by md-toc: https://github.com/hoytech/md-toc -->
1210

13-
* [Concept](#concept)
14-
* [Operation](#operation)
15-
* [Usage](#usage)
16-
* [Virtual Reserves](#virtual-reserves)
17-
* [Desynchronised Virtual Reserves](#desynchronised-virtual-reserves)
18-
* [Curves](#curves)
19-
* [Constant Sum](#constant-sum)
20-
* [Constant Product](#constant-product)
21-
* [License](#license)
11+
- [Concept](#concept)
12+
- [Operation](#operation)
13+
- [Usage](#usage)
14+
- [Virtual Reserves](#virtual-reserves)
15+
- [Desynchronised Virtual Reserves](#desynchronised-virtual-reserves)
16+
- [Curves](#curves)
17+
- [Constant Sum](#constant-sum)
18+
- [Constant Product](#constant-product)
19+
- [License](#license)
2220

2321
<!-- END OF TOC -->
2422

2523
## Concept
2624

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.
25+
Given a fixed size investment, EulerSwap 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.
2826

2927
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.
3028

3129
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.
3230

3331
## Operation
3432

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).
33+
Since the level of acceptable borrowing risk may not be the same for every user, pooled deposits are not yet possible, and each EulerSwap instance manages funds for a single user (who of course may operate on behalf of pooled funds).
3634

37-
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.
35+
EulerSwap 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.
3836

3937
### Usage
4038

41-
The following are the high-level steps required to use Maglev:
39+
The following are the high-level steps required to use EulerSwap:
4240

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()`
46-
* Install the Maglev contract as an operator for your account
47-
* Invoke the `configure()` function on the Maglev contract
41+
- Deposit funds into one or both of the vaults
42+
- Deploy the desired EulerSwap contract, choosing parameters such as the vaults and the desired `fee`
43+
- Calculate the desired [virtual reserves](#virtual-reserves) and set these values by invoking `setVirtualReserves()`
44+
- Install the EulerSwap contract as an operator for your account
45+
- Invoke the `configure()` function on the EulerSwap contract
4846

49-
At this point, anyone can invoke `swap()` on the Maglev contract, and this will perform borrowing and transferring activity between the two vaults.
47+
At this point, anyone can invoke `swap()` on the EulerSwap contract, and this will perform borrowing and transferring activity between the two vaults.
5048

5149
### Virtual Reserves
5250

53-
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.
51+
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, EulerSwap 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 EulerSwap's account.
5452

55-
Virtual reserves control the maximum debt that the Maglev contract will attempt to acquire on each of its two vaults. Each vault can be configured independently.
53+
Virtual reserves control the maximum debt that the EulerSwap contract will attempt to acquire on each of its two vaults. Each vault can be configured independently.
5654

5755
For example, if the initial investment has a NAV of $1000, and virtual reserves are configured at $5000 for each vault, then the maximum LTV loan that the AMM will support will be `5000/6000 = 0.8333`. In order to leave a safety buffer, it is recommended to select a maximum LTV that is below the borrowing LTV of the vault.
5856

5957
Note that it depends on the [curve](#curves) if the maximum LTV can actually be achieved. A constant product will only approach these reserve levels asymptotically, since each unit will get more and more expensive. However, with constant sum, this LTV can be achieved directly.
6058

6159
### Desynchronised Virtual Reserves
6260

63-
The Maglev contract tracks what it believes the reserves to be by caching their values in storage. These reserves are updated on each swap. However, since the balance is not actually held by the Maglev contract (it is simply an operator), the actual underlying balances may get out of sync. This can happen gradually as interest is accrued, or suddenly if the holder moves funds or the position is liquidated.
61+
The EulerSwap contract tracks what it believes the reserves to be by caching their values in storage. These reserves are updated on each swap. However, since the balance is not actually held by the EulerSwap contract (it is simply an operator), the actual underlying balances may get out of sync. This can happen gradually as interest is accrued, or suddenly if the holder moves funds or the position is liquidated.
6462

6563
When this occurs, the `syncVirtualReserves()` should be invoked. This determines the actual balances (and debts) of the holder, and adjusts them by the configured virtual reserve levels.
6664

67-
68-
6965
## Curves
7066

7167
### Constant Sum
@@ -80,8 +76,6 @@ In this curve, the entire virtual reserves can be consumed, and since each margi
8076

8177
This is the traditional Uniswap2 curve that preserves the product of the two reserves. The larger a swap, the higher the price impact and the more profitable it is to arbitrage a disbalanced pool back to its wider market price.
8278

83-
84-
8579
## License
8680

8781
(c) 2024 Euler Labs Ltd.

docs/maglev.png

-264 KB
Binary file not shown.

0 commit comments

Comments
 (0)