Title: | Access and Analyze Data from 'DeFiLlama' |
---|---|
Description: | Provides an interface to access and analyze data from 'DeFiLlama'<https://defillama.com>. This package simplifies the process of fetching and manipulating 'DeFiLlama' data for further analysis and visualization. |
Authors: | Alexey Ivanov [aut, cre, cph] |
Maintainer: | Alexey Ivanov <[email protected]> |
License: | MIT + file LICENSE |
Version: | 0.4.4 |
Built: | 2025-02-26 02:58:50 UTC |
Source: | https://github.com/alextwor/rllama |
Fetches historical TVL data for a specified Blockchain in USD. The data is returned as a table sorted by date.
get_defillama_chain_hist_tvl(name)
get_defillama_chain_hist_tvl(name)
name |
A string representing the unique name (name) of the protocol.
This name can be obtained from the result of the |
A 'data.table' object containing historical TVL data of the specified chain The table includes columns for date, TVL in USD. It is sorted by date.
# total tvl by date chain_tvl = get_defillama_chain_hist_tvl( "Ethereum" ) tail( chain_tvl )
# total tvl by date chain_tvl = get_defillama_chain_hist_tvl( "Ethereum" ) tail( chain_tvl )
This function retrieves TVL data for various chains from a specified API and formats it into a data.table for analysis.
get_defillama_chain_tvl()
get_defillama_chain_tvl()
A 'data.table' containing the TVL data with columns: name, symbol, tvl, gecko_id, cmcId, and chainId. The data is sorted by TVL in descending order.
chain_tvl = get_defillama_chain_tvl() head( chain_tvl )
chain_tvl = get_defillama_chain_tvl() head( chain_tvl )
Fetches historical TVL data for a specified DeFi protocol, including TVL in USD and token amount. The data is returned as a table sorted by date.
get_defillama_protocol_hist_tvl(slug, by_token = FALSE)
get_defillama_protocol_hist_tvl(slug, by_token = FALSE)
slug |
A string representing the unique name (slug) of the protocol.
This slug can be obtained from the result of the |
by_token |
A boolean indicating whether to include token-specific data. Defaults to FALSE. |
A 'data.table' object containing historical TVL data of the specified protocol. The table includes columns for date, TVL in USD. It is sorted by date.
# total tvl by date protocol_tvl = get_defillama_protocol_hist_tvl( "lido" ) tail( protocol_tvl ) # tvl by token protocol_tvl = get_defillama_protocol_hist_tvl( "lido", by_token = TRUE ) tail( protocol_tvl )
# total tvl by date protocol_tvl = get_defillama_protocol_hist_tvl( "lido" ) tail( protocol_tvl ) # tvl by token protocol_tvl = get_defillama_protocol_hist_tvl( "lido", by_token = TRUE ) tail( protocol_tvl )
This function retrieves Total Value Locked (TVL) data for various protocols from a specified API and formats it into a table for analysis.
get_defillama_protocol_tvl(is_cex_include = F)
get_defillama_protocol_tvl(is_cex_include = F)
is_cex_include |
Logical; if FALSE (default), data for CEX will be excluded from the results. Set to TRUE to include CEX data. |
A 'data.table' containing TVL data with columns: symbol, tvl, slug, name, chain, and category. The data is sorted by TVL in descending order.
protocol_tvl = get_defillama_protocol_tvl() head( protocol_tvl )
protocol_tvl = get_defillama_protocol_tvl() head( protocol_tvl )
Retrieves stablecoin data, including details like name, symbol, price, and market cap. The data is returned as a sorted table by market cap.
get_defillama_stablecoin_data()
get_defillama_stablecoin_data()
A 'data.table' with stablecoin information, sorted by market capitalization.
stablecoin_data = get_defillama_stablecoin_data() head( stablecoin_data )
stablecoin_data = get_defillama_stablecoin_data() head( stablecoin_data )
Retrieves stablecoin data, including details like name, symbol, price, and market cap. The data is returned as a sorted table.
get_defillama_stablecoin_hist_data(stablecoin_id)
get_defillama_stablecoin_hist_data(stablecoin_id)
stablecoin_id |
An integer representing the ID of the stablecoin. This ID can be obtained
from the result of the |
A 'data.table' object containing historical data of the specified stablecoin. The table is sorted by date.
stablecoin_hist_data = get_defillama_stablecoin_hist_data( 5 ) head( stablecoin_hist_data )
stablecoin_hist_data = get_defillama_stablecoin_hist_data( 5 ) head( stablecoin_hist_data )