@soft dome @subtle haven Hey I've been looking at the paralkink project which is a data ingress solution built on polkadot. It allows for access to user defined data feeds. I think this could be a useful utility that could be leveraged by INJ to allow for users to create abstract derivatives of their choosing. They use a PQL language to define the request, example shown below:
{
"name": "Bitcoin Ticker",
"schema": {
"@price": "eth::uint256",
},
"sources": [
{
"method": "http.get",
"uri": "https://my-crypto-api.com/tickers",
"result": {
"parser": "json",
"query": "SELECT int(results.BTC.Price * 1e18) AS @price"
}
},
{
"method": "http.post",
"uri": "https://my-crypto-api.com/tickers",
"content_type": "application/json",
"args": {"foo": "bar"},
"result": {
"parser": "json",
"query": "SELECT int(x.Price * 1e18) AS @price \
FROM data.results AS x WHERE x.SYMBOL = 'BTC'"
}
}
],
"aggregate": {"@price": "mean"},
"validate": {
"min_treshold": 2,
"max_variance": 0.5,
},
"callback": {
"chain": "Ethereum",
"address": "0x123...f",
"method": "updatePrice(string,uint256)",
"args": ["BTC", "@price"],
},
"on_error": {}
}