-
Notifications
You must be signed in to change notification settings - Fork 125
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(funding): Add defaultFunding8hrPpm
field to Perpetual Create/Update indexer events
#2674
Changes from 2 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,13 @@ | ||
import * as Knex from 'knex'; | ||
|
||
export async function up(knex: Knex): Promise<void> { | ||
await knex.schema.alterTable('perpetual_markets', (table) => { | ||
table.decimal('defaultFundingRate1H', null).defaultTo(0); | ||
}); | ||
} | ||
|
||
export async function down(knex: Knex): Promise<void> { | ||
await knex.schema.alterTable('perpetual_markets', (table) => { | ||
table.dropColumn('defaultFundingRate1H'); | ||
}); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ export interface PerpetualMarketCreateObject { | |
liquidityTierId: number, | ||
marketType: PerpetualMarketType, | ||
baseOpenInterest: string, | ||
defaultFundingRate1H: string, | ||
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. Add defaultFundingRate1H to PerpetualMarketUpdateObject. The export interface PerpetualMarketUpdateObject {
// ... existing fields ...
liquidityTierId?: number,
+ defaultFundingRate1H?: string,
} Also applies to: 24-41 |
||
} | ||
|
||
export interface PerpetualMarketUpdateObject { | ||
|
@@ -54,6 +55,7 @@ export enum PerpetualMarketColumns { | |
subticksPerTick = 'subticksPerTick', | ||
stepBaseQuantums = 'stepBaseQuantums', | ||
liquidityTierId = 'liquidityTierId', | ||
defaultFundingRate1H = 'defaultFundingRate1H', | ||
} | ||
|
||
export enum PerpetualMarketStatus { | ||
|
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.
🛠️ Refactor suggestion
Specify decimal precision for funding rate column.
The
decimal
type without precision and scale could lead to data truncation or inconsistency. Consider specifying appropriate precision and scale parameters based on the expected range of funding rates.📝 Committable suggestion