This commit is contained in:
Tyler Shipe 2021-06-07 13:01:41 -04:00
parent c44105e4cd
commit 3a57263452
2 changed files with 10 additions and 15 deletions

View File

@ -15,16 +15,11 @@ const calculatePNL = (tradeHistory, prices, mangoGroup) => {
if (!prices.length) return '-'
const assetIndex = {
'BTC/USDT': 0,
'BTC/WUSDT': 0,
'ETH/USDT': 1,
'ETH/WUSDT': 1,
'SOL/USDT': 2,
'SOL/WUSDT': 2,
'SRM/USDT': 3,
'SRM/WUSDT': 3,
USDT: 2,
WUSDT: 2,
'BTC/USDC': 0,
'ETH/USDC': 1,
'SOL/USDC': 2,
'SRM/USDC': 3,
USDC: 4,
}
groupedTrades.forEach((val, key) => {
@ -35,7 +30,7 @@ const calculatePNL = (tradeHistory, prices, mangoGroup) => {
)
})
const totalNativeUsdt = tradeHistory.reduce((acc, current) => {
const totalNativeUSDC = tradeHistory.reduce((acc, current) => {
const usdtAmount =
current.side === 'sell'
? parseInt(current.nativeQuantityReleased)
@ -44,9 +39,9 @@ const calculatePNL = (tradeHistory, prices, mangoGroup) => {
return usdtAmount + acc
}, 0)
profitAndLoss['USDT'] = nativeToUi(
totalNativeUsdt,
mangoGroup.mintDecimals[2]
profitAndLoss['USDC'] = nativeToUi(
totalNativeUSDC,
mangoGroup.mintDecimals[assetIndex['USDC']]
)
let total = 0

View File

@ -1,6 +1,6 @@
const PageBodyContainer = ({ children }) => (
<div className="min-h-screen grid grid-cols-12 gap-4 pb-10">
<div className="col-span-12 px-6 lg:col-start-2 lg:col-span-10 2xl:col-start-5 2xl:col-span-6">
<div className="col-span-12 px-6 xl:col-start-2 xl:col-span-10 2xl:col-start-3 2xl:col-span-8">
{children}
</div>
</div>