Closed akan72 closed 2 years ago
/chains
Adding another method to the Defillama class to consume the output from the /chains API endpoint.
This will allow us to programmatically get the TVL and/or names of all protocols for a specific chain.
Sorting the results to ensure that they're returned consistently between runs.
get_chain_tvl_timeseries
When grabbing data from get_chain_tvl_timeseries() for certain chains, the global TVL data can come back empty (ran into this for OntologyEVM)
To fix this, check to see if the global TVL results are empty and return an empty pd.DataFrame before assigning column names.
New endpoint
Results before the check
Results after the check is added
get_chain_tvl_timeseries() works for all chains returned when calling the /chains endpoint on Defillama
get_chain_tvl_timeseries()
Summary
New
/chains
EndpointAdding another method to the Defillama class to consume the output from the /chains API endpoint.
This will allow us to programmatically get the TVL and/or names of all protocols for a specific chain.
Sorting the results to ensure that they're returned consistently between runs.
Empty Check for
get_chain_tvl_timeseries
When grabbing data from get_chain_tvl_timeseries() for certain chains, the global TVL data can come back empty (ran into this for OntologyEVM)
To fix this, check to see if the global TVL results are empty and return an empty pd.DataFrame before assigning column names.
Tests
New endpoint
Results before the check
Results after the check is added
get_chain_tvl_timeseries()
works for all chains returned when calling the/chains
endpoint on Defillama