ain icon indicating copy to clipboard operation
ain copied to clipboard

Future Swap limitation

Open Bushstar opened this issue 1 year ago • 0 comments

Summary

  • Limits the amount that can be swapped from loan token to DUSD to 10% of the 28 day average liquidity of that loan token in its DUSD pool. Actual percentage and period is configurable, but defaults to the values above.
  • Average liquidity will only populate on a Future Swap event if there is enough liquidity data present, which there should be as long as the limitation has been enabled for the full 28 days period before the event.
  • If there is no average liquidity present then Future Swap will behave as normal without any limits.
  • Implements https://github.com/DeFiCh/dfips/issues/238

RPCs

  • listloantokenliquidity returns a list of all present average liquidity.

Implications

  • Storage

    • [ ] Database reindex required
    • [ ] Database reindex optional
    • [ ] Database reindex not required
    • [x] None
  • Consensus

    • [x] Network upgrade required
    • [ ] Includes backward compatible changes
    • [ ] Includes consensus workarounds
    • [ ] Includes consensus refactors
    • [ ] None

Bushstar avatar Mar 04 '24 16:03 Bushstar