---
updatedAt: 2026-09-23T14:37:47.000Z
agentTools:
  siteIndex: https://developers.pismo.io/llms.txt
  projectIndex: https://developers.pismo.io/pismo-docs/llms.txt
---

# Price Table strategy calculation

The `PRICE_TABLE` strategy is a fee calculation method that generates installment plans with compound interest, fees, and Imposto sobre Operações Financeiras (IOF - Brazilian tax) calculations. This strategy automatically generates default transaction postings that are used by the transactions domain to create financial transactions. In this way, the `PRICE_TABLE` strategy removes the need to manually generate the transaction flow to see the transactions generated by the configured fees.

<Callout icon="📘" theme="info">
  The transaction mappings documented here represent the default behavior when using the `PRICE_TABLE` strategy. Any transaction flow different from these defaults must be created manually.
</Callout>

There are a few things you must be aware of when considering the use of the `PRICE_TABLE` strategy.

* IOF (Imposto sobre Operações Financeiras) is a Brazilian tax specific to financial operations.
* Maximum daily IOF calculation period is 365 days.
* All monetary values are rounded to 2 decimal places (`HALF_EVEN`).
* The strategy handles edge cases like negative interest on last installment through redistribution.
* Installment numbering starts at 1, not 0.

# Client configuration

Clients (issuers/banks) configure the PRICE\_TABLE strategy through the fee models. This configuration determines how rates, taxes, and fees are calculated for transactions.

**Configuration parameters**

| Parameter      | Type   | Description                                                        | Example value                                    |
| :------------- | :----- | :----------------------------------------------------------------- | :----------------------------------------------- |
| `strategy`     | String | Must be set to `"PRICE_TABLE"`                                     | `"PRICE_TABLE"`                                  |
| `interestRate` | Object | Interest rate configuration (fixed or rule-based)                  | Refer to the Interest rate configuration section |
| `fixedIofRate` | Number | Fixed IOF rate (%)—Brazilian tax applied once on first installment | `0.38`                                           |
| `dailyIofRate` | Number | Daily IOF rate (%)—Brazilian tax applied per day (max 365 days)    | `0.0082`                                         |
| `fixed`        | Number | Fixed amount to be charged                                         | `10.00`                                          |
| `percentage`   | Number | Percentage fee to be applied to the principal amount               | `2.5`                                            |
| `index`        | String | Calculation index (typically `"INSTALLMENT"`                       | `"INSTALLMENT"`                                  |
| `daysRange`    | Number | Days range for compound interest calculation (typically 30)        | `30`                                             |

## Interest rate configuration

The `interestRate` object supports fixed interest rates and rule-based interest rates.

**Fixed interest rate:**

```
{
  "type": "FIXED",
  "value": 12.0,
  "precedence": 0,
  "rules": null
}

```

**Rule-based interest rate:**

```
{
  "type": "RULE_BASED",
  "precedence": 0,
  "rules": [
    {
      "installments": { "from": 1, "to": 6 },
      "value": 10.0
    },
    {
      "installments": { "from": 7, "to": 12 },
      "value": 15.0
    }
  ]
}

```

### Processing codes

The `filters.processingCodes` array determines which transaction types trigger the `PRICE_TABLE` calculation. Common codes include:

* `"01"`—Domestic withdrawal
* `"013100"`—International withdrawal
* `"00"`—Purchase
* `"003100"`—International purchase

### Configuration notes

* If `interestRate.value` is `0` or `null`, the strategy uses interest-free calculation.
* IOF rates are specific to Brazilian operations (for other countries, set to `0`).
* `precedence` determines the order of fee application when multiple fees exist.
* `applyInto` specifies whether the fee applies to `PRINCIPAL_AMOUNT` or `CONTRACT_AMOUNT`.

# Configuration to postings mapping

This table shows how the configuration parameters map to the output postings generated by the `PRICE_TABLE` strategy.

<Table align={["left","left","left"]}>
  <thead>
    <tr>
      <th>
        Configuration\
        parameter
      </th>

      <th>
        Output\
        posting
      </th>

      <th>
        Relationship
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `interestRate`
      </td>

      <td>
        `interest_amount`
      </td>

      <td>
        The configured interest rate (fixed or rule-based) determines the interest charged per installment using a compound interest formula.
      </td>
    </tr>

    <tr>
      <td>
        `fixedIofRate`
      </td>

      <td>
        `fixed_iof_amount`
      </td>

      <td>
        This is applied once to the first installment only.

        For example: 0.38% = R3.80 on R1,000 principal
      </td>
    </tr>

    <tr>
      <td>
        `dailyIofRate`
      </td>

      <td>
        `daily_iof_amount`
      </td>

      <td>
        This is applied daily per accumulated days, calculated per installment.

        For example: 0.0082% × 30 days = R2.46 on R1,000
      </td>
    </tr>

    <tr>
      <td>
        `fixedIofRate` + `dailyIofRate`
      </td>

      <td>
        `iof_amount`
      </td>

      <td>
        This is the sum of `fixed_iof_amount `+ `daily_iof_amount` (first installment includes both, subsequent installments include only daily).
      </td>
    </tr>

    <tr>
      <td>
        `fixed` + `percentage`
      </td>

      <td>
        `feeAmount`\
        (calculated fees)
      </td>

      <td>
        This is the GREATER of fixed amount vs percentage of principal.

        For example: max(R10.00, 2.51, 000) = R$25.00
      </td>
    </tr>

    <tr>
      <td>
        (calculated)
      </td>

      <td>
        `amortization`
      </td>

      <td>
        This is the principal portion of each payment (PMT - interest), adjusted for IOF inclusion.
      </td>
    </tr>
  </tbody>
</Table>

### Example mapping

Configuration:

```
{
  "interestRate": { "value": 12.0 },
  "fixedIofRate": 0.38,
  "dailyIofRate": 0.0082,
  "fixed": 10.0,
  "percentage": 2.5
}

```

Transaction: R$1,000.00 principal, 3 installments

Output postings (Installment 1):

```
{
  "amortization": 328.50,
  "interest_amount": 10.00,
  "iof_amount": 6.26,
  "daily_iof_amount": 2.46,
  "fixed_iof_amount": 3.80
}

```

Calculated fees (overall transaction):

```
{
  "feeAmount": 25.00,
  "interestAmount": 30.00,
  "iofAmount": 14.72
}

```

**Key formulas**

| Output                            | Formula                                                         |
| :-------------------------------- | :-------------------------------------------------------------- |
| `feeAmount`                       | `max(fixed, principal × percentage / 100)`                      |
| `iof_amount` (1st installment)    | `fixed_iof_amount` + `daily_iof_amount`                         |
| `iof_amount` (other installments) | `daily_iof_amount` only                                         |
| fixed\_iof\_amount                | `newPrincipal` × `fixedIofRate` / 100                           |
| daily\_iof\_amount                | `amortization` × `dailyIofRate` / 100 × `accumulatedDays`       |
| interest\_amount                  | `remainingPrincipal` × ((1 + `interestRate`/100)^(days/30) - 1) |

# Calculation process

The PRICE\_TABLE strategy follows these steps to calculate installments.

**1—Days interval calculation**

* Calculates the number of days between each installment due date.
* Accumulates days for IOF calculation, capped at 365 days maximum.
* Each installment tracks:
  * `days`—Days from previous installment
  * `accumulatedDays`—Cumulative days (max 365)

**2—PMT (payment) calculation**

* Uses compound interest formula to calculate fixed payment amount.
* Formula: `PMT = principal × [r(1+r)^n] / [(1+r)^n - 1]`
* Where:
  * `r` = monthly interest rate
  * `n` = number of installments
  * Adjusted for effective interval based on month length

**3—Interest and amortization calculation**

* For each installment:
  * **Interest** = remaining principal × ((1 + rate/100)^(days/30) - 1)
  * **Amortization** = PMT - interest
  * Remaining principal = previous remaining principal - amortization
* First installment uses actual days to first due date.
* Subsequent installments use effective month length (28-31 days).

**4—IOF adjustment (principal recalculation)**

* Recalculates principal to include IOF in amortization.
* **Fixed IOF**—Applied once (typically 0.38%).
* **Daily IOF**—Applied per accumulated day (typically 0.0082% per day, max 365 days).
* New principal accounts for both fixed and daily IOF.

**5—IOF amount calculation**

* **Daily IOF per installment** = `amortization` × (`dailyIof`/100) × `accumulatedDays`
* **Fixed IOF** = `newPrincipal` × (`fixedIof`/100) - added only to first installment

**6—Negative interest redistribution**

* If last installment has negative interest (due to rounding), redistributes it to previous installments.
* Redistribution ensures all interest amounts are non-negative.

**7—Fee calculation**

* **Fixed Fee**—Applied as defined.
* **Percentage Fee**—Applied as percentage of amount.
* Uses GREATER strategy (max of fixed or percentage).

# Output - postings generated

The PRICE\_TABLE strategy generates a `postings` map for each installment with the following fields:

| Posting key        | Description                                  | Calculation                                                      |
| :----------------- | :------------------------------------------- | :--------------------------------------------------------------- |
| `amortization`     | Portion of payment reducing the principal    | PMT - interest (adjusted for IOF)                                |
| `interest_amount`  | Interest charged on this installment         | Remaining principal × compound interest formula                  |
| `iof_amount`       | Total IOF for this installment               | `daily_iof_amount `+ `fixed_iof_amount` (first installment only) |
| `daily_iof_amount` | Daily IOF component                          | `amortization` × (`dailyIof`/100) × `accumulatedDays`            |
| `fixed_iof_amount` | Fixed IOF component (first installment only) | `newPrincipal` × (`fixedIof`/100)                                |

**Example posting output**

```
postings: [
    amortization: 95.45,
    interest_amount: 4.55,
    iof_amount: 0.87,        // 0.38 (fixed) + 0.49 (daily) for installment 1
    daily_iof_amount: 0.49,
    fixed_iof_amount: 0.38
]

```

Note: The transactions domain consumes these `postings` keys (in snake\_case) and converts them to camelCase for transaction generation.

# Default transaction mappings

The following table shows the default transaction types generated by the transactions domain when processing `PRICE_TABLE` postings. These mappings are automatically applied based on processing codes and posting keys.

<Callout icon="📘" theme="info">
  Any transaction flow different from this table must be created manually by the client.
</Callout>

| Process                        | Amount type    | Processing code |
| :----------------------------- | :------------- | :-------------- |
| INTERNATIONAL IOF              | iofAmount      | 003100          |
| INTERNATIONAL IOF CANC         | iofAmount      | 003101          |
| WITHDRAWAL FEE                 | feeAmount      | 01              |
| WITHDRAWAL CHARGES             | interestAmount | 01              |
| WITHDRAWAL TAXES               | iofAmount      | 01              |
| WITHDRAWAL TAXES REVERSAL      | iofAmount      | 0101            |
| WITHDRAWAL FEE REVERSAL        | feeAmount      | 0101            |
| WITHDRAWAL CHARGES REVERSAL    | interestAmount | 0101            |
| WITHDRAWAL FEE                 | feeAmount      | 013100          |
| INTERNATIONAL IOF              | iofAmount      | 013100          |
| INTER WITHDRAWAL FEE REV       | feeAmount      | 013101          |
| INTERNATIONAL IOF CANC         | iofAmount      | 013101          |
| WITHDRAWAL TAXES               | iofAmount      | 013200          |
| WITHDRAWAL CHARGES             | interestAmount | 013200          |
| WITHDRAWAL TAXES REVERSAL      | iofAmount      | 013201          |
| WITHDRAWAL CHARGES REVERSAL    | interestAmount | 013201          |
| WITHDRAWAL FEE REVERSAL        | feeAmount      | 013201          |
| INSTALLMENT WITHDRAWAL FEE     | feeAmount      | PSM018          |
| INSTALLMENT WITHDRAWAL CHARGES | interestAmount | PSM018          |
| INSTALLMENT WITHDRAWAL TAXES   | iofAmount      | PSM018          |
| REV INSTALLMENT WDWL TAXES     | iofAmount      | PSM019          |
| REV INSTALLMENT WDWL FEE       | feeAmount      | PSM019          |
| REV INSTALLMENT WDWL CHARGES   | interestAmount | PSM019          |

# Interest-free scenario

When `interestRate` is `0` or `null`, the strategy uses the `InterestFreeCalculator` and the following conditions apply:

* Divides the amount equally across all installments
* No interest calculation
* No IOF recalculation (fixed and daily IOF remain 0)
* Only fees are applied (fixed/percentage)
* Postings will have:
  * `amortization`: `amount` / `installmentsNumber`
  * `interest_amount`: `0`
  * `iof_amount`: `0`
  * `daily_iof_amount`: `0`
  * `fixed_iof_amount`: `0`

<br />