Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions TODO
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
! Don't make quotes that would cause a swap to fail if supply/borrow caps exceeded
* Better revert messages when a swap fails due to maglev debt-limit/vault utilisation/etc
* currently it's an arithmetic underflow


TESTING

* when exchange rate in vaults != 1
* uniswap callback, flash swaps
* hitting reserve/utilisation limits
* AssetsOutOfOrderOrEqual


MISC

? A really small swap could fail because deposit() results in 0 shares, which causes EVK to revert. Call convertToShares() first? Seems like overkill...
? permit2 instead of regular approval: measure gas savings
* Improve the efficiency of on-chain quoting
* Probably necessary for supporting non-zero slippage swaps
* Use unchecked math in verify() (needs careful boundary analysis)
* Closed-form quoting solutions
* "Range hints" for the binary search


IDEAS

* Currently we have only been supporting stable-stable pairs
* What extra considerations would there be for floating pairs?
* Automatically re-invest fees? There are a few options:
* Don't do anything: Re-deploing probably isn't a huge deal
* Increase the reserves by the fee amount
* Increase the reserves by the extra amount of possible leverage supported by the new fee
* Apply fees to a super-concentrated middle section of the curve (needs R&D)
* Could current reserves be calculated dynamically based on balances/debts/debt limits?
* I guess you would lose a chunk of interest to arbitrage
* Donation attacks?
* What can we do to make this easily integrated with aggregators/MEV bots/etc?
* How to handle a discovery/tracking of the different Maglev instances?
? Factory? Registry? Maybe a fake factory that reads the actually installed operators from a set of addresses?
? Transparent proxy so a Maglev address can stay constant
9 changes: 8 additions & 1 deletion src/EulerSwap.sol
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,14 @@ contract EulerSwap is IEulerSwap, EVCUtil {
reserve1 = uint112(newReserve1);

emit Swap(
msg.sender, amount0In, amount1In, amount0Out, amount1Out, uint112(newReserve0), uint112(newReserve1), to
_msgSender(),
amount0In,
amount1In,
amount0Out,
amount1Out,
uint112(newReserve0),
uint112(newReserve1),
to
);
}
}
Expand Down
Loading