Skip to content

Commit 630d7b8

Browse files
Merge branch 'master' into feat/factory
2 parents 8f0df26 + ec46a58 commit 630d7b8

File tree

3 files changed

+48
-80
lines changed

3 files changed

+48
-80
lines changed

TODO

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
! Don't make quotes that would cause a swap to fail if supply/borrow caps exceeded
2+
* Better revert messages when a swap fails due to maglev debt-limit/vault utilisation/etc
3+
* currently it's an arithmetic underflow
4+
5+
6+
TESTING
7+
8+
* when exchange rate in vaults != 1
9+
* uniswap callback, flash swaps
10+
* hitting reserve/utilisation limits
11+
* AssetsOutOfOrderOrEqual
12+
13+
14+
MISC
15+
16+
? A really small swap could fail because deposit() results in 0 shares, which causes EVK to revert. Call convertToShares() first? Seems like overkill...
17+
? permit2 instead of regular approval: measure gas savings
18+
* Improve the efficiency of on-chain quoting
19+
* Probably necessary for supporting non-zero slippage swaps
20+
* Use unchecked math in verify() (needs careful boundary analysis)
21+
* Closed-form quoting solutions
22+
* "Range hints" for the binary search
23+
24+
25+
IDEAS
26+
27+
* Currently we have only been supporting stable-stable pairs
28+
* What extra considerations would there be for floating pairs?
29+
* Automatically re-invest fees? There are a few options:
30+
* Don't do anything: Re-deploing probably isn't a huge deal
31+
* Increase the reserves by the fee amount
32+
* Increase the reserves by the extra amount of possible leverage supported by the new fee
33+
* Apply fees to a super-concentrated middle section of the curve (needs R&D)
34+
* Could current reserves be calculated dynamically based on balances/debts/debt limits?
35+
* I guess you would lose a chunk of interest to arbitrage
36+
* Donation attacks?
37+
* What can we do to make this easily integrated with aggregators/MEV bots/etc?
38+
* How to handle a discovery/tracking of the different Maglev instances?
39+
? Factory? Registry? Maybe a fake factory that reads the actually installed operators from a set of addresses?
40+
? Transparent proxy so a Maglev address can stay constant

src/EulerSwap.sol

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,14 @@ contract EulerSwap is IEulerSwap, EVCUtil {
131131
reserve1 = uint112(newReserve1);
132132

133133
emit Swap(
134-
msg.sender, amount0In, amount1In, amount0Out, amount1Out, uint112(newReserve0), uint112(newReserve1), to
134+
_msgSender(),
135+
amount0In,
136+
amount1In,
137+
amount0Out,
138+
amount1Out,
139+
uint112(newReserve0),
140+
uint112(newReserve1),
141+
to
135142
);
136143
}
137144
}

test/EulerSwapFactoryTest.t.sol

Lines changed: 0 additions & 79 deletions
This file was deleted.

0 commit comments

Comments
 (0)