Chart of Accounts

Midaz introduces the concept of a chart of accounts (CoA), essential for marking transaction events and cross-referencing them with customer data. As Midaz operates on a double-entry system by design, it prevents the creation of "dry" adjustments, ensuring that money cannot be created or lost out of thin air.

If a clearing account has a balance at the end of the day, this usually indicates that a transaction (or more) did not occur as expected.

Account Movements and Accounting Routes

A typical P2P transfer will involve the following account movements and accounting routes, as shown in Figure 1 and further explained in the table.

MovementTypeAccountChart-of-accountsGroup name

1

DEBIT

source

p2p_debit_source_8123891

P2P_TRANSFER

2

CREDIT

bucket (clearing)

p2p_credit_bucket_998239

P2P_TRANSFER

3

CREDIT

destination

p2p_credit_destination_1231412

P2P_TRANSFER

4

DEBIT

bucket (clearing)

p2p_debit_bucket_625430

P2P_TRANSFER

It is common for CoAs to be created with customer-specific codes such as 8123891, 998239, 1231412, and 625430.

For movements 1 and 2:

(transaction-template v1
  (chart-of-accounts-group-name p2p_transfer_group)
  (metadata
    (anyKey anyValue)
    (anotherKey anotherValue)
  )
  (code P2P_TRANSFER)
  (description "P2P sent")
  (pending false)
  (send BRL $amount+$fee|2 
    (source
      (from $sourceAccount :amount BRL $amount|2
        (description "P2P sent to $destination")
        (chart-of-accounts p2p_debit_source_8123891)
      )
    )
  )
  (distribute
    (to @bucket/p2p :amount BRL $amount|2
      (description "P2P received from $sourceAccount")
      (chart-of-accounts p2p_credit_bucket_998239)
    )
  )
)

For movements 3 and 4, it's important to note that a credit (movement 3) cannot be made without a corresponding debit (movement 4). Therefore, the clearing account loses its value if it needs to be debited beforehand, as it does not serve as an end-of-day flag for validating transaction issues.

(transaction-template v1
  (chart-of-accounts-group-name p2p_transfer_group)
  (metadata
      (anyKey anyValue)
      (anotherKey anotherValue)
  )
  (code P2P_TRANSFER)
  (description "P2P sent")
  (pending false)
  (send BRL $amount+$fee|2 
    (source
      (from @bucket/p2p :amount BRL $amount|2
        (description "P2P sent to $destination")
        (chart-of-accounts p2p_debit_bucket_625430)
      )
  )
 )
  (distribute
    (to $destination :amount BRL $amount|2
      (chart-of-accounts p2p_credit_destination_1231412)
    )
  )
)

Simplified Transaction Modeling

Given that Midaz ensures "dry" adjustments cannot be created, a more efficient approach to transaction modeling is recommended. The simplified chart-of-accounts for the same transaction would be as shown in Figure 2 and further explained in the table.

MovementTypeAccountChart-of-accountsGroup name

1

DEBIT

source

p2p_debit_source_8123891

P2P_TRANSFER

2

CREDIT

destination

p2p_credit_destination_1231412

P2P_TRANSFER

For movements 1 and 2:

(transaction-template v1
  (chart-of-accounts-group-name p2p_transfer_group)
  (metadata
    (anyKey anyValue)
    (anotherKey anotherValue)
  )
  (code P2P_TRANSFER)
  (description "P2P sent")
  (pending false)
  (send BRL $amount+$fee|2 
    (source
      (from $sourceAccount :amount BRL $amount|2
        (description "P2P sent to $destination")
        (chart-of-accounts p2p_debit_source_8123891)
      )
    )
  )
  (distribute
    (to $destination :amount BRL $amount|2
      (chart-of-accounts p2p_credit_destination_1231412)
    )
  )
)

We recommend using transactions without transitional accounts. Midaz guarantees the integrity of transaction amounts, simplifying the integration and usage of the platform for customers.

Last updated