cardano-community / koios-artifacts

Artifacts for https://koios.rest and https://api.koios.rest websites
Creative Commons Attribution 4.0 International
20 stars 25 forks source link

Adding delegation Tx to #get-/pool_delegators #38

Closed sundayScoop closed 2 years ago

sundayScoop commented 2 years ago

We have a use case where we'd want to drop some rewards for users registered against our pool. We'd like to get the tx_hash for every delegation tx for https://api.koios.rest/#get-/pool_delegators - already discussed in Koios discussions group.

dostrelith678 commented 2 years ago

@sundayScoop @rdlrt @Scitz0 We have different scenarios for this endpoint when epoch_no is specified and not. If not, we use the stake distribution cache and can return the latest delegation tx hash along with the current response. Otherwise, we use the epoch_stake table to look at the epoch_no. In that case, is it okay to return the same latest delegation tx hash as well?

dostrelith678 commented 2 years ago

As dicussed offline, we will separate two endpoints for clear distinction between LIVE and ACTIVE stakes: /pool_delegators -> returning LIVE delegators and INCLUDING the latest delegation tx for each address in the response. /pool_delegators_history -> returning ACTIVE delegators for a specified epoch (current if not specified) and NOT INCLUDING any delegation txs in the response.