public static string ToDeribitString(this OrderbookDepth depth) { switch (depth) { case OrderbookDepth._1: return("1"); case OrderbookDepth._10: return("10"); case OrderbookDepth._20: return("20"); default: throw new Exception(); } }
// https://docs.deribit.com/v2/#book-instrument_name-group-depth-interval public static string book(string instrument, OrderbookGrouping group, OrderbookDepth depth, Interval interval) { return $"book.{group}.{instrument}.{group.ToDeribitString()}" + $".{depth.ToDeribitString()}.{interval.ToDeribitString()}"; }