Concepts

Markets

A market is a run of one to ten epochs with its own tick and cap. Orders are made and taken until it starts.

What a market sets#

FieldMeaning
EpochsFrom start_epoch through end_epoch, at most ten. Each epoch is one leg of every swap in the market.
TickFixed rates are whole multiples of the tick. With a 1,000 ppb tick, rates move in steps of 0.0001%.
CapThe highest crest the market settles at, and the highest fixed rate it accepts.

Every market settles against the same index.

Three phases#

  • Taking orders, until start_epoch begins. Orders can be placed, taken and cancelled.
  • Running, from start_epoch through end_epoch. Nothing new can be placed or taken. Positions settle one epoch at a time as checkpoints become final. An order that was never taken can only be cancelled.
  • Matured, after end_epoch. Positions close as their last epoch settles, then pay out.

The app groups markets the same way and shows how long is left before a market stops taking orders.

Timing is in epochs#

A market's start and end are epochs, not dates. On mainnet an epoch is 432,000 slots, about two days, so a ten-epoch market runs about twenty days. The app's top bar shows the live epoch and the time left in it, measured from recent slot times.

Who creates markets#

Crest's administrator key creates markets. The program accepts a market only if it starts in a future epoch, runs one to ten epochs, and has a cap that is a whole number of ticks and within the rate ceiling.