Hey guys! This is Joon from Chung-ang University Blockchain lab ‘C-Link’
I have question & suggestion for spread formula in Market Module.(https://github.com/terra-project/core/blob/develop/docs/specifications/market.md)
As I know, current spread formula for on-chain luna swap is:
spread = MinSwapSpread + {dailyDelta/maxDelta(MaxSwapSpread - MinSwapSpread)}*
But, from this formula, I think spread cannot be a good safety for on-chain market. If attacker sends MsgSwap at the time when the dailyDelta resets, he can easily swap his asset with the lowest spread fee. Considering luna’s current market volume, 2% cannot be a proper safety for large swap. If this is true, I think spread formula for Terra’s on-chain market should be changed. So I suggest new formula for spread.
Here is my suggestion:
spread = MinSwapSpread + {(dailyDelta+myDelta)/maxDelta(MaxSwapSpread - MinSwapSpread)}*
myDelta = ‘luna included in current MsgSwapTx’/’total luna supply’
The problem of current spread formula is that the formula does not include the luna of current MsgSwap Tx. So, I add myDelta value, which represents the Delta of current MsgSwap Tx. By adding this simple value, I think spread can be a nice safety for Terra’s on-chain market!