Skip to content

Commit 3b884dd

Browse files
committed
Exclude treasury account balance from transferable tokens
1 parent 67b966c commit 3b884dd

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/api/controllers/token.controller.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ const { executeApiCall } = require("../services/rpc.service");
33
const {
44
ACCOUNTS_TO_SUBTRACT_AMPLITUDE,
55
ACCOUNTS_TO_SUBTRACT_PENDULUM,
6+
TREASURY_ACCOUNT,
67
} = require("../utils/constants");
78
const { Keyring } = require("@polkadot/api");
89

@@ -61,7 +62,15 @@ async function fetchTokenStats(network) {
6162
getAddressForFormat(accountToSubtract, 0) ===
6263
getAddressForFormat(account, 0)
6364
) {
64-
supplyToIgnore += free - frozen;
65+
if (
66+
getAddressForFormat(accountToSubtract, 0) ===
67+
getAddressForFormat(TREASURY_ACCOUNT, 0)
68+
) {
69+
// Exclude treasury balance from transferable tokens
70+
totalTransferable -= free;
71+
} else {
72+
supplyToIgnore += free - frozen;
73+
}
6574
}
6675
}
6776

src/api/utils/constants.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,13 @@ const ACCOUNTS_TO_SUBTRACT_PENDULUM = [
1313
"6dZRnXfN7nnrAUDWykWc7gpHpByVBj9HTRpFNNQyENh11xjq",
1414
]
1515

16+
const TREASURY_ACCOUNT = "13UVJyLnbVp9RBZYFwFGyDvVd1y27Tt8tkntv6Q7JVPhFsTB"
17+
1618
const ACCOUNTS_TO_SUBTRACT_AMPLITUDE = [
1719
]
1820

1921
module.exports = {
2022
ACCOUNTS_TO_SUBTRACT_PENDULUM,
2123
ACCOUNTS_TO_SUBTRACT_AMPLITUDE,
24+
TREASURY_ACCOUNT,
2225
}

0 commit comments

Comments
 (0)