Skip to content
This repository was archived by the owner on Oct 9, 2025. It is now read-only.

Marketplayer Sell Function is Incorrect #38

@0xdomrom

Description

@0xdomrom

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions