Skip to content

Commit

Permalink
Merge pull request #7 from GenerationSoftware/gen-956-update-flash-sw…
Browse files Browse the repository at this point in the history
…ap-example-link-on-builder-code-examples

fix contract example link and update description
  • Loading branch information
trmid authored Dec 18, 2023
2 parents b1a8722 + 1ce514c commit 042b469
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/liquidations/examples/flash-swap-liquidations/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
| [Overview](#overview)
| [Design](#deisgn)
| [Example](#example)
| [Try it out](#try-it-out)
|

## Overview

Flashswaps are unique swaps where the sender receives the output first, executes some external logic to obtain input tokens, and sends the required input amount to the swap contract. In order for this to be possible, the contract verifies that the required token input has been received at the end of the transaction and fails if they haven't.
Flashswaps are unique swaps where the sender receives the output first, executes some external logic to obtain input tokens and sends the required input amount to the swap contract, keeping the profit from the arbitrage. In order for this to be possible, the contract verifies that the required token input has been received at the end of the transaction and fails if they haven't.

In PoolTogether V5, flashswaps can be used with yield liquidations as a way to atomically liquidate yield for prize tokens with an onchain market without having to worry about volatility.

Expand All @@ -21,4 +22,8 @@ During the callback function, the flashswap contract must acquire the necessary

## Example

For an example of using a `LiquidationPair` flashswap with Uniswap, see this [example flashswap contract](https://github.com/GenerationSoftware/pt-v5-flash-liquidator/blob/cd19685f83a285ef50145717248fa3ce296b3b48/src/UniswapFlashLiquidation.sol).
For an example of using a `LiquidationPair` flashswap with Uniswap, see this [example flashswap contract](https://github.com/GenerationSoftware/pt-v5-flash-liquidator/blob/main/src/UniswapFlashLiquidation.sol).

## Try it out!

Check out the [Cabana Flash](https://flash.cabana.fi/) to participate in PoolTogether V5 yield liquidations and make profit with flashswaps!

0 comments on commit 042b469

Please sign in to comment.