Skip to content
This repository has been archived by the owner on May 2, 2023. It is now read-only.

Bancor strategy #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

matthewh86
Copy link

Attempt at the Bancor Strategy bounty.

I don't think I did too terribly considering I didn't know Solidity on Friday 😅

areas accounted for (or at least code exists for it)

  • 100 day withdraw lock (to accrue Liquidity Protection against IL)
  • withdraw lock configured at construction to allow for easier testing
  • trading BNT for the collateral token
  • keeping track of each liquidity position
  • partial withdraws of liquidity
  • interest tracking
  • override withdraw that will ignore liquidity protection lock in
  • fee transfers
  • I aimed to make base BancorStrategy token agnostic, so hopefully should be extendible to LINK etc.

tech debt

  • I couldn't get the Bancor integration tests to work, as the behaviour to simulate market conditions did not seem to alter the results I was getting back for the removeLiquidityReturn call.
  • I didn't get time to work out what some of the tests were attempting (e.g. the compound one obtained the exchange rate several times)
  • some troubleshooting / debug code left in
  • lots of tests aren't passing due to lack of time
  • I did not initially realise that the BNT compensation had a 24H lock before being released to the account. spare BNT should still be hoovered up whenever a withdrawal is done though

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant