Exemplo n.º 1
0
        public static string ToDeribitString(this OrderbookGrouping group)
        {
            switch (group)
            {
            case OrderbookGrouping._none:
                return("none");

            case OrderbookGrouping._1:
                return("1");

            case OrderbookGrouping._2:
                return("2");

            case OrderbookGrouping._5:
                return("5");

            case OrderbookGrouping._10:
                return("10");

            case OrderbookGrouping._25:
                return("25");

            case OrderbookGrouping._100:
                return("100");

            case OrderbookGrouping._250:
                return("250");

            default:
                throw new Exception();
            }
        }
Exemplo n.º 2
0
 // 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()}";
 }