Update Token Price History query in Fee allocator
Closed this issue · 3 comments
Xeonus commented
Certain queries are deprecated and it is not clear how long they are still supported.
Following queries are known to be "deprecated":
BAL_GQL_QUERY = """
query {{
tokenGetPriceChartData(address:"{token_addr}", range: NINETY_DAY)
{{
id
price
timestamp
}}
}}
"""
Tritium-VLK commented
Also take a look at the protocol_fee_allocator for historical prices.
Tritium-VLK commented
@Xeonus can you please provide an example of a new query/method to do this?
Thanks
Xeonus commented
Example of new Query layout:
query getTokenPrice{tokenGetHistoricalPrices(addresses:["0xed65c5085a18fa160af0313e60dcc7905e944dc7"], range: NINETY_DAY, chain: ARBITRUM)
{
prices {
price
timestamp
}
}
}
To refactor the above mentioned query, do something like this:
BAL_GQL_QUERY = """
query {{
tokenGetHistoricalPrices(addresses:"{token_address_array}", range: NINETY_DAY, chain: "{chain_id}" )
{{
prices {{
price
timestamp
}}
}}
}}
"""