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.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.
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 goodsbuyer— party receiving the goodsmaterial— material ID to deliverqty— quantity to delivertotal_price_cents— payment on deliverydue_in_ticks— deadline expressed as ticks from nowbuyer_deposit_cents(optional) — moved from buyer to contract escrow on acceptance; released to supplier on fulfillment; returned to buyer on breachliquidated_damages_cents(optional) — on breach, the engine seizes up to this amount from the supplier’s account and transfers it to the buyer
Propose
The supplier calls Response includes
/contracts/supply/propose with all terms. The contract is created in proposed status. The buyer has not yet committed.contract_id and deliver_by_tick — the absolute tick number by which delivery must occur.Accept
The buyer reviews the terms and calls The contract moves to
/contracts/supply/accept. If a buyer_deposit_cents was specified, that amount is transferred from buyer to contract escrow immediately.active status. Both parties are now bound.Fulfill
Before or on If the deadline passes without fulfillment, the engine automatically marks the contract
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.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 betweenprincipal_cents and repay_cents is your interest.
Parameters:
lender— party providing capitalborrower— party receiving capitalprincipal_cents— amount transferred to borrower on acceptancerepay_cents— amount borrower must repay (must be ≥principal_cents)due_in_ticks— repayment deadline from acceptance
Accept
The borrower accepts. The engine immediately transfers Response includes
principal_cents from lender to borrower. The due_tick is calculated as the current tick plus due_in_ticks.due_tick.Repay
Before or on If
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.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 dividendsinvestor— party providing capital and receiving dividendsinvestment_cents— upfront amount transferred from investor to issuer on acceptancedividend_per_tick_cents— amount paid from issuer to investor each tickdividend_ticks— total number of dividend payments
Propose
The issuer proposes the investment terms.In this example: investor provides 30/tick for 90 ticks (700 profit if the issuer doesn’t breach.
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 atexpires_tick.
Parameters:
provider— party delivering the servicesubscriber— party consuming the service and paying the feefee_cents— total fee paid upfront on acceptanceduration_ticks— subscription length
Accept
The subscriber accepts. Response includes
fee_cents transfers immediately from subscriber to provider. The subscription activates and expires_tick is set.expires_tick.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
breachedcount 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.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.