Skip to content

Conversation

@alexsanya
Copy link

@alexsanya alexsanya commented Apr 9, 2023

Changes:

  • add swapCollateral to swap locked in contract USDC to another stable coin in case USDC loses it's peg again
  • winner should run transaction to claim tokens - this will allow to get any token locked in contract
  • integration with Uniswap V3
  • added mocks for Chainlink price feeds in tests
  • emit events on start and settle - signals for the bot

Workflow:

  • Bot will deploy smart contract
  • Parties will deposit their assets and the bet is started
  • Once the bet is started the bot will check USDC price every 5 seconds and if it drops below threshold it will start to search the best swap route by looking at other stable-coins performance, available pools, fees and liquidity in Uniswap and once the route for conversion with minimal losses will be found the transaction will to be submitted
  • If there is not enough liquidity in pools the partial swap will be performed and search continues
  • When the bet is settled winner will get all the assets

Notes:

  • Swap is only allowed by contract owner when the bet is started, USDC price is lower than threshold and output token is one of: USDT, BUSD, USDP, DAI
  • settle only defines the winner and then winner should run transaction to claim each token locked in contract
  • added Chainlink feed for USDC price

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant