How does LUSID handle rounding?

Prev Next

LUSID rounds numbers in four distinct places, each for a different reason. Everywhere else, figures are kept at full precision. This article explains each of the four, what it rounds, whether you can control it, and which endpoints it affects.

The two fundamental rules are as follows:

  • Where a market convention requires rounding — bond accrued interest, compounded rates — the rounding happens inside the calculation, so every downstream figure inherits the same rounded number.

  • Amounts are rounded to a currency's real decimal places per ISO 4217 (for example, USD to 2dp, JPY to 0dp, BHD to 3dp) only once they become actual money: booked cost, cash, ledger entries, and optionally final valuation results. Per-unit values are never rounded, because rounding a unit price and then scaling it up by a large holding would introduce a real error.

When and where does rounding occur?

1) If an instrument has a rounding convention

By default, no rounding is applied at the instrument level.

You can configure LUSID to round accrued interest and/or cashflows to a specific number of decimal places for a Bond, ComplexBond or InflationLinkedBond. You may want to do this because some markets round by market convention rather than by currency; for example, Thai government bonds round accrued interest to 2dp per 1,000 face value, while French OATs round to 7dp per unit nominal.

Consider the following example of a fixed-rate vanilla bond mastered as an instrument of type Bond:

curl -X POST 'https://mydomain.lusid.com/api/api/instruments'
   -H 'Content-Type: application/json-patch+json'
   -H 'Authorization: Bearer myAPIAccessToken'
   -d '{"upsert-request-1": {
    "name": "UKT 0 ⅜ 10/22/26",
    "identifiers": {"Figi": {"value": "BBG00ZF1T9P5"}},
    "definition": {
      "instrumentType": "Bond",
      "startDate": "2016-10-22T10:00:00.0000000+00:00",
      "maturityDate": "2026-10-22T10:00:00.0000000+00:00",
      "domCcy": "GBP",
      "couponRate": 0.00375,
      "principal": 1
      "flowConventions": {
        "currency": "GBP",
        "paymentFrequency": "12M",
        "dayCountConvention": "Actual365",
        "rollConvention": "22",
        "businessDayConvention": "Following"
      },
      "roundingConventions": [
        {
          "roundingTarget": "AccruedInterest",
          "faceValue": 100,
          "precision": 10,
          "roundingType": "Up"
        },
        {
          "roundingTarget": "Cashflows",
          "faceValue": 100,
          "precision": 6,
          "roundingType": "Down"
        },
      ]
    }
  }
}'

Note the following:

  • The instrument definition has a roundingConventions array with two RoundingConvention objects.

  • The first has a roundingTarget of AccruedInterest, which impacts the Instrument/Accrued metric available when calling the GetValuation API, and rounds up to 10 decimal places.

  • The second has a roundingTarget of Cashflows, which impacts the GetCashLadder API, and rounds down to 6 decimal places.

  • Both have a faceValue of the par value specified in the bond prospectus.

Note: To define a universal rounding convention, specify a single RoundingConvention object with a roundingTarget of All.

LUSID applies a rounding convention as follows:

  1. Calculates the unitised accrued interest or cashflow amount.

  2. Multiplies by the face value.

  3. Applies the rounding convention.

  4. Inverts the rounded scaled accrued interest or cashflow amount.

  5. Multiplies by the number of units in the holding.

Because rounding happens inside the calculation, the rounded figure appears everywhere that amount is used: accrued interest in valuations, coupons in the cashflow endpoints and payment diary, coupon events, and the settlement transactions they generate. It is a single rounded number, used consistently downstream.

Note: Instrument rounding conventions are applied before every other stage. If you set the wrong precision here, every downstream figure inherits it, and no later stage corrects it. Only set a rounding convention where the instrument genuinely requires one.

2) If a compounded instrument leg has a rounding precision

Floating legs that compound take a roundingPrecision on the Compounding object. This rounds the computed rate, and the rounded rate then drives the accrual and the cashflows.

This applies to the final rate only. Some loan conventions round at earlier stages of the rate calculation; this is not currently configurable.

3) Booking (when amounts become money)

When LUSID generates holdings and ledger entries from transactions, the resulting amounts are rounded to the currency's ISO 4217 decimal places. This behaviour is always on and cannot be disabled.

This covers:

  • Holding cost and book value

  • Unsettled and settled cash

  • Settlement amounts

  • Journal entry lines, in both local and portfolio currency

  • Corporate action outcomes

A2B and cash ladder reports are built from these holdings and movements, so they show the same rounded figures.

This rounding does not impact valuation. For example, buying 1 unit of a JPY instrument with a computed consideration of 123.123 gives a holding cost of 123, since JPY has no decimal places. The same position can still show an unrounded market value of ¥123.11702 at the same time. Cost reflects money that has actually settled; market value is a calculated measurement, so the two are allowed to differ.

4) Valuation

A recipe has an aggregationOptions.applyIso4217Rounding option that is set to False by default.

You can set this option to True to round final valuation results — Valuation/PV, holding-level accrued, and the P&L keys, in every report currency — to the currency's decimal places as the last step, after all calculation, scaling, and FX conversion have completed.

This option never rounds per-unit, instrument-level keys, such as Valuation/InstrumentPV, instrument-level accrued, exposure, and their per-leg equivalents. These are unit prices rather than money, so the second rule at the top of this article applies: they stay at full precision. One consequence of this is that multiplying InstrumentPV by the number of units yourself can differ from a rounded Valuation/PV by up to half a minor currency unit. This is expected: it is the rounding taking effect, not a discrepancy in the calculation.

This option applies only to recipe-driven valuation endpoints. It does not change holdings, cashflows, journal entries, or the amounts on instrument events; a coupon amount of 0.41666 recurring stays exactly that on the event, regardless of the recipe setting. Sections 1 and 3 above cover rounding for those areas.

Display precision

The currency data type carries each currency's decimal places as metadata. The LUSID web app uses this to format numbers on screen. Display formatting never changes a stored or computed value; if the screen shows 2 decimal places, the API still returns the value at full precision.

Order of operations

The stages above run in a fixed order:

  1. Instrument rounding conventions, inside the calculation (section 1).

  2. Full-precision valuation and scaling.

  3. ISO 4217 rounding, as the final step, if enabled in the recipe (section 4).

Booking-side rounding of real money (section 3) happens independently of this sequence and is always on.

The order matters when more than one stage is configured. Take 123.123 in a currency with 2 decimal places. ISO rounding on its own gives 123.12. But if the instrument also carries a 1dp rounding convention, the calculation produces 123.1 before ISO rounding is applied, and 123.1 is the final answer — ISO rounding has nothing left to round further. Both stages are working correctly; the instrument was configured to round coarsely, and it did. If a result looks over-rounded, check the instrument's rounding convention first.

What is never rounded

  • Valuation results when aggregationOptions.applyIso4217Rounding is False (the default).

  • Per-unit, instrument-level keys under any recipe setting.

  • Intermediate values: discount factors, FX conversions, and rates (beyond the compounding rate in section 2).

  • Quotes and market data, which are used exactly as supplied.

Current limitations

  • Instrument rounding conventions cover accrued interest and cashflows only; conventions on other quantities are not yet expressible.

  • Compounded-rate rounding applies to the final rate only.

  • For inflation-linked bonds, the index ratio is not independently rounded, and configurations where accrual and principal need different rounding treatments are not fully expressible.