Skip to content

Commit

Permalink
feat: integrate yield endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
martinkersner committed May 17, 2024
1 parent ca08e29 commit e548f7c
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions datamaxi/defillama/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,13 +278,25 @@ def token_price(
}
return self.query("/v1/defillama/token", params)

# def yields(self, pools: Union[str, List[str]]=None) -> pd.DataFrame:
# pools = make_list(pools)
# check_required_parameter_list(pools, "pools")
# params = {
# "poolIds": encode_string_list(pools),
# }
# return self.query("/v1/defillama/yield", params)
@postprocess()
def pool_yield(self, poolId: str) -> pd.DataFrame:
"""Get yield for given pool
`GET /v1/defillama/pool/yield`
<https://docs.datamaxiplus.com/defillama/yield>
Args:
poolId (str): Pool ID
Returns:
Timeseries of yield for given pool
"""
check_required_parameter(poolId, "poolId")
params = {
"poolId": poolId,
}
return self.query("/v1/defillama/pool/yield", params)

@postprocess()
def stablecoin_mcap(
Expand Down

0 comments on commit e548f7c

Please sign in to comment.