- this is work in progress
- UI process walkthrough:
- user clicks some ui to swap collateral 100 A tokens to collateral B tokens
- front end calls flashloanLender to borrow 100 A tokens
- crAToken calls this contract's function onFlashLoan, and send 100 A tokens to this contract
- swap (100-flashloanFee) A tokens for B tokens
- deposit B tokens and get crBTokens
- send crBTokens to the user
- grab crATokens from the user
- withdraw from crATokens and get 100 A tokens
- by now the contract has (100 + flashloanFee) A tokens, ready to be grabbed by crAToken for flashloan repayment
-
Notifications
You must be signed in to change notification settings - Fork 4
CreamFi/collateral-swap
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published