diff --git a/packages/augur-simplified/src/modules/common/tables.tsx b/packages/augur-simplified/src/modules/common/tables.tsx index 657daa042ff..8cd3ad60ff4 100644 --- a/packages/augur-simplified/src/modules/common/tables.tsx +++ b/packages/augur-simplified/src/modules/common/tables.tsx @@ -666,7 +666,7 @@ const TransactionRow = ({ transaction }: TransactionProps) => {
  • -
  • {formatDai(transaction.value).full}
  • +
  • {formatDai(transaction.cashValueUsd).full}
  • {transaction.tokenAmount}
  • {transaction.shareAmount}
  • diff --git a/packages/augur-simplified/src/modules/constants.ts b/packages/augur-simplified/src/modules/constants.ts index 1c9117dc238..576880caac0 100644 --- a/packages/augur-simplified/src/modules/constants.ts +++ b/packages/augur-simplified/src/modules/constants.ts @@ -47,7 +47,6 @@ export const MILLION = THOUSAND.times(THOUSAND); export const BILLION = MILLION.times(THOUSAND); export const TRILLION = BILLION.times(THOUSAND); export const SEC_IN_YEAR = createBigNumber(86400).times(createBigNumber(365)); -export const NUM_TICKS_Y_N = 1000; // # Asset Types export const ETH = 'ETH'; diff --git a/packages/augur-simplified/src/utils/process-data.ts b/packages/augur-simplified/src/utils/process-data.ts index 04f5cd042f6..ca5195f5c5e 100644 --- a/packages/augur-simplified/src/utils/process-data.ts +++ b/packages/augur-simplified/src/utils/process-data.ts @@ -430,6 +430,7 @@ const shapeEnterTransactions = ( sender: e.sender?.id, subheader, ...properties, + cashValueUsd: String(cashValueUsd), value: cashValueUsd }; }); @@ -451,6 +452,7 @@ const shapeExitTransactions = ( subheader, ...properties, value: cashValueUsd, + cashValueUsd: String(cashValueUsd) }; }); }; @@ -464,17 +466,13 @@ const shapeAddLiquidityTransactions = ( const subheader = `Add ${cash.name} Liquidity`; // TODO: cashValue seems to be off on graph data, work around is to add up yes/no share cashValues const totalCashValue = new BN(e.noShareCashValue).plus(e.yesShareCashValue); - // const cashValue = String( - // convertOnChainCashAmountToDisplayCashAmount( - // e.cashValue, - // new BN(cash.decimals) - // ) - // ); - const cashValueUsd = String( + const cashValue = convertOnChainSharesToDisplayShareAmount( totalCashValue, new BN(cash.decimals) - ).times(cash.usdPrice) + ); + const cashValueUsd = String( + cashValue.times(cash.usdPrice) ); const lpTokens = String( convertOnChainSharesToDisplayShareAmount( @@ -491,7 +489,7 @@ const shapeAddLiquidityTransactions = ( ...properties, price: null, cashValueUsd, - value: cashValueUsd, + value: String(cashValue), lpTokens, netShares: e.netShares }; @@ -505,11 +503,12 @@ const shapeRemoveLiquidityTransactions = ( return transactions.map((e) => { const properties = formatTransaction(e, cash); const subheader = `Remove ${cash.name} Liquidity`; - const cashValue = String( - convertOnChainSharesToDisplayShareAmount( - new BN(e.cashValue), - new BN(cash.decimals) - ) + const cashValue = convertOnChainSharesToDisplayShareAmount( + new BN(e.cashValue), + new BN(cash.decimals) + ) + const cashValueUsd = String( + cashValue.times(cash.usdPrice) ); const shares = new BN(e.noShares).plus(new BN(e.yesShares)); const shareAmount = String(formatShares( @@ -531,8 +530,9 @@ const shapeRemoveLiquidityTransactions = ( subheader, ...properties, price: null, - cashValue, - value: cashValue, + cashValue: String(cashValue), + cashValueUsd, + value: String(cashValue), tokenAmount, shareAmount };