---
referrals: 3
kind: program
payer: domain:acme.example
code: acme_listing
category: ai_native
status: open
at: 2026-10-30T00:00:00Z
net_of: tax, marketplace_fee
---
# Acme agent marketplace listing

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

In plain words: a marketplace that lists this product earns a flat 3.00 per install, plus 7% of net payments for 12 months. If a listing and a recommendation both reached the customer, the listing counts and the recommendation does not.

Change first: `payer`, `code`, both amounts and the order in `precedence`.

## Rules

### install_fee

- on: install
- basis: flat
- amount: 3.00
- asset: USD
- once_per: customer

### revenue_share

- on: payment
- basis: percent
- rate: 7%
- of: net
- recurring.months: 12

## Attribution

- model: last_touch
- window_days: 30
- allowed_kinds: marketplace_listing, recommendation
- precedence: [["marketplace_listing"],["recommendation"]]
- token.signed: signed

## Settlement

- holdback_days: 30
- clawback_days: 60
- cycle: monthly
- payout_asset: USD
- rails: ach

## Example

Made-up lines. A customer finds the product in a listing, and an agent also recommends it. Both tokens reach the install. The listing wins by precedence, and the customer stays with it for the first payment. Signatures use the public test key in `/vectors.json`, so they say nothing.

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

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

```jsonl
{"type":"agreement","code":"market","partner":"domain:market.example","partner_role":"marketplace"}
{"type":"agreement","code":"agent_one","partner":"domain:agentone.example"}
{"type":"event","at":"2026-11-07T10:00:00Z","kind":"install","source":"marketplace:inst_801","customer":"cu_3c4d5e6f7a81b2c3","tokens":["rf1.acme_listing.market.l3v8p.to2rs0.dhl.h.ZWEgFWqbG4M6x7HysQHQ1w","rf1.acme_listing.agent_one.r4w9q.to4jo0.dar.h.2ZzLGeMMjIdNfWCIdBbN8w"]}
{"type":"event","at":"2026-12-01T10:00:00Z","kind":"payment","source":"marketplace:pay_802","customer":"cu_3c4d5e6f7a81b2c3","amount":"220.00","net":"200.00","asset":"USD","deductions":[{"kind":"marketplace_fee","amount":"20.00"}]}
```

## Worked result

Computed by `run_ledger` as of 2027-02-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 |
|---|---|---|---|---|
| install, 2026-11-07 | market | Flat 3.00 | 3.00 |  |
| install, 2026-11-07 | agent_one | A touch of a higher-precedence kind qualified. | 0.00 | X13 |
| payment, 2026-12-01 | market | 7% of 200.00 | 14.00 |  |
| payment, 2026-12-01 | agent_one | This customer is locked to other touches. | 0.00 | X15 |

| Payee | Asset | Earned | Reversed | Net | Held | Payable |
|---|---|---|---|---|---|---|
| market | USD | 17.00 | 0.00 | 17.00 | 0.00 | 17.00 |


## Why these settings

`precedence` writes down who wins when a listing and a recommendation overlap, which is a conflict the payer would otherwise settle by hand each time.
