Skip to content

Support TWAP at the Airnode feed side #48

@bbenligiray

Description

@bbenligiray

Users frequently request us to provide a kind of data that we only have access to in raw form, with TWAP applied. If we could specify in the pusher config that the signed data for a Beacon requires 15 minutes TWAP to be applied for example, we would be able to serve a wider variety of data. Two problems:

  • This will increase the memory requirements significantly. If this appears to be a problem in practice (which I doubt), we can approximate TWAP through a running cumulative average as in
avg(t + 1) = avg(t) * ((twap_window - fetch_interval) / twap_window) + x(t) * (fetch_interval / twap_window)
  • The existing implementation (of the signed API and pusher) is agnostic about the data schema, while a TWAP would assume a single number. We can say that if a TWAP window is defined, the data needs to be decodable to an int256.

@bdrhn9 for visibility because we discussed implementing this at the Nodary API-side yesterday (but if we implement this here we can generalize it to other API providers as well)

Metadata

Metadata

Assignees

No one assigned

    Labels

    on holdWe do not plan to address this at the moment

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions