-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feat/merkle-airdrop
* main: (40 commits) fix: delete swap file fix: decimal type conversion Fix none case in indexer Update alembic/versions/33b920ecf3d6_add_incentives_apy_column.py Update alembic/versions/33b920ecf3d6_add_incentives_apy_column.py fix strategies view Add incentives_apy to indexer state Restructure query Add migration Add incentives_apy field to and Remove truefi production, add maple address fix: log unix timestamp fix: migration feat: remove old migrations feat: log maple apy Make consistent Update meta with hook and usdc-incentives Remove Euler strategy reference Add comment re-add apy edge case handling ...
- Loading branch information
Showing
19 changed files
with
479 additions
and
16 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
27 changes: 27 additions & 0 deletions
27
alembic/versions/33b920ecf3d6_add_incentives_apy_column.py
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,27 @@ | ||
"""add incentives_apy column | ||
Revision ID: 33b920ecf3d6 | ||
Revises: 9563fd232d2f | ||
Create Date: 2022-08-25 08:58:09.448640 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = '33b920ecf3d6' | ||
down_revision = '9563fd232d2f' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# TODO decide if nullable=true and server_default=None or not. | ||
op.add_column("stats_apy", sa.Column("incentives_apy", sa.Float(), nullable=False, server_default=sa.schema.DefaultClause("0"))) | ||
op.add_column("indexer_state", sa.Column("incentives_apy", sa.Float(), nullable=False, server_default=sa.schema.DefaultClause("0"))) | ||
|
||
|
||
def downgrade(): | ||
op.drop_column("stats_apy", "incentives_apy") | ||
op.drop_column("indexer_state", "incentives_apy") |
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,28 @@ | ||
"""Add additional_apy | ||
Revision ID: 9563fd232d2f | ||
Revises: fe1a6b4ecd8a | ||
Create Date: 2022-08-29 13:49:43.314919 | ||
""" | ||
import sqlalchemy as sa | ||
|
||
from alembic import op | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "9563fd232d2f" | ||
down_revision = "fe1a6b4ecd8a" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.add_column("indexer_state", sa.Column("additional_apy", sa.Float(), server_default="0", nullable=False)) | ||
# ### end Alembic commands ### | ||
|
||
|
||
def downgrade(): | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
op.drop_column("indexer_state", "additional_apy") | ||
# ### end Alembic commands ### |
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
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
Binary file not shown.
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
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
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
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
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
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
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
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,45 @@ | ||
import sentry_sdk | ||
from sentry_sdk.integrations.flask import FlaskIntegration | ||
|
||
import settings | ||
|
||
sentry_sdk.init( | ||
dsn=settings.SENTRY_DSN, | ||
environment=settings.SENTRY_ENVIRONMENT, | ||
integrations=[ | ||
FlaskIntegration(), | ||
], | ||
# Set traces_sample_rate to 1.0 to capture 100% | ||
# of transactions for performance monitoring. | ||
# We recommend adjusting this value in production. | ||
traces_sample_rate=0.01, | ||
# By default the SDK will try to use the SENTRY_RELEASE | ||
# environment variable, or infer a git commit | ||
# SHA as release, however you may want to set | ||
# something more human-readable. | ||
# release="[email protected]", | ||
) | ||
|
||
|
||
def report_message(message: str, level: str = None, extra={}): | ||
"""Capture a message and send it to Sentry | ||
Available levels are: | ||
- fatal | ||
- critical | ||
- error | ||
- warning | ||
- log | ||
- info | ||
- debug | ||
Args: | ||
message (str): Message text | ||
extra (dict): Dict of extra items to send with the message | ||
""" | ||
|
||
with sentry_sdk.push_scope() as scope: | ||
for key, value in extra.items(): | ||
scope.set_extra(key, value) | ||
|
||
sentry_sdk.capture_message(message, level) |
Oops, something went wrong.