Buckets:
AnonymousSpottedToad/human_verified_bucket / codebase /python /freqtrade_freqtrade /tests /leverage /test_interest.py
| import pytest | |
| from freqtrade.exceptions import OperationalException | |
| from freqtrade.leverage import interest | |
| from freqtrade.util import FtPrecise | |
| ten_mins = FtPrecise(1 / 6) | |
| five_hours = FtPrecise(5.0) | |
| twentyfive_hours = FtPrecise(25.0) | |
| def test_interest(exchange, interest_rate, hours, expected): | |
| borrowed = FtPrecise(60.0) | |
| assert ( | |
| pytest.approx( | |
| float( | |
| interest( | |
| exchange_name=exchange, | |
| borrowed=borrowed, | |
| rate=FtPrecise(interest_rate), | |
| hours=hours, | |
| ) | |
| ) | |
| ) | |
| == expected | |
| ) | |
| def test_interest_exception(): | |
| with pytest.raises(OperationalException, match=r"Leverage not available on .* with freqtrade"): | |
| interest( | |
| exchange_name="bitmex", borrowed=FtPrecise(60.0), rate=FtPrecise(0.0005), hours=ten_mins | |
| ) | |
Xet Storage Details
- Size:
- 1.41 kB
- Xet hash:
- 9af7720a7ee5abbef3ac1eae5b97c3e8e9f15c4ec7b2f77182edd3fba8944917
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.