Skip to content

Commit

Permalink
Merge pull request #4923 from bigscoop/bybit-tickers
Browse files Browse the repository at this point in the history
[bybit] Optimize getting of tickers
  • Loading branch information
timmolter authored Aug 16, 2024
2 parents f8855e5 + 07964a7 commit 2908701
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import org.knowm.xchange.bybit.BybitAdapters;
import org.knowm.xchange.bybit.BybitExchange;
import org.knowm.xchange.bybit.dto.BybitCategory;
Expand Down Expand Up @@ -65,11 +64,19 @@ public Ticker getTicker(CurrencyPair currencyPair, Object... args) throws IOExce

@Override
public List<Ticker> getTickers(Params params) throws IOException {
if (!(params instanceof BybitCategory)) {
// get category
BybitCategory category;
if (params == null) {
category = BybitCategory.SPOT;
}
else if (!(params instanceof BybitCategory)) {
throw new IllegalArgumentException("Params must be instance of BybitCategory");
}
BybitCategory category = (BybitCategory) params;
if (category.equals(BybitCategory.OPTION)) {
else {
category = (BybitCategory) params;
}

if (category == BybitCategory.OPTION) {
throw new NotYetImplementedForExchangeException("category OPTION not yet implemented");
}
BybitResult<BybitTickers<BybitTicker>> response = getTickers(category);
Expand Down
4 changes: 2 additions & 2 deletions xchange-bybit/src/test/resources/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


<!-- Define logging for organization applications only -->
<logger name="org.knowm.xchange" level="DEBUG"/>
<logger name="si.mazi.rescu" level="TRACE"/>
<!-- <logger name="org.knowm.xchange" level="DEBUG"/>-->
<!-- <logger name="si.mazi.rescu" level="TRACE"/>-->

</configuration>

0 comments on commit 2908701

Please sign in to comment.