forked from XRPLF/rippled
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
limitOut() in StrandFlow adjusts remainingOut for single path with AMM and limitQuality so that generated AMM offer matches limitQuality. If there is LOB offer and this offer is not considered when calculating quality function then the following might happen. The quality function is calculated based on max AMM offer and remainingOut is reduced. When the strand is executed, AMM offer can't be generated to match LOB quality and LOB offer is used instead of AMM offer. Because remainingOut is reduced, possibly substantially, only a fraction of LOB offer is consumed. The same process may repeat for many iterations until either LOB offer is consumed or max iterations is reached. Two fixes address this issue. One is to factor in the trading fee into AMM spot quality. This enables to make a decision that AMM offer can't be genereated to match LOB offer quality. This is done when LOB quality is compared to AMM spot quality. Another fix, which is included in 2.2.0, is to consider LOB offer quality into the quality function calculation. Added unit-test verifies that the fixes resolve the issue.
- Loading branch information
1 parent
f2d37da
commit 12f0273
Showing
4 changed files
with
131 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters