post https://api-lib.bambu.life/api/generalCalculator/v2/profitAndLoss/calcFundsPnl
The following table describes the parameters for this API:
Name | DataType | Description | Mandatory | Sample Value | No. of decimals | Notes |
---|---|---|---|---|---|---|
endMarketValue | Ending market value, shows the value of a security at the end of a given date. If it's a stock, it's the current stock priceIf it's a Mutual Fund or ETF, it's the current net asset value. | Y | 0.7444 | 6 | The valid values for this parameter is 0 or more | |
transactionType | String | List of transaction type - SA - SubscriptionRD - RedemptionDD - Cash DividendsBI - Unit SplitDR - Dividends Reinvestment | Y | SA | ||
transactionValue | Number | The value of the transaction being performed.Values can be negative or positive If it's a cash inflow, value should be positive.Types of cash inflow (SA, DR)If it's a cash outflow, value should be negativeTypes of cash outflow (RD, DD) | Y | 100, -80 | 6 | No boundary value set for this parameter |
purchasePrice | Number | The price at which the security was bought | Y | 100 | 6 | This values come from the broker, during trade confirmation.The valid values for this parameter is 0 or more. |
The following table describes the outputs for this API:
Name | DataType | Description | Sample Value | No. of decimals |
---|---|---|---|---|
valuationDateFundMarketValue | Number | Current Value of the funds | 126.55 | 6 |
valuationDateFundDeposits | Number | -80 | 6 | |
profitAndLossAmt | Number | This is the unrealized profit/loss in $ value | -93.45 | 2 |
profitAndLossPercentage | Number | This is the unrealized profit/loss in % value | -0.4247 | 6 |
balanceUnitHolding | Number | This is the total number of units the user has | 170 | 2 |
avgPurchasePrice | Number | This is the average purchase price on a fund level | 1.29411765 | 8 |
iterations | Array of objects | [ { "transactionUnit": 100, "balanceUnitHolding": 100, "avgPurchasePrice": 1 },{ "transactionUnit": -40, "balanceUnitHolding": 60, "avgPurchasePrice": 1 },...] | ||
transactionUnit | Number | number of units purchased | 100 | 2 |
balanceUnitHolding | Number | rolling number of units based on all previous transactions | 100 | 2 |
avgPurchasePrice | Number | The rolling average purchased price based on all previous transactions | 1 | 8 |