Skip to content

Commit

Permalink
Merge pull request #52 from pontem-network/LS-1909-customFee
Browse files Browse the repository at this point in the history
LS-1909 custom fee
  • Loading branch information
extg5 authored May 6, 2024
2 parents ac8936c + c03c5d1 commit 23e28e9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pontem/liquidswap-sdk",
"version": "0.7.0",
"version": "0.7.1",
"description": "SDK to use LiquidSwap functions",
"author": "Igor Demko <igor@pontem.network>",
"repository": "https://github.com/pontem-network/liquidswap-sdk",
Expand Down
7 changes: 6 additions & 1 deletion src/modules/SwapModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export type CalculateRatesParams = {
interactiveToken: 'from' | 'to';
curveType: CurveType;
version?: typeof VERSION_0 | typeof VERSION_0_5;
additionalFee?: number;
};

export type CreateTXPayloadParams = {
Expand Down Expand Up @@ -112,7 +113,11 @@ export class SwapModule implements IModule {
? d(liquidityPoolResource.data.coin_y_reserve.value)
: d(liquidityPoolResource.data.coin_x_reserve.value);

const fee = d(liquidityPoolResource.data.fee);
let fee = d(liquidityPoolResource.data.fee);

if (params.additionalFee) {
fee = fee.plus(params.additionalFee);
}

const coinFromDecimals = +sortedFromCoinInfo.data.decimals;
const coinToDecimals = +sortedToCoinInfo.data.decimals;
Expand Down

0 comments on commit 23e28e9

Please sign in to comment.