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

Issue in usage of fill_cost when quantity is in decimal places. #26

Open
Gordon-TheTurtle opened this issue Jun 22, 2019 · 0 comments
Open

Comments

@Gordon-TheTurtle
Copy link

In cb_order_fill callback:

Cost fill_cost = cb.price * cb.quantity;
Both price and quantity have been multiplied their respective precisions to convert to int64_t:
i.e. price = 100.00 USD -> 10000, quantity 5.00 -> 500

so according to the formula fill_cost is 10000 * 500 -> 5000000 or 50000.00
which is wrong,

Correct fill_cost = 100.00 * 5.00 = 500.00

It would be better to not calculate fill_cost as there is no need for it in liquibook and save computation.

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