@triadxyz/triad-protocol 2.8.4-beta → 2.8.6-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -899,13 +899,13 @@ class TriadProtocolClient {
|
|
|
899
899
|
}
|
|
900
900
|
if (isTrdPayout && totalUSDCNeeded.gt(new bn_js_1.default(0))) {
|
|
901
901
|
const price = yield (0, swap_1.getPrice)(constants_1.TRD_MINT.toString());
|
|
902
|
-
const amountInTRD = totalUSDCNeeded.toNumber() / Math.pow(10, this.decimals)
|
|
902
|
+
const amountInTRD = totalUSDCNeeded.toNumber() / (price * Math.pow(10, this.decimals));
|
|
903
903
|
const { swapIxs, addressLookupTableAccounts: swapAddressLookupTableAccounts, outAmount, setupInstructions } = yield (0, swap_1.swap)({
|
|
904
904
|
connection: this.program.provider.connection,
|
|
905
905
|
wallet: this.program.provider.publicKey.toBase58(),
|
|
906
906
|
inToken: constants_1.TRD_MINT.toString(),
|
|
907
907
|
outToken: constants_1.USDC_MINT.toString(),
|
|
908
|
-
amount: amountInTRD
|
|
908
|
+
amount: Math.floor(amountInTRD / Math.pow(10, this.decimals))
|
|
909
909
|
});
|
|
910
910
|
if (swapIxs.length === 0) {
|
|
911
911
|
return;
|