MCPcopy Index your code
hub / github.com/ccxt/ccxt / fetchFundingRate

Method fetchFundingRate

java/lib/src/main/java/io/github/ccxt/Exchange.java:12637–12667  ·  view source on GitHub ↗
(Object symbol2, Object... optionalArgs)

Source from the content-addressed store, hash-verified

12635 }
12636
12637 public java.util.concurrent.CompletableFuture<Object> fetchFundingRate(Object symbol2, Object... optionalArgs)
12638 {
12639 final Object symbol3 = symbol2;
12640 return java.util.concurrent.CompletableFuture.supplyAsync(() -> {
12641 Object symbol = symbol3;
12642 Object parameters = Helpers.getArg(optionalArgs, 0, new java.util.HashMap<String, Object>() {{}});
12643 if (Helpers.isTrue(Helpers.GetValue(this.has, "fetchFundingRates")))
12644 {
12645 (this.loadMarkets()).join();
12646 Object market = this.market(symbol);
12647 symbol = Helpers.GetValue(market, "symbol");
12648 if (!Helpers.isTrue(Helpers.GetValue(market, "contract")))
12649 {
12650 throw new BadSymbol((String)Helpers.add(this.id, " fetchFundingRate() supports contract markets only")) ;
12651 }
12652 Object rates = (this.fetchFundingRates(new java.util.ArrayList<Object>(java.util.Arrays.asList(symbol)), parameters)).join();
12653 Object rate = this.safeValue(rates, symbol);
12654 if (Helpers.isTrue(Helpers.isEqual(rate, null)))
12655 {
12656 throw new NullResponse((String)Helpers.add(Helpers.add(this.id, " fetchFundingRate () returned no data for "), symbol)) ;
12657 } else
12658 {
12659 return rate;
12660 }
12661 } else
12662 {
12663 throw new NotSupported((String)Helpers.add(this.id, " fetchFundingRate () is not supported yet")) ;
12664 }
12665 });
12666
12667 }
12668
12669 public java.util.concurrent.CompletableFuture<Object> fetchFundingInterval(Object symbol2, Object... optionalArgs)
12670 {

Callers

nothing calls this directly

Calls 9

getArgMethod · 0.95
isTrueMethod · 0.95
GetValueMethod · 0.95
loadMarketsMethod · 0.95
marketMethod · 0.95
addMethod · 0.95
fetchFundingRatesMethod · 0.95
safeValueMethod · 0.95
isEqualMethod · 0.95

Tested by

no test coverage detected