post https://api-lib.bambu.life/api/transactions/generic/v2/generalSplitter
This endpoint serves as a calculator to split transactional related orders that has a large number of decimal places. It can be used for:
- split of user-input Investment amounts between funds
- split of master-level executed units between accounts, to be sent as allocations to the broker/custodian
- split of account-level executed units between goals
- split of account-level left over cents between goals
- split of account-level settlement amount between goals
- split of account-level cash dividends between goals
- split of account-level fee between goals
Request Body
Name | Datatype | Description | Mandatory | Sample value | Notes |
---|---|---|---|---|---|
decimalPrecision | integer | number of decimals used for the baseInput and for the Splits | Yes | 5 | "2" decimals if we are splitting dollars, euros, "0" decimals it we are splitting yens |
baseInput | decimal | Value to be split | Yes | 40.34534 | Throws an error if baseInput comes with strictly more decimals than DecimalPrecision |
splits | Array of Objects | vector of references values used to split pro-rata the baseInput | Yes | [{ "id": "1","value":55.24}, {"id": "2","value": 55.24}, {"id": "3","value": 67.79}, {"id": "4","value": 7.39}] | |
id | string | id | Yes | 1 | |
value | decimal | reference values use to split pro rata | Yes | 7.39 | Number of decimals in Value restricted to 16 |
Response Body
Name | Datatype | Description | Sample value | No. of decimal places | Notes |
---|---|---|---|---|---|
baseInput | Array of Objects | ||||
id | string | id | "1" | ||
value | decimal | reference values use to split pro rata | 55.24 | ||
rawAllocatedAmount | decimal | The raw allocated account without any rounding | 11.901325002693094904664440375 | 16 | |
originalAllocatedAmount | decimal | The rounded down allocated amount rounded down to the decimal precision | 11.90132 | based on decimalPrecision | |
originalAllocatedAmountLastDigit | decimal | The digit in the originalAllocatedAmount at the DecimalPrecision+1 th place | 5.0 | 1 | |
actualAllocatedAmount | decimal | The final allocated amount after the adjustment based on 'most deserving' logic | 11.90132 | based on decimalPrecision |