2022-11-29 16:45:00 +00:00
|
|
|
import Card from 'components/Card'
|
2022-12-06 09:20:22 +00:00
|
|
|
import FormattedNumber from 'components/FormattedNumber'
|
2022-11-29 16:45:00 +00:00
|
|
|
import Text from 'components/Text'
|
2022-09-02 11:51:00 +00:00
|
|
|
|
2022-09-08 06:23:02 +00:00
|
|
|
const mockedAccounts = [
|
|
|
|
{
|
|
|
|
id: 1,
|
2022-09-29 19:21:31 +00:00
|
|
|
label: 'Subaccount 1',
|
2022-09-08 06:23:02 +00:00
|
|
|
networth: 100000,
|
|
|
|
totalPositionValue: 150000,
|
|
|
|
debt: 50000,
|
|
|
|
profit: 25000,
|
|
|
|
leverage: 3,
|
|
|
|
maxLeverage: 5,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: 2,
|
2022-09-29 19:21:31 +00:00
|
|
|
label: 'Subaccount 2',
|
2022-09-08 06:34:05 +00:00
|
|
|
networth: 33000,
|
|
|
|
totalPositionValue: 11000,
|
|
|
|
debt: 20000,
|
|
|
|
profit: -11366,
|
|
|
|
leverage: 2,
|
|
|
|
maxLeverage: 10,
|
2022-09-08 06:23:02 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
id: 3,
|
2022-09-29 19:21:31 +00:00
|
|
|
label: 'Subaccount 3',
|
2022-09-08 06:34:05 +00:00
|
|
|
networth: 0,
|
|
|
|
totalPositionValue: 12938129,
|
|
|
|
debt: 9999999999,
|
|
|
|
profit: -99999999,
|
2022-09-08 06:23:02 +00:00
|
|
|
leverage: 3,
|
|
|
|
maxLeverage: 5,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
id: 4,
|
2022-09-29 19:21:31 +00:00
|
|
|
label: 'Subaccount 4',
|
2022-09-08 06:34:05 +00:00
|
|
|
networth: 33653.22,
|
|
|
|
totalPositionValue: 100000,
|
|
|
|
debt: 50001.9,
|
2022-09-08 06:23:02 +00:00
|
|
|
profit: 25000,
|
|
|
|
leverage: 3,
|
|
|
|
maxLeverage: 5,
|
|
|
|
},
|
2022-09-29 19:21:31 +00:00
|
|
|
]
|
2022-09-08 06:23:02 +00:00
|
|
|
|
2022-09-02 11:51:00 +00:00
|
|
|
const Portfolio = () => {
|
2022-09-02 14:55:49 +00:00
|
|
|
return (
|
2022-12-06 09:20:22 +00:00
|
|
|
<div className='flex w-full items-start gap-4'>
|
2022-11-29 16:45:00 +00:00
|
|
|
<Card className='flex-1'>
|
2022-12-06 09:20:22 +00:00
|
|
|
<Text size='lg' uppercase={true}>
|
2022-11-29 16:45:00 +00:00
|
|
|
Portfolio Module
|
2022-12-06 09:20:22 +00:00
|
|
|
</Text>
|
2022-11-29 16:45:00 +00:00
|
|
|
</Card>
|
2022-11-09 09:04:06 +00:00
|
|
|
<div className='grid grid-cols-2 gap-4'>
|
2022-09-08 06:23:02 +00:00
|
|
|
{mockedAccounts.map((account) => (
|
2022-11-29 16:45:00 +00:00
|
|
|
<Card key={account.id}>
|
|
|
|
<Text size='lg' uppercase={true} className='mb-4 text-center'>
|
|
|
|
{account.label}
|
|
|
|
</Text>
|
2022-11-09 09:04:06 +00:00
|
|
|
<div className='grid grid-cols-3 gap-4'>
|
2022-09-08 06:34:05 +00:00
|
|
|
<div>
|
2022-11-29 16:45:00 +00:00
|
|
|
<Text>
|
2022-12-06 09:20:22 +00:00
|
|
|
<FormattedNumber amount={account.networth} animate prefix='$' />
|
2022-11-29 16:45:00 +00:00
|
|
|
</Text>
|
|
|
|
<Text size='sm' className='text-white/40'>
|
|
|
|
Net worth
|
|
|
|
</Text>
|
2022-09-08 06:34:05 +00:00
|
|
|
</div>
|
|
|
|
<div>
|
2022-11-29 16:45:00 +00:00
|
|
|
<Text>
|
2022-12-06 09:20:22 +00:00
|
|
|
<FormattedNumber amount={account.totalPositionValue} animate prefix='$' />
|
2022-11-29 16:45:00 +00:00
|
|
|
</Text>
|
|
|
|
<Text size='sm' className='text-white/40'>
|
|
|
|
Total Position Value
|
|
|
|
</Text>
|
2022-09-08 06:34:05 +00:00
|
|
|
</div>
|
|
|
|
<div>
|
2022-11-29 16:45:00 +00:00
|
|
|
<Text>
|
2022-12-06 09:20:22 +00:00
|
|
|
<FormattedNumber amount={account.debt} animate prefix='$' />
|
2022-11-29 16:45:00 +00:00
|
|
|
</Text>
|
|
|
|
<Text size='sm' className='text-white/40'>
|
|
|
|
Debt
|
|
|
|
</Text>
|
2022-09-08 06:34:05 +00:00
|
|
|
</div>
|
|
|
|
<div>
|
2022-11-29 16:45:00 +00:00
|
|
|
<Text className={account.profit > 0 ? 'text-green-400' : 'text-red-500'}>
|
2022-12-06 09:20:22 +00:00
|
|
|
<FormattedNumber
|
2022-11-29 16:45:00 +00:00
|
|
|
amount={account.debt}
|
2022-12-06 09:20:22 +00:00
|
|
|
animate
|
2022-11-29 16:45:00 +00:00
|
|
|
prefix={account.profit > 0 ? '+$' : '$'}
|
|
|
|
/>
|
|
|
|
</Text>
|
|
|
|
<Text size='sm' className='text-white/40'>
|
|
|
|
P&L
|
|
|
|
</Text>
|
2022-09-08 06:34:05 +00:00
|
|
|
</div>
|
|
|
|
<div>
|
2022-11-29 16:45:00 +00:00
|
|
|
<Text>
|
2022-12-06 09:20:22 +00:00
|
|
|
<FormattedNumber amount={account.leverage} minDecimals={0} suffix='x' />
|
2022-11-29 16:45:00 +00:00
|
|
|
</Text>
|
|
|
|
<Text size='sm' className='text-white/40'>
|
|
|
|
Current Leverage
|
|
|
|
</Text>
|
2022-09-08 06:34:05 +00:00
|
|
|
</div>
|
|
|
|
<div>
|
2022-11-29 16:45:00 +00:00
|
|
|
<Text>
|
2022-12-06 09:20:22 +00:00
|
|
|
<FormattedNumber amount={account.maxLeverage} minDecimals={0} suffix='x' />
|
2022-11-29 16:45:00 +00:00
|
|
|
</Text>
|
|
|
|
<Text size='sm' className='text-white/40'>
|
|
|
|
Max Leverage
|
|
|
|
</Text>
|
2022-09-08 06:34:05 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2022-11-29 16:45:00 +00:00
|
|
|
</Card>
|
2022-09-08 06:23:02 +00:00
|
|
|
))}
|
2022-09-02 14:55:49 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
2022-09-29 19:21:31 +00:00
|
|
|
)
|
|
|
|
}
|
2022-09-02 11:51:00 +00:00
|
|
|
|
2022-09-29 19:21:31 +00:00
|
|
|
export default Portfolio
|