From d76c2a7768b8ac57cc936fbbc204a1f417bb937a Mon Sep 17 00:00:00 2001 From: arihantbansal <17180950+arihantbansal@users.noreply.github.com> Date: Sun, 14 Jul 2024 00:07:50 +0530 Subject: [PATCH] subscribe to drift client --- src/routes/index.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/routes/index.ts b/src/routes/index.ts index a1e2edb..3b25dca 100644 --- a/src/routes/index.ts +++ b/src/routes/index.ts @@ -20,7 +20,6 @@ import { BulkAccountLoader, calculateDepositRate, convertToNumber, - PERCENTAGE_PRECISION, } from '@drift-labs/sdk'; import { clamp, @@ -114,15 +113,14 @@ router.get('/blinks/deposit', async (req: Request, res: Response) => { accountLoader: bulkAccountLoader, }, }); + await driftClient.subscribe(); let title = `Deposit ${depositToken} into Drift`; const spotMarket = driftClient.getSpotMarketAccount(spotMarketConfig.marketIndex); if (spotMarket) { - const apr = convertToNumber(calculateDepositRate(spotMarket), new BN(PERCENTAGE_PRECISION)); - - console.log('APR:', apr); + const apr = convertToNumber(calculateDepositRate(spotMarket), new BN(10000)); if (apr >= 0.1) { title = `Deposit ${depositToken} into Drift and earn ${apr}% APR`;