Skip to content

Commit

Permalink
Apply Code Formatter Change
Browse files Browse the repository at this point in the history
  • Loading branch information
aoki-h-jp authored and github-actions[bot] committed Sep 3, 2023
1 parent 41c01d0 commit a0818b5
Show file tree
Hide file tree
Showing 9 changed files with 230 additions and 143 deletions.
5 changes: 2 additions & 3 deletions examples/fetch_funding_rate.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
"""
from funding_rate_arbitrage.frarb import FundingRateArbitrage


if __name__ == '__main__':
if __name__ == "__main__":
# fetch from binance
fr = FundingRateArbitrage()
print(fr.fetch_all_funding_rate(exchange='binance'))
print(fr.fetch_all_funding_rate(exchange="binance"))
3 changes: 1 addition & 2 deletions examples/fetch_funding_rate_all_exchanges.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
"""
from funding_rate_arbitrage.frarb import FundingRateArbitrage


if __name__ == '__main__':
if __name__ == "__main__":
# fetch from all exchanges
fr = FundingRateArbitrage()
for ex in fr.get_exchanges():
Expand Down
5 changes: 2 additions & 3 deletions examples/fetch_funding_rate_history.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
"""
from funding_rate_arbitrage.frarb import FundingRateArbitrage


if __name__ == '__main__':
if __name__ == "__main__":
# fetch from binance
fr = FundingRateArbitrage()
# figure funding rate history
fr.figure_funding_rate_history(exchange='binance', symbol='BTC/USDT:USDT')
fr.figure_funding_rate_history(exchange="binance", symbol="BTC/USDT:USDT")
19 changes: 11 additions & 8 deletions examples/get_commission.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,20 @@
"""
from funding_rate_arbitrage.frarb import FundingRateArbitrage


if __name__ == '__main__':
if __name__ == "__main__":
fr = FundingRateArbitrage()
# binance futures maker commission with BNB
print('binance futures maker commission with BNB')
print(fr.get_commission(exchange='binance', trade='futures', taker=False, by_token=True))
print("binance futures maker commission with BNB")
print(
fr.get_commission(
exchange="binance", trade="futures", taker=False, by_token=True
)
)

# bybit spot taker commission
print('bybit spot taker commission')
print(fr.get_commission(exchange='bybit', trade='spot'))
print("bybit spot taker commission")
print(fr.get_commission(exchange="bybit", trade="spot"))

# OKX spot maker commission
print('OKX spot maker commission')
print(fr.get_commission(exchange='okx', trade='spot', taker=False))
print("OKX spot maker commission")
print(fr.get_commission(exchange="okx", trade="spot", taker=False))
3 changes: 1 addition & 2 deletions examples/get_large_divergence_multi_exchange.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
"""
from funding_rate_arbitrage.frarb import FundingRateArbitrage


if __name__ == '__main__':
if __name__ == "__main__":
fr = FundingRateArbitrage()
# Display Top 5 large funding rate divergence between multi exchange.
# print(fr.display_large_divergence_multi_exchange(display_num=5, sorted_by='divergence'))
Expand Down
17 changes: 11 additions & 6 deletions examples/get_large_divergence_single_exchange.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,22 @@
"""
from funding_rate_arbitrage.frarb import FundingRateArbitrage


if __name__ == '__main__':
if __name__ == "__main__":
fr = FundingRateArbitrage()
# Display Top 5 large funding rate divergence on binance.
print(fr.display_large_divergence_single_exchange(exchange='binance', display_num=5))
print(
fr.display_large_divergence_single_exchange(exchange="binance", display_num=5)
)

# Display Top 5 large funding rate divergence on bybit (minus FR).
print(fr.display_large_divergence_single_exchange(exchange='bybit', display_num=5, minus=True))
print(
fr.display_large_divergence_single_exchange(
exchange="bybit", display_num=5, minus=True
)
)

# Display Top 5 large funding rate divergence on binance one by one.
fr.display_one_by_one_single_exchange(exchange='binance', display_num=5)
fr.display_one_by_one_single_exchange(exchange="binance", display_num=5)

# Display Top 5 large funding rate divergence on bybit one by one (minus FR).
fr.display_one_by_one_single_exchange(exchange='bybit', display_num=5, minus=True)
fr.display_one_by_one_single_exchange(exchange="bybit", display_num=5, minus=True)
2 changes: 1 addition & 1 deletion funding_rate_arbitrage/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""
Funding Rate Arbitrage: A trading strategy that takes advantage of the difference in funding rates between perpetual swaps.
"""
import funding_rate_arbitrage.frarb
import funding_rate_arbitrage.frarb
Loading

0 comments on commit a0818b5

Please sign in to comment.