Skip to content

Commit

Permalink
fix: double swap scenario using wrong swap fee
Browse files Browse the repository at this point in the history
  • Loading branch information
snobbee committed Dec 23, 2023
1 parent 01542f9 commit 6d81a2b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "app",
"version": "2.14.30",
"version": "2.14.31",
"private": true,
"scripts": {
"bump": "bump patch --tag --commit 'testnet release '",
Expand Down
6 changes: 3 additions & 3 deletions core/src/entities/Pool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -363,13 +363,13 @@ export class CompositePool implements IPool {
? [this.pool1, this.pool2]
: [this.pool2, this.pool1];
const firstSwapFee = first.calcProviderFee(x);
const firstSwapOutput = first.calcSwapResult(x);
const secondSwapFee = second.calcProviderFee(firstSwapOutput);
// const firstSwapOutput = first.calcSwapResult(x);
// const secondSwapFee = second.calcProviderFee(firstSwapOutput);
const firstSwapFeeInOutputAsset = second.calcSwapResult(firstSwapFee);

return AssetAmount(
second.otherAsset(firstSwapFee),
firstSwapFeeInOutputAsset.add(secondSwapFee),
firstSwapFeeInOutputAsset.add(firstSwapFeeInOutputAsset),
);
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sifchain-ui",
"version": "2.14.14",
"version": "2.14.31",
"private": true,
"license": "UNLICENSED",
"packageManager": "[email protected]",
Expand Down

0 comments on commit 6d81a2b

Please sign in to comment.