Trading
Players can trade resources with each other through direct offers or the open market. Trading requires a Market building (level >= 1) in the offering and accepting towns, and both towns must be placed on the map.
Overview
- Market required: Both parties must have a Market building (level >= 1) in a town placed on the map to create or accept trade offers.
- Offered resources are locked in escrow when a trade is created. The escrow, minus the realm’s trade fee, is delivered to the acceptor — or refunded to you on cancellation or decline. The fee is the price of posting; it is never returned. The fee is charged on both sides: the acceptor pays the same fee on the resources it sends, so the offerer is delivered the request minus the fee. See Transaction Fee.
- Order slots: a town may hold as many pending offers at once as its Market level grants —
trade_order_slots_per_levelin the building catalog,[1, 2, …, 10]on the shipped realms (Evony’s “each level allows one more concurrent transaction”). See Order slots. - Transaction cap: no single resource amount on either side of an offer may exceed the realm’s
trade_max_amount— 10,000,000 on the shipped realms, Evony’s “maximum transaction size at the marketplace”. - Trade caravans travel in real time: After acceptance, resources travel between towns. Travel time is based on distance.
- Open market: Omit
target_player_id(or set it to null) for any player to accept. Or target a specific player for a direct offer. - Bilateral offers are the market, permanently. Restfall’s Marketplace is this immediate offer/accept flow — any bundle of resources for any other, matched by a player choosing to accept it. There is no bid/ask order book; see Why not an order book for the reasoning and what the Evony rulebook does and does not pin down.
Create a Trade Offer
POST /api/v1/trades/
Offered resources are immediately deducted from your town and held in escrow. Your town is settled first: what it has produced since it was last settled, its food upkeep, its tax and its heroes’ salary are banked up to that moment, and the escrow comes out of that balance. So a town sitting at its storage cap pays out of the capped amount — the overflow it already lost does not come back afterwards — and gold your heroes are owed in salary is spent on salary, not available to offer: an offer that would need it is refused as insufficient resources.
import httpx
response = httpx.post( "http://localhost:8731/api/v1/trades/", headers={"Authorization": "Bearer your-token-here"}, json={ "offering_town_id": "your-town-uuid", "offered_resources": {"wood": 200}, "requested_resources": {"stone": 100}, "target_player_id": None, # null = open market offer },)print(response.json())curl -X POST http://localhost:8731/api/v1/trades/ \ -H "Authorization: Bearer your-token-here" \ -H "Content-Type: application/json" \ -d '{"offering_town_id": "town-uuid", "offered_resources": {"wood": 200}, "requested_resources": {"stone": 100}}'const response = await fetch("http://localhost:8731/api/v1/trades/", { method: "POST", headers: { "Authorization": "Bearer your-token-here", "Content-Type": "application/json", }, body: JSON.stringify({ offering_town_id: "town-uuid", offered_resources: { wood: 200 }, requested_resources: { stone: 100 }, target_player_id: null, }),});Response 201 Created:
{ "id": "trade-uuid", "season_id": "season-uuid", "offering_player_id": "player-uuid", "offering_town_id": "town-uuid", "target_player_id": null, "offered_resources": {"wood": 200}, "requested_resources": {"stone": 100}, "offered_after_fee": {"wood": 190}, "requested_after_fee": {"stone": 95}, "status": "pending", "accepted_player_id": null, "accepted_town_id": null, "accepted_at": null, "arrives_at": null, "resources_delivered": false, "created_at": "2026-03-25T00:00:00Z", "departed_at": null, "origin": {"x": 10, "y": 12}, "target": null}origin is the offering town’s map position; target is the accepting town’s position and departed_at mirrors accepted_at — both are null while the offer is pending. offered_after_fee is offered_resources with the realm’s fee taken off (here a 5% realm): it is exactly what the acceptor will be delivered, and exactly what a cancel or decline refunds to you. Every trade response carries it. requested_after_fee is requested_resources with the same fee taken off: it is exactly what you will be delivered once the acceptor has paid the whole request.
Resource amounts must be positive integers, no larger than the realm’s trade_max_amount, and a resource type cannot appear in both offered_resources and requested_resources on the same offer.
Errors:
400— Missing Market building, town not placed on the map, insufficient resources, unknown resource type, self-directed offer, a resource type listed in bothoffered_resourcesandrequested_resources, an amount abovetrade_max_amount(“A trade may move at most 10000000 of any one resource.”), or every one of the town’s order slots already holding a pending offer (“This town’s Market is full: it allows 2 pending offer(s) at once. Cancel one, wait for one to be accepted, or upgrade the Market.”).404— Town not found or target player not found in this season.422— A resource amount is zero or negative, oroffered_resources/requested_resourcesis empty.
Order slots
Each Market level grants its town one more order slot — the building catalog’s trade_order_slots_per_level, [1, 2, …, 10] on the shipped realms, published per town as trade_order_slots on game state (0 without a completed Market). A slot is occupied by a pending offer from that town and by nothing else:
- an offer that was accepted frees its slot the moment the caravan departs (the transaction is done; the caravan is delivery, not a listing), and so does one that was cancelled or declined;
- accepting someone else’s offer never takes a slot — the accepting town only needs a Market;
- slots are per town: a full Market in one town never blocks your other towns.
When every slot holds a pending offer, POST /api/v1/trades/ answers 400 with the message above; cancel an offer, wait for one to be taken, or upgrade the Market. The slot count is the town’s best completed Market (max across instances, never the sum), the same rule as the Town Hall’s valley cap.
Restfall offers are bundles — one offer may list several resources on each side — so a level-1 Market with one slot can still put all four resources up at once, where Evony needed one transaction per resource. That is a deliberate convenience, not a divergence in the slot rule.
Browse Open Trade Offers
GET /api/v1/trades/market/
Lists all pending offers in the season that are available to you (open market + directed at you), excluding your own. The response uses the standard pagination envelope { "count", "limit", "offset", "results" }, where results holds the trade offers (each in the shape shown above) and count is the total number available to you. Supports limit and offset query parameters (limit defaults to 50, max 200; offset defaults to 0).
offers = httpx.get( "http://localhost:8731/api/v1/trades/market/", headers={"Authorization": "Bearer your-token-here"},).json()curl http://localhost:8731/api/v1/trades/market/ \ -H "Authorization: Bearer your-token-here"const offers = await fetch("http://localhost:8731/api/v1/trades/market/", { headers: { "Authorization": "Bearer your-token-here" },}).then(r => r.json());Accept a Trade Offer
POST /api/v1/trades/{trade_id}/accept/
Requested resources are deducted immediately, from your town’s balance as of that moment: like an escrow, the payment settles your accepting town first, so it pays out of what the town holds now (capped, with its heroes’ salary charged). A caravan departs — resources arrive after travel time. You pay the whole requested amount, and the fee comes out of what the offerer is delivered (requested_after_fee); the fee on what you receive is the offerer’s, taken from the offer (offered_after_fee). Each side pays the fee on what it sends, so your balance only needs to cover the requested amount.
httpx.post( f"http://localhost:8731/api/v1/trades/{trade_id}/accept/", headers={"Authorization": "Bearer your-token-here"}, json={"accepting_town_id": "your-town-uuid"},)curl -X POST http://localhost:8731/api/v1/trades/{trade_id}/accept/ \ -H "Authorization: Bearer your-token-here" \ -H "Content-Type: application/json" \ -d '{"accepting_town_id": "your-town-uuid"}'await fetch(`http://localhost:8731/api/v1/trades/${tradeId}/accept/`, { method: "POST", headers: { "Authorization": "Bearer your-token-here", "Content-Type": "application/json", }, body: JSON.stringify({ accepting_town_id: "your-town-uuid" }),});Errors:
400— Offer not pending, accepting own offer, insufficient resources, missing Market building, or a town (yours or the offerer’s) not placed on the map.403— Offer directed at a different player.404— Trade or town not found.
Cancel a Trade Offer
POST /api/v1/trades/{trade_id}/cancel/
Only the offerer can cancel. Only pending offers can be cancelled. The escrow minus the realm’s trade fee (offered_after_fee) is refunded immediately — the fee was paid when the offer was posted and is never returned, so cancelling and re-listing pays it twice. Returns 204 No Content.
Decline a Trade Offer
POST /api/v1/trades/{trade_id}/decline/
Only the target player (for directed offers) can decline. The escrow minus the trade fee (offered_after_fee) is refunded to the offerer — a declined listing costs its poster the same fee as a cancelled one. Returns 204 No Content.
View Your Trades
GET /api/v1/trades/
Lists all trades where you are the offerer, acceptor, or target, newest first. The response uses the standard pagination envelope { "count", "limit", "offset", "results" }, where results holds the trades (each in the shape shown above) and count is the total number you are involved in. Supports limit and offset query parameters (limit defaults to 50, max 200; offset defaults to 0). Caravan deliveries happen automatically on the server within a few seconds of arrival — no polling required.
Trade Caravan Travel
Travel time between two towns starts as ceil(Euclidean distance) seconds (speed = 1 tile/second for caravans), with a minimum of 1 second. At time_scale 1.0 that raw value is the actual duration.
A Relief Station can speed the caravan up. A caravan is a transport, one of the two kinds of march the building covers (the other is support), so its travel time is divided by the multiplier — 2× at level 1, up to 6× at level 10 — under two conditions:
- The Relief Station is in the offering town. The caravan departs from there when the offer is accepted, and the bonus is always read from the sending town, never the destination.
- The two towns belong to the same player or to allied players (a fellow member of the offering player’s alliance, or a member of an alliance with an accepted ALLY relation to it). A trade with a neutral partner — the common case — travels at the plain baseline.
The multiplier is applied before the realm’s time_scale, exactly as it is for marches. At other scales it is divided by the realm’s time_scale and floored at the resolver tick — the same rule that governs attack and scout marches, including the same short-distance collapse (see Return-trip timing for the exact formula). Resources are not accessible during transit — check status and arrives_at to know when they land.
{ "status": "in_transit", "arrives_at": "2026-03-25T06:00:00Z", "resources_delivered": false}Once arrives_at has passed, the server delivers the resources automatically within a few seconds — the trade’s status becomes completed and resources_delivered flips to true. Other possible status values are pending, cancelled, and declined.
A delivery settles both towns first. Before the caravan’s resources land, the accepting and the offering town are each settled up to that moment, at the stock they held while the caravan was on the road: their production, food upkeep, tax and heroes’ salary are banked, and a garrison that ran out of food deserts over that window as it would have anyway. So food on its way does not feed a starving garrison before it arrives, and what a caravan delivers counts from the moment it lands.
The Merchant Fleet item lands a caravan now. Using one
(trade_instant) against an in-transit, undelivered trade sets its
arrives_at to the present moment; the ordinary delivery then happens on the
server’s next tick, seconds later. Either party to the trade may spend it —
both are waiting on the same caravan — and it takes exactly one item per
caravan. It does not deliver the resources itself, so the fee, the caps and
everything else about the delivery are unchanged.
A trade you accepted is safe even if the offering player deletes their player while the caravan is still in transit: the delivery resolves normally and the trade stays in your history — its offering_player_id just becomes null. Only their still-pending offers disappear with them.
An offer you sent directly to a player who deletes their player before answering it is cancelled for you, exactly as a cancel would: the escrow minus the trade fee (offered_after_fee) comes back to your offering town and the offer’s status becomes cancelled. It is never left pending with no target, which would make it an open offer anyone could accept.
Transaction Fee
The fee is configured per realm in YAML (trade_fee_percent, 5% on the shipped free and fast realms). It is a posting fee: the offered resources go into escrow in full when you post, and the fee comes out of that escrow whichever way the offer ends — delivered to the acceptor after the fee, or refunded to you after the fee on cancel or decline. Every trade response shows the result as offered_after_fee.
The fee is charged on both sides: each party pays it on what it sends. The acceptor’s payment is the whole requested amount, deducted when it accepts; the offerer is delivered that amount after the fee, shown on every trade as requested_after_fee. A cancel or decline never touches the requested side, because the acceptor has paid nothing yet.
Example: With a 10% fee, offering 100 wood means the acceptor receives floor(100 × 0.90) = 90 wood — and cancelling instead refunds the same 90. If the offer asks for 200 stone, the acceptor pays 200 stone when it accepts and the offerer is delivered floor(200 × 0.90) = 180 stone. Round trip, with both sides: you post 100 wood for 200 stone, they take it; you end up 100 wood down and 180 stone up, they end up 200 stone down and 90 wood up.
This closes the gift trick: a directed offer that gives away a fortune for next to nothing — 10,000,000 of a resource for 1 of another, or the reverse — loses the fee on the fortune whichever side sends it. At 5%, moving 10,000,000 costs 500,000.
If an amount floors to zero after the fee, that resource is dropped from the delivery (or the refund) entirely: 1 wood at 10% is all fee.
Evony’s own rulebook says a fee exists and that “fees applied will not be returned” when the market is used as a bank, but never prints the rate; the percentage is therefore realm configuration rather than a corpus number.
The market as a bank
Because escrowed resources are out of your town’s wallet, they cannot be plundered: posting an offer nobody will take — say 500,000 stone for 10,000,000 gold — parks the stone beyond an attacker’s reach (and, while it sits there, outside your storage cap; the refund lands like any other income and overflow is discarded) until you cancel. This is the classic Evony “bank”, and it works here on the same terms: it costs the posting fee every time, and it costs order slots. Evony additionally punished a listing made just before an attack landed (the attacker still took those resources); Restfall does not model that — escrow is escrow from the moment the offer posts.
Why not an order book
The Evony Marketplace was a per-server bid/ask book priced in gold: sellers listed a resource at a gold price, buyers bid, an order “listed above market value” sat unsold while one at or below it was taken by the next bidder, and trades happened “without transporters” — instantly. Restfall keeps its immediate bilateral offers instead, permanently, for two reasons:
- The rulebook does not pin the book down. It gives the slot count per level and the 10,000,000 cap (both adopted above), says a fee exists and is kept on cancel (adopted), but never states the fee rate, the execution price when a bid crosses an ask, partial fills, or what the “deadening tax” on overpriced listings was. An order book built on guesses would carry false precision.
- Bilateral bundles are strictly more expressive. Any resource for any other, several at once, directed at one player or open to all — the order book is a special case (one resource for gold) with a matching engine on top.
The Market rules the corpus does state — slots per level, the transaction cap, the posting fee, cancellation refunding the escrow minus the fee — are all enforced on the bilateral flow. Should an order book ever land, it would sit beside these endpoints, not replace them.