Skip to content

Commit

Permalink
fix: correct the number of staked coin for getLending
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-donor committed Oct 10, 2023
1 parent 8cbb55f commit 466d603
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
".": {
"source": "./src/index.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.cjs",
"require": "./dist/index.js",
"default": "./dist/index.js"
}
},
Expand Down
2 changes: 1 addition & 1 deletion src/queries/portfolioQuery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export const getLending = async (
const accountStakedAmount = accountStakedMarketCoinAmount.multipliedBy(
marketPool?.conversionRate ?? 1
);
const accountStakedCoin = accountStakedMarketCoin.shiftedBy(
const accountStakedCoin = accountStakedAmount.shiftedBy(
-1 * spool.coinDecimal
);
const accountStakedValue = accountStakedCoin.multipliedBy(
Expand Down
1 change: 1 addition & 0 deletions test/query.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ describe('Test Query Scallop Contract On Chain Data', async () => {
networkType: NETWORK,
});
const scallopQuery = await scallopSDK.createScallopQuery();
console.info('Your wallet:', scallopQuery.suiKit.currentAddress());

it('Should query market data', async () => {
const market = await scallopQuery.queryMarket();
Expand Down

0 comments on commit 466d603

Please sign in to comment.