timewave-computer / rebalancer

Other
3 stars 0 forks source link

Fix bugs #75

Closed Art3miX closed 5 months ago

Art3miX commented 5 months ago

Fix the bug where trades were generated wrongfully, the reason behind it is because we were updating the max_sell value incorrectly (the amount the user set to sell at most per 1 cycle)

Fix wrong dt calculation, instead of Decimel::new we should have used Decimal::from_atomic.

Generate new test that allows us to fetch live data from mainnet and input it into our mocked environment, there are several benefits to this type of testing, but the main are:

  1. We now see the errors and the trace, which allows us to save huge amount of time for debugging errors that happen.
  2. This allows us to reproduce the exact calculation that happen per cycle, and play with those values as we want
  3. This allows us to test future updates on live data and see if the new version gives a different result then the old version, we can include this test into the test pipe line and automate it on PRs.