diff --git a/packages/contract-helpers/src/v3-UiPoolDataProvider-contract/index.ts b/packages/contract-helpers/src/v3-UiPoolDataProvider-contract/index.ts index c1777d3e..3f87369e 100644 --- a/packages/contract-helpers/src/v3-UiPoolDataProvider-contract/index.ts +++ b/packages/contract-helpers/src/v3-UiPoolDataProvider-contract/index.ts @@ -262,12 +262,12 @@ export class UiPoolDataProvider implements UiPoolDataProviderInterface { collateralBitmap: eMode.eMode.collateralBitmap .toBigInt() .toString(2) - .padEnd(256, '0'), + .padStart(256, '0'), label: eMode.eMode.label, borrowableBitmap: eMode.eMode.borrowableBitmap .toBigInt() .toString(2) - .padEnd(256, '0'), + .padStart(256, '0'), }, })); } diff --git a/packages/math-utils/src/formatters/emode/index.ts b/packages/math-utils/src/formatters/emode/index.ts index 62efb537..06addbd9 100644 --- a/packages/math-utils/src/formatters/emode/index.ts +++ b/packages/math-utils/src/formatters/emode/index.ts @@ -57,8 +57,11 @@ export function getReservesEModes( eModes: EModeData[], ): ReserveEMode[] { return eModes.reduce((acc, eMode) => { - const borrowingEnabled = eMode.eMode.borrowableBitmap[reserveId] === '1'; - const collateralEnabled = eMode.eMode.collateralBitmap[reserveId] === '1'; + const { borrowableBitmap, collateralBitmap } = eMode.eMode; + const borrowingEnabled = + borrowableBitmap[borrowableBitmap.length - reserveId - 1] === '1'; + const collateralEnabled = + collateralBitmap[collateralBitmap.length - reserveId - 1] === '1'; if (borrowingEnabled || collateralEnabled) { acc.push({ id: eMode.id,