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

Marketplayer Sell Function is Incorrect #38

Open
0xdomrom opened this issue Oct 19, 2017 · 0 comments
Open

Marketplayer Sell Function is Incorrect #38

0xdomrom opened this issue Oct 19, 2017 · 0 comments

Comments

@0xdomrom
Copy link
Contributor

0xdomrom commented Oct 19, 2017

Currently the _sell_quoted function uses the lowest price to calculate the quantity to place a buy order for. This will lead to errors as multiple order prices can be filled, leading leftover of the quoted quantity.

eg.
Market = NOM_FIAT
quantity = 100
buying FIAT using 100 NOM
lowest ask is [email protected]
So the player attempts to buy 100/1.1 fiat ~ 90.9
order is partially filled: player get 50 fiat, left with 45 NOM, still has to buy 40.9 FIAT
next lowest ask is [email protected]
Player attempts to buy 40.9 FIAT, but only has 45 NOM, can only afford 30FIAT
order will fail.
player left with 50 FIAT, 45 NOM even though they wanted to use all NOM

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

Successfully merging a pull request may close this issue.

1 participant