Class LiveSourceRequest

java.lang.Object
com.qtsurfer.api.client.model.LiveSourceRequest

@Generated(value="org.openapitools.codegen.languages.JavaClientCodegen", comments="Generator version: 7.24.0") public class LiveSourceRequest extends Object
One market feed to start a live run on. Exactly one entry per run today. It is `LiveSource` as you ask for it: the only difference is that `instruments` can be left out.
  • Field Details

  • Constructor Details

    • LiveSourceRequest

      public LiveSourceRequest()
  • Method Details

    • venueType

      public LiveSourceRequest venueType(@Nonnull LiveSourceRequest.VenueTypeEnum venueType)
    • getVenueType

      @Nonnull public LiveSourceRequest.VenueTypeEnum getVenueType()
      Venue category. `cex` is a centralized exchange and `dex` is one pool on a decentralized exchange, which takes its own `exchange`, `segment`, `type` and `instruments` (see \"Sources\" in the Live execution guide). `cx` and `dx`, the spellings used before, are still read as `cex` and `dex`; the run always reports the new ones.
      Returns:
      venueType
    • setVenueType

      public void setVenueType(@Nonnull LiveSourceRequest.VenueTypeEnum venueType)
    • exchange

      public LiveSourceRequest exchange(@Nonnull String exchange)
    • getExchange

      @Nonnull public String getExchange()
      The exchange id, as `GET /exchanges` lists it. For a `dex` source, the chain the pool is on; `robinhood` is the only one today.
      Returns:
      exchange
    • setExchange

      public void setExchange(@Nonnull String exchange)
    • segment

      public LiveSourceRequest segment(@Nonnull String segment)
    • getSegment

      @Nonnull public String getSegment()
      The segment, as `GET /exchanges` lists it for that exchange, among its `liveSegments` (a segment with no live data is refused with `400`). For a `cex` source, the market segment (`spot` today); for a `dex` source, the protocol of the pool, `uniswap-v3` the only one today.
      Returns:
      segment
    • setSegment

      public void setSegment(@Nonnull String segment)
    • type

      public LiveSourceRequest type(@Nonnull LiveSourceRequest.TypeEnum type)
    • getType

      @Nonnull public LiveSourceRequest.TypeEnum getType()
      Both `ticker` and `kline` connect to the lightest (fastest) cadence available for the exchange — today, 1 tick/second on every supported exchange. Choosing a specific cadence is not offered yet. A `dex` source supports only `kline`: one candle per second of the pool's trades.
      Returns:
      type
    • setType

      public void setType(@Nonnull LiveSourceRequest.TypeEnum type)
    • instruments

      public LiveSourceRequest instruments(@Nullable List<String> instruments)
    • addInstrumentsItem

      public LiveSourceRequest addInstrumentsItem(String instrumentsItem)
    • getInstruments

      @Nullable public List<String> getInstruments()
      Which instruments the run reads. A QTScript strategy can declare which instruments it accepts with an `instruments` line in its source. When the compilation of the strategy records that selection as a list of pairs, leaving `instruments` out, or sending `[\"*\"]`, takes that list; otherwise the run reads every instrument the exchange/segment offers. A list of instruments is taken as sent, and `[]` and `null` are refused with `400`. An entry is written `BASE/QUOTE`; either side can be `*` to mean any: any base can be paired with USDT, and BTC can be paired with any quote. Entries are not case-sensitive and spaces around them are ignored, so `btc/usdt` and `BTC/USDT` are the same instrument. An entry that is not of that form (no `/`, an empty side, a `.` or a space inside a side, or a `*` mixed with other characters of a side) makes the run fail when it starts. Plan limits: a list with an entry that has a `*` on a side counts like `[\"*\"]` and only plans that include the wildcard accept it; the other entries are counted one by one. The instruments the run actually reads come back in the run's `sources`. A `dex` source needs exactly one entry, the address of its pool (`0x` and 40 hexadecimal digits, not case-sensitive): it cannot be left out and `*` is not accepted.
      Returns:
      instruments
    • setInstruments

      public void setInstruments(@Nullable List<String> instruments)
    • equals

      public boolean equals(Object o)
      Return true if this LiveSourceRequest object is equal to o.
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toUrlQueryString

      public String toUrlQueryString()
      Convert the instance into URL query string.
      Returns:
      URL query string
    • toUrlQueryString

      public String toUrlQueryString(String prefix)
      Convert the instance into URL query string.
      Parameters:
      prefix - prefix of the query string
      Returns:
      URL query string