Traders can choose to swap between 3 different assets at launch:
The swap process is as follows:
The price of each asset against USD is retrieved from external oracles
The current balance and target balance is calculated to determine if a discount or premium is to be applied (this incentivises arbitrageurs to rebalance the pools)
The trade volume is accounted for to determine slippage
The estimated amount of received tokens is projected for the trader
After a swap has been executed, it will be added to the list of pending settlements and there is a three-minute countdown before the position can be settled and the tokens are received.
During this settlement-pending period, the affected pools will be locked and new trades (that utilise similar pools) cannot be initiated.
The primary drawback of oracle price derivation involves front-running attacks conducted by malicious users:
Attacker sees an external price update (on a CEX or aggregator)
Attacker places a favorable trade and pays a higher gas fee to ensure it is processed before the price update (placing a buy order if the external price goes up)
Oracles update the price to reflect the changes
Attacker settles their position for a guaranteed profit
Losses are distributed among liquidity providers
To mitigate this, Centaur Swap uses an execution-settlement structure for trades. This means that prices are locked in when the trade is executed and any profit between the two events is removed from the settlement:
Trader swaps 2000 USDT to 1 ETH at 2000 USDT/ETH
Trader waits 3 mins for the settlement
At the time of settlement,
3.1 If the price of ETH increases to 2500 USDT/ETH, the trader will receive 0.8 ETH
3.2 If the price of ETH decreases to 1500 USDT/ETH, the trader will still receive 1 ETH
The extra ETH is kept in the liquidity pool and distributed to liquidity providers proportionately. As this is a fringe use case, we do not expect the amount to be of major significance.
Due to the calculations required for the curves and the technologies employed (details in the technical section of this document), the gas consumed is higher than simplified automated market makers. We are actively following the developments related to scalability on Ethereum and we have plans to deploy Centaur Swap on other protocols. There is also a trading competition to support the first month of the launch and to reward users who provide tangible data for future versions.