Skip to content

Commit 11317eb

Browse files
authored
Merge pull request #1784 from bdmason/fix/modify-liquidity-position-delta
fix: only remove delta when modifying a position
2 parents d9a93a5 + f4dfa1e commit 11317eb

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

pallets/swap/src/pallet/impls.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -964,8 +964,8 @@ impl<T: Config> Pallet<T> {
964964
position.liquidity = position.liquidity.saturating_add(delta_liquidity_abs);
965965
} else {
966966
// Remove liquidity at tick
967-
Self::remove_liquidity_at_index(netuid, position.tick_low, position.liquidity, false);
968-
Self::remove_liquidity_at_index(netuid, position.tick_high, position.liquidity, true);
967+
Self::remove_liquidity_at_index(netuid, position.tick_low, delta_liquidity_abs, false);
968+
Self::remove_liquidity_at_index(netuid, position.tick_high, delta_liquidity_abs, true);
969969

970970
// Remove liquidity from user position
971971
position.liquidity = position.liquidity.saturating_sub(delta_liquidity_abs);

runtime/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
217217
// `spec_version`, and `authoring_version` are the same between Wasm and native.
218218
// This value is set to 100 to notify Polkadot-JS App (https://polkadot.js.org/apps) to use
219219
// the compatible custom types.
220-
spec_version: 280,
220+
spec_version: 281,
221221
impl_version: 1,
222222
apis: RUNTIME_API_VERSIONS,
223223
transaction_version: 1,

0 commit comments

Comments
 (0)