diff --git a/indexer/packages/postgres/__tests__/helpers/constants.ts b/indexer/packages/postgres/__tests__/helpers/constants.ts index 56e2865227..5de24209bd 100644 --- a/indexer/packages/postgres/__tests__/helpers/constants.ts +++ b/indexer/packages/postgres/__tests__/helpers/constants.ts @@ -990,9 +990,10 @@ export const defaultAffiliateInfo: AffiliateInfoCreateObject = { affiliateEarnings: '10', referredMakerTrades: 10, referredTakerTrades: 20, - totalReferredFees: '10', + totalReferredMakerFees: '10', + totalReferredTakerFees: '10', + totalReferredMakerRebates: '-10', totalReferredUsers: 5, - referredNetProtocolEarnings: '20', firstReferralBlockHeight: '1', referredTotalVolume: '1000', }; @@ -1002,9 +1003,10 @@ export const defaultAffiliateInfo2: AffiliateInfoCreateObject = { affiliateEarnings: '11', referredMakerTrades: 11, referredTakerTrades: 21, - totalReferredFees: '11', + totalReferredMakerFees: '11', + totalReferredTakerFees: '11', + totalReferredMakerRebates: '-11', totalReferredUsers: 5, - referredNetProtocolEarnings: '21', firstReferralBlockHeight: '11', referredTotalVolume: '1000', }; @@ -1014,9 +1016,10 @@ export const defaultAffiliateInfo3: AffiliateInfoCreateObject = { affiliateEarnings: '12', referredMakerTrades: 12, referredTakerTrades: 22, - totalReferredFees: '12', + totalReferredMakerFees: '12', + totalReferredTakerFees: '12', + totalReferredMakerRebates: '-12', totalReferredUsers: 10, - referredNetProtocolEarnings: '22', firstReferralBlockHeight: '12', referredTotalVolume: '1111111', }; diff --git a/indexer/packages/postgres/__tests__/stores/affiliate-info-table.test.ts b/indexer/packages/postgres/__tests__/stores/affiliate-info-table.test.ts index 04790001c8..9c9eddc6eb 100644 --- a/indexer/packages/postgres/__tests__/stores/affiliate-info-table.test.ts +++ b/indexer/packages/postgres/__tests__/stores/affiliate-info-table.test.ts @@ -113,9 +113,10 @@ describe('Affiliate info store', () => { affiliateEarnings: '1000', referredMakerTrades: 1, referredTakerTrades: 1, - totalReferredFees: '2000', + totalReferredMakerFees: '0', + totalReferredTakerFees: '1000', + totalReferredMakerRebates: '-1000', totalReferredUsers: 1, - referredNetProtocolEarnings: '1000', firstReferralBlockHeight: '1', referredTotalVolume: '2', }; @@ -140,9 +141,10 @@ describe('Affiliate info store', () => { affiliateEarnings: '1000', referredMakerTrades: 2, referredTakerTrades: 0, - totalReferredFees: '2000', + totalReferredMakerFees: '2000', + totalReferredTakerFees: '0', + totalReferredMakerRebates: '0', totalReferredUsers: 1, - referredNetProtocolEarnings: '1000', firstReferralBlockHeight: '1', referredTotalVolume: '2', }; @@ -157,14 +159,15 @@ describe('Affiliate info store', () => { const updatedInfo2 = await AffiliateInfoTable.findById( defaultWallet2.address, ); - const expectedAffiliateInfo2 = { + const expectedAffiliateInfo2: AffiliateInfoFromDatabase = { address: defaultWallet2.address, affiliateEarnings: '2000', referredMakerTrades: 3, referredTakerTrades: 1, - totalReferredFees: '4000', + totalReferredMakerFees: '2000', + totalReferredTakerFees: '1000', + totalReferredMakerRebates: '-1000', totalReferredUsers: 1, - referredNetProtocolEarnings: '2000', firstReferralBlockHeight: '1', referredTotalVolume: '4', }; @@ -183,14 +186,15 @@ describe('Affiliate info store', () => { const updatedInfo3 = await AffiliateInfoTable.findById( defaultWallet2.address, ); - const expectedAffiliateInfo3 = { + const expectedAffiliateInfo3: AffiliateInfoFromDatabase = { address: defaultWallet2.address, affiliateEarnings: '2000', referredMakerTrades: 3, referredTakerTrades: 1, - totalReferredFees: '4000', + totalReferredMakerFees: '2000', + totalReferredTakerFees: '1000', + totalReferredMakerRebates: '-1000', totalReferredUsers: 2, - referredNetProtocolEarnings: '2000', firstReferralBlockHeight: '1', referredTotalVolume: '4', }; @@ -236,9 +240,10 @@ describe('Affiliate info store', () => { affiliateEarnings: '0', referredMakerTrades: 0, referredTakerTrades: 0, - totalReferredFees: '0', + totalReferredMakerFees: '0', + totalReferredTakerFees: '0', + totalReferredMakerRebates: '0', totalReferredUsers: 1, - referredNetProtocolEarnings: '0', firstReferralBlockHeight: '2', referredTotalVolume: '0', }; @@ -391,7 +396,7 @@ async function populateFillsAndReferrals(): Promise { eventId: defaultTendermintEventId2, price: '1', size: '1', - fee: '1000', + fee: '-1000', affiliateRevShare: '500', }), FillTable.create({ diff --git a/indexer/packages/postgres/src/db/migrations/migration_files/20241002144813_change_affiliate_info_fee_columns.ts b/indexer/packages/postgres/src/db/migrations/migration_files/20241002144813_change_affiliate_info_fee_columns.ts new file mode 100644 index 0000000000..877b2524c0 --- /dev/null +++ b/indexer/packages/postgres/src/db/migrations/migration_files/20241002144813_change_affiliate_info_fee_columns.ts @@ -0,0 +1,25 @@ +import * as Knex from 'knex'; + +export async function up(knex: Knex): Promise { + 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 { + 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'); + }); +} diff --git a/indexer/packages/postgres/src/models/affiliate-info-model.ts b/indexer/packages/postgres/src/models/affiliate-info-model.ts index 7fcbefac39..49dd0dfdbd 100644 --- a/indexer/packages/postgres/src/models/affiliate-info-model.ts +++ b/indexer/packages/postgres/src/models/affiliate-info-model.ts @@ -1,4 +1,4 @@ -import { NonNegativeNumericPattern } from '../lib/validators'; +import { NonNegativeNumericPattern, NumericPattern } from '../lib/validators'; import UpsertQueryBuilder from '../query-builders/upsert'; import BaseModel from './base-model'; @@ -19,9 +19,10 @@ export default class AffiliateInfoModel extends BaseModel { 'affiliateEarnings', 'referredMakerTrades', 'referredTakerTrades', - 'totalReferredFees', + 'totalReferredMakerFees', + 'totalReferredTakerFees', + 'totalReferredMakerRebates', 'totalReferredUsers', - 'referredNetProtocolEarnings', 'firstReferralBlockHeight', 'referredTotalVolume', ], @@ -30,9 +31,10 @@ export default class AffiliateInfoModel extends BaseModel { affiliateEarnings: { type: 'string', pattern: NonNegativeNumericPattern }, referredMakerTrades: { type: 'int' }, referredTakerTrades: { type: 'int' }, - totalReferredFees: { type: 'string', pattern: NonNegativeNumericPattern }, + totalReferredMakerFees: { type: 'string', pattern: NonNegativeNumericPattern }, + totalReferredTakerFees: { type: 'string', pattern: NonNegativeNumericPattern }, + totalReferredMakerRebates: { type: 'string', pattern: NumericPattern }, totalReferredUsers: { type: 'int' }, - referredNetProtocolEarnings: { type: 'string', pattern: NonNegativeNumericPattern }, firstReferralBlockHeight: { type: 'string', pattern: NonNegativeNumericPattern }, referredTotalVolume: { type: 'string', pattern: NonNegativeNumericPattern }, }, @@ -51,9 +53,10 @@ export default class AffiliateInfoModel extends BaseModel { affiliateEarnings: 'string', referredMakerTrades: 'int', referredTakerTrades: 'int', - totalReferredFees: 'string', + totalReferredMakerFees: 'string', + totalReferredTakerFees: 'string', + totalReferredMakerRebates: 'string', totalReferredUsers: 'int', - referredNetProtocolEarnings: 'string', firstReferralBlockHeight: 'string', referredTotalVolume: 'string', }; @@ -69,11 +72,13 @@ export default class AffiliateInfoModel extends BaseModel { referredTakerTrades!: number; - totalReferredFees!: string; + totalReferredMakerFees!: string; - totalReferredUsers!: number; + totalReferredTakerFees!: string; + + totalReferredMakerRebates!: string; - referredNetProtocolEarnings!: string; + totalReferredUsers!: number; firstReferralBlockHeight!: string; diff --git a/indexer/packages/postgres/src/stores/affiliate-info-table.ts b/indexer/packages/postgres/src/stores/affiliate-info-table.ts index 6c2ab2adc4..d661a01d70 100644 --- a/indexer/packages/postgres/src/stores/affiliate-info-table.ts +++ b/indexer/packages/postgres/src/stores/affiliate-info-table.ts @@ -192,7 +192,9 @@ affiliate_stats AS ( affiliate_fills."affiliateAddress", SUM(affiliate_fills."fee") AS "totalReferredFees", SUM(affiliate_fills."affiliateRevShare") AS "affiliateEarnings", - SUM(affiliate_fills."fee") - SUM(affiliate_fills."affiliateRevShare") AS "referredNetProtocolEarnings", + SUM(CASE WHEN affiliate_fills."liquidity" = '${Liquidity.MAKER}' AND affiliate_fills."fee" > 0 THEN affiliate_fills."fee" ELSE 0 END) AS "totalReferredMakerFees", + SUM(CASE WHEN affiliate_fills."liquidity" = '${Liquidity.TAKER}' THEN affiliate_fills."fee" ELSE 0 END) AS "totalReferredTakerFees", + SUM(CASE WHEN affiliate_fills."liquidity" = '${Liquidity.MAKER}' AND affiliate_fills."fee" < 0 THEN affiliate_fills."fee" ELSE 0 END) AS "totalReferredMakerRebates", COUNT(CASE WHEN affiliate_fills."liquidity" = '${Liquidity.MAKER}' THEN 1 END) AS "referredMakerTrades", COUNT(CASE WHEN affiliate_fills."liquidity" = '${Liquidity.TAKER}' THEN 1 END) AS "referredTakerTrades", SUM(affiliate_fills."price" * affiliate_fills."size") AS "referredTotalVolume" @@ -210,9 +212,10 @@ affiliate_info_update AS ( affiliate_metadata."affiliateAddress", affiliate_metadata."totalReferredUsers", affiliate_metadata."firstReferralBlockHeight", - COALESCE(affiliate_stats."totalReferredFees", 0) AS "totalReferredFees", + COALESCE(affiliate_stats."totalReferredMakerFees", 0) AS "totalReferredMakerFees", + COALESCE(affiliate_stats."totalReferredTakerFees", 0) AS "totalReferredTakerFees", + COALESCE(affiliate_stats."totalReferredMakerRebates", 0) AS "totalReferredMakerRebates", COALESCE(affiliate_stats."affiliateEarnings", 0) AS "affiliateEarnings", - COALESCE(affiliate_stats."referredNetProtocolEarnings", 0) AS "referredNetProtocolEarnings", COALESCE(affiliate_stats."referredMakerTrades", 0) AS "referredMakerTrades", COALESCE(affiliate_stats."referredTakerTrades", 0) AS "referredTakerTrades", COALESCE(affiliate_stats."referredTotalVolume", 0) AS "referredTotalVolume" @@ -231,8 +234,9 @@ INSERT INTO affiliate_info ( "affiliateEarnings", "referredMakerTrades", "referredTakerTrades", - "totalReferredFees", - "referredNetProtocolEarnings", + "totalReferredMakerFees", + "totalReferredTakerFees", + "totalReferredMakerRebates", "referredTotalVolume" ) SELECT @@ -242,8 +246,9 @@ SELECT "affiliateEarnings", "referredMakerTrades", "referredTakerTrades", - "totalReferredFees", - "referredNetProtocolEarnings", + "totalReferredMakerFees", + "totalReferredTakerFees", + "totalReferredMakerRebates", "referredTotalVolume" FROM affiliate_info_update @@ -254,8 +259,9 @@ DO UPDATE SET "affiliateEarnings" = affiliate_info."affiliateEarnings" + EXCLUDED."affiliateEarnings", "referredMakerTrades" = affiliate_info."referredMakerTrades" + EXCLUDED."referredMakerTrades", "referredTakerTrades" = affiliate_info."referredTakerTrades" + EXCLUDED."referredTakerTrades", - "totalReferredFees" = affiliate_info."totalReferredFees" + EXCLUDED."totalReferredFees", - "referredNetProtocolEarnings" = affiliate_info."referredNetProtocolEarnings" + EXCLUDED."referredNetProtocolEarnings", + "totalReferredMakerFees" = affiliate_info."totalReferredMakerFees" + EXCLUDED."totalReferredMakerFees", + "totalReferredTakerFees" = affiliate_info."totalReferredTakerFees" + EXCLUDED."totalReferredTakerFees", + "totalReferredMakerRebates" = affiliate_info."totalReferredMakerRebates" + EXCLUDED."totalReferredMakerRebates", "referredTotalVolume" = affiliate_info."referredTotalVolume" + EXCLUDED."referredTotalVolume"; `; diff --git a/indexer/packages/postgres/src/types/affiliate-info-types.ts b/indexer/packages/postgres/src/types/affiliate-info-types.ts index 885de8b9b7..a1dcc61be6 100644 --- a/indexer/packages/postgres/src/types/affiliate-info-types.ts +++ b/indexer/packages/postgres/src/types/affiliate-info-types.ts @@ -3,9 +3,10 @@ export interface AffiliateInfoCreateObject { affiliateEarnings: string, referredMakerTrades: number, referredTakerTrades: number, - totalReferredFees: string, + totalReferredMakerFees: string, + totalReferredTakerFees: string, + totalReferredMakerRebates: string, 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', } diff --git a/indexer/packages/postgres/src/types/db-model-types.ts b/indexer/packages/postgres/src/types/db-model-types.ts index b400153118..9557be8ede 100644 --- a/indexer/packages/postgres/src/types/db-model-types.ts +++ b/indexer/packages/postgres/src/types/db-model-types.ts @@ -288,9 +288,10 @@ export interface AffiliateInfoFromDatabase { affiliateEarnings: string, referredMakerTrades: number, referredTakerTrades: number, - totalReferredFees: string, + totalReferredMakerFees: string, + totalReferredTakerFees: string, + totalReferredMakerRebates: string, totalReferredUsers: number, - referredNetProtocolEarnings: string, firstReferralBlockHeight: string, referredTotalVolume: string, } diff --git a/indexer/services/comlink/__tests__/controllers/api/v4/affiliates-controller.test.ts b/indexer/services/comlink/__tests__/controllers/api/v4/affiliates-controller.test.ts index ea89899e15..30ceebd062 100644 --- a/indexer/services/comlink/__tests__/controllers/api/v4/affiliates-controller.test.ts +++ b/indexer/services/comlink/__tests__/controllers/api/v4/affiliates-controller.test.ts @@ -369,9 +369,16 @@ function affiliateInfoCreateToResponseObject( affiliateEarnings: Number(info.affiliateEarnings), affiliateReferredTrades: Number(info.referredTakerTrades) + Number(info.referredMakerTrades), - affiliateTotalReferredFees: Number(info.totalReferredFees), + affiliateTotalReferredFees: Number(info.totalReferredMakerFees) + + Number(info.totalReferredTakerFees) + + Number(info.totalReferredMakerRebates), affiliateReferredUsers: Number(info.totalReferredUsers), - affiliateReferredNetProtocolEarnings: Number(info.referredNetProtocolEarnings), + affiliateReferredNetProtocolEarnings: Number(info.totalReferredMakerFees) + + Number(info.totalReferredTakerFees) + + Number(info.totalReferredMakerRebates) - + Number(info.affiliateEarnings), affiliateReferredTotalVolume: Number(info.referredTotalVolume), + affiliateReferredMakerFees: Number(info.totalReferredMakerFees), + affiliateReferredTakerFees: Number(info.totalReferredTakerFees), }; } diff --git a/indexer/services/comlink/public/api-documentation.md b/indexer/services/comlink/public/api-documentation.md index 4d08bf1430..eaec0a2fbe 100644 --- a/indexer/services/comlink/public/api-documentation.md +++ b/indexer/services/comlink/public/api-documentation.md @@ -653,7 +653,9 @@ fetch(`${baseURL}/affiliates/snapshot`, "affiliateTotalReferredFees": 0.1, "affiliateReferredUsers": 0.1, "affiliateReferredNetProtocolEarnings": 0.1, - "affiliateReferredTotalVolume": 0.1 + "affiliateReferredTotalVolume": 0.1, + "affiliateReferredMakerFees": 0.1, + "affiliateReferredTakerFees": 0.1 } ], "total": 0.1, @@ -4244,7 +4246,9 @@ This operation does not require authentication "affiliateTotalReferredFees": 0.1, "affiliateReferredUsers": 0.1, "affiliateReferredNetProtocolEarnings": 0.1, - "affiliateReferredTotalVolume": 0.1 + "affiliateReferredTotalVolume": 0.1, + "affiliateReferredMakerFees": 0.1, + "affiliateReferredTakerFees": 0.1 } ``` @@ -4261,6 +4265,8 @@ This operation does not require authentication |affiliateReferredUsers|number(double)|true|none|none| |affiliateReferredNetProtocolEarnings|number(double)|true|none|none| |affiliateReferredTotalVolume|number(double)|true|none|none| +|affiliateReferredMakerFees|number(double)|true|none|none| +|affiliateReferredTakerFees|number(double)|true|none|none| ## AffiliateSnapshotResponse @@ -4280,7 +4286,9 @@ This operation does not require authentication "affiliateTotalReferredFees": 0.1, "affiliateReferredUsers": 0.1, "affiliateReferredNetProtocolEarnings": 0.1, - "affiliateReferredTotalVolume": 0.1 + "affiliateReferredTotalVolume": 0.1, + "affiliateReferredMakerFees": 0.1, + "affiliateReferredTakerFees": 0.1 } ], "total": 0.1, diff --git a/indexer/services/comlink/public/swagger.json b/indexer/services/comlink/public/swagger.json index 23de12c60c..e94a095d65 100644 --- a/indexer/services/comlink/public/swagger.json +++ b/indexer/services/comlink/public/swagger.json @@ -303,6 +303,14 @@ "affiliateReferredTotalVolume": { "type": "number", "format": "double" + }, + "affiliateReferredMakerFees": { + "type": "number", + "format": "double" + }, + "affiliateReferredTakerFees": { + "type": "number", + "format": "double" } }, "required": [ @@ -313,7 +321,9 @@ "affiliateTotalReferredFees", "affiliateReferredUsers", "affiliateReferredNetProtocolEarnings", - "affiliateReferredTotalVolume" + "affiliateReferredTotalVolume", + "affiliateReferredMakerFees", + "affiliateReferredTakerFees" ], "type": "object", "additionalProperties": false diff --git a/indexer/services/comlink/src/controllers/api/v4/affiliates-controller.ts b/indexer/services/comlink/src/controllers/api/v4/affiliates-controller.ts index 76e2433255..ac246bbfdf 100644 --- a/indexer/services/comlink/src/controllers/api/v4/affiliates-controller.ts +++ b/indexer/services/comlink/src/controllers/api/v4/affiliates-controller.ts @@ -164,10 +164,17 @@ class AffiliatesController extends Controller { info.address in addressUsernameMap ? addressUsernameMap[info.address] : '', affiliateEarnings: Number(info.affiliateEarnings), affiliateReferredTrades: Number(info.referredMakerTrades) + Number(info.referredTakerTrades), - affiliateTotalReferredFees: Number(info.totalReferredFees), + affiliateTotalReferredFees: Number(info.totalReferredMakerFees) + + Number(info.totalReferredTakerFees) + + Number(info.totalReferredMakerRebates), affiliateReferredUsers: Number(info.totalReferredUsers), - affiliateReferredNetProtocolEarnings: Number(info.referredNetProtocolEarnings), + affiliateReferredNetProtocolEarnings: Number(info.totalReferredMakerFees) + + Number(info.totalReferredTakerFees) + + Number(info.totalReferredMakerRebates) - + Number(info.affiliateEarnings), affiliateReferredTotalVolume: Number(info.referredTotalVolume), + affiliateReferredMakerFees: Number(info.totalReferredMakerFees), + affiliateReferredTakerFees: Number(info.totalReferredTakerFees), })); const response: AffiliateSnapshotResponse = { diff --git a/indexer/services/comlink/src/types.ts b/indexer/services/comlink/src/types.ts index c777521f48..81eace3303 100644 --- a/indexer/services/comlink/src/types.ts +++ b/indexer/services/comlink/src/types.ts @@ -731,6 +731,8 @@ export interface AffiliateSnapshotResponseObject { affiliateReferredUsers: number, affiliateReferredNetProtocolEarnings: number, affiliateReferredTotalVolume: number, + affiliateReferredMakerFees: number, + affiliateReferredTakerFees: number, } export interface AffiliateTotalVolumeResponse { diff --git a/indexer/services/roundtable/__tests__/tasks/update-affiliate-info.test.ts b/indexer/services/roundtable/__tests__/tasks/update-affiliate-info.test.ts index adc63c68e3..26b139cdb8 100644 --- a/indexer/services/roundtable/__tests__/tasks/update-affiliate-info.test.ts +++ b/indexer/services/roundtable/__tests__/tasks/update-affiliate-info.test.ts @@ -72,9 +72,10 @@ describe('update-affiliate-info', () => { affiliateEarnings: '0', referredMakerTrades: 0, referredTakerTrades: 0, - totalReferredFees: '0', + totalReferredMakerFees: '0', + totalReferredTakerFees: '0', + totalReferredMakerRebates: '0', totalReferredUsers: 1, - referredNetProtocolEarnings: '0', firstReferralBlockHeight: '1', referredTotalVolume: '0', }; @@ -121,9 +122,10 @@ describe('update-affiliate-info', () => { affiliateEarnings: '500', referredMakerTrades: 0, referredTakerTrades: 1, - totalReferredFees: '1000', + totalReferredMakerFees: '0', + totalReferredTakerFees: '1000', + totalReferredMakerRebates: '0', totalReferredUsers: 2, - referredNetProtocolEarnings: '500', firstReferralBlockHeight: '1', referredTotalVolume: '1', }; @@ -189,9 +191,10 @@ describe('update-affiliate-info', () => { affiliateEarnings: '1000', referredMakerTrades: 0, referredTakerTrades: 2, - totalReferredFees: '2000', + totalReferredMakerFees: '0', + totalReferredTakerFees: '2000', + totalReferredMakerRebates: '0', totalReferredUsers: 1, - referredNetProtocolEarnings: '1000', firstReferralBlockHeight: '1', referredTotalVolume: '2', }; @@ -255,9 +258,10 @@ describe('update-affiliate-info', () => { affiliateEarnings: '1000', referredMakerTrades: 0, referredTakerTrades: 2, - totalReferredFees: '2000', + totalReferredMakerFees: '0', + totalReferredTakerFees: '2000', + totalReferredMakerRebates: '0', totalReferredUsers: 1, - referredNetProtocolEarnings: '1000', firstReferralBlockHeight: '1', referredTotalVolume: '2', };