pontem-network / liquidswap

AMM core smart contracts
Other
167 stars 73 forks source link

Stable type swap error #123

Closed lulu0024 closed 1 year ago

lulu0024 commented 1 year ago

The swap network fee in stable type is as high as 0.3APT.But he swap network fee in uncorrelated type is only 0.004APT.Fix it please

borispovod commented 1 year ago

Hi @lulu0024 ,

We currently working on it, thanks

lulu0024 commented 1 year ago

Hi @lulu0024 ,

We currently working on it, thanks

This bug is still not fixed

borispovod commented 1 year ago

So, we updated liquidswap UI and we are using right now swap_unchecked function for stable pairs in UI. It's probably wouldn't give user the best price, only expected one, but this is how we do it right now, and as price movements there should not affect swap too much and price itself plus minus stable.

It currently eats ~100k gas. We can't optimize it more now (it uses our implementation of u256, which became much more expensive just before mainnet launch), only for future versions of liquidswap. There is also a chance that Aptos might update the gas table again, and it would become less expensive.