Open henrio123 opened 2 years ago
Use coingecko API to get 1W change price:
https://www.coingecko.com/en/api/documentation
id: wrapped-bitcoin
vs_currency: usd
days: 7
interval: daily
id: weth
vs_currency: usd
days: 7
interval: daily
https://api.coingecko.com/api/v3/coins/wrapped-bitcoin/market_chart?vs_currency=usd&days=7&interval=daily https://api.coingecko.com/api/v3/coins/weth/market_chart?vs_currency=usd&days=7&interval=daily
The price delta between cellar and eth/btc 50/50 should be:
cellar_interval_gain_pct - ((eth_interval_gain_pct + btc_interval_gain_pct) / 2)
function getGainPct(priceNow, priceBefore) {
return (priceNow - priceBefore) / priceBefore
}
Link to Figma: https://www.figma.com/file/7IAQbLyzapnrow9sIcO77P/App?node-id=2195%3A101337
"Token price" 1 M change vs "ETH/BTC 50/50" 1 M change (%)
Strategy performance chart block- "Token price" atm "Token price" 1 W change (%) "Token price" 1 M change (%) "Token price" 1 Y change (%) "Token price" All change (%)
For chart lines, should we sum them cumulative in front-end side? "Token price" daily change historically until today (%) "ETH/BTC 50/50" daily change historically until today (%) "BTC" daily change historically until today (%) "ETH" daily change historically until today (%)