Periodically runs Raxol.Payments.RebalanceAdvisor against the solver's live
balances and the SettlementLedger drain, emitting recommendations (via the
advisor's telemetry + logs). Recommend-only: raxol cannot move the solver wallet;
the Riddler auto-rebalancer executes.
A GenServer scheduled with Process.send_after/3 (the codebase's periodic-task
idiom). The gather+advise step is exposed as advise_once/1 so the on-demand mix
task shares the exact code path.
Phase 1 covers native gas-refuel recommendations (native balances only). USDC and
other-asset inventory rebalancing arrive with the multi-asset ChainReader
ERC-20 read.
Options
:ledger-- theSettlementLedgerserver. Required.:reader-- aChainReader.reader. Required.:solver_address-- the solver wallet to read balances for. Required.:policy-- aRebalancePolicy(defaultRebalancePolicy.default/0).:chains-- chains to sweep (default the six supported EVM chains).:interval_ms-- sweep period (default 5 min).:initial_delay_ms-- delay before the first sweep (default:interval_ms).:price_fn--native_symbol -> Decimal | nilfor sizing conversions.
Summary
Functions
Run one gather+advise cycle without a running process -- the shared core used by
the periodic sweep and the on-demand mix task. Takes the same keys as
start_link/1 (:ledger, :reader, :solver_address, :policy, :chains,
:price_fn).
Returns a specification to start this module under a supervisor.
Trigger a sweep immediately and return the recommendation list.
Functions
@spec advise_once(keyword()) :: [Raxol.Payments.RebalanceAdvisor.recommendation()]
Run one gather+advise cycle without a running process -- the shared core used by
the periodic sweep and the on-demand mix task. Takes the same keys as
start_link/1 (:ledger, :reader, :solver_address, :policy, :chains,
:price_fn).
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec start_link(keyword()) :: GenServer.on_start()
@spec sweep_now(GenServer.server()) :: [ Raxol.Payments.RebalanceAdvisor.recommendation() ]
Trigger a sweep immediately and return the recommendation list.