Skip to content

Commit

Permalink
amm.ts: fix additional bug in calculateSpreadBN (negative nums)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xbigz committed Dec 5, 2022
1 parent 22830cc commit edf27af
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Fixes
- ts-sdk: fix bugs in calculateSpreadBN
- ts-sdk: fix additional bug in calculateSpreadBN (negative nums)

### Breaking
2 changes: 1 addition & 1 deletion sdk/src/math/amm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ export function calculateSpreadBN(
maxTargetSpread / 10,
Math.floor(
(baseSpread * netRevenueSinceLastFunding.abs().toNumber()) /
DEFAULT_REVENUE_SINCE_LAST_FUNDING_SPREAD_RETREAT.toNumber()
DEFAULT_REVENUE_SINCE_LAST_FUNDING_SPREAD_RETREAT.abs().toNumber()
)
);
const halfRevenueRetreatAmount = Math.floor(revenueRetreatAmount / 2);
Expand Down

0 comments on commit edf27af

Please sign in to comment.