---
title: "Assigning economic activity to general ledger accounts using posting rules"
slug: "assigning-economic-activity-to-general-ledger-accounts-using-posting-rules"
updated: 2025-09-10T09:59:39Z
published: 2025-09-10T09:59:39Z
canonical: "support.lusid.com/assigning-economic-activity-to-general-ledger-accounts-using-posting-rules"
---

> ## Documentation Index
> Fetch the complete documentation index at: https://support.lusid.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Assigning economic activity to general ledger accounts using posting rules

You must specify rules to post the [journal entry lines](/v1/docs/how-does-lusid-generate-journal-entry-lines-from-economic-activity) automatically generated by LUSID in reponse to portfolio activity to general ledger accounts. To do this:

1. [Add a posting module](/v1/docs/how-do-i-add-a-posting-module-with-posting-rules-to-a-chart-of-accounts) to your chart of accounts (CoA) with posting rules that assign journal entry lines matching particular criteria to specific accounts.
2. [Apply the code of the posting module](/v1/docs/how-do-i-create-a-fund#understanding-nav-types) to each NAV type in your fund.

A posting module contains posting rules in a specific order. For each journal entry line, LUSID applies the **first matching posting rule found**. Unmatched journal entry lines remain unassigned. The goal of a posting module is to create a waterfall of logic that ensures all economic activity *is* assigned. [Syntax of a posting rule](/v1/docs/how-do-i-add-a-posting-module-with-posting-rules-to-a-chart-of-accounts#syntax-of-a-posting-rule).

Consider the following example, of a posting module with five posting rules:

```json
{
  "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'"
    },
    {
      "ruleId": "rule_05",
      "account": "Error",
      "ruleFilter": "True"
    }
  ]
}
```

For each generated journal entry line, LUSID automatically:

1. Assigns the amount to the `3-Capital` account if the [economic bucket](/v1/docs/what-are-economic-buckets) starts with `CA`.
2. If not, assigns the amount to the `1-Investments` account if the economic bucket starts with `NA` and the [holding type](/v1/docs/what-are-the-holding-types) code is `P` (position, signifying a non-currency holding).
3. If not, assigns the amount to the `4-PnL` account if the economic bucket starts with `PL`.
4. If not, assigns the amount to the `2-Cash` account if the economic bucket starts with `NA` and the holding type code is *not* equal to `P` (that is, is a currency holding).
5. If not, assigns the amount to an `Error` account for manual remediation.

In this example, rule 5 is a 'catch all' rule that assigns unmatched journal entry lines to a general-purpose account. You could omit rule 5, in which case any journal entry lines failing to match rules 1, 2, 3 and 4 would remain unassigned.
