Skip to content

Commit

Permalink
feat: update config for vault on Swell
Browse files Browse the repository at this point in the history
  • Loading branch information
anhvietnguyennva committed Dec 20, 2024
1 parent 4949181 commit efc4f99
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ SCROLL_NODE_URL='https://rpc.scroll.io'
MODE_NODE_URL='https://mainnet.mode.network'
FRAXTAL_NODE_URL='https://rpc.frax.com'
LYRA_NODE_URL='https://rpc.derive.xyz'
SWELL_NODE_URL='https://rpc.scroll.io'
SWELL_NODE_URL='https://rpc.ankr.com/swell'

DERIVE_SUBGRAPH_API_KEY=''
2 changes: 1 addition & 1 deletion constants/chains.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ class Chain(Enum):
MODE = "Mode"
OPTIMISM = "Optimism"
Lyra = "Lyra"
SWELL = "Scroll"
SWELL = "Swell"
6 changes: 3 additions & 3 deletions constants/tempest.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from dataclasses import dataclass

GET_USERS_API_URL = "https://protocol-service-api.tempestdev.xyz/api/v1/users"
CHAIN_ID_SWELL = "534352"
GET_USERS_API_URL = "https://protocol-service-api.tempestfinance.xyz/api/v1/users"
CHAIN_ID_SWELL = "1923"

ABI_FILENAME = "abi/tempest_symmetric_vault.json"

Expand All @@ -11,5 +11,5 @@ class VaultConfig:
genesis_block: int

VAULTS = [
VaultConfig(address="0x9674d655bf1a456c441157a5e8c5fa4c144e21e8", genesis_block=10717843)
VaultConfig(address="0x1783eb6b8966f7a2c3aa9b913dd53353b2c8c873", genesis_block=965288)
]
6 changes: 4 additions & 2 deletions integrations/tempest_swell_usde.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def get_data_for_block(
) -> Dict[ChecksumAddress, float]:
logging.info(f"Getting data for Tempest at block {block}...")

if block < genesis_block:
if block <= genesis_block:
return {}

contract = self.vault_contract_by_address[vault_address]
Expand All @@ -90,6 +90,8 @@ def get_data_for_block(

# convert share balance to USDe balance
for i in range(0, len(users)):
if balance_of_results[i][0] == 0:
continue
data[users[i]] = balance_of_results[i][0] * total_assets / total_supply

return data
Expand Down Expand Up @@ -124,5 +126,5 @@ def get_block_balances(
chain=Chain.SWELL,
summary_cols=[SummaryColumn.TEMPEST_SWELL_SHARDS],
)
balances = integration.get_block_balances(cached_data={}, blocks=[12008398])
balances = integration.get_block_balances(cached_data={}, blocks=[983436])
print(balances)
3 changes: 1 addition & 2 deletions utils/web3_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,7 @@
"0x5BA1e12693Dc8F9c48aAD8770482f4739bEeD696" # Ethereum mainnet address
)
MULTICALL_ADDRESS_BY_CHAIN = {
Chain.SWELL: "0xcA11bde05977b3631167028862bE2a173976CA11",
Chain.SCROLL: "0xcA11bde05977b3631167028862bE2a173976CA11"
Chain.SWELL: "0xcA11bde05977b3631167028862bE2a173976CA11"
}


Expand Down

0 comments on commit efc4f99

Please sign in to comment.