Skip to content
Open
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
13 changes: 10 additions & 3 deletions projects/bifrost-dex/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,16 @@ function formatToken(token, type) {
return "vGLMR";
case `{"VToken2":"4"}`:
return "vFIL";
case `{"VToken2":"8"}`:
return "vMANTA";
case `{"Token2":"4"}`:
return "FIL";
case `{"VToken2":"3"}`:
return "vASTR";
case `{"Token2":"3"}`:
return "ASTR";
case `{"Token2":"8"}`:
return "MANTA";
case `{"VToken":"BNC"}`:
return "vBNC";
case `{"VToken":"MOVR"}`:
Expand Down Expand Up @@ -83,6 +87,8 @@ function formatTokenAmount(amount, tokenSymbol) {
case "vFIL":
case "ASTR":
case "vASTR":
case "MANTA":
case "vMANTA":
decimals = 18;
break;
}
Expand All @@ -100,7 +106,8 @@ const tokenToCoingecko = {
ZLK: "zenlink-network-token",
USDT: "tether",
FIL: "filecoin",
ASTR: "astar"
ASTR: "astar",
MANTA: "manta"
};

async function tvl() {
Expand Down Expand Up @@ -157,7 +164,7 @@ async function tvl() {
currentToken = isVtoken ? currentToken.slice(1) : currentToken;

if (isVtoken) {
const tokenPool = await polkadotApi.query.vtokenMinting.tokenPool({ "token2": poolTokens[0][0].toHuman()[1].VToken2 });
const tokenPool = await polkadotApi.query.vtokenMinting.tokenPool({ "vToken2": poolTokens[0][0].toHuman()[1].VToken2 });
const totalIssuance = await polkadotApi.query.tokens.totalIssuance({ "vToken2": poolTokens[0][0].toHuman()[1].VToken2 });
ratio = new BigNumber(tokenPool).div(totalIssuance).toNumber();
}
Expand Down Expand Up @@ -221,7 +228,7 @@ async function tvl() {
currentToken = isVstoken ? currentToken.slice(2) : currentToken;

if (isVtoken) {
const tokenPool = await polkadotApi.query.vtokenMinting.tokenPool({ "token2": token.VToken2 });
const tokenPool = await polkadotApi.query.vtokenMinting.tokenPool({ "vToken2": token.VToken2 });
const totalIssuance = await polkadotApi.query.tokens.totalIssuance({ "vToken2": token.VToken2 });
ratio = new BigNumber(tokenPool).div(totalIssuance).toNumber();
}
Expand Down
7 changes: 0 additions & 7 deletions projects/bifrost-staking/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,6 @@ module.exports = {
};
},
},
filecoin: {
tvl: async () => {
const { bifrost } = getExports("bifrost-staking", ["bifrost"]);
const { filecoin } = await bifrost.tvl();
return { filecoin };
},
},
astar: {
tvl: async () => {
const { bifrost } = getExports("bifrost-staking", ["bifrost"]);
Expand Down
Loading