|
@ -531,31 +531,46 @@ export class OrderService { |
|
|
|
|
|
|
|
|
const value = new Big(order.quantity).mul(order.unitPrice).toNumber(); |
|
|
const value = new Big(order.quantity).mul(order.unitPrice).toNumber(); |
|
|
|
|
|
|
|
|
return { |
|
|
const [ |
|
|
...order, |
|
|
feeInAssetProfileCurrency, |
|
|
value, |
|
|
feeInBaseCurrency, |
|
|
feeInAssetProfileCurrency: |
|
|
unitPriceInAssetProfileCurrency, |
|
|
await this.exchangeRateDataService.toCurrencyAtDate( |
|
|
valueInBaseCurrency |
|
|
|
|
|
] = await Promise.all([ |
|
|
|
|
|
this.exchangeRateDataService.toCurrencyAtDate( |
|
|
order.fee, |
|
|
order.fee, |
|
|
order.currency ?? order.SymbolProfile.currency, |
|
|
order.currency ?? order.SymbolProfile.currency, |
|
|
order.SymbolProfile.currency, |
|
|
order.SymbolProfile.currency, |
|
|
order.date |
|
|
order.date |
|
|
), |
|
|
), |
|
|
SymbolProfile: assetProfile, |
|
|
this.exchangeRateDataService.toCurrencyAtDate( |
|
|
unitPriceInAssetProfileCurrency: |
|
|
order.fee, |
|
|
await this.exchangeRateDataService.toCurrencyAtDate( |
|
|
order.currency ?? order.SymbolProfile.currency, |
|
|
|
|
|
userCurrency, |
|
|
|
|
|
order.date |
|
|
|
|
|
), |
|
|
|
|
|
this.exchangeRateDataService.toCurrencyAtDate( |
|
|
order.unitPrice, |
|
|
order.unitPrice, |
|
|
order.currency ?? order.SymbolProfile.currency, |
|
|
order.currency ?? order.SymbolProfile.currency, |
|
|
order.SymbolProfile.currency, |
|
|
order.SymbolProfile.currency, |
|
|
order.date |
|
|
order.date |
|
|
), |
|
|
), |
|
|
valueInBaseCurrency: |
|
|
this.exchangeRateDataService.toCurrencyAtDate( |
|
|
await this.exchangeRateDataService.toCurrencyAtDate( |
|
|
|
|
|
value, |
|
|
value, |
|
|
order.currency ?? order.SymbolProfile.currency, |
|
|
order.currency ?? order.SymbolProfile.currency, |
|
|
userCurrency, |
|
|
userCurrency, |
|
|
order.date |
|
|
order.date |
|
|
) |
|
|
) |
|
|
|
|
|
]); |
|
|
|
|
|
|
|
|
|
|
|
return { |
|
|
|
|
|
...order, |
|
|
|
|
|
feeInAssetProfileCurrency, |
|
|
|
|
|
feeInBaseCurrency, |
|
|
|
|
|
unitPriceInAssetProfileCurrency, |
|
|
|
|
|
value, |
|
|
|
|
|
valueInBaseCurrency, |
|
|
|
|
|
SymbolProfile: assetProfile |
|
|
}; |
|
|
}; |
|
|
}) |
|
|
}) |
|
|
); |
|
|
); |
|
|