diff --git a/TODO b/TODO new file mode 100644 index 0000000..88cb24a --- /dev/null +++ b/TODO @@ -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 \ No newline at end of file diff --git a/src/EulerSwap.sol b/src/EulerSwap.sol index 837001d..cd37af6 100644 --- a/src/EulerSwap.sol +++ b/src/EulerSwap.sol @@ -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 ); } }