Skip to main content

Module watch

Module watch 

Source
Expand description

§Watchlists

A watchlist is a saved set of targets (tokens, pairs, addresses), each with rules on the metrics of crate::metrics, plus the interval, the duration and the output files of a run. It is the “saved metric set” of #47 and the output of the TUI’s monitor wizard.

This module is pure: types, rule evaluation (rule), the “market health” preset (preset), snapshot comparison (diff), the memory between ticks (history) and the file format (file). The fetchers that read the metrics live in scope-cli.

Re-exports§

pub use diff::Event;
pub use diff::diff;
pub use history::History;
pub use history::Reading;
pub use history::Readings;
pub use rule::Op;
pub use rule::Rule;
pub use rule::RuleStatus;
pub use rule::TargetStatus;
pub use rule::target_status;

Modules§

diff
Events between two snapshots: a breach or a warning that starts or ends.
file
The watchlist file: <scope home>/watchlists/<name>.yaml.
history
What a run remembers from one tick to the next, for the metrics that compare a tick with the one before (MetricId::since_last_tick).
preset
The “market health” preset: the checks of market summary, as they are.
rule
Rules (metric op value) and their evaluation.
time
Intervals and durations, shared by market summary --every and watchlists, so both read 30s the same way and have the same defaults (#47, Q7).

Structs§

Cell
One cell of a target’s row: a preset check or a rule.
Outputs
Where a run writes its record.
Snapshot
Every target’s state after one tick, in watchlist order.
Target
One thing a watchlist watches.
TargetSnapshot
One target’s state after a tick.
Watchlist
A saved watchlist.

Enums§

Preset
A named set of rules a target can use instead of writing them out.
TargetKind
What a target is.