In the following post, Vitalik Buterin claimed that ETH2-Sharding will not break DeFi composablity: [1] https://ethresear.ch/t/cross-shard-defi-composability/6268
However, I am not at all convinced by his arguments. Let's look at the following example from Vitalik [1]:
Composability example 1: Uniswap <-> Tokens Nearly all DeFi applications are uses of composability, because tokens are a type of application and so any DeFi application that uses tokens is an application that interacts with another application. Let us look at Uniswap as an example. In Uniswap, a user sends some quantity of token A to a Uniswap contract, which sends some quantity of token token B back to the user. Uniswap requires strict dependency between all transactions that interact with it: the Nth transaction must be aware of the output of the N-1’th transaction, because this is how the price updating algorithm works.
Hence, the Uniswap contract would need to live on a single shard (there are designs for multi-shard Uniswap, but they are more complex). Users looking to trade would perform a 2-step procedure:
Send their token A to the shard that Uniswap is on. Perform a trade with Uniswap as before (the transaction doing this would be combined with the transaction “claiming” the receipt from step (1), so it’s a single step) [Optional] If desired, move the token B that Uniswap gave them to some other shard.
Now this is a very simple use case. Since Uniswap acts as an automated market maker, it seems pretty obvious that Uniswap wants to run on a single shard. However, sending token from one shard to another shard seems to be very tedious for DeFi users. If I want to trade with DeFi-assets, then I don't want to care about moving ETH between shards. I just want to invoke a smart contract, and I don't want to care about where a particular smart contract is sharded. For me, this seems like a lot of needless technical complexity for the average DeFi-trader.
But this is just one aspect that I am concerned about. The other aspect is that Vitalik's Uniswap example does not explain at all how atomic composability is still supposed to work. For example, let's consider the use case of flash loans. Flash loans are uncollaterized loans that succeed only if they are paid back within the same transaction. In contrast, with asynchronous messages between shards, flash loans would probably be infeasible. And flash loans are just one advanced example, I am pretty sure that we could find many more advanced DeFi use cases.
So what do you think, do you believe that Vitalik did not even realize what "atomic DeFi composability" actually means?