so https://dashboard.cptoken.app/ it is my website in this website u can see value under cpt balance
so defnition of value is cpt balance of user multiply with current cpt price in usd…
soo when i m doing multiplication of t*usdprice , then it is taking all three usd prices of cardano ,bnb,cpt
and i m trying to change the let usdprice for bnb and cardano how i change that constant ?
u can see that every function have let usdprice .
// cpt price
async function getPrice() {
price= await Moralis.Web3API.token.getTokenPrice({address: "0x28e4f32fa7e842ad0a6e530bb6b4ec03b36d5078", chain: "bsc"})
console.log(price);
let ethPrice = (price.nativePrice.value / (8**price.nativePrice.decimals)) + "BNB"
console.log(ethPrice)
let usdPrice = price.usdPrice + " USD"
console.log(usdPrice)
document.getElementById("BNB_price").innerHTML = ethPrice;
document.getElementById("usd_price").innerHTML = usdPrice;
}
getPrice();
// bnb price
async function takePrice() {
price= await Moralis.Web3API.token.getTokenPrice({address: "0x3ee2200efb3400fabb9aacf31297cbdd1d435d47", chain: "bsc"})
console.log(price);
let usdPrice = price.usdPrice
console.log(usdPrice)
document.getElementById("usd1").innerHTML = usdPrice;
}
takePrice();
// cardano price
async function givePrice() {
price= await Moralis.Web3API.token.getTokenPrice({address: "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c", chain: "bsc"})
console.log(price);
let usdPrice = price.usdPrice
console.log(usdPrice)
document.getElementById("usd2").innerHTML = usdPrice;
}
givePrice();