Open Mars12-dev opened 1 year ago
It doesn't make sense to me: we are doing mint/redeemSingle and I think it's better in our use case. we have a mint fee of 0 and the 2*swap fee > redeem fee. plus, using two swaps actually moves some eth around. if we use redeem single, we aren't moving any unrelated funds (i.e. eth).
aren't moving unrelated funds is a good point, again, less influence of external arbitrage.
traders should pay the swap fee. The objectif is not to reduce fee and propose for traders a swap alternative with less fee. Moreover, the mint fee cannot be set to zero. Indeed, in this case a trader can mint tapETH for free and do a single side redeem to recieve a token different of his deposit token, so he do a swap with a fee less than the swap fee.
Summary
The contract "StableAssetApplication" proposes a swap of token "x" to token "y cross pools by depositing token "x in pool "In" and withdrawing token "y" from pool "Out" using "tapETH".
The idea is to replace this process by swapping token "x" to ETH from the pool "In" and swapping ETH to token "y" from the pool "Out".
Motivation
Action plan
1) Change the function "swapCrossPool" in the contract "StableAssetApplication" to use the swap function instea of "mint" and "redeem" functions. 2) Update unit tests for this function.
Detailed design
1) Swap token "x" to "WETH" from the pool "In". 2) Swap "WETH" to token "y" from the pool "Out".
Implementation Timeline
2 days