feat: add ontology evm data in wing.js;

This commit is contained in:
ErickYangs
2022-05-30 18:58:46 +08:00
parent 3fb73a63e3
commit 82e481a662

View File

@@ -17,6 +17,9 @@ function fetchChain(chainId) {
case 'bsc':
url = "https://ethapi.wing.finance/bsc/flash-pool/detail";
break;
case 'ontology_evm':
url = "https://ethapi.wing.finance/ontevm/flash-pool/detail";
break;
};
const response = await utils.fetchURL(url);
let tvl = response.data.result.totalSupply - response.data.result.totalBorrow;
@@ -46,6 +49,9 @@ function stake(chainId) {
case 'bsc':
url = "https://ethapi.wing.finance/bsc/flash-pool/detail";
break;
case 'ontology_evm':
url = "https://ethapi.wing.finance/ontevm/flash-pool/detail";
break;
};
const response = await utils.fetchURL(url);
let staked = response.data.result.totalLockedWingDollar;
@@ -73,6 +79,10 @@ module.exports = {
fetch: fetchChain('bsc'),
staking: stake('bsc')
},
ontology_evm:{
fetch: fetchChain('ontology_evm'),
staking: stake('ontology_evm')
},
fetch,
methodology: `Wing Finance TVL is achieved by subtracting total borrow from total supply on each chain. Staking is calculated by finding the dollar value of locked WING on each chain. The values are fetched from Wing Finance's own API.`
}