Next we're going to talk about a flash swap. We've talked about flash loans. What is a flash swap? Basically flash swap is a contract sends tokens before the user actually pays for them. A swap is just an exchange, but this is a little different than a flash loan. There's a lot of possibilities and terms of deploying this idea where you can essentially deploying liquidity to acquire another asset and get this basically before paying for it. Again, this is going to have zero duration, it's all going to be within one transaction, but it opens up many possibilities here. It's swap because we're going to be operating with not just one asset. The swap is an exchange of one asset for another. A loan is always the same asset. Let's go through the details and mechanics of a flash swap. Again, this is much different than the flash loan because a loan needs to be repaid in the same asset. I borrow 10,000 DAI, I need to pay back 10,000 DAI. The swap will be with different assets. Again, it's in a single Ethereum transaction. It's going to be atomic just like the flash loan, but it's a very interesting idea that happens on Uniswap. Let's as usual go through an example. Let's say we're talking about the DAI/USDC market that we've talked about before. It's a high correlation market, not that much impermanent loss. We've got a supply of a 100,000 each. This is a large K, so the invariant is quite large here. Having a 100,000 each means that the exchange rate is one to one and the invariant is 10 billion. A 100,000 times a 100,000. In this situation we've got a trader that has no starting capital, that's important. It's like a flash loan. Remember that the flash loan, there was no collateral for it. For this flash swap, the same thing, just no starting capital. But they see that there's an arbitrage opportunity to buy DAI on another DEX for 0.95 USDC. You see the possibility here, if I can buy for 0.95 USDC, and then sell for one on this very liquid Uniswap market with the invariant of 10 billion, then this is an arbitrage opportunity. Let's go through the details of how this works. It's going to involve the flash swap. What we're going to do, and I've got the diagram that explains this, that we're going to withdraw 950 USDC, a flash liquidity. Indeed this is derived from a flash loan. We're going to do this from the DAI/USDC market and then purchase 1000 DAI via the arbitrage trade. Then we're going to repay 963 DAI and end up with a profit. The 963 is going to be calculated as the 960, and I've got rounding of course. We need to maintain obviously in the invariant of 10 billion and there is some slippage as a result of that. This is not without slippage. Let's actually go through the mechanics again. There will be 30 basis point fee that's going to be paid into the pool and let's see how it actually goes. So from Uniswap, step number one, we'll flash swap 950 USDC, and then we're actually going to trade with that USDC. We're going to trade with this alternative DEX. Notice the alternative DEX, the exchange rate is 0.95 USDC for one DAI. 950 USDC is going to get me 1,000 DAI. I've got the 1,000 DAI I get from the DEX in step number 2. Then I close the flash swap with 963 DAI. The slippage here is 10 DAI. There's a fee of three DAI, and this means that the swap is done at 963. Think about the profit here, the profit is 1,000 minus 963, which is 37 DAI. This is all done in one transaction and it is arbitrage because you make some money for not taking a lot of risk. Again, this is atomic at any point if something fails, then we return to the original state.