Skip to content

Commit

Permalink
refactor: reorganize imports and update reward multiplier in campaign…
Browse files Browse the repository at this point in the history
….py; fix block chain reference in stonfi_integration.py
  • Loading branch information
deHB6 committed Jan 23, 2025
1 parent b4a01c7 commit 984f5b0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
28 changes: 14 additions & 14 deletions campaign/campaign.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
from typing import List
from constants.example_integrations import (
ACTIVE_ENA_START_BLOCK_EXAMPLE,
BEEFY_ARBITRUM_START_BLOCK_EXAMPLE,
KAMINO_SUSDE_COLLATERAL_START_BLOCK_EXAMPLE,
RATEX_EXAMPLE_USDE_START_BLOCK,
)
from constants.stonfi import STONFI_USDE_START_BLOCK
from web3 import Web3
from integrations.beefy_cached_balance_example_integration import (
BeefyCachedBalanceIntegration,
)
Expand All @@ -17,17 +11,23 @@
RatexL2DelegationExampleIntegration,
)
from integrations.stonfi_integration import StonFiIntegration
from utils import pendle
from web3 import Web3

from constants.chains import Chain
from constants.pendle import PENDLE_USDE_JULY_DEPLOYMENT_BLOCK
from constants.summary_columns import SummaryColumn
from integrations.integration import Integration
from integrations.integration_ids import IntegrationID
from integrations.pendle_lpt_integration import PendleLPTIntegration
from integrations.pendle_yt_integration import PendleYTIntegration
from integrations.template import ProtocolNameIntegration
from utils import pendle

from constants.example_integrations import (
ACTIVE_ENA_START_BLOCK_EXAMPLE,
BEEFY_ARBITRUM_START_BLOCK_EXAMPLE,
KAMINO_SUSDE_COLLATERAL_START_BLOCK_EXAMPLE,
RATEX_EXAMPLE_USDE_START_BLOCK,
)
from constants.stonfi import STONFI_USDE_START_BLOCK
from constants.chains import Chain
from constants.pendle import PENDLE_USDE_JULY_DEPLOYMENT_BLOCK
from constants.summary_columns import SummaryColumn

# TODO: Add your integration here
INTEGRATIONS: List[Integration] = [
Expand All @@ -39,7 +39,7 @@
SummaryColumn.STONFI_USDE_PTS,
],
chain=Chain.TON,
reward_multiplier=1,
reward_multiplier=30,
),
# Template integration
ProtocolNameIntegration(
Expand Down
3 changes: 2 additions & 1 deletion integrations/stonfi_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def get_l2_block_balances(

def get_participants_data(self, block: int) -> Dict[str, float]:
# block timestamp format "2025-01-16T01:00:00"
target_date = get_block_date(block, self.chain, adjustment=3600, fmt="%Y-%m-%dT%H:%M:%S")
target_date = get_block_date(block, Chain.ETHEREUM, adjustment=3600, fmt="%Y-%m-%dT%H:%M:%S")

logging.info(
f"Fetching participants data for STON.fi L2 delegation at block {block} timestamp {target_date}..."
Expand Down Expand Up @@ -96,6 +96,7 @@ def get_participants_data(self, block: int) -> Dict[str, float]:
wallet_address = holder["wallet_address"]
block_data[wallet_address] = int(holder["total_amount"]) / token_decimals_base
except Exception as e:
# pylint: disable=line-too-long
err_msg = f"Error getting participants data for STON.fi L2 delegation at block {block}: {e}"
logging.error(err_msg)
slack_message(err_msg)
Expand Down

0 comments on commit 984f5b0

Please sign in to comment.