-
Notifications
You must be signed in to change notification settings - Fork 1
feat: reset referral rewards after claim #183
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
feat: reset referral rewards after claim #183
Conversation
create index "IX_deposit_srAddress_depositDate_pId_tId_status" | ||
on deposit ("stickyReferralAddress", "depositDate", "priceId", "tokenId", status) | ||
`); |
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.
This index will help to get the deposits faster when using these fields in the WHERE clause
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.
I can't speak to the SQL, but LGTM
@@ -0,0 +1,16 @@ | |||
import { MigrationInterface, QueryRunner } from "typeorm"; | |||
|
|||
export class Deposit1671299400000 implements MigrationInterface { |
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.
Just curious: what's the significance of this timestamp?
date -u -r 1671299400
Sat Dec 17 17:50:00 UTC 2022
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.
this is the timestamp when the migration file was created. The migration files contain the queries that define the structure of the database: creating tables, adding columns, altering tables, etc, so it's crucial for the migration files to run chronologically
This PR updates the logic for computing the referral rewards by grouping the deposits by the Claim events.