Aave Flash Loans
Decentralized margin trading protocol for opening long and short positions on any tokens listed on Aave with up to 5x leverage. Levered uses Aave for borrowing and 1inch.exchange for trading. Each position is automatically represented as an NFT that can be transferred to other accounts. Every position is isolated in its own address so users can have multiple positions that don't affect each other.
How It's Made
I used Aave for borrowing and 1inch for trading. I used the ERC721 standard to represent each position as an NFT. The minimal proxy contract from EIP 1167 was also used for saving gas on the deployment of new contracts. Aave flash loans are used to borrow the margin initially and create the position, then once its created, the amount owed to the flash loan is borrowed form Aave and paid back. Each position is isolated in its own address so a liquidation of 1 position doesnt affect the other.