Adding profit fee to collateral based on Peg

Problem:
Possible drainage of contract when BR is below 1.

Proposal:
Calculatie a fee from the swap based on the PEG to calculatie a 10% fee that is deposited into the contract. Function stays while PEG is below 0,95.

Example: (Based on only waves as collateral.
Wavesusd : 1
Wavesusdn : 2
Swap 1000 USDN.
1000 USDN swap would give 995 Waves (incl. 0,5 Fee for NSBT holders.)
1000 USDN would buy 500 Waves.
Profit 995- 500 = 495 Waves.
10% of 495 = 49,5 Waves
49,5 Waves go back as collateral.

1 Like