Skip to content

Commit

Permalink
fix bug: counting liquidities (#76)
Browse files Browse the repository at this point in the history
* fix bug: counting liquidities

* update spec

---------

Co-authored-by: Cyberaurora <[email protected]>
  • Loading branch information
kb1ns and kb1ns authored Jun 2, 2023
1 parent 76b2ec5 commit 942ee57
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# v0.9.30-mainnet.163

- fix bug of `Rewards` pallet: counting `ask`-`maker`-`vol` into the `taken_liquidity`

# v0.9.30-mainnet.162

- fix bug of `Token` pallet: when `from` and `to` are the same
Expand Down
11 changes: 6 additions & 5 deletions pallets/verifier/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1857,13 +1857,14 @@ pub mod pallet {
mq_delta = mq_delta
.checked_add(quote_incr)
.ok_or(Error::<T>::Overflow)?;
let filled_vol = Permill::one()
.checked_sub(&maker_fee)
.ok_or(Error::<T>::Overflow)?
.saturating_reciprocal_mul_ceil(quote_incr);
// let filled_vol = Permill::one()
// .checked_sub(&maker_fee)
// .ok_or(Error::<T>::Overflow)?
// .saturating_reciprocal_mul_ceil(quote_incr);
// FIXME this is actually wrong, we need to include the transaction fee
maker_mutation.push(MakerMutation {
who: maker_b_id,
filled_volume: filled_vol.into(),
filled_volume: quote_incr.into(),
base_balance: mb1.into(),
quote_balance: mq1.into(),
});
Expand Down
2 changes: 1 addition & 1 deletion runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion {
// `spec_version`, and `authoring_version` are the same between Wasm and native.
// This value is set to 100 to notify Polkadot-JS App (https://polkadot.js.org/apps) to use
// the compatible custom types.
spec_version: 162,
spec_version: 163,
impl_version: 1,
apis: RUNTIME_API_VERSIONS,
transaction_version: 3,
Expand Down

0 comments on commit 942ee57

Please sign in to comment.