euler-xyz / fee-flow

Efficient, decentralised and MEV resistant mechanism to convert fee assets to a single token.
GNU General Public License v2.0
14 stars 0 forks source link

Suggestion: Just record buyer address instead of forcing all assets to be sent at the time of purchase #19

Open Mookow4eva opened 3 months ago

Mookow4eva commented 3 months ago

I can easily see the number of assets causing the gas required to exceed the block gas limit (or just being annoyingly expensive), so instead of sending them all at the time of purchase, just record the owner's address and allow them to transfer them (or more importantly for shitcoins, NOT transfer them) at their leisure.

Another way to think of it: sell off ownership of a Gnosis Safe (though it doesn't have to necessarily be one).

MickdeGraaf commented 3 months ago

When designing fee flow the fact that it technically supports infinite tokens but not in practice due to gas limitations was something I took into consideration.

Recording the amounts per token at the time the buyer settles the auction has the same gas constraints although slightly more efficient at buy time. Since most of the tokens will probably be transferred into the contract at auction settlement a fair portion of the involved storage should be warm already. Additionally it adds extra complexity whilst it is now such a simple and easily understood smart contract.

I've also considered going the route of selling the ownership of a simple smart contract wallet as an NFT like you are suggesting. However this means that all contracts that push fees to fee flow would need to then lookup which address they need to send the fees to. Which creates a tighter coupling between the fee generating contracts and fee flow. Again I favored simplicity both in fee flow and the contracts that use it over a design which could serve the use case of a large number of tokens.

I also expect most buyers to be bots which will want to immediately convert any asset into they paymentToken and earn a small profit which would actually be less efficient if there was an extra step in the middle of selling the smart contract wallet.

All in all fee flow should not be used when it is expected a very large amount of different tokens will be pushed to it. Would love to see a version selling smart contracts wallets though.

Mookow4eva commented 2 months ago

fee flow should not be used when it is expected a very large amount of different tokens will be pushed to it

I really think.... no I hope.... Euler v2 will have a very large amount of different tokens pushed to it. It is permissionless after all.

Here's another random spin on the smart contract wallet idea, not sure it's any good but just dumping it: What if there are N (say 10) smart contract wallets in rotation and you buy the right (but not the obligation!) to withdraw any tokens in that smart contract wallet for N-1 (say 9) epochs. This would allow low value shitcoins to be ignored and to accumulate until they are worth withdrawing. I guess N could even be as low as 2(?) depending how long an epoch is...