Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RFC] Swap Cross Pools With ETH #39

Open
Mars12-dev opened this issue Nov 14, 2023 · 3 comments
Open

[RFC] Swap Cross Pools With ETH #39

Mars12-dev opened this issue Nov 14, 2023 · 3 comments
Assignees

Comments

@Mars12-dev
Copy link
Contributor

Mars12-dev commented Nov 14, 2023

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

  • The default cross swap should use the swap functions to generate swap fee.

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

@Mars12-dev Mars12-dev changed the title [RFC] SwapCrossPool [RFC] Swap Cross Pools With ETH Nov 15, 2023
@ukby1234
Copy link
Contributor

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).

@tangdaniu
Copy link

aren't moving unrelated funds is a good point, again, less influence of external arbitrage.

@Mars12-dev
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants