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

spot orders often filled a minSize too small #110

Open
cloorem2 opened this issue Jul 29, 2022 · 2 comments
Open

spot orders often filled a minSize too small #110

cloorem2 opened this issue Jul 29, 2022 · 2 comments

Comments

@cloorem2
Copy link

place a taker order to buy 10, immediately spotOpenOrdersAccounts[marketIndex] values are empty and my balance on the token is 9.9. i think it payed the taker fee but i can't see how to get an exact output, or how much i paid.

i'm guessing the taker fee is 0.001 so i should 10 * 1.001 = 10.01 and round up on orderSizeDecimals so 10.1 for this example, to get 10 out.

@cloorem2
Copy link
Author

wrong. placeSpotOrder 'size' is a maxOutput. i guess i should bump up maxQuoteQuantity in the client to guarantee my 10 output tokens.

@cloorem2
Copy link
Author

in client.ts
const maxQuoteQuantity = new BN( spotMarket['_decoded'].quoteLotSize.toNumber() * (1 + rates.taker), ).mul( spotMarket .baseSizeNumberToLots(size) .mul(spotMarket.priceNumberToLots(price)), );
is truncated.

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