fix(accounts): dont add vesting account balances to used total (#5182)

This commit is contained in:
Matthew Russell 2023-11-02 16:56:56 -07:00 committed by GitHub
parent 06cfd79415
commit b0169a0d39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -105,6 +105,8 @@ export interface AccountFields extends Account {
breakdown?: AccountFields[];
}
// The total balance of these accounts will be used for the 'used' column in the
// collateral table
const USE_ACCOUNT_TYPES = [
AccountType.ACCOUNT_TYPE_MARGIN,
AccountType.ACCOUNT_TYPE_BOND,
@ -112,8 +114,6 @@ const USE_ACCOUNT_TYPES = [
AccountType.ACCOUNT_TYPE_FEES_LIQUIDITY,
AccountType.ACCOUNT_TYPE_FEES_MAKER,
AccountType.ACCOUNT_TYPE_PENDING_TRANSFERS,
AccountType.ACCOUNT_TYPE_VESTED_REWARDS,
AccountType.ACCOUNT_TYPE_VESTING_REWARDS,
];
const getAssetIds = (data: Account[]) =>
@ -152,9 +152,6 @@ const getAssetAccountAggregation = (
};
const breakdown = accounts
.filter((a) =>
[...USE_ACCOUNT_TYPES, AccountType.ACCOUNT_TYPE_GENERAL].includes(a.type)
)
.map((a) => ({
...a,
asset: accounts[0].asset,