From ec0d27887fd89e6b666659b5bec42f0fc2167b98 Mon Sep 17 00:00:00 2001 From: fedorovdg Date: Wed, 11 Dec 2024 12:29:47 +0400 Subject: [PATCH 1/2] feat: add depositBonus for lite --- src/pools/PoolTemplate.ts | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/src/pools/PoolTemplate.ts b/src/pools/PoolTemplate.ts index cf523035..1e3ab5c4 100644 --- a/src/pools/PoolTemplate.ts +++ b/src/pools/PoolTemplate.ts @@ -374,16 +374,31 @@ export class PoolTemplate extends CorePool { public async depositBonus(amounts: (number | string)[]): Promise { const amountsBN = amounts.map(BN); let pricesBN: BigNumber[] = []; - + const multicallContract = curve.contracts[this.address].multicallContract; if(this.isCrypto || this.id === 'wsteth') { - pricesBN = (await this._underlyingPrices()).map(BN); + if(curve.isLiteChain) { + const prices = this.id.includes('twocrypto') + ? [ + 1, + Number(await curve.contracts[this.address].contract.price_oracle()) / (10 ** 18), + ] + : [ + 1, + ...(await curve.multicallProvider.all([ + multicallContract.price_oracle(0), + multicallContract.price_oracle(1), + ])).map((value) => Number(value) / (10 ** 18)), + ] + pricesBN = prices.map(BN); + } else { + pricesBN = (await this._underlyingPrices()).map(BN); + } } else { pricesBN = await this._storedRatesBN(true); } const balancesBN = (await this.stats.underlyingBalances()).map(BN); const balancedAmounts = this._balancedAmountsWithSameValue(amountsBN, pricesBN, balancesBN); - const expectedBN = BN(await this.depositExpected(amounts)); const balancedExpectedBN = BN(await this.depositExpected(balancedAmounts)); From 001b993539ec23b125f410e46690a8d31be37c39 Mon Sep 17 00:00:00 2001 From: fedorovdg Date: Wed, 11 Dec 2024 12:46:42 +0400 Subject: [PATCH 2/2] build: v2.65.20 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 958dc6cd..6e58b46d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@curvefi/api", - "version": "2.65.19", + "version": "2.65.20", "description": "JavaScript library for curve.fi", "main": "lib/index.js", "author": "Macket",