--- import DefaultLayout from '@shared/layouts/DefaultLayout.astro'; import Avatar from '@shared/components/ui/Avatar.astro'; import Trending from '@shared/components/ui/Trending.astro'; import CardDropdown from '@shared/components/ui/CardDropdown.astro'; import NavSegmented from '@shared/components/ui/NavSegmented.astro'; import Chart from '@shared/components/Chart.astro'; import SwitchIcon from '@shared/components/ui/SwitchIcon.astro'; import cryptoCurrencies from '@data/crypto-currencies.json'; import cryptoMarkets from '@data/crypto-markets.json'; import cryptoOrders from '@data/crypto-orders.json'; interface Currency { symbol: string; price: string; p24h: number; 'volume-24h': string; } const currencies = cryptoCurrencies as Currency[]; const find = (symbol: string) => currencies.find((c) => c.symbol === symbol)!; const btc = find('BTC'); const ltc = find('LTC'); const eth = find('ETH'); const xmr = find('XMR'); const btcBalance = 2.3; const num = (s: string) => parseFloat(s.replace(/[$,]/g, '')); const btcPriceNum = num(btc.price); const totalUsd = Math.round(btcPriceNum * btcBalance).toLocaleString('en-US'); // Liquid `divided_by` then `round: 8` (trailing zeros dropped by number output) const r8 = (x: number) => parseFloat(x.toFixed(8)); const ltcBtc = r8(num(ltc.price) / btcPriceNum); const ethBtc = r8(num(eth.price) / btcPriceNum); const xmrBtc = r8(num(xmr.price) / btcPriceNum); const markets = (cryptoMarkets as { coin: string; price: string; volume: string; change: string }[]).slice(0, 10); const orders = cryptoOrders as { sell_orders: { price: string; btc: string; sum: string }[]; buy_orders: { price: string; btc: string; sum: string }[] }; const operationCurrencies = currencies.slice(0, 20); ---
Total balance
${totalUsd} {btcBalance} {btc.symbol}
Since last week
USD/BTC
{btc.price} {btc.price}
Volume: {btc['volume-24h']}
LTC/BTC
{ltcBtc} {ltc.price}
Volume: {ltc['volume-24h'].replace('$', '')}
ETH/BTC
{ethBtc} {eth.price}
Volume: {eth['volume-24h'].replace('$', '')}
XMR/BTC
{xmrBtc} {xmr.price}
Volume: {xmr['volume-24h'].replace('$', '')}
Markets
{ markets.map((market) => ( )) }
Coin Price Volume Change
{market.coin} {market.price} {market.volume}
LTC/BTC
Operations

Place new order:

The final amount could change depending on current market conditions.

Sell Orders
{ orders.sell_orders.map((order) => ( )) }
Price BTC Sum(BTC)
{order.price} {order.btc} {order.sum}
Buy Orders
{ orders.buy_orders.map((order) => ( )) }
Price BTC Sum(BTC)
{order.price} {order.btc} {order.sum}