Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/at6132/econ/llms.txt

Use this file to discover all available pages before exploring further.

Contracts are the connective tissue of Realm’s economy. A spot trade is a one-time exchange; a contract is a multi-step agreement that creates obligations, moves money and goods on a schedule, and records your track record for everyone to see. Real economies run on long-term contracts, not instant trades — and Realm is built to reflect that. Every contract in Realm is a template plus parameters enforced by the engine. You don’t write contract logic from scratch; you parameterize one of four engine-native templates and the engine handles execution, escrow, and breach detection automatically.
A proposed contract is not binding until accepted. The accepting party should review all terms before accepting — once accepted, the contract is active and the engine will enforce it. There is no undo.

Supply contracts

A supply contract commits a supplier to deliver a specified quantity of material to a buyer by a deadline, in exchange for a payment. It’s the most common contract type, used for everything from ongoing raw material procurement to one-off commissioned deliveries. Parameters:
  • supplier — party delivering the goods
  • buyer — party receiving the goods
  • material — material ID to deliver
  • qty — quantity to deliver
  • total_price_cents — payment on delivery
  • due_in_ticks — deadline expressed as ticks from now
  • buyer_deposit_cents (optional) — moved from buyer to contract escrow on acceptance; released to supplier on fulfillment; returned to buyer on breach
  • liquidated_damages_cents (optional) — on breach, the engine seizes up to this amount from the supplier’s account and transfers it to the buyer
1

Propose

The supplier calls /contracts/supply/propose with all terms. The contract is created in proposed status. The buyer has not yet committed.
curl -X POST "http://localhost:8000/contracts/supply/propose?supplier=supplier-party-id&buyer=buyer-party-id&material=clay&qty=500&total_price_cents=27500&due_in_ticks=30&buyer_deposit_cents=5000&liquidated_damages_cents=10000"
Response includes contract_id and deliver_by_tick — the absolute tick number by which delivery must occur.
2

Accept

The buyer reviews the terms and calls /contracts/supply/accept. If a buyer_deposit_cents was specified, that amount is transferred from buyer to contract escrow immediately.
curl -X POST "http://localhost:8000/contracts/supply/accept?buyer=buyer-party-id&contract_id=c-17"
The contract moves to active status. Both parties are now bound.
3

Fulfill

Before or on deliver_by_tick, the supplier calls /contracts/supply/fulfill. The engine checks that the supplier holds at least qty of the material and the buyer has sufficient cash, then executes atomically: goods transfer to the buyer, payment transfers to the supplier, deposit (if any) releases to the supplier. Both parties’ honored reputation count increments.
curl -X POST "http://localhost:8000/contracts/supply/fulfill?supplier=supplier-party-id&contract_id=c-17"
If the deadline passes without fulfillment, the engine automatically marks the contract breached on the next tick: the deposit (if any) returns to the buyer, liquidated damages (if any) are seized from the supplier, and the supplier receives a breach event in their reputation record.

Loan contracts

A loan contract transfers principal from lender to borrower immediately on acceptance, and obligates the borrower to repay a larger amount by a specified deadline. The difference between principal_cents and repay_cents is your interest. Parameters:
  • lender — party providing capital
  • borrower — party receiving capital
  • principal_cents — amount transferred to borrower on acceptance
  • repay_cents — amount borrower must repay (must be ≥ principal_cents)
  • due_in_ticks — repayment deadline from acceptance
1

Propose

The lender proposes terms. The borrower hasn’t committed yet.
curl -X POST "http://localhost:8000/contracts/loan/propose?lender=lender-party-id&borrower=borrower-party-id&principal_cents=500000&repay_cents=550000&due_in_ticks=60"
2

Accept

The borrower accepts. The engine immediately transfers principal_cents from lender to borrower. The due_tick is calculated as the current tick plus due_in_ticks.
curl -X POST "http://localhost:8000/contracts/loan/accept?borrower=borrower-party-id&contract_id=c-18"
Response includes due_tick.
3

Repay

Before or on due_tick, the borrower calls /contracts/loan/repay. The engine transfers repay_cents from borrower to lender and marks the loan repaid. Both parties get an honored increment.
curl -X POST "http://localhost:8000/contracts/loan/repay?borrower=borrower-party-id&contract_id=c-18"
If due_tick passes with no repayment, the engine attempts automatic settlement: if the borrower has enough cash, it’s seized and the loan marks repaid with an honored event for both parties. If the borrower doesn’t have enough, whatever cash exists is seized, the loan marks breached, and the borrower receives a breach on their reputation record.

Equity contracts

An equity contract is a fixed-schedule cash-flow agreement: an investor provides upfront capital, and the issuer pays dividends per tick for a set number of ticks. It models equity-style investments without requiring percentage ownership tracking. Parameters:
  • issuer — party receiving the investment and paying dividends
  • investor — party providing capital and receiving dividends
  • investment_cents — upfront amount transferred from investor to issuer on acceptance
  • dividend_per_tick_cents — amount paid from issuer to investor each tick
  • dividend_ticks — total number of dividend payments
1

Propose

The issuer proposes the investment terms.
curl -X POST "http://localhost:8000/contracts/equity/propose?issuer=issuer-party-id&investor=investor-party-id&investment_cents=200000&dividend_per_tick_cents=3000&dividend_ticks=90"
In this example: investor provides 2,000upfront,issuerpays2,000 upfront, issuer pays 30/tick for 90 ticks (2,700total).Theinvestorreceives2,700 total). The investor receives 700 profit if the issuer doesn’t breach.
2

Accept

The investor accepts. The investment_cents transfers from investor to issuer immediately.
curl -X POST "http://localhost:8000/contracts/equity/accept?investor=investor-party-id&contract_id=c-19"
3

Dividends pay out automatically

Each tick, the engine checks active equity contracts and transfers dividend_per_tick_cents from issuer to investor. No manual action required from either party.If the issuer doesn’t have enough cash to pay the full dividend on any tick, the contract marks breached: whatever cash is available is transferred as a partial payment, the issuer gets a breach on their record, and no further dividends are paid.When dividends_remaining reaches zero, the contract marks completed and both parties receive an honored increment.

Service subscriptions

A service subscription prepays a provider for access to a service for a defined duration. Payment transfers on acceptance; the subscription expires automatically at expires_tick. Parameters:
  • provider — party delivering the service
  • subscriber — party consuming the service and paying the fee
  • fee_cents — total fee paid upfront on acceptance
  • duration_ticks — subscription length
1

Propose

The provider proposes the subscription.
curl -X POST "http://localhost:8000/contracts/service/propose?provider=saas-provider-party-id&subscriber=subscriber-party-id&fee_cents=1500&duration_ticks=30"
2

Accept

The subscriber accepts. fee_cents transfers immediately from subscriber to provider. The subscription activates and expires_tick is set.
curl -X POST "http://localhost:8000/contracts/service/accept?subscriber=subscriber-party-id&contract_id=c-20"
Response includes expires_tick.
3

Subscription runs until expiry

The contract is active from acceptance until expires_tick. The engine sets it to expired automatically when that tick passes. No breach mechanism applies to service subscriptions — payment was prepaid upfront.The subscriber can check whether their subscription is still active by querying their contract list and checking status.

Breach and reputation

When any party fails to fulfill their obligations under a contract, the engine records a breach event against them. Breach events:
  • Increment the breaching party’s breached count in the public reputation record
  • Trigger any penalty clauses in the contract (deposit forfeiture, liquidated damages)
  • Are permanent — they cannot be removed from the record
Contract history is public. Every party’s honored and breached counts are visible to any other player. Defaulting on contracts follows your account permanently. Other players and AI agents use this data when deciding whether to trade with you, extend you credit, or accept your contract proposals.
Reputation accumulates from both directions: each fulfilled contract adds an honored event for all parties involved, and each successful spot trade on the order book or via P2P adds an honored event too. Building a strong reputation is a long-term asset that unlocks better terms from counterparties — including the named AI rivals.

Markets and trading

How spot trades on the order book also build your reputation.

Building a business

See how each business archetype relies on specific contract types.

AI agents

Margaux and Kingfisher both propose contracts — how to evaluate their offers.

Engine API reference

Full parameter documentation for all contract endpoints.

Build docs developers (and LLMs) love