Skip to content

Commit

Permalink
chore: fix linter part 2
Browse files Browse the repository at this point in the history
  • Loading branch information
FJ-Riveros committed Nov 19, 2024
1 parent 386e5fa commit 83ee6b2
Show file tree
Hide file tree
Showing 81 changed files with 487 additions and 368 deletions.
2 changes: 1 addition & 1 deletion constants/allstake.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

class StrategyConfig(TypedDict):
start: int
chain: str
chain: Chain
underlying: Contract
strategy: Contract
page_size: int
Expand Down
30 changes: 21 additions & 9 deletions constants/equilibria.py
Original file line number Diff line number Diff line change
@@ -1,30 +1,42 @@
PENDLE_LOCKER_ETHEREUM = "0x64627901dAdb46eD7f275fD4FC87d086cfF1e6E3"
equilibria_deposit_ethereum = "0x4D32C8Ff2fACC771eC7Efc70d6A8468bC30C26bF"
from web3 import Web3

SUSDE_SEPT = "0x198Ddb596a080215F0e15caeABca7eAB6b2d7A8f"
PENDLE_LOCKER_ETHEREUM = Web3.to_checksum_address(
"0x64627901dAdb46eD7f275fD4FC87d086cfF1e6E3"
)
equilibria_deposit_ethereum = Web3.to_checksum_address(
"0x4D32C8Ff2fACC771eC7Efc70d6A8468bC30C26bF"
)

SUSDE_SEPT = Web3.to_checksum_address("0x198Ddb596a080215F0e15caeABca7eAB6b2d7A8f")
SUSDE_SEPT_ID = 51
SUSDE_SEPT_DEPLOYMENT_BLOCK = 19931018

Karak_sUSDe_SEPT = "0xcB7212d19D52b53e44625Dc1A9d4B1f1d4833575"
Karak_sUSDe_SEPT = Web3.to_checksum_address(
"0xcB7212d19D52b53e44625Dc1A9d4B1f1d4833575"
)
Karak_sUSDe_SEPT_ID = 57
Karak_sUSDe_SEPT_DEPLOYMENT_BLOCK = 19975464

Karak_USDE_SEPT = "0x6fDF80071499b46Bb53AfBA7bAFf9D91A21133AB"
Karak_USDE_SEPT = Web3.to_checksum_address("0x6fDF80071499b46Bb53AfBA7bAFf9D91A21133AB")
Karak_USDE_SEPT_ID = 56
Karak_USDE_SEPT_DEPLOYMENT_BLOCK = 19975462

Zircuit_USDe_AUG = "0x0CaCF4ACdAAB8664857C29755Bd710B8bafDBeC3"
Zircuit_USDe_AUG = Web3.to_checksum_address(
"0x0CaCF4ACdAAB8664857C29755Bd710B8bafDBeC3"
)
Zircuit_USDe_AUG_ID = 69
Zircuit_USDe_AUG_DEPLOYMENT_BLOCK = 20181693

rUSDE_SEPT = "0x2F35DF137b64D1b62AE440b0D6A7b1cf9af4aB62"
rUSDE_SEPT = Web3.to_checksum_address("0x2F35DF137b64D1b62AE440b0D6A7b1cf9af4aB62")
rUSDE_SEPT_ID = 70
rUSDE_SEPT_DEPLOYMENT_BLOCK = 20230561

USDE_EXPIRY = "0x8c9590Fa87d5083668f1Ba0C6696688A0d2E8EC0"
USDE_EXPIRY = Web3.to_checksum_address("0x8c9590Fa87d5083668f1Ba0C6696688A0d2E8EC0")
USDE_EXPIRY_ID = 33
USDE_EXPIRY_DEPLOYMENT_BLOCK = 19330240

SUSDE_APR_EXPIRY = "0xDC947a371D46356859860451198cB3450086c88C"
SUSDE_APR_EXPIRY = Web3.to_checksum_address(
"0xDC947a371D46356859860451198cB3450086c88C"
)
SUSDE_APR_EXPIRY_ID = 35
SUSDE_APR_EXPIRY_DEPLOYMENT_BLOCK = 19382154
6 changes: 5 additions & 1 deletion constants/firm.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
from web3 import Web3

FIRM_SUSDE_DEPLOYMENT_BLOCK = 20441987

SUSDE_MARKET_ADDRESS = "0x79eF6d28C41e47A588E2F2ffB4140Eb6d952AEc4"
SUSDE_MARKET_ADDRESS = Web3.to_checksum_address(
"0x79eF6d28C41e47A588E2F2ffB4140Eb6d952AEc4"
)
16 changes: 10 additions & 6 deletions constants/fluid.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
vaultResolver = "0x49290f778faAD125f2FBCDE6F09600e73bf4bBd9"
vaultPositionResolver = "0x3E3dae4F30347782089d398D462546eb5276801C"
vaultFactory = "0x324c5Dc1fC42c7a4D43d92df1eBA58a54d13Bf2d"
sUSDe = "0x9D39A5DE30e57443BfF2A8307A4256c8797A3497"
USDe = "0x4c9EDD5852cd905f086C759E8383e09bff1E68B3"
dexResolver = "0x7af0C11F5c787632e567e6418D74e5832d8FFd4c"
from web3 import Web3

vaultResolver = Web3.to_checksum_address("0x49290f778faAD125f2FBCDE6F09600e73bf4bBd9")
vaultPositionResolver = Web3.to_checksum_address(
"0x3E3dae4F30347782089d398D462546eb5276801C"
)
vaultFactory = Web3.to_checksum_address("0x324c5Dc1fC42c7a4D43d92df1eBA58a54d13Bf2d")
sUSDe = Web3.to_checksum_address("0x9D39A5DE30e57443BfF2A8307A4256c8797A3497")
USDe = Web3.to_checksum_address("0x4c9EDD5852cd905f086C759E8383e09bff1E68B3")
dexResolver = Web3.to_checksum_address("0x7af0C11F5c787632e567e6418D74e5832d8FFd4c")
2 changes: 1 addition & 1 deletion constants/lyra.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class LyraVaultDetails(TypedDict):
),
page_size=20000,
),
IntegrationID.LYRA_SUSDE_EXCHANGE_DEPOSIT: LyraVaultDetails(
IntegrationID.LYRA_SUSDE_EXCHANGE_DEPOSIT: LyraVaultDetails( # type: ignore
detail_type=DetailType.Exchange,
start=11481048,
chain=Chain.Lyra,
Expand Down
14 changes: 11 additions & 3 deletions constants/nuri.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
NURI_NFP_MANAGER_ADDRESS = "0xAAA78E8C4241990B4ce159E105dA08129345946A"
NURI_POOL_ADDRESS = "0x93b77EABf65921477EE1FbC1B3833D7071DB1797"
from web3 import Web3

NURI_NFP_MANAGER_ADDRESS = Web3.to_checksum_address(
"0xAAA78E8C4241990B4ce159E105dA08129345946A"
)
NURI_POOL_ADDRESS = Web3.to_checksum_address(
"0x93b77EABf65921477EE1FbC1B3833D7071DB1797"
)
NURI_DEPLOYMENT_BLOCK = 7055711

SCROLL_USDE_TOKEN_ADDRESS = "0x5d3a1Ff2b6BAb83b63cd9AD0787074081a52ef34"
SCROLL_USDE_TOKEN_ADDRESS = Web3.to_checksum_address(
"0x5d3a1Ff2b6BAb83b63cd9AD0787074081a52ef34"
)
109 changes: 69 additions & 40 deletions constants/penpie.py
Original file line number Diff line number Diff line change
@@ -1,65 +1,94 @@
PENDLE_LOCKER_ETHEREUM = "0x6E799758CEE75DAe3d84e09D40dc416eCf713652"
PENDLE_LOCKER_ARBITRUM = "0x6DB96BBEB081d2a85E0954C252f2c1dC108b3f81"
master_penpie_ethereum="0x16296859C15289731521F199F0a5f762dF6347d0"
master_penpie_arbitrum="0x0776C06907CE6Ff3d9Dbf84bA9B3422d7225942D"


SUSDE_JULY = "0xae52ec79F2444D642B7E855DfF67bA4849D365eB"
from web3 import Web3

PENDLE_LOCKER_ETHEREUM = Web3.to_checksum_address(
"0x6E799758CEE75DAe3d84e09D40dc416eCf713652"
)
PENDLE_LOCKER_ARBITRUM = Web3.to_checksum_address(
"0x6DB96BBEB081d2a85E0954C252f2c1dC108b3f81"
)
master_penpie_ethereum = Web3.to_checksum_address(
"0x16296859C15289731521F199F0a5f762dF6347d0"
)
master_penpie_arbitrum = Web3.to_checksum_address(
"0x0776C06907CE6Ff3d9Dbf84bA9B3422d7225942D"
)


SUSDE_JULY = Web3.to_checksum_address("0xae52ec79F2444D642B7E855DfF67bA4849D365eB")
SUSDE_JULY_DEPLOYMENT_BLOCK = 19717752

Karak_sUSDe_26SEP2024_PRT="0x1c055D8081CA3B2bE0DD00ABe784b142C608219E"
Karak_sUSDe_26SEP2024_PRT_DEPLOYMENT_BLOCK=19967918

Karak_sUSDe_26SEP2024_PRT = Web3.to_checksum_address(
"0x1c055D8081CA3B2bE0DD00ABe784b142C608219E"
)
Karak_sUSDe_26SEP2024_PRT_DEPLOYMENT_BLOCK = 19967918


Karak_USDE_26SEP2024_PRT="0x0980Be7cC405ae7C31CC39E1dd1ee77483C1a430"
Karak_USDE_26SEP2024_PRT_DEPLOYMENT_BLOCK=19967899
Karak_USDE_26SEP2024_PRT = Web3.to_checksum_address(
"0x0980Be7cC405ae7C31CC39E1dd1ee77483C1a430"
)
Karak_USDE_26SEP2024_PRT_DEPLOYMENT_BLOCK = 19967899


sUSDe25APR2024_PRT="0xD35B5F85aeec81ba3A9BFa26478b2C43B8889C91"
sUSDe25APR2024_PRT_DEPLOYMENT_BLOCK=19367010
sUSDe25APR2024_PRT = Web3.to_checksum_address(
"0xD35B5F85aeec81ba3A9BFa26478b2C43B8889C91"
)
sUSDe25APR2024_PRT_DEPLOYMENT_BLOCK = 19367010


sUSDe26SEP2024_PRT="0xA60f87Eac3877dFCE688Df40AeBba20030E0eb75"
sUSDe26SEP2024_PRT_DEPLOYMENT_BLOCK=19909022
sUSDe26SEP2024_PRT = Web3.to_checksum_address(
"0xA60f87Eac3877dFCE688Df40AeBba20030E0eb75"
)
sUSDe26SEP2024_PRT_DEPLOYMENT_BLOCK = 19909022

USDe25JUL2024_PRT="0x3984E25AF3EbcfB4ca8925e9fA8855e17DC1D240"
USDe25JUL2024_PRT_DEPLOYMENT_BLOCK=19564654
USDe25JUL2024_PRT = Web3.to_checksum_address(
"0x3984E25AF3EbcfB4ca8925e9fA8855e17DC1D240"
)
USDe25JUL2024_PRT_DEPLOYMENT_BLOCK = 19564654


Zircuit_USDe27JUN2024_PRT="0x15254c0CD69cD5c92D6A8D66De487370E146b17d"
Zircuit_USDe27JUN2024_PRT_DEPLOYMENT_BLOCK=19588125
Zircuit_USDe27JUN2024_PRT = Web3.to_checksum_address(
"0x15254c0CD69cD5c92D6A8D66De487370E146b17d"
)
Zircuit_USDe27JUN2024_PRT_DEPLOYMENT_BLOCK = 19588125


ENA29AUG2024_PRT="0xF65d42E30C15E861bc410a94e01f0CbADC0356C2"
ENA29AUG2024_PRT_DEPLOYMENT_BLOCK=19644726
ENA29AUG2024_PRT = Web3.to_checksum_address(
"0xF65d42E30C15E861bc410a94e01f0CbADC0356C2"
)
ENA29AUG2024_PRT_DEPLOYMENT_BLOCK = 19644726

USDE_ARB_AUG2024="0x51FF42a579EBfC18EF9e92050494028B4aF34FA5"
USDE_ARB_AUG2024_DEPLOYMENT_BLOCK=197776131
USDE_ARB_AUG2024 = Web3.to_checksum_address(
"0x51FF42a579EBfC18EF9e92050494028B4aF34FA5"
)
USDE_ARB_AUG2024_DEPLOYMENT_BLOCK = 197776131

USDe_24OCT2024="0x39dAF77ad5514a9d3008313c2B8a37520C1F86D2"
USDe_24OCT2024_DEPLOYMENT_BLOCK=20326930
USDe_24OCT2024 = Web3.to_checksum_address("0x39dAF77ad5514a9d3008313c2B8a37520C1F86D2")
USDe_24OCT2024_DEPLOYMENT_BLOCK = 20326930

ENA_31OCT2024="0x0328C188287EaDA3E2E2151544d0226f800Eb9b5"
ENA_31OCT2024_DEPLOYMENT_BLOCK=20395113
ENA_31OCT2024 = Web3.to_checksum_address("0x0328C188287EaDA3E2E2151544d0226f800Eb9b5")
ENA_31OCT2024_DEPLOYMENT_BLOCK = 20395113


rsUSDe_26SEP2024="0x7F5955E5E36ABD98914c11E8c3Eff318CCc4eAF5"
rsUSDe_26SEP2024_DEPLOYMENT_BLOCK=20208513
rsUSDe_26SEP2024 = Web3.to_checksum_address(
"0x7F5955E5E36ABD98914c11E8c3Eff318CCc4eAF5"
)
rsUSDe_26SEP2024_DEPLOYMENT_BLOCK = 20208513

USDe_26DEC2024="0x6065c7870fF455fb9a78DD304579BdE2D7735703"
USDe_26DEC2024_DEPLOYMENT_BLOCK=20323985
USDe_26DEC2024 = Web3.to_checksum_address("0x6065c7870fF455fb9a78DD304579BdE2D7735703")
USDe_26DEC2024_DEPLOYMENT_BLOCK = 20323985

sUSDE_26DEC2024="0x590F0AB4c70686985D2C5a38859E0550445ACC20"
sUSDE_26DEC2024_DEPLOYMENT_BLOCK=20323930
sUSDE_26DEC2024 = Web3.to_checksum_address("0x590F0AB4c70686985D2C5a38859E0550445ACC20")
sUSDE_26DEC2024_DEPLOYMENT_BLOCK = 20323930


sUSDE_24OCT2024="0xaf09EE734B9B7157F371Ce984F67b1E87f8f2b2c"
sUSDE_24OCT2024_DEPLOYMENT_BLOCK=20326872
sUSDE_24OCT2024 = Web3.to_checksum_address("0xaf09EE734B9B7157F371Ce984F67b1E87f8f2b2c")
sUSDE_24OCT2024_DEPLOYMENT_BLOCK = 20326872


rsENA_26SEP2024="0x618e5ee4DD5BbD995883425B8AaC87dDCfb48Cf7"
rsENA_26SEP2024_DEPLOYMENT_BLOCK=20208485
rsENA_26SEP2024 = Web3.to_checksum_address("0x618e5ee4DD5BbD995883425B8AaC87dDCfb48Cf7")
rsENA_26SEP2024_DEPLOYMENT_BLOCK = 20208485

USDE_ARB_NOV2024="0x706f7F4cc144d6621E0c8798381575a8Cd1E0572"
USDE_ARB_NOV2024_DEPLOYMENT_BLOCK=242775302
USDE_ARB_NOV2024 = Web3.to_checksum_address(
"0x706f7F4cc144d6621E0c8798381575a8Cd1E0572"
)
USDE_ARB_NOV2024_DEPLOYMENT_BLOCK = 242775302
2 changes: 1 addition & 1 deletion constants/radiant.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

class RadiantLendingDetails(TypedDict):
start: int
chain: str
chain: Chain
collateral_address: str
r_token_contract: Contract
lending_pool: Contract
Expand Down
14 changes: 11 additions & 3 deletions constants/synthetix.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
SYNTHETIX_ARB_CORE_PROXY_ADDRESS = "0xffffffaEff0B96Ea8e4f94b2253f31abdD875847"
SYNTHETIX_ARB_CORE_ACCOUNT_PROXY_ADDRESS = "0x0E429603D3Cb1DFae4E6F52Add5fE82d96d77Dac"
from web3 import Web3

SYNTHETIX_ARB_CORE_PROXY_ADDRESS = Web3.to_checksum_address(
"0xffffffaEff0B96Ea8e4f94b2253f31abdD875847"
)
SYNTHETIX_ARB_CORE_ACCOUNT_PROXY_ADDRESS = Web3.to_checksum_address(
"0x0E429603D3Cb1DFae4E6F52Add5fE82d96d77Dac"
)
SYNTHETIX_ARB_DEPLOYMENT_BLOCK = 218272801

ARB_USDE_TOKEN_ADDRESS = "0x5d3a1Ff2b6BAb83b63cd9AD0787074081a52ef34"
ARB_USDE_TOKEN_ADDRESS = Web3.to_checksum_address(
"0x5d3a1Ff2b6BAb83b63cd9AD0787074081a52ef34"
)
2 changes: 1 addition & 1 deletion integrations/allstake_susde.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
integration = AllstakeIntegration(IntegrationID.ALLSTAKE_SUSDE)
current_block = W3_BY_CHAIN[integration.chain]["w3"].eth.get_block_number()

participants = integration.get_participants()
participants = integration.get_participants(None)
print("Get Participants:")
print(participants)
print("Get Balances of All Participants:")
Expand Down
2 changes: 1 addition & 1 deletion integrations/allstake_usde.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
integration = AllstakeIntegration(IntegrationID.ALLSTAKE_USDE)
current_block = W3_BY_CHAIN[integration.chain]["w3"].eth.get_block_number()

participants = integration.get_participants()
participants = integration.get_participants(None)
print("Get Participants:")
print(participants)
print("Get Balances of All Participants:")
Expand Down
10 changes: 5 additions & 5 deletions integrations/ambient_scroll.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ def get_balance(self, user: str, block: int) -> float:
Get the balance of a user at a given block
"""
url = f"{AMBIENT_SCROLL_API_URL}/sats/scroll/balance"
params = {"user": user, "block": block}
response = requests.get(url, params=params)
params = {"user": str(user), "block": str(block)}
response = requests.get(url, params=params) # type: ignore
data = response.json()
return data["data"]

def get_participants(self) -> list:
def get_participants(self, blocks: list[int] | None) -> set[str]:
"""
Get all participants of the protocol, ever.
This function should only be called once and should cache the results by setting self.participants
Expand All @@ -41,5 +41,5 @@ def get_participants(self) -> list:
if __name__ == "__main__":
# Simple tests for the integration
ambient = Ambient()
print(ambient.get_participants())
print(ambient.get_balance(list(ambient.get_participants())[2], 7372500))
print(ambient.get_participants(None))
print(ambient.get_balance(list(ambient.get_participants(None))[2], 7372500))
4 changes: 2 additions & 2 deletions integrations/beefy_arbitrum_usde.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
beefy_integration = BeefyIntegration(
IntegrationID.BEEFY_ARBITRUM_USDE, 179921508, Chain.ARBITRUM
)
print(beefy_integration.get_participants())
print(beefy_integration.get_participants(None))
print(
beefy_integration.get_balance(
list(beefy_integration.get_participants())[0], 20000001
list(beefy_integration.get_participants(None))[0], 20000001
)
)
4 changes: 2 additions & 2 deletions integrations/beefy_fraxtal_usde.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
beefy_integration = BeefyIntegration(
IntegrationID.BEEFY_FRAXTAL_USDE, 2366784, Chain.FRAXTAL
)
print(beefy_integration.get_participants())
print(beefy_integration.get_participants(None))
print(
beefy_integration.get_balance(
list(beefy_integration.get_participants())[0], 2466784
list(beefy_integration.get_participants(None))[0], 2466784
)
)
4 changes: 2 additions & 2 deletions integrations/beefy_mantle_usde.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
beefy_integration = BeefyIntegration(
IntegrationID.BEEFY_MANTLE_USDE, 66470986, Chain.MANTLE
)
print(beefy_integration.get_participants())
print(beefy_integration.get_participants(None))
print(
beefy_integration.get_balance(
list(beefy_integration.get_participants())[0], 66480986
list(beefy_integration.get_participants(None))[0], 66480986
)
)
4 changes: 2 additions & 2 deletions integrations/beefy_optimism_usde.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
beefy_integration = BeefyIntegration(
IntegrationID.BEEFY_OPTIMISM_USDE, 38082415, Chain.OPTIMISM
)
print(beefy_integration.get_participants())
print(beefy_integration.get_participants(None))
print(
beefy_integration.get_balance(
list(beefy_integration.get_participants())[0], 106819558
list(beefy_integration.get_participants(None))[0], 106819558
)
)
6 changes: 3 additions & 3 deletions integrations/equilibria_karak_susde_sept.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
Chain.ETHEREUM,
20,
1,
[PENDLE_LOCKER_ETHEREUM],
{PENDLE_LOCKER_ETHEREUM},
)

print(equilibria_integration.get_participants())
print(equilibria_integration.get_participants(None))
print(
equilibria_integration.get_balance(
list(equilibria_integration.get_participants())[0], "latest"
list(equilibria_integration.get_participants(None))[0]
)
)
6 changes: 3 additions & 3 deletions integrations/equilibria_karak_usde_sept.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
Chain.ETHEREUM,
20,
1,
[PENDLE_LOCKER_ETHEREUM],
{PENDLE_LOCKER_ETHEREUM},
)

print(equilibria_integration.get_participants())
print(equilibria_integration.get_participants(None))
print(
equilibria_integration.get_balance(
list(equilibria_integration.get_participants())[0], "latest"
list(equilibria_integration.get_participants(None))[0]
)
)
Loading

0 comments on commit 83ee6b2

Please sign in to comment.