Skip to main content

Module file

Module file 

Source
Expand description

The watchlist file: <scope home>/watchlists/<name>.yaml.

name: stablecoins
interval: 30s
duration: 1h          # optional; absent or `forever` = until stopped
outputs:
  csv: ./watch.csv
  report: ./watch.md
targets:
  - kind: pair
    id: USDC
    venue: binance    # or a list: [binance, weex]
    preset: market health
    health:
      max_spread_pct: 0.5
  - kind: token
    id: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"
    chain: ethereum
    rules:
      - holders >= 1000
      - liquidity_usd > 1000000

parse and to_text are the only functions that touch the YAML crate (#47, N7). parse reports every error with its line, not only the first.

Structs§

FileError
One problem in a watchlist file.
FileErrors
Every problem in a watchlist file, one per line of the message.

Constants§

EXTENSION
The file extension of a watchlist.

Functions§

list
The watchlist names in dir, sorted. A missing folder has none.
load
Reads the watchlist at path. A file with no name: takes its stem.
parse
Parses a watchlist file’s text. default_name names a file with no name:. With venues, a venue must be one of them.
path_in
The file of the watchlist name in dir.
save
Writes w to path, creating its folder.
to_text
The file text of w. parse reads it back equal.