Defillama¶
Defillama
¶
Defillama(api_key=None, **kwargs: Any)
Bases: API
Client to fetch Defillama data from DataMaxi+ API.
Parameters:
-
api_key
(str
, default:None
) –The DataMaxi+ API key
-
**kwargs
(Any
, default:{}
) –Keyword arguments used by
datamaxi.api.API
.
protocols
¶
protocols() -> List[str]
Get supported protocols
GET /api/v1/defillama/protocol
https://docs.datamaxiplus.com/rest/defillama/protocol
Returns:
-
List[str]
–List of supported protocols
chains
¶
chains() -> List[str]
Get supported chains
GET /api/v1/defillama/chain
https://docs.datamaxiplus.com/rest/defillama/chain
Returns:
-
List[str]
–List of supported chains
pools
¶
pools() -> List[str]
Get supported pools
GET /api/v1/defillama/pool
https://docs.datamaxiplus.com/rest/defillama/pool
Returns:
-
List[str]
–List of supported pools
stablecoins
¶
stablecoins() -> List[str]
Get supported stablecoins
GET /api/v1/defillama/stablecoin
https://docs.datamaxiplus.com/rest/defillama/stablecoin
Returns:
-
List[str]
–List of supported stablecoins
tvl
¶
tvl(
protocol: str = None,
chain: str = None,
pandas: bool = True,
) -> Union[List, pd.DataFrame]
Get total TVL across all chains and protocols
GET /api/v1/defillama/tvl
https://docs.datamaxiplus.com/rest/defillama/tvl
Parameters:
-
protocol
(str
, default:None
) –Protocol name
-
chain
(str
, default:None
) –Chain name
-
pandas
(bool
, default:True
) –Return data as pandas DataFrame
Returns:
-
Union[List, DataFrame]
–Timeseries of total TVL
tvl_detail
¶
tvl_detail(
protocol: str,
chain: str = None,
token: bool = False,
pandas: bool = True,
) -> Union[List, pd.DataFrame]
Get TVL detail for given protocol and chain
GET /api/v1/defillama/tvl/detail
https://docs.datamaxiplus.com/rest/defillama/tvl-detail
Parameters:
-
protocol
(str
) –Protocol name
-
chain
(str
, default:None
) –Chain name
-
token
(bool
, default:False
) –Return token amount (return by default USD)
-
pandas
(bool
, default:True
) –Return data as pandas DataFrame
Returns:
-
Union[List, DataFrame]
–Timeseries of TVL detail for a given protocol and chain
mcap
¶
mcap(
protocol: str, pandas: bool = True
) -> Union[List, pd.DataFrame]
Get market cap for given protocol
GET /api/v1/defillama/mcap
https://docs.datamaxiplus.com/rest/defillama/mcap
Parameters:
-
protocol
(str
) –Protocol name
-
pandas
(bool
, default:True
) –Return data as pandas DataFrame
Returns:
-
Union[List, DataFrame]
–Timeseries of market cap for given protocol
pool_yield
¶
pool_yield(
poolId: str, pandas: bool = True
) -> Union[List, pd.DataFrame]
Get yield for given pool
GET /api/v1/defillama/pool/yield
https://docs.datamaxiplus.com/rest/defillama/pool-yield
Parameters:
-
poolId
(str
) –Pool ID
-
pandas
(bool
, default:True
) –Return data as pandas DataFrame
Returns:
-
Union[List, DataFrame]
–Timeseries of yield for given pool
stablecoin_mcap
¶
stablecoin_mcap(
stablecoin: str, chain: str = None, pandas: bool = True
) -> Union[List, pd.DataFrame]
Get market cap for given stablecoin and chain
GET /api/v1/defillama/stablecoin/mcap
https://docs.datamaxiplus.com/rest/defillama/stablecoin-mcap
Parameters:
-
stablecoin
(str
) –Stablecoin name
-
chain
(str
, default:None
) –Chain name (optional)
-
pandas
(bool
, default:True
) –Return data as pandas DataFrame
Returns:
-
Union[List, DataFrame]
–Timeseries of market cap for given stablecoin and chain
stablecoin_price
¶
stablecoin_price(
stablecoin: str, pandas: bool = True
) -> Union[List, pd.DataFrame]
Get price for given stablecoin
GET /api/v1/defillama/stablecoin/price
https://docs.datamaxiplus.com/rest/defillama/stablecoin-price
Parameters:
-
stablecoin
(str
) –Stablecoin name
-
pandas
(bool
, default:True
) –Return data as pandas DataFrame
Returns:
-
Union[List, DataFrame]
–Timeseries of stablecoin prices
fee
¶
fee(
protocol: str = None,
chain: str = None,
daily: bool = True,
pandas: bool = True,
) -> Union[List, pd.DataFrame]
Get fee for given protocol or chain
GET /api/v1/defillama/fee
https://docs.datamaxiplus.com/rest/defillama/fee
Parameters:
-
protocol
(str
, default:None
) –Protocol name
-
chain
(str
, default:None
) –Chain name
-
daily
(bool
, default:True
) –Daily fee or total fee
-
pandas
(bool
, default:True
) –Return data as pandas DataFrame
Returns:
-
Union[List, DataFrame]
–Timeseries of protocol or fees
revenue
¶
revenue(
protocol: str = None,
chain: str = None,
daily: bool = True,
pandas: bool = True,
) -> Union[List, pd.DataFrame]
Get revenue for given protocol or chain
GET /api/v1/defillama/revenue
https://docs.datamaxiplus.com/rest/defillama/revenue
Parameters:
-
protocol
(str
, default:None
) –Protocol name
-
chain
(str
, default:None
) –Chain name
-
daily
(bool
, default:True
) –Daily revenue or total revenue
-
pandas
(bool
, default:True
) –Return data as pandas DataFrame
Returns:
-
Union[List, DataFrame]
–Timeseries of protocol or chain revenues
fee_detail
¶
fee_detail(
protocol: str = None,
chain: str = None,
daily: bool = True,
pandas: bool = True,
) -> Union[List, pd.DataFrame]
Get fee detail for given protocol and chain
GET /api/v1/defillama/fee/detail
https://docs.datamaxiplus.com/rest/defillama/fee-detail
Parameters:
-
protocol
(str
, default:None
) –Protocol name
-
chain
(str
, default:None
) –Chain name
-
daily
(bool
, default:True
) –Daily fee or total fee
-
pandas
(bool
, default:True
) –Return data as pandas DataFrame
Returns:
-
Union[List, DataFrame]
–Timeseries of fee detail for a given protocol and chain
revenue_detail
¶
revenue_detail(
protocol: str = None,
chain: str = None,
daily: bool = True,
pandas: bool = True,
) -> Union[List, pd.DataFrame]
Get revenue detail for given protocol and chain
GET /api/v1/defillama/revenue/detail
https://docs.datamaxiplus.com/rest/defillama/revenue-detail
Parameters:
-
protocol
(str
, default:None
) –Protocol name
-
chain
(str
, default:None
) –Chain name
-
daily
(bool
, default:True
) –Daily revenue or total revenue
-
pandas
(bool
, default:True
) –Return data as pandas DataFrame
Returns:
-
Union[List, DataFrame]
–Timeseries of revenue detail for a given protocol and chain