Skip to content

Commit

Permalink
Properly set maximum slippage in case of LP overflows (#5000)
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaptic committed Aug 21, 2023
1 parent affcc13 commit cdc7114
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
11 changes: 9 additions & 2 deletions services/horizon/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,15 @@ file. This project adheres to [Semantic Versioning](http://semver.org/).

## Unreleased

- The command line flag --remote-captive-core-url has been removed as remote captive core functionality is now deprecated ([4940](https://github.com/stellar/go/pull/4940)).
- Added new command-line flag --network to specify the Stellar network (pubnet or testnet), aiming at simplifying the configuration process by automatically configuring the following parameters based on the chosen network: --history-archive-urls, --network-passphrase, --captive-core-config-path. ([4949](https://github.com/stellar/go/pull/4949)).
### Breaking Changes
- The command line flag `--remote-captive-core-url` has been removed, as remote captive core functionality is now deprecated ([4940](https://github.com/stellar/go/pull/4940)).

### Added
- Added new command-line flag `--network` to specify the Stellar network (pubnet or testnet), aiming at simplifying the configuration process by automatically configuring the following parameters based on the chosen network: `--history-archive-urls`, `--network-passphrase`, and `--captive-core-config-path` ([4949](https://github.com/stellar/go/pull/4949)).

### Fixed
- The same slippage calculation from the [`v2.26.1`](#2261) hotfix now properly excludes spikes for smoother trade aggregation plots ([4999](https://github.com/stellar/go/pull/4999)).


## 2.26.1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,8 @@ func (p *TradeProcessor) roundingSlippage(
)
if !ok {
// Temporary workaround for https://github.com/stellar/go/issues/4203
// Give strict receives that would underflow here, maximum slippage so
// they get excluded.
// Given strict receives that would underflow here, set maximum
// slippage so they get excluded.
roundingSlippageBips = xdr.Int64(math.MaxInt64)
}
return null.IntFrom(int64(roundingSlippageBips)), nil
Expand All @@ -267,9 +267,9 @@ func (p *TradeProcessor) roundingSlippage(
)
if !ok {
// Temporary workaround for https://github.com/stellar/go/issues/4203
// Given strict receives that would overflow here, minimum slippage
// Given strict sends that would overflow here, set maximum slippage
// so they get excluded.
roundingSlippageBips = xdr.Int64(math.MinInt64)
roundingSlippageBips = xdr.Int64(math.MaxInt64)
}
return null.IntFrom(int64(roundingSlippageBips)), nil
default:
Expand Down

0 comments on commit cdc7114

Please sign in to comment.