Sessions and the calendar
Every pool points at a calendar account. The calendar is the only source of time rules the program has, so the program never needs a time zone.
What a calendar holds
A calendar covers one year and stores 366 sessions, one per day of the year. A session is either closed for the whole day or carries an open and a close time. Daylight saving is already baked in when the table is written, so the program compares plain unix seconds.
For the US market the table follows the NYSE schedule:
| Rule | Value |
|---|---|
| Regular session | 9:30 to 16:00 New York time |
| Early close | 13:00 New York time (for example November 27, 2026 and December 24, 2026) |
| Full holidays in 2026 | Jan 1, Jan 19, Feb 16, Apr 3, May 25, Jun 19, Jul 3, Sep 7, Nov 26, Dec 25 |
| Daylight time 2026 | open 13:30 UTC; from Nov 2, open 14:30 UTC |
Changing a calendar
A calendar is written in pages (WriteCalendar), then sealed (SealCalendar). After sealing, changes go through AmendCalendar, one day at a time, with notice:
| Change | Minimum notice |
|---|---|
| Adds trading time (a new session, an earlier open, a later close) | 7 days before the affected day |
| Only removes trading time (an emergency closure, an early close) | 1 hour |
| A freshly sealed year becomes usable | 7 days after sealing |
Removing trading time can come fast because closing more never makes a pool trade at a stale price.
The phase crank
Swaps and orders never read the calendar directly. Each pool caches the session it is in (previous close, next open, next close). CrankPhase refreshes that cache from the calendar and anyone can call it. If the cache may be out of date, the pool reads as stale and nothing trades until someone cranks.
The pool is always in one of these phases:
| Phase | When | What works |
|---|---|---|
| Open | between the bell and the close | swaps (fee easing from 0.60% to 0.25% over the first 30 minutes), deposits, withdrawals |
| Closed | between the close and the collection window | swaps at the rising closed hours fee, deposits, withdrawals |
| Collect | the 10 minutes before the bell | placing and cancelling cross orders only (no cancels in the last 2 minutes) |
| Due | the bell has rung, the cross has not run | RunCross only |
| Stale | the cache must be refreshed | CrankPhase only |
The next session is searched up to 14 days ahead. A longer gap leaves the pool closed at its peak fee until a crank finds the next session.
Errors you may see
| Error | Meaning |
|---|---|
PhaseStale | crank the pool before trading |
CrossInProgress | swaps and LP changes wait until the cross has run |
NotCollecting | orders can only be placed during the collection window |
NotDue | the bell has not rung yet |
NoticeTooShort | a calendar amendment did not give enough notice |
CalendarUnavailable | the next year's calendar is not sealed and usable yet |