Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/chubby-states-change.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@venusprotocol/evm": patch
---

fix bug where incorrect collateral factor was being used when E-mode was activated
Original file line number Diff line number Diff line change
Expand Up @@ -1802,7 +1802,7 @@ exports[`useGetPools > returns pools with user data and E-mode group enabled in
"isIsolated": false,
"name": "Core Pool",
"userBorrowBalanceCents": "19999299932759.6580216",
"userBorrowLimitCents": "321988798902158.7477772",
"userBorrowLimitCents": "321988798486640.8408083",
"userEModeGroup": {
"assetSettings": [
{
Expand Down Expand Up @@ -2802,7 +2802,7 @@ exports[`useGetPools > returns pools with user data and isolated E-mode group en
"tokenPriceCents": "99.993",
"userBorrowBalanceCents": "9999300000000",
"userBorrowBalanceTokens": "100000000000",
"userBorrowLimitSharePercentage": 3.1,
"userBorrowLimitSharePercentage": 0,
"userCollateralFactor": 0,
"userLiquidationThresholdPercentage": 0,
"userSupplyBalanceCents": "199986000000000",
Expand Down Expand Up @@ -2888,7 +2888,7 @@ exports[`useGetPools > returns pools with user data and isolated E-mode group en
"tokenPriceCents": "99.999999",
"userBorrowBalanceCents": "9999999900000",
"userBorrowBalanceTokens": "100000000000",
"userBorrowLimitSharePercentage": 3.1,
"userBorrowLimitSharePercentage": 0,
"userCollateralFactor": 0,
"userLiquidationThresholdPercentage": 0,
"userSupplyBalanceCents": "199999998000000",
Expand Down Expand Up @@ -3042,7 +3042,7 @@ exports[`useGetPools > returns pools with user data and isolated E-mode group en
"isIsolated": false,
"name": "Core Pool",
"userBorrowBalanceCents": "19999299932759.6580216",
"userBorrowLimitCents": "321988798902158.7477772",
"userBorrowLimitCents": "0",
"userEModeGroup": {
"assetSettings": [
{
Expand Down
2 changes: 1 addition & 1 deletion apps/evm/src/utilities/calculateUserPoolValues/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const calculateUserPoolValues = ({

if (asset.isCollateralOfUser) {
userBorrowLimitCents = userBorrowLimitCents.plus(
asset.userSupplyBalanceCents.multipliedBy(asset.collateralFactor),
asset.userSupplyBalanceCents.multipliedBy(asset.userCollateralFactor),
);

userLiquidationThresholdCents = userLiquidationThresholdCents.plus(
Expand Down