market.gno
0.79 Kb · 19 lines
1package lastcall
2
3// Market hours. US equities don't trade 24/7, and a stock can gap over a weekend
4// or overnight while the quote stands still. The updater pushes the real market
5// status each cycle. While it is closed, new perps and limit fills are held to
6// closedMaxLeverage (risk.gno), so a gap at the open hits smaller positions.
7// Closing, stops, liquidations and spot work as usual so no one is trapped.
8
9var marketOpen = true
10
11// SetMarketOpen is pushed by the off-chain updater (bot) from the live market state.
12func SetMarketOpen(cur realm, open bool) {
13 assertUpdater(cur)
14 marketOpen = open
15}
16
17// IsMarketOpen reports whether the stock market is open, as last pushed by the
18// updater. While it is false the leverage cap is closedMaxLeverage.
19func IsMarketOpen() bool { return marketOpen }