Commit Graph

6392 Commits

Author SHA1 Message Date
matstedt bfd758d353 krakenfutures: recompute average and cost from fills for terminal orders 2026-03-22 19:07:19 +01:00
matstedt c533e48310 refactor: remove funding_fee_candle_limit override
Kraken Futures now provides 1 year of hourly funding rate history.
The previous limit of 700 candles (29 days) was a workaround for
limited API retention. Freqtrade paginates funding rate fetches
automatically, so the CCXT default (2000) works correctly.
2026-03-22 19:07:19 +01:00
matstedt a1e9b6bea8 fix: compute average price from trades and enrich fees for Kraken Futures
Kraken Futures' /orders/status returns limitPrice (not fill price) and
/fills omits fee amounts (only fillType). This adds:

- _adjust_krakenfutures_order: fetches trades for closed/filled orders
  with average=None and computes VWAP average price.
- get_trades_for_order override: enriches trades with calculated fees
  from the market's maker/taker fee schedule.

Tests: 7 new tests covering VWAP computation, fee enrichment with
maker/taker rates, and preservation of existing values.
2026-03-22 19:07:19 +01:00
matstedt 0dfd7324bd fix: extract triggerPrice from priceTriggerOptions for stoploss orders
CCXT's krakenfutures parse_order misses triggerPrice when the
/orders/status endpoint nests it inside priceTriggerOptions.
Override _order_contracts_to_amount to populate triggerPrice and
stopPrice from info.order.priceTriggerOptions.triggerPrice.
2026-03-22 19:07:19 +01:00
Matthias 3c4b07ce46 test: update krakenfutures_tests for usage of __name__ 2026-03-22 19:07:19 +01:00
Matthias 027ac3d66c test: simplify longrun tests 2026-03-22 19:07:19 +01:00
matstedt 8c1674b415 fix(tests): use CandleType.FUTURES in test_ohlcv_limit_futures
The futures_only ternary incorrectly used CandleType.SPOT for exchanges
that support both spot and futures (binance, gate), causing candle limit
mismatch against candle_count_futures.
2026-03-22 19:07:19 +01:00
matstedt eaa35d7b47 style: ruff format 2026-03-22 19:07:19 +01:00
matstedt 0dc26584cc krakenfutures: add funding_fee_candle_limit for limited history
Kraken Futures retains only ~29 days of hourly funding rate history.
Set funding_fee_candle_limit to 700 so ohlcv_candle_limit returns the
correct cap for CandleType.FUNDING_RATE instead of the general OHLCV
limit.
2026-03-22 19:07:19 +01:00
matstedt cb2e50abcf fix(tests): restore exchange_params return in get_futures_exchange 2026-03-22 19:07:19 +01:00
matstedt f0aedc8d23 test(krakenfutures): align tests with simplified stoploss handling
- Add test for stoploss_query_requires_stop_flag in _ft_has.
- Replace _fix_trigger_order_id tests with base class integration tests
  (verify stop=True is passed by fetch_stoploss_order/cancel_stoploss_order).
- Add tests for stop param flow: passed to history endpoints, stripped
  from open orders query.
- Remove obsolete cancel_stoploss_order/fetch_stoploss_order override tests.
2026-03-22 19:07:19 +01:00
Matthias 83c2ca5a90 test: krakenfutures has no websockets at the moment 2026-03-22 19:07:19 +01:00
Matthias b190079aa8 test: Simplify live test setup 2026-03-22 19:07:19 +01:00
matstedt bfbae5d040 fix(krakenfutures): re-introduce improved stoploss lookup for trigger orders 2026-03-22 19:07:19 +01:00
matstedt f81e335b27 krakenfutures: simplify order/balance handling and harden error mapping 2026-03-22 19:07:05 +01:00
matstedt 756f178ec3 exchange_utils: use ccxt exchange.has directly in capability checks 2026-03-22 19:07:05 +01:00
Matthias 712fd8ac14 chore: import formatting 2026-03-22 19:07:05 +01:00
matstedt 1c77bd6f5d krakenfutures: improve fetch_order fallback 2026-03-22 19:07:05 +01:00
Matthias 1d0bcbe234 test: remove no longer necessary test 2026-03-22 19:07:05 +01:00
matstedt a8d7a72cec tests: drop unused krakenfutures spot leverage flag 2026-03-22 19:07:04 +01:00
matstedt 6ed470884b krakenfutures: backfill leverage tier notionals 2026-03-22 19:07:04 +01:00
matstedt 0cab0e8ac5 fix(tests): use myokx for non-futures list-exchanges check 2026-03-22 19:07:04 +01:00
matstedt 9ddf464c03 fix(exchange): drop unused get_ft_has override plumbing 2026-03-22 19:07:04 +01:00
matstedt 06abc95b2e test: fix contradictory sorting by ruff and isort 7 2026-03-22 19:07:04 +01:00
matstedt b4daabe491 test: re-organize imports 2026-03-22 19:07:04 +01:00
matstedt e5a23f5afd test: fix import order in exchange utils test 2026-03-22 19:07:04 +01:00
matstedt 7ee4338b1f tests: increase coverage - krakenfutures edge paths and ft_has overrides 2026-03-22 19:07:04 +01:00
matstedt 3f6e7ca4c1 tests: cover krakenfutures currency sum and funding fees 2026-03-22 19:07:04 +01:00
matstedt 1345cfdbee exchange: fallback to canceled orders for krakenfutures fetch_order; add tests 2026-03-22 19:07:04 +01:00
matstedt f2780c7c68 exchange: drop ccxt workarounds; keep closed-order fallback 2026-03-22 19:07:04 +01:00
matstedt 1254bd5bab tests: align krakenfutures ohlcv limit check 2026-03-22 19:07:04 +01:00
matstedt 5af4147eb3 tests: adjust list-exchanges futures assertions for krakenfutures 2026-03-22 19:07:04 +01:00
matstedt ca9d4ed026 tests: fix _exchange_has_helper input in exchange_utils test 2026-03-22 19:07:04 +01:00
matstedt 2ed3db330a krakenfutures: use fetch_order_emulated with history fallback 2026-03-22 19:07:04 +01:00
matstedt 38d197b3bf krakenfutures: rely on ft_has stoploss params, update tests/docs 2026-03-22 19:07:04 +01:00
matstedt 5752e52b0f tests: update krakenfutures tests for get_ft_has removal and InvalidOrderException 2026-03-22 19:07:04 +01:00
matstedt 60f71bbc2b tests: re-enable hyperliquid spot online tests 2026-03-22 19:07:04 +01:00
matstedt ea5ae9627d style: ruff format 2026-03-22 19:07:04 +01:00
matstedt 6fdeab2747 krakenfutures: align class name with resolver titlecase and remove unnecessary alias 2026-03-22 19:07:04 +01:00
matstedt 04ec24e737 krakenfutures: move ohlcv cap to _ft_has and support futures-only online tests 2026-03-22 19:07:04 +01:00
matstedt 2f7e77a41e test(exchange): add Kraken Futures exchange tests 2026-03-22 19:07:04 +01:00
Matthias cebbb40c99 test: remove testing for time_in_ratio 2026-03-21 14:09:49 +01:00
Matthias cbeae975f0 test: simplify funding fee test 2026-03-21 14:08:20 +01:00
Matthias bbb1fecb02 test: enhanced fetch_order_fallback test 2026-03-21 09:32:28 +01:00
Matthias b7c89a72fa feat: enhance orders_emulate to include canceled orders 2026-03-21 09:19:27 +01:00
Stefano f2b930079b fix cagr on zero or negative values 2026-03-16 12:38:39 +09:00
Matthias fcecbe780b test: Re-write test-data with proper decimals 2026-03-14 16:40:04 +01:00
Matthias be00f2c26f test: update mock for price_to_precision 2026-03-14 15:54:18 +01:00
Matthias 70fe211a8b Merge pull request #12927 from stash86/main-stash
number_assets in RemotePairlist becomes optional
2026-03-13 06:31:43 +01:00
Matthias 4a9a630765 test: add test for new sysinfo behavior 2026-03-13 06:29:14 +01:00