-
Notifications
You must be signed in to change notification settings - Fork 115
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
Split affiliate info fees by taker and maker #2439
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import * as Knex from 'knex'; | ||
|
||
export async function up(knex: Knex): Promise<void> { | ||
return knex | ||
.schema | ||
.alterTable('affiliate_info', (table) => { | ||
table.dropColumn('totalReferredFees'); | ||
table.dropColumn('referredNetProtocolEarnings'); | ||
table.decimal('totalReferredTakerFees', null).notNullable().defaultTo(0); | ||
table.decimal('totalReferredMakerFees', null).notNullable().defaultTo(0); | ||
table.decimal('totalReferredMakerRebates', null).notNullable().defaultTo(0); | ||
}); | ||
} | ||
|
||
export async function down(knex: Knex): Promise<void> { | ||
return knex | ||
.schema | ||
.alterTable('affiliate_info', (table) => { | ||
table.decimal('totalReferredFees', null).notNullable().defaultTo(0); | ||
table.decimal('referredNetProtocolEarnings', null).notNullable().defaultTo(0); | ||
table.dropColumn('totalReferredTakerFees'); | ||
table.dropColumn('totalReferredMakerFees'); | ||
table.dropColumn('totalReferredMakerRebates'); | ||
}); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,9 +3,10 @@ export interface AffiliateInfoCreateObject { | |
affiliateEarnings: string, | ||
referredMakerTrades: number, | ||
referredTakerTrades: number, | ||
totalReferredFees: string, | ||
totalReferredMakerFees: string, | ||
totalReferredTakerFees: string, | ||
jerryfan01234 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
totalReferredMakerRebates: string, | ||
Comment on lines
+6
to
+8
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification Action Required: Residual References Found for The property
Please address these residual references to ensure database migrations function correctly without the removed property. 🔗 Analysis chainLGTM! Changes align with PR objectives. The addition of Please verify the impact of removing the If there are any occurrences, ensure they are updated accordingly. 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Description: Check for usage of removed property 'referredNetProtocolEarnings'
# Test: Search for 'referredNetProtocolEarnings' in TypeScript files
rg --type typescript 'referredNetProtocolEarnings'
Length of output: 85 Script: #!/bin/bash
# Description: Check for usage of removed property 'referredNetProtocolEarnings'
# Test: Search for 'referredNetProtocolEarnings' in TypeScript files
rg 'referredNetProtocolEarnings' --glob '*.ts' --glob '*.tsx'
Length of output: 1396 |
||
totalReferredUsers: number, | ||
referredNetProtocolEarnings: string, | ||
firstReferralBlockHeight: string, | ||
referredTotalVolume: string, | ||
} | ||
|
@@ -15,9 +16,10 @@ export enum AffiliateInfoColumns { | |
affiliateEarnings = 'affiliateEarnings', | ||
referredMakerTrades = 'referredMakerTrades', | ||
referredTakerTrades = 'referredTakerTrades', | ||
totalReferredFees = 'totalReferredFees', | ||
totalReferredMakerFees = 'totalReferredMakerFees', | ||
totalReferredTakerFees = 'totalReferredTakerFees', | ||
totalReferredMakerRebates = 'totalReferredMakerRebates', | ||
totalReferredUsers = 'totalReferredUsers', | ||
referredNetProtocolEarnings = 'referredNetProtocolEarnings', | ||
firstReferralBlockHeight = 'firstReferralBlockHeight', | ||
referredTotalVolume = 'referredTotalVolume', | ||
} |
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.
Can we separate positive maker fees from negative maker fees?
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 will add totalReferredMakerRebates for negative, and keep totalReferredMakerFees for positive