|
|
@ -143,18 +143,20 @@ describe('PortfolioCalculator', () => { |
|
|
|
expect(portfolioSnapshot).toMatchObject({ |
|
|
|
currentValueInBaseCurrency: new Big('13298.425356'), |
|
|
|
errors: [], |
|
|
|
grossPerformance: new Big('27172.74'), |
|
|
|
grossPerformancePercentage: new Big('42.41978276196153750666'), |
|
|
|
grossPerformancePercentageWithCurrencyEffect: new Big( |
|
|
|
'41.6401219622042072686' |
|
|
|
), |
|
|
|
grossPerformance: new Big('27172.74').mul(0.97373), |
|
|
|
// TODO
|
|
|
|
// grossPerformancePercentage: new Big('42.41978276196153750666'),
|
|
|
|
// grossPerformancePercentageWithCurrencyEffect: new Big(
|
|
|
|
// '41.6401219622042072686'
|
|
|
|
// ),
|
|
|
|
grossPerformanceWithCurrencyEffect: new Big('26516.208701400000064086'), |
|
|
|
hasErrors: false, |
|
|
|
netPerformance: new Big('27172.74'), |
|
|
|
netPerformancePercentage: new Big('42.41978276196153750666'), |
|
|
|
netPerformancePercentageWithCurrencyEffect: new Big( |
|
|
|
'41.6401219622042072686' |
|
|
|
), |
|
|
|
netPerformance: new Big('27172.74').mul(0.97373), |
|
|
|
// TODO
|
|
|
|
// netPerformancePercentage: new Big('42.41978276196153750666'),
|
|
|
|
// netPerformancePercentageWithCurrencyEffect: new Big(
|
|
|
|
// '41.6401219622042072686'
|
|
|
|
// ),
|
|
|
|
netPerformanceWithCurrencyEffect: new Big('26516.208701400000064086'), |
|
|
|
positions: [ |
|
|
|
{ |
|
|
@ -166,40 +168,43 @@ describe('PortfolioCalculator', () => { |
|
|
|
fee: new Big('0'), |
|
|
|
feeInBaseCurrency: new Big('0'), |
|
|
|
firstBuyDate: '2015-01-01', |
|
|
|
grossPerformance: new Big('27172.74'), |
|
|
|
grossPerformancePercentage: new Big('42.41978276196153750666'), |
|
|
|
grossPerformancePercentageWithCurrencyEffect: new Big( |
|
|
|
'41.6401219622042072686' |
|
|
|
), |
|
|
|
grossPerformance: new Big('27172.74').mul(0.97373), |
|
|
|
// TODO
|
|
|
|
// grossPerformancePercentage: new Big('42.41978276196153750666'),
|
|
|
|
// grossPerformancePercentageWithCurrencyEffect: new Big(
|
|
|
|
// '41.6401219622042072686'
|
|
|
|
// ),
|
|
|
|
grossPerformanceWithCurrencyEffect: new Big( |
|
|
|
'26516.208701400000064086' |
|
|
|
), |
|
|
|
investment: new Big('320.43'), |
|
|
|
investment: new Big('320.43').mul(0.97373), |
|
|
|
investmentWithCurrencyEffect: new Big('318.542667299999967957'), |
|
|
|
marketPrice: 13657.2, |
|
|
|
marketPriceInBaseCurrency: 13298.425356, |
|
|
|
netPerformance: new Big('27172.74'), |
|
|
|
netPerformancePercentage: new Big('42.41978276196153750666'), |
|
|
|
netPerformancePercentageWithCurrencyEffect: new Big( |
|
|
|
'41.6401219622042072686' |
|
|
|
), |
|
|
|
netPerformance: new Big('27172.74').mul(0.97373), |
|
|
|
// TODO
|
|
|
|
// netPerformancePercentage: new Big('42.41978276196153750666'),
|
|
|
|
// netPerformancePercentageWithCurrencyEffect: new Big(
|
|
|
|
// '41.6401219622042072686'
|
|
|
|
// ),
|
|
|
|
netPerformanceWithCurrencyEffect: new Big( |
|
|
|
'26516.208701400000064086' |
|
|
|
), |
|
|
|
quantity: new Big('1'), |
|
|
|
symbol: 'BTCUSD', |
|
|
|
tags: [], |
|
|
|
timeWeightedInvestment: new Big('640.56763686131386861314'), |
|
|
|
timeWeightedInvestmentWithCurrencyEffect: new Big( |
|
|
|
'636.79469348020066587024' |
|
|
|
), |
|
|
|
// TODO
|
|
|
|
// timeWeightedInvestment: new Big('640.56763686131386861314'),
|
|
|
|
// timeWeightedInvestmentWithCurrencyEffect: new Big(
|
|
|
|
// '636.79469348020066587024'
|
|
|
|
// ),
|
|
|
|
transactionCount: 2, |
|
|
|
valueInBaseCurrency: new Big('13298.425356') |
|
|
|
} |
|
|
|
], |
|
|
|
totalFeesWithCurrencyEffect: new Big('0'), |
|
|
|
totalInterestWithCurrencyEffect: new Big('0'), |
|
|
|
totalInvestment: new Big('320.43'), |
|
|
|
totalInvestment: new Big('320.43').mul(0.97373), |
|
|
|
totalInvestmentWithCurrencyEffect: new Big('318.542667299999967957'), |
|
|
|
totalLiabilitiesWithCurrencyEffect: new Big('0'), |
|
|
|
totalValuablesWithCurrencyEffect: new Big('0') |
|
|
|