---
referrals: 3
kind: program
payer: domain:acme.example
code: acme_retainer
category: bizdev
status: open
at: 2026-10-30T00:00:00Z
crit: floors
---
# Acme retainer and success fee

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

In plain words: a consultant gets a 2,000.00 retainer per month during its agreement, plus 7% of total contract value on any deal it brought. A deal that closes within 6 months after the agreement ends still counts.

Change first: `payer`, `code`, the retainer, the rate and the tail.

## Rules

### success_fee

- on: deal_won
- basis: percent
- rate: 7%
- of: tcv
- once_per: deal

## Attribution

- model: last_touch
- requires_agreement: true
- allowed_kinds: intro, co_sell
- window_days_by_kind.intro: 180
- window_days_by_kind.co_sell: 180

## Settlement

- holdback_days: 30
- clawback_days: 90
- cycle: monthly
- payout_asset: USD
- rails: ach
- tail_months: 6
- on_end: pay_all

## Floors

| id | amount | asset | period | against | recoup |
|---|---|---|---|---|---|
| monthly_retainer | 2000.00 | USD | month | [] | none |

## Example

Made-up lines. The agreement runs January to March, so three retainers. A deal the consultant introduced in February is won in May, inside the tail.

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-08-01T00:00:00Z`.

As of: 2027-08-01T00:00:00Z

```jsonl
{"type":"agreement","code":"consultant","partner":"domain:consultant.example","partner_role":"consultancy","at":"2027-01-01T00:00:00Z","starts":"2027-01-01T00:00:00Z","ends":"2027-04-01T00:00:00Z"}
{"type":"event","at":"2027-05-15T00:00:00Z","kind":"deal_won","source":"crm:won_c1","deal":"opp_c1","asset":"USD","contract":{"tcv":"100000.00"},"token":"rf1.acme_retainer.consultant.intro1.tsj400.dhb.n.-"}
```

## Worked result

Computed by `run_ledger` as of 2027-08-01T00: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 |
|---|---|---|---|---|
| deal_won, 2027-05-15 | consultant | 7% of 100000.00 | 7000.00 |  |
| end of period | consultant | Top-up for monthly_retainer, period from 2027-01-01 | 2000.00 |  |
| end of period | consultant | Top-up for monthly_retainer, period from 2027-02-01 | 2000.00 |  |
| end of period | consultant | Top-up for monthly_retainer, period from 2027-03-01 | 2000.00 |  |

| Payee | Asset | Earned | True-ups | Reversed | Net | Held | Payable |
|---|---|---|---|---|---|---|---|
| consultant | USD | 7000.00 | 6000.00 | 0.00 | 13000.00 | 0.00 | 13000.00 |


## Why these settings

A floor with `against: []` is a plain retainer the engine computes from the agreement's dates, and `tail_months` answers the usual question of what happens to a deal closing just after the end.
