serum-dex icon indicating copy to clipboard operation
serum-dex copied to clipboard

Spillover when converting from USDC/USDT to another token

Open amerfarooq opened this issue 3 years ago • 0 comments

When I try to do a swap on Serum from USDC/USDT to some other token, I’ve noticed that there is some spillover. Here are some transactions that showcase this behavior:

3YS8Skg4sSX92Fc4PkXXdhfvskoATNoN1r5eLjgYX6245NJg1HwSVzUM6d4AD8LVa6W9fabJZ79vJWsLY8AZ67CE

Here, I could have received up to 0.17 SOL but only get 0.1 SOL and the rest is returned.

5oDj65D2UDuxq7d8fmGzuxN7fKheQ6taw3mxjXUzj8dPbc57PGS23vbTELmVxk9dfsg9gYzJ7eys6CLRYVqe29Ni

Similarly, here I could have received up to 0.35 SOL but only got 0.3 SOL.

What is the reason for this truncation in the output balance? By the way, this only happens if you exchange the USDC to SOL. If you convert SOL to USDC, you see no such spillover e.g.

4trewrpt1Ns6smDy7xVS1XEkBC9qqStA6pQabpGnazR93sVYtDvG9o379Ua2A8arh52xQSy7yhexRVxCZ6Q58ntn

amerfarooq avatar Nov 10 '22 04:11 amerfarooq