Skip to content
This repository has been archived by the owner on Jan 15, 2021. It is now read-only.

Commit

Permalink
Liquidity trades fill% and total order amount have unlimited on csv
Browse files Browse the repository at this point in the history
  • Loading branch information
Leandro Boscariol committed Jul 10, 2020
1 parent 865460b commit e65f506
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions src/components/TradesWidget/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,19 @@ function csvTransformer(trade: Trade): CsvColumns {
const fillPriceStr = formatPrice({ price: invertPrice(fillPrice), decimals: 8 })
const inverseFillPriceStr = formatPrice({ price: fillPrice, decimals: 8 })

const fillPercentage =
orderSellAmount && trade.type != 'liquidity' ? divideBN(sellAmount, orderSellAmount).toString(10) : 'N/A'
const totalOrderAmount =
orderSellAmount && trade.type != 'liquidity'
? formatAmountFull({ amount: orderSellAmount, precision: sellToken.decimals, thousandSeparator: false })
: 'N/A'
let fillPercentage = 'N/A'
let totalOrderAmount = 'N/A'
if (trade.type === 'liquidity') {
fillPercentage = 'unlimited'
totalOrderAmount = 'unlimited'
} else if (orderSellAmount) {
fillPercentage = divideBN(sellAmount, orderSellAmount).toString(10)
totalOrderAmount = formatAmountFull({
amount: orderSellAmount,
precision: sellToken.decimals,
thousandSeparator: false,
})
}

// The order of the keys defines csv column order,
// as well as names and whether to include it or not.
Expand Down

0 comments on commit e65f506

Please sign in to comment.