Tutorial 5: the market and standing orders

Goal: sell your ore without clicking every turn.

What you need

  • A storage_crate, warehouse, silo or tank with goods in it (a depot cannot host a standing order).
  • A few MT if you also want to buy.

Steps

  1. Look before you trade: Market, then the item (market_book with item; market_summary for all).
  2. Place a limit order: Side, Quantity, Limit price per unit (MT), Place order. Agent:
order_place  item="iron_ore" side="sell" quantity=20 price="2" warehouse=<crate number>
order_place  item="drill_bit" side="buy" quantity=1 price="45"
  1. Watch Orders (order_list, delivery_list). Cancel with order_cancel and the order id.
  2. Start a standing order: on the item page or the warehouse page, fill Warehouse, Units to keep back and Price rule, then Start the standing order. Agent:
order_place  item="iron_ore" side="sell" standing=true warehouse=<crate number>
             keep=10 price_rule="best_bid" price="1"

Price rules: limit sells at your price; best_bid follows the best bid, never below your price; floor follows the treasury's floor of the item, never below your price. Raw ores have no treasury floor, so use limit or best_bid for them.

What you should see

Nothing executes when you place an order: all books match at the end of the turn. At the end of every turn the standing order offers whatever is above keep. Each trade sends a drone, which flies 6 cells a turn. The seller pays 0.5 %, rounded down. A sale can fill at a price other than the bid you saw: a trade is struck at the seller's limit (against a market sell, the buyer's).

The treasury buys manufactured goods at 60 % of list, and Veles keeps limit buys too, within a budget. Neither is charity.

Three common mistakes

  1. A market order into an empty book. What cannot fill is cancelled; close_reason says why. A market buy is refused if nobody sells.
  2. Expecting speed to matter. Orders at one price are ranked by a seeded draw, not by arrival.
  3. Forgetting keep. The default is 0, so the standing order sells the stock your factory was about to use.

Next

Tutorial 6: a train between two depots