Background
In SIP#12 (https://snapshot.org/#/stgdao.eth/proposal/0xe366d625a736b8f66e5c3fa640c538d37ff503d019460e9267d6c3a54fe09f98) a depeg protection module was introduced. This module sets parameters for depeg where if the stablecoin value is $0.9800 or lower for 30 continuous minutes OR if the stablecoin value reaches $0.9500 it is considered depegged and transfers are stopped.
However, further protocol protection enhancements and guardrails are required to mitigate the risk of pool imbalances within Stargate Protocol arising from depeg scenarios. More specifically, under the current system, in the event of a slight stablecoin depeg (e.g., a depeg of greater than 10 basis points), Stargate Protocol can be arbitraged in a manner that creates greater pool imbalances, which in turn requires greater rebalancing effort (as demonstrated in SIP#19) (https://snapshot.org/#/stgdao.eth/proposal/0xa040cd10e6b648014373e84569218937f986ca1ab11210ceb39e65c88cd005a3).
Solution
Stargate should implement a new depeg protection module. This module will rely on the Chainlink Oracle on BNB Chain to provide a verified price for every coin within Stargate that is connected to a different asset. There would be three unique states within this module:
When the module is in the Normal State the protocol functions normally. When the module is in a Drift state, the protocol adds the amount of depeg in basis points to the cost of the transfer. For example, if USDT is depegged by 12 basis points (It is at $0.988), an additional 12 basis point fee would be added to transfer USDT to any cross chain (different) asset that originates from the depegged token. Fees charged from this state would be sent directly to protocol owned liquidity to benefit Stargate. This would take away the ability for cross chain arbitrage to impact the protocol and allow the protocol to function in a more balanced way. When the module is in the depeg state, it will block all outbound messages from swaps where the depegged asset is trying to make a cross asset swap. As a result when it’s within this state, there is no ability for arbitrage to impact Stargate.
When the protocol is in the Drift State or Depeg State, transfers to a depegged asset will function normally at a 1:1 ratio to enable users that want to bridge the other way to do so.
Additionally, it is proposed that cross asset swap fees be increased to 10 basis points total from 6 basis points total. This creates a barrier for toxic arbitrage and results in more protocol owned liquidity accruing to the Stargate Protocol.
Success
By implementing this depeg module, Stargate protects Stargate LPs more thoroughly and creates a healthier protocol. Stargate also removes the ability for toxic arbitrage to imbalance the protocol making the liquidity within the protocol more usable. This will result in better flow of assets, more transaction volume and more protocol fees, helping build protocol owned liquidity and a healthier Stargate.
Execution
To execute on this, contracts would need to be created to monitor Chainlink price feeds on BNB Chain and send a LayerZero messages under different conditions to update the FeeLibrary on all chains supported in order to charge more on swaps from depegged assets. All fees collected during the Drift State will be sent directly to protocol owned liquidity for the benefit of the Stargate Protocol.
If the depeg is less than 10 basis points, no message will be sent or a message will be sent to return the protocol to the normal state.
If the depeg is between 10 and 150 basis points, a message will be sent every 1 basis point, with the option of changing the threshold from 1-5 basis points, to update the fees that should be added to swaps from the depegged asset to other assets to protect the protocol. The range in basis points allows the protocol to adjust the depeg threshold if a lower basis point amount is too costly to a point where the cost of messaging outweighs the benefit the protocol will receive.
If the depeg is greater than 150 basis points, all messaging should be block from the depegged asset to other assets.
These messages will be incentivized by a publicly callable function in Gelato so anyone can help keep Stargate healthy.
Finally, the FeeLibrary on all chains will be updated to price cross-chain cross-asset swaps at 10 basis points total to discourage toxic arbitrage.
Success
If successful Stargate will be better protected against any asset within it depegging from other assets. Stargate will have a method to protect LPs in the event of a severe depeg as well as encourage balance within the protocol during all market conditions.