oceanprotocol / pdr-backend

Instructions & code to run predictoors, traders, more.
Apache License 2.0
30 stars 22 forks source link

[YAML] Filter by feeds in publisher module #490

Closed calina-c closed 9 months ago

calina-c commented 9 months ago

Parent: [EPIC: YAML] Add YAML & CLI. "v0.2" of Predictoor #400

Background / motivation

In "Refine ppss.yaml for closer 1:1 mapping to bots" #451, the yaml file got reworked. The big change was: each module got its own "ss" module, with parameters specified via a sub-section of ppss.yaml. Then, most modules got their own way to specify feeds. Because modules earlier in the flow may have more feeds (eg ohlcv data factory), and modules later on may have fewer (eg predictoor).

Exception: one module isn't done yet: publisher. That's the goal of this issue.

Specifically, to specify to publisher what feeds to publish, we need to move from its status quo of hardcoded list of feeds, to a list of feeds specified in publisher_ss.

Details:

In ppss.yaml, there is already:

publisher_ss:
  sapphire-mainnet:
    fee_collector_address: 0x0000000000000000000000000000000000000000
  sapphire-testnet:
    fee_collector_address: 0x0000000000000000000000000000000000000000
  development:
    fee_collector_address: 0x0000000000000000000000000000000000000000

A feeds section needs to get added to that:

[publisher_ss:]
  feeds:
    - 5m binance BTC/USDT
#    - 1h binance BTC/USDT
#    - 5m binance BTC/USDT ETH/USDT BNB/USDT XRP/USDT ADA/USDT DOGE/USDT SOL/USDT LTC/USDT TRX/USDT DOT/USDT

Then, publisher module needs to read in publisher_ss.feeds, and choose what to publish based on that.

Publisher will not be doing subgraph queries from existing feeds. Rather, it is publishing new feeds.

Note that most module ss's inherit a base ss in order to get feeds functionality in a single line. We should be able to do the same thing here. Of course we still need to update publisher behavior, and add tests.

TODOs

trentmc commented 9 months ago

Done in PR https://github.com/oceanprotocol/pdr-backend/pull/533