Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
arcticfloyd1984 committed Dec 12, 2024
1 parent a0143d4 commit 40368ec
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions packages/services/src/quote/Quote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,16 +119,15 @@ export class Quote {
* destinationOutputAmount = amount * (originCurrencyUsdPrice / destinationCurrencyUsdPrice)
*/

let destinationOutputAmount = Math.ceil(
let destinationOutputAmount =
(Number(this.amount) * Number(originCurrencyUsdPrice)) /
(Number(destinationCurrencyUsdPrice) * Math.pow(10, 18)),
);
(Number(destinationCurrencyUsdPrice) * Math.pow(10, 18));

if (this.destinationCurrencyAddress === zeroAddress) {
transactionObject = {
account,
to: this.recipientAddress as `0x${string}`,
value: BigInt(destinationOutputAmount),
value: BigInt(Math.ceil(destinationOutputAmount)),
};
} else {
// create ERC 20 transfer function call data
Expand All @@ -137,7 +136,7 @@ export class Quote {
functionName: "transfer",
args: [
this.recipientAddress as `0x${string}`,
BigInt(destinationOutputAmount),
BigInt(Math.ceil(destinationOutputAmount)),
],
});

Expand Down

0 comments on commit 40368ec

Please sign in to comment.