-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added support of DCA action with Swapped events
- Loading branch information
Showing
29 changed files
with
13,569 additions
and
3,263 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
indexers/liquidity-pools/db/migrations/1736694847383-Data.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
module.exports = class Data1736694847383 { | ||
name = 'Data1736694847383' | ||
|
||
async up(db) { | ||
await db.query(`ALTER TABLE "chain_activity_trace" DROP CONSTRAINT "FK_26c2eb8e87337934308e440e2de"`) | ||
await db.query(`DROP INDEX "public"."IDX_26c2eb8e87337934308e440e2d"`) | ||
await db.query(`CREATE TABLE "chain_activity_trace_relation" ("id" character varying NOT NULL, "created_at_para_chain_block_height" integer NOT NULL, "child_trace_id" character varying, "parent_trace_id" character varying, CONSTRAINT "PK_a5284175c0ed2afaf3703b9cd07" PRIMARY KEY ("id"))`) | ||
await db.query(`CREATE INDEX "IDX_6be7f6950fe25222e68a9ccde4" ON "chain_activity_trace_relation" ("child_trace_id") `) | ||
await db.query(`CREATE INDEX "IDX_e140c24845ed82e99ec4a65c15" ON "chain_activity_trace_relation" ("parent_trace_id") `) | ||
await db.query(`ALTER TABLE "chain_activity_trace" DROP COLUMN "root_trace_id"`) | ||
await db.query(`ALTER TABLE "chain_activity_trace_relation" ADD CONSTRAINT "FK_6be7f6950fe25222e68a9ccde4e" FOREIGN KEY ("child_trace_id") REFERENCES "chain_activity_trace"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) | ||
await db.query(`ALTER TABLE "chain_activity_trace_relation" ADD CONSTRAINT "FK_e140c24845ed82e99ec4a65c155" FOREIGN KEY ("parent_trace_id") REFERENCES "chain_activity_trace"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) | ||
} | ||
|
||
async down(db) { | ||
await db.query(`ALTER TABLE "chain_activity_trace" ADD CONSTRAINT "FK_26c2eb8e87337934308e440e2de" FOREIGN KEY ("root_trace_id") REFERENCES "chain_activity_trace"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) | ||
await db.query(`CREATE INDEX "IDX_26c2eb8e87337934308e440e2d" ON "chain_activity_trace" ("root_trace_id") `) | ||
await db.query(`DROP TABLE "chain_activity_trace_relation"`) | ||
await db.query(`DROP INDEX "public"."IDX_6be7f6950fe25222e68a9ccde4"`) | ||
await db.query(`DROP INDEX "public"."IDX_e140c24845ed82e99ec4a65c15"`) | ||
await db.query(`ALTER TABLE "chain_activity_trace" ADD "root_trace_id" character varying`) | ||
await db.query(`ALTER TABLE "chain_activity_trace_relation" DROP CONSTRAINT "FK_6be7f6950fe25222e68a9ccde4e"`) | ||
await db.query(`ALTER TABLE "chain_activity_trace_relation" DROP CONSTRAINT "FK_e140c24845ed82e99ec4a65c155"`) | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
indexers/liquidity-pools/db/migrations/1736702149041-Data.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
module.exports = class Data1736702149041 { | ||
name = 'Data1736702149041' | ||
|
||
async up(db) { | ||
await db.query(`ALTER TABLE "swap" DROP CONSTRAINT "FK_cdeb57fc49ab9df38808386f1fa"`) | ||
await db.query(`DROP INDEX "public"."IDX_cdeb57fc49ab9df38808386f1f"`) | ||
await db.query(`ALTER TABLE "swap" RENAME COLUMN "dca_schedule_execution_id" TO "dca_schedule_execution_action_id"`) | ||
await db.query(`ALTER TABLE "dca_schedule_execution_action" ADD "swap_id" character varying`) | ||
await db.query(`CREATE INDEX "IDX_2ea29fabaf7e05c3546723086e" ON "dca_schedule_execution_action" ("swap_id") `) | ||
await db.query(`CREATE INDEX "IDX_01a8428ecd73bbd9809d8b243a" ON "swap" ("dca_schedule_execution_action_id") `) | ||
await db.query(`ALTER TABLE "dca_schedule_execution_action" ADD CONSTRAINT "FK_2ea29fabaf7e05c3546723086e2" FOREIGN KEY ("swap_id") REFERENCES "swap"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) | ||
await db.query(`ALTER TABLE "swap" ADD CONSTRAINT "FK_01a8428ecd73bbd9809d8b243ad" FOREIGN KEY ("dca_schedule_execution_action_id") REFERENCES "dca_schedule_execution_action"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) | ||
} | ||
|
||
async down(db) { | ||
await db.query(`ALTER TABLE "swap" ADD CONSTRAINT "FK_cdeb57fc49ab9df38808386f1fa" FOREIGN KEY ("dca_schedule_execution_id") REFERENCES "dca_schedule_execution"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) | ||
await db.query(`CREATE INDEX "IDX_cdeb57fc49ab9df38808386f1f" ON "swap" ("dca_schedule_execution_id") `) | ||
await db.query(`ALTER TABLE "swap" RENAME COLUMN "dca_schedule_execution_action_id" TO "dca_schedule_execution_id"`) | ||
await db.query(`ALTER TABLE "dca_schedule_execution_action" DROP COLUMN "swap_id"`) | ||
await db.query(`DROP INDEX "public"."IDX_2ea29fabaf7e05c3546723086e"`) | ||
await db.query(`DROP INDEX "public"."IDX_01a8428ecd73bbd9809d8b243a"`) | ||
await db.query(`ALTER TABLE "dca_schedule_execution_action" DROP CONSTRAINT "FK_2ea29fabaf7e05c3546723086e2"`) | ||
await db.query(`ALTER TABLE "swap" DROP CONSTRAINT "FK_01a8428ecd73bbd9809d8b243ad"`) | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
indexers/liquidity-pools/db/migrations/1736784159931-Data.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
module.exports = class Data1736784159931 { | ||
name = 'Data1736784159931' | ||
|
||
async up(db) { | ||
await db.query(`ALTER TABLE "dca_schedule_execution_action" DROP CONSTRAINT "FK_2ea29fabaf7e05c3546723086e2"`) | ||
await db.query(`DROP INDEX "public"."IDX_b5e76a3b57e6d4ce71262668c7"`) | ||
await db.query(`DROP INDEX "public"."IDX_2ea29fabaf7e05c3546723086e"`) | ||
await db.query(`ALTER TABLE "dca_schedule_execution_action" DROP COLUMN "swap_id"`) | ||
await db.query(`ALTER TABLE "dca_schedule_execution_action" DROP COLUMN "operation_id"`) | ||
await db.query(`ALTER TABLE "dca_schedule_execution_action" ADD "operation_ids" text array`) | ||
} | ||
|
||
async down(db) { | ||
await db.query(`ALTER TABLE "dca_schedule_execution_action" ADD CONSTRAINT "FK_2ea29fabaf7e05c3546723086e2" FOREIGN KEY ("swap_id") REFERENCES "swap"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`) | ||
await db.query(`CREATE INDEX "IDX_b5e76a3b57e6d4ce71262668c7" ON "dca_schedule_execution_action" ("operation_id") `) | ||
await db.query(`CREATE INDEX "IDX_2ea29fabaf7e05c3546723086e" ON "dca_schedule_execution_action" ("swap_id") `) | ||
await db.query(`ALTER TABLE "dca_schedule_execution_action" ADD "swap_id" character varying`) | ||
await db.query(`ALTER TABLE "dca_schedule_execution_action" ADD "operation_id" text`) | ||
await db.query(`ALTER TABLE "dca_schedule_execution_action" DROP COLUMN "operation_ids"`) | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
indexers/liquidity-pools/db/migrations/1736875670868-Data.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module.exports = class Data1736875670868 { | ||
name = 'Data1736875670868' | ||
|
||
async up(db) { | ||
await db.query(`ALTER TABLE "chain_activity_trace" ADD "associated_accounts_flat" text array NOT NULL`) | ||
} | ||
|
||
async down(db) { | ||
await db.query(`ALTER TABLE "chain_activity_trace" DROP COLUMN "associated_accounts_flat"`) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,7 +43,7 @@ scale: | |
dedicated: false | ||
addons: | ||
postgres: | ||
profile: large | ||
profile: small | ||
storage: 50G | ||
processor: | ||
profile: large |
50 changes: 50 additions & 0 deletions
50
indexers/liquidity-pools/deployment-hydration-testnet-indexer.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
manifestVersion: subsquid.io/v0.1 | ||
name: hydration-testnet-pools | ||
slot: 103 | ||
description: Hydration Testnet pools indexer | ||
build: | ||
deploy: | ||
addons: | ||
postgres: | ||
config: | ||
statement_timeout: 360000 | ||
log_min_duration_statement: 60000 | ||
processor: | ||
env: | ||
CHAIN: 'hydration_paseo_next' | ||
RPC_URL: 'wss://max.lark.hydration.cloud' | ||
PROCESS_LBP_POOLS: true | ||
PROCESS_XYK_POOLS: true | ||
PROCESS_OMNIPOOLS: true | ||
PROCESS_STABLEPOOLS: true | ||
PROCESS_DCA: true | ||
PROCESS_OTC: true | ||
GQL_PORT: 8080 | ||
NODE_ENV: 'production' | ||
OMNIPOOL_ADDRESS: '0x6d6f646c6f6d6e69706f6f6c0000000000000000000000000000000000000000' | ||
PROCESS_FROM_BLOCK: 1000 | ||
|
||
USE_STORAGE_DICTIONARY: false | ||
STORAGE_DICTIONARY_LBPPOOL_URL: 'https://galacticcouncil.squids.live/hydration-storage-dictionary:lbppool/api/graphql' | ||
STORAGE_DICTIONARY_XYKPOOL_URL: 'https://galacticcouncil.squids.live/hydration-storage-dictionary:xykpool/api/graphql' | ||
STORAGE_DICTIONARY_OMNIPOOL_URL: 'https://galacticcouncil.squids.live/hydration-storage-dictionary:omnipool/api/graphql' | ||
STORAGE_DICTIONARY_STABLEPOOL_URL: 'https://galacticcouncil.squids.live/hydration-storage-dictionary:stablepool/api/graphql' | ||
cmd: | ||
- sqd | ||
- process:prod | ||
api: | ||
env: | ||
CHAIN: 'hydration_paseo_next' | ||
GQL_PORT: 8080 | ||
NODE_ENV: 'production' | ||
cmd: | ||
- sqd | ||
- api:prod | ||
scale: | ||
dedicated: false | ||
addons: | ||
postgres: | ||
profile: small | ||
storage: 50G | ||
processor: | ||
profile: large |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.