-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding member_zrx_staked to epoch pool rewards query #56
Adding member_zrx_staked to epoch pool rewards query #56
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me but I think @sui414 should review as the data and queries are her expertise :)
packages/api/package.json
Outdated
"scripts": { | ||
"build": "yarn tsc -b", | ||
"clean": "rm -rf lib", | ||
"dev": "nodemon -r dotenv/config src/index.ts | pino-pretty", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yay, thanks!
I took a peek at 0xProject/website#366 for more context. Why not add Highly recommend doing aggregate queries and joins at the SQL layer instead of the API/network layer. Also, this data changes slowly so we can add a cache at the ingress layer for faster page loads. |
packages/api/src/queries.ts
Outdated
@@ -328,18 +328,21 @@ export const poolEpochRewardsQuery = ` | |||
, e.ending_timestamp | |||
, e.ending_block_number | |||
, e.ending_transaction_hash | |||
, esps.member_zrx_delegated AS member_zrx_staked |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
COALESCE(esps.member_zrx_delegated, 0.00)
…ool-epoch-rewards Adding member_zrx_staked to epoch pool rewards query
In reference to: 0xProject/website#366
Basically, we want to be able to see the amount of ZRX staked per each epoch. Currently, staking endpoint
staking/pools/{poolId}
only shows amount of ZRX staked for current epoch and next epoch. Also added back nodemon dev npm script.