Question & Suggestion for current Spread formula

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!

1 Like

I think we already implement this formula (where the amount of the swap tx is taken into account on the spread calculation), but further to this the concept of the “daily swap limit” needs to be trailing rather than operating on a cliff. (For example, instead of the daily limit reseting on 0:00 UTC, we need to take into account the amount of swaps in any given 24 hr window).

Another thought I’ve had recently is to enforce the spread / swap limit on Terra issuance rather than luna issuance. Currently in comparison to Terra adoption Luna is probably overvalued, which forces us to adopt a rather arbitrary daily swap limit of 0.1% on market cap. While this makes sense today where Terra market cap is small, it would make little sense in a future state of the economy where it is > 1 bil +.

That’s Great, using Terra issuance to enforce the spreads/swap limit totally makes sense. Because the actual size of Terra’s economy depends on Terra, not Luna.