Skip to content

Commit

Permalink
add fix for pricing
Browse files Browse the repository at this point in the history
  • Loading branch information
aburkut committed Dec 17, 2024
1 parent f3ef370 commit 09316bd
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/dex/usual/usual.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,12 @@ export class Usual extends SimpleExchange implements IDex<UsualBondData> {
return null;
}

const unitOut = BI_POWS[18]; // 1:1 swap
const amountsOut = amounts; // 1:1 swap, so output amounts are the same as input
const unitOut = BI_POWS[this.config.toToken.decimals]; // 1:1 swap
const amountsOut = amounts.map(
amount =>
(amount * BI_POWS[this.config.toToken.decimals]) /
BI_POWS[this.config.fromToken.decimals],
); // 1:1 swap, so output amounts are the same as input

return [
{
Expand Down

0 comments on commit 09316bd

Please sign in to comment.