Views:

Related resources:

Tutorials

Reference

How-to guides

When you request a trial balance for an ABOR between two points in time, LUSID automatically generates at least one journal entry line for each item of economic activity in the transaction portfolio(s) referenced by that ABOR.

A journal entry line is a debit or credit amount representing the financial impact of that economic activity. The posting rules you've chosen for the ABOR then post the amount to a specific general ledger account. The trial balance aggregates the debits and credits in each account and enables you to check that the overall balance of the ledger is zero.

LUSID generates journal entry lines in response to the following types of economic activity in a portfolio:

  • Transaction activity
    LUSID generates at least one journal entry line per output transaction. Note the following:
    • The precise number and nature of journal entry lines is determined by the transaction type. Every movement belonging to that transaction type generates at least one journal entry line, while some movements generate multiple lines on trade and settlement dates. More about transaction types and movements.
    • It is your responsibility to use transaction types that create balanced pairs of journal entry lines. For example, for a transaction representing an equity purchase your Buy transaction type should have two movements, one generating a positive debit amount for posting to an investments account (or similar) and the other generating an equal and opposite negative credit amount for posting from a cash account (or similar).
    • The amount of a journal entry line depends on the economic bucket into which it is categorised by LUSID, which depends on the movement type. It is reported in both local (transaction) and base (portfolio) currency.
  • Valuation activity
    LUSID generates at least one pair of journal entry lines per holding impacted by the latest market data (prices and/or FX rates) detected in the LUSID Quote Store. Note the following:
    • The precise number and nature of journal entry line pairs is determined by the type of underlying instrument and the impact of that market data on the valuation.
    • LUSID automatically balances journal entry lines for valuation activity, so for example a positive debit amount for unrealised share price gain/loss for posting to an investments account (or similar) is always paired with an equal and opposite negative credit amount for posting from a PnL account (or similar).
    • It is your responsibility to load market data suitable for valuing each holding on the start and end dates of a trial balance period. You do not need to load market data for intermediate dates. More about valuation and market data.
    • The amount of a journal entry line depends on the economic bucket into which it is categorised by LUSID. It is always reported in base currency, and for most buckets in local currency as well.

Example: A simple portfolio containing equities

Imagine we have a simple GBP-denominated portfolio containing equities. And an ABOR set up to reference that portfolio with the following four general ledger accounts in the underlying chart of accounts:

In this example we'll see how to configure LUSID to generate balanced pairs of journal entry lines representing a typical selection of portfolio economic activity for posting to these accounts.

Subscription transaction

On 1 July we seed the portfolio with $15,000 at a USD/GBP exchange rate of 0.75, using a FundsIn transaction type with two movements, Capital and CashAccrual. When the trade settles on 3 July, these movement types combine to generate a balanced pair of journal entry lines, so no further configuration is required.

LUSID generates the following journal entry lines for this transaction:

Transaction typeMovement(s)Journal entry linesNotes
DateEconomic bucketHolding typeDR or CRLocal amount (USD)Base amount (GBP)
FundsInCapital1 JulyCA_CapitalBCredit-15000-11250Balances the cash holding.
Subtotal    -15000-11250 
CashAccrual1 JulyNA_CostADebit1500011250Receivable cash holding on the trade date.
3 JulyNA_CostACredit-15000-11250Reverses the receivable cash holding on the settlement date.
3 JulyNA_CostBDebit1500011250Permanent cash holding.
Subtotal1500011250 
Total00 

We can post the:

  • Debit amount (journal entry line with an economic bucket of NA_Cost and holding type of B) to the 2-Cash account.
  • Credit amount (economic bucket of CA_Capital) to the 3-Capital account.

Note: You can choose to post journal entry lines reflecting temporary receivable/payable cash holdings (holding types of A, C or R) to specific accounts on the trade date if you wish. For the purpose of simplicity in this example, these journal entry lines are ignored.

Purchase transaction

On 3 July we buy 300 Microsoft shares @ $10 at a USD/GBP exchange rate of 0.7, using a Buy transaction type with two movements, StockMovement and CashCommitment. When the trade settles on 5 July, these movement types combine to generate a balanced pair of journal entry lines, so no further configuration is required. A holdings report on 5 July shows a position of 300 Microsoft shares and a USD cash balance of $12,000.

LUSID generates the following journal entry lines for this transaction:

Transaction typeMovement(s)Journal entry linesNotes
DateEconomic bucketHolding typeDR or CRLocal amount (USD)Base amount (GBP)
BuyStockMovement3 JulyNA_CostPDebit30002100Security (non-cash) holding.
Subtotal    30002100 
CashCommitment3 JulyNA_CostCCredit-3000-2100Payable cash holding on the trade date.
5 JulyNA_CostCDebit30002100Reverses the payable cash holding on the settlement date.
5 JulyNA_CostBCredit-3000-2250Permanent cash holding.
5 JulyPL_RealFXGLBDebit0150Currency gain/loss is only reported in the base (or portfolio) currency.
Subtotal-3000-2100 
Total00 

We can post the:

  • Debit amount for the security (economic bucket of NA_Cost and holding type of P) to the 1-Investments account.
  • Credit amount for cash (economic bucket of NA_Cost and holding type of B) to the 2-Cash account.
  • Debit amount for realised currency gain/loss to the 4-PnL account. Note an equal and opposite amount of base currency has already been factored into the credit amount for cash.

Dividend transaction

On 5 July we load a dividend of 10 cents per share for our 300 Microsoft shares at a USD/GBP exchange rate of 0.77, using a Dividend transaction type with two movements, Carry and CashAccrual. When the trade settles on 7 July, these movement types combine to generate a balanced pair of journal entry lines, so no further configuration is required. A holdings report on 7 July shows a position of 300 Microsoft shares and a USD cash balance of $12,030.

LUSID generates the following journal entry lines for this transaction:

Transaction typeMovement(s)Journal entry linesNotes
DateEconomic bucketHolding typeDR or CRLocal amount (USD)Base amount (GBP)
DividendCarry5 JulyPL_CarryPCredit-30-23.10Security (non-cash) holding.
Subtotal    -30-23.10 
CashAccrual5 JulyNA_CostADebit3023.10Receivable cash holding on the trade date.
7 JulyNA_CostACredit-30-23.10Reverses the receivable cash holding on the settlement date.
7 JulyNA_CostBDebit3023.10Permanent cash holding.
Subtotal3023.10 
Total00 

We can post the:

  • Credit amount representing a flow of value out of the security (economic bucket of PL_Carry and holding type of P) to the 4-PnL account.
  • Debit amount for cash (economic bucket of NA_Cost and holding type of B) to the 2-Cash account.

Portfolio fee transaction

On 7 July we pay a portfolio fee of £50 using a PortfolioFee transaction type with two movements, Fee and CashCommitment. When the trade settles on 9 July, these movement types combine to generate a balanced pair of journal entry lines, so no further configuration is required. A holdings report on 9 July shows a position of 300 Microsoft shares, a USD cash balance of $12,030 and a GBP cash balance of -£50.

LUSID generates the following journal entry lines for this transaction:

Transaction typeMovement(s)Journal entry linesNotes
DateEconomic bucketHolding typeDR or CRLocal amount (GBP)Base amount (GBP)
PortfolioFeeFee7 JulyPL_FeesBDebit5050Balances the cash holding.
Subtotal    5050 
CashCommitment7 JulyNA_CostCCredit-50-50Payable cash holding on the trade date.
9 JulyNA_CostCDebit5050Reverses the payable cash holding on the settlement date.
9 JulyNA_CostBCredit-50-50Permanent cash holding.
Subtotal-50-50 
Total00 

We can post the:

  • Credit amount (economic bucket of NA_Cost and holding type of B) to the 2-Cash account.
  • Debit amount (economic bucket of PL_Fees and holding type of B) to the 4-PnL account.

Sale transaction

On 9 July we sell 100 Microsoft shares @ $15 at a USD/GBP exchange rate of 0.8, using a Sell transaction type with movements, StockMovement and CashCommitment. When the trade settles on 11 July, these movement types combine to generate a balanced pair of journal entry lines, so no further configuration is required. A holdings report on 11 July shows a position of 200 Microsoft shares, a USD cash balance of $13,530 and a GBP cash balance of -£50.

LUSID generates the following journal entry lines for this transaction:

Transaction typeMovement(s)Journal entry linesNotes
DateEconomic bucketHolding typeDR or CRLocal amount (USD)Base amount (GBP)
SellStockMovement9 JulyNA_CostPCredit-1000-700Security (non-cash) holding.
9 JulyPL_RealPriceGLPCredit-500-400Realised gain/loss is a combination of price gain/loss and currency gain/loss. Currency gain/loss is only reported in the base (or portfolio) currency.
9 JulyPL_RealFXGLPCredit0-100
Subtotal -1500-1200 
CashCommitment9 JulyNA_CostCDebit15001200Receivable cash holding on the trade date.
11 JulyNA_CostCCredit-1500-1200Reverses the receivable cash holding on the settlement date.
11 JulyNA_CostBDebit15001200Permanent cash holding.
Subtotal 15001200 
Total 00 

We can post the:

  • Credit amount for the security (economic bucket of NA_Cost and holding type of P) to the 1-Investments account.
  • Debit amount for cash (economic bucket of NA_Cost and holding type of B) to the 2-Cash account.
  • Credit amounts for realised share price and currency gain/loss to the 4-PnL account. Note a combined equal and opposite amount has already been factored into the debit amount for cash.

Valuation

On 15 July we load the latest market data into the LUSID quote store: a MSFT share price of $20 and USD/GBP spot rate of 0.9. Our remaining 200 shares, which originally cost $2,000 or £1,400, are now worth $4,000 or £3,600, an unrealised gain of £2,200. Our cash balance of $13,530 which cost £10,223.10 is now worth £12,177, an unrealised gain of £1,953.90. 

There are no transaction types (and therefore no movements) associated with valuation activity, and LUSID automatically generates balanced pairs of journal entry lines, so no further configuration is required.

LUSID generates the following journal entry lines for the valuation:

Journal entry lines
DateEconomic bucketHolding typeDR or CRLocal amount (USD)Base amount (GBP)Notes
15 JulyNA_UnrealPriceGLPDebit20001800The PL* automatically balances the NA* unrealised price gain/loss for the security holding.
PL_UnrealPriceGLPCredit-2000-1800
NA_UnrealFXGLPDebit0400The PL* automatically balances the NA* unrealised currency gain/loss for the security holding. Note this is only reported in the base (or portfolio) currency.
PL_UnrealFXGLPCredit0-400
NA_UnrealFXGLBDebit01953.90The PL* automatically balances the NA* unrealised currency gain/loss for the cash holding. Note this is only reported in the base (or portfolio) currency.
PL_UnrealFXGLBCredit0-1953.90

We can post the:

  • Debit amounts for unrealised share price gain/loss and currency gain/loss for the security (economic bucket starting with NA_ and holding type of P) to the 1-Investments account.
  • Debit amount for unrealised currency gain/loss for cash (economic bucket starting with NA_ and holding type of B) to the 2-Cash account.
  • Credit amounts (economic bucket starting with PL_) to the 4-PnL account.

Auditing journal entry lines

LUSID automatically generates journal entry lines in preparation for creating a trial balance, but you can view them directly for audit purposes if you wish. See how to do this.

The response for this example is as follows, transformed to a Pandas dataframe and with some columns removed and others renamed for clarity. Note the following:

  • Journal entry lines representing transactions have a source_type of LusidTransaction. The source_id references the ID of the upserted transaction.
  • Journal entry lines representing valuations have a source_type of LusidValuation.

For reference, the posting rules used to post debit and credit amounts to accounts in this example are as follows:

{
  "values": [
    {
      "ruleId": "rule_01",
      "account": "3-Capital",
      "ruleFilter": "EconomicBucket startswith 'CA'"
    },
    {
      "ruleId": "rule_02",
      "account": "1-Investments",
      "ruleFilter": "HoldType eq 'P' and EconomicBucket startswith 'NA'"
    },
    {
      "ruleId": "rule_03",
      "account": "4-PnL",
      "ruleFilter": "EconomicBucket startswith 'PL'"
    },
    {
      "ruleId": "rule_04",
      "account": "2-Cash",
      "ruleFilter": "HoldType neq 'P' and EconomicBucket startswith 'NA'"
    }
  ]
}

The trial balance for this example is as follows; we can see that the overall balance of the ledger is zero: