Skip to content

Commit

Permalink
Merge pull request #10 from itzmestar/fees-revenue
Browse files Browse the repository at this point in the history
added fees & revenue eps
  • Loading branch information
itzmestar committed Apr 27, 2024
2 parents e379c4e + 0bb90b4 commit edba4bb
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
2 changes: 1 addition & 1 deletion defillama/__version__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
__title__ = 'DeFiLlama'
__description__ = 'Unofficial DeFi Llama API client.'
__url__ = 'https://github.com/itzmestar/DeFiLlama'
__version__ = '2.1.0'
__version__ = '2.1.1'
__build__ = 0x010001
__author__ = 'Tarique Anwer'
__author_email__ = '[email protected]'
Expand Down
39 changes: 39 additions & 0 deletions defillama/defillama.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,3 +212,42 @@ def get_options_dex_summary(self, protocol, dataType='dailyPremiumVolume'):
}

return self._get(path, params=params)

# ##### Fees & Revenue EPs ###### #

def get_fees(self, excludeTotalDataChart=True, excludeTotalDataChartBreakdown=True, dataType='dailyFees'):
"""
list all protocols along with summaries of their fees & revenue & dataType history data
"""
path = f'/overview/fees'
params = {
'excludeTotalDataChart': excludeTotalDataChart,
'excludeTotalDataChartBreakdown': excludeTotalDataChartBreakdown,
'dataType': dataType
}

return self._get(path, params=params)

def get_fees_chain(self, chain, excludeTotalDataChart=True, excludeTotalDataChartBreakdown=True, dataType='dailyFees'):
"""
list all protocols along with summaries of their fees & revenue & dataType history data by chain
"""
path = f'/overview/fees/{chain}'
params = {
'excludeTotalDataChart': excludeTotalDataChart,
'excludeTotalDataChartBreakdown': excludeTotalDataChartBreakdown,
'dataType': dataType
}

return self._get(path, params=params)

def get_fees_protocol(self, protocol, dataType='dailyFees'):
"""
Get summary of protocol fees and revenue with historical data
"""
path = f'/overview/fees/{protocol}'
params = {
'dataType': dataType
}

return self._get(path, params=params)

0 comments on commit edba4bb

Please sign in to comment.