Skip to content

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

Merged
merged 1 commit into from
Dec 20, 2022

Conversation

amateima
Copy link
Collaborator

This PR updates the logic for computing the referral rewards by grouping the deposits by the Claim events.

@linear
Copy link

linear bot commented Dec 19, 2022

Comment on lines +8 to +10
create index "IX_deposit_srAddress_depositDate_pId_tId_status"
on deposit ("stickyReferralAddress", "depositDate", "priceId", "tokenId", status)
`);
Copy link
Collaborator Author

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

Copy link
Member

@james-a-morris james-a-morris left a 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 {
Copy link

@pxrl pxrl Dec 20, 2022

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

Copy link
Collaborator Author

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

@amateima amateima merged commit 509ce30 into stage Dec 20, 2022
@amateima amateima deleted the amatei/acx-502-fix-the-reset-of-referral-rate-after branch January 30, 2023 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants