Skip to content
This repository has been archived by the owner on Jan 22, 2020. It is now read-only.

Computing path payment price is probably using wrong rounding #419

Open
vogel opened this issue Jan 9, 2018 · 0 comments
Open

Computing path payment price is probably using wrong rounding #419

vogel opened this issue Jan 9, 2018 · 0 comments

Comments

@vogel
Copy link

vogel commented Jan 9, 2018

Path payment computation on horizon uses rounding down:

it uses truncating division at the moment:
https://github.com/stellar/go/blob/master/services/horizon/internal/simplepath/order_book.go#L113

The pricing mechanism for a single path element can be found here:
https://github.com/stellar/go/blob/master/services/horizon/internal/simplepath/order_book.go#L24

And in stellar-core it uses rounding up: https://github.com/stellar/stellar-core/blob/master/src/transactions/OfferExchange.cpp#L91

Here are some tests in stellar-core:
https://github.com/stellar/stellar-core/blob/master/src/transactions/ExchangeTests.cpp

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

No branches or pull requests

1 participant