Skip to content

Commit

Permalink
fix script syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
teddyding committed Jan 8, 2025
1 parent b891f8c commit c29878d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions indexer/packages/postgres/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ Add a knex migration by running `pnpm run migrate:make <create_fake_table>`

Run the migration with `pnpm run migrate`

In `__tests__/db/migrations.test.ts`, test cases may be expected to fail (and hence should be commented out) if a model is modified due to the latest migration.

In order to migrate in dev and staging, you must redeploy and run bazooka.

TODO(CORE-512): Add info/resources around bazooka. [Doc](https://www.notion.so/dydx/Engineering-Runbook-15064661da9643188ce33e341b68e7bb#cb2283d80ef14a51924f3bd1a538fd82).
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ BEGIN
/* For backwards compatibility, handle the case where defaultFundingPpm is not present */
CASE
/* Convert defaultFundingPpm from parts-per-million to a rate */
WHEN event_data ? 'defaultFunding8hrPpm' THEN dydx_trim_scale(
WHEN (event_data->>'defaultFunding8hrPpm') IS NOT NULL THEN dydx_trim_scale(
power(10, PPM_EXPONENT) /
FUNDING_RATE_FROM_PROTOCOL_IN_HOURS *
(event_data->'defaultFunding8hrPpm')::numeric);
(event_data->'defaultFunding8hrPpm')::numeric)
ELSE 0.0
END;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ BEGIN
WHEN event_data ? 'defaultFunding8hrPpm' THEN dydx_trim_scale(
power(10, PPM_EXPONENT) /
FUNDING_RATE_FROM_PROTOCOL_IN_HOURS *
(event_data->'defaultFunding8hrPpm')::numeric);
(event_data->'defaultFunding8hrPpm')::numeric)
ELSE 0.0
END;
UPDATE perpetual_markets
Expand Down

0 comments on commit c29878d

Please sign in to comment.