Skip to content

Commit

Permalink
Merge pull request #18 from oraichain/hotfix/calculate-take-profit
Browse files Browse the repository at this point in the history
Hotfix take profit calculate
  • Loading branch information
sonnx-oraichain authored Mar 4, 2024
2 parents 60cfb4f + 7ffe36a commit a9e86c7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/tp_sl_lq/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export class EngineHandler {
spread: string,
decimals: string
): bigint => {
if (decimals === "0") return 0n;
if (decimals === "0" || !amount) return 0n;
return (BigInt(amount) * BigInt(spread)) / BigInt(decimals);
};

Expand Down Expand Up @@ -388,7 +388,7 @@ export async function executeEngine(
const executePayFundingPromises = vammList
.map((item) => [engineHandler.payFunding(item)])
.flat();

const liquidateResults = await Promise.allSettled(executeLiquidatePromises);
const tpslResults = await Promise.allSettled(executeTPSLPromises);
const payFundingResults = await Promise.allSettled(executePayFundingPromises);
Expand Down

0 comments on commit a9e86c7

Please sign in to comment.