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

For exact swap there is always dust amount #1

Open
top1st opened this issue Apr 10, 2023 · 0 comments
Open

For exact swap there is always dust amount #1

top1st opened this issue Apr 10, 2023 · 0 comments

Comments

@top1st
Copy link

top1st commented Apr 10, 2023

@daoio @bghughes Can you please review this issue?

The fee logic makes always dust and it will keep make external gas out also users will not happy with not exact matching amounts.

Current fee logic made fees all from taker and make dust amount for exact matching request.

bytes32 makeId = market.make(token1, token2, 1 ether, 1 ether);
market.take(makeId, 1 ether);

Offer ID: 1
pay_amt 1000000000000000000
buy_amt 1000000000000000000
Will Spend 1000000000000000000
quantity 999900000000000000
buy amt 1000000000000000000
pay amt 1000000000000000000
Internal Spend 999900000000000000
Maker Token 1 0
Maker Token 2 999900000000000000
Taker Token 1 999900000000000000
Taker Token 2 10000000000
Offer ID: 1
pay_amt 100000000000000
buy_amt 100000000000000

Here is some logs I made and always dust as fee percent.

I think need to upgrade the RubiconMarket contract subtract the quantity and spend amount as user take, buy function amount then make zero the left amount. after that need to remove the offer from the map.

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

1 participant