---
referrals: 3
kind: program
payer: domain:vendor.example
code: vendor_oem
category: enterprise
status: open
at: 2026-10-30T00:00:00Z
net_of: tax
crit: floors
---
# Example vendor OEM royalty

Rates, amounts and names in this file are placeholders, not recommendations or market rates. Each party sets its own terms.

In plain words: an OEM partner earns a 7% royalty on net payments, with a minimum of 5,000.00 per quarter. If the royalty for a quarter falls short, a top-up makes up the difference. Nobody types the top-up in: it is computed.

Change first: `payer`, `code`, the rate, the minimum and the period. Start the agreement on the first day of a quarter, since periods start at its `starts`.

## Rules

### royalty

- on: payment
- basis: percent
- rate: 7%
- of: net

## Attribution

- model: last_touch
- requires_agreement: true
- allowed_kinds: contract_clause
- window_months_by_kind.contract_clause: 24

## Settlement

- holdback_days: 30
- clawback_days: 60
- cycle: quarterly
- payout_asset: USD
- rails: wire

## Floors

| id | amount | asset | period | against | recoup |
|---|---|---|---|---|---|
| quarter_min | 5000.00 | USD | quarter | ["royalty"] | none |

## Example

Made-up lines. The first quarter earns 2,100.00 in royalty, so the minimum adds 2,900.00. The second earns 7,000.00, above the minimum, so it adds nothing. The third quarter has not ended by the date below. The token stands for the clause in the signed contract.

To run it, save this file as `REFERRALS.md` and these lines as `referrals.jsonl`, then run `node referrals.mjs run REFERRALS.md referrals.jsonl --as-of 2027-07-15T00:00:00Z`.

As of: 2027-07-15T00:00:00Z

```jsonl
{"type":"agreement","code":"oem","partner":"domain:oem.example","at":"2027-01-01T00:00:00Z","starts":"2027-01-01T00:00:00Z"}
{"type":"event","at":"2027-02-15T00:00:00Z","kind":"payment","source":"billing:inv_q1","account":"acct_oem_1","amount":"30000.00","net":"30000.00","asset":"USD","token":"rf1.vendor_oem.oem.clause1.tqxpc0.dhu.n.-"}
{"type":"event","at":"2027-05-15T00:00:00Z","kind":"payment","source":"billing:inv_q2","account":"acct_oem_1","amount":"100000.00","net":"100000.00","asset":"USD","token":"rf1.vendor_oem.oem.clause1.tqxpc0.dhu.n.-"}
```

## Worked result

Computed by `run_ledger` as of 2027-07-15T00:00:00Z, on the made-up lines above. Computed amounts are arithmetic on the records and terms you sent. They do not say what anyone owes. Your contract decides that.

| Event | Who | Working | Computed | Note |
|---|---|---|---|---|
| payment, 2027-02-15 | oem | 7% of 30000.00 | 2100.00 |  |
| payment, 2027-05-15 | oem | 7% of 100000.00 | 7000.00 |  |
| end of period | oem | Top-up for quarter_min, period from 2027-01-01 | 2900.00 |  |

| Payee | Asset | Earned | True-ups | Reversed | Net | Held | Payable |
|---|---|---|---|---|---|---|---|
| oem | USD | 9100.00 | 2900.00 | 0.00 | 12000.00 | 0.00 | 12000.00 |


## Why these settings

A computed floor stays right when a late sale lands in a closed quarter, where a typed adjustment would pay the top-up and the royalty both.
