Skip to content

Commit d6eaa0f

Browse files
committed
Add: sUSDe July expiry
1 parent dae8fbc commit d6eaa0f

4 files changed

Lines changed: 65 additions & 13 deletions

File tree

constants/silo_finance.py

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,24 +25,30 @@ class SiloFinanceMarket:
2525
assets_decimals=18,
2626
),
2727
# https://etherscan.io/address/0x46d30718F0372713b989F91f9f0Be1Bf5Cf5F082
28-
# SiloFinanceMarket(
29-
# address="0x46d30718F0372713b989F91f9f0Be1Bf5Cf5F082",
30-
# start_block=22694943,
31-
# non_borrowable_token_address="0x7a3E2284DB8F2b9d6Bcc54faB182284FaC53f51b",
32-
# ),
28+
SiloFinanceMarket(
29+
address="0x46d30718F0372713b989F91f9f0Be1Bf5Cf5F082",
30+
start_block=22694943,
31+
non_borrowable_token_address="0x7a3E2284DB8F2b9d6Bcc54faB182284FaC53f51b",
32+
shares_decimals=21,
33+
assets_decimals=18,
34+
),
3335
# https://etherscan.io/address/0x4902F25cf6486840F9dED17A6b3AF74fE107fffc
34-
# SiloFinanceMarket(
35-
# address="0x4902F25cf6486840F9dED17A6b3AF74fE107fffc",
36-
# start_block=22695554,
37-
# non_borrowable_token_address="0x0000000000000000000000000000000000000000",
38-
# ),
36+
SiloFinanceMarket(
37+
address="0x4902F25cf6486840F9dED17A6b3AF74fE107fffc",
38+
start_block=22694943,
39+
non_borrowable_token_address="0x0000000000000000000000000000000000000000",
40+
shares_decimals=21,
41+
assets_decimals=18,
42+
),
3943
]
4044

4145
SILO_FINANCE_INTEGRATION_ID_TO_MARKET = {
4246
IntID.SILO_FINANCE_LP_SUSDE_SEP_25_EXPIRY: SILO_FINANCE_MARKETS[0],
47+
IntID.SILO_FINANCE_LP_SUSDE_JUL_31_EXPIRY: SILO_FINANCE_MARKETS[1],
4348
}
4449

4550
# NOTE: the first deployment block is the earliest block where any of the markets are deployed
4651
SILO_FINANCE_INTEGRATION_ID_TO_START_BLOCK = {
4752
IntID.SILO_FINANCE_LP_SUSDE_SEP_25_EXPIRY: SILO_FINANCE_MARKETS[0].start_block,
53+
IntID.SILO_FINANCE_LP_SUSDE_JUL_31_EXPIRY: SILO_FINANCE_MARKETS[1].start_block,
4854
}

integrations/integration_ids.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -512,6 +512,13 @@ class IntegrationID(Enum):
512512
Token.USDE,
513513
)
514514

515+
# Silo Finance LP-sUSDe (31 Jul 2025)
516+
SILO_FINANCE_LP_SUSDE_JUL_31_EXPIRY = (
517+
"silo_finance_lp_susde_jul_31_expiry",
518+
"Silo Finance LP-sUSDe (Jul 31)",
519+
Token.SUSDE,
520+
)
521+
515522
def __init__(self, column_name: str, description: str, token: Token = Token.USDE):
516523
self.column_name = column_name
517524
self.description = description
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
from rich.console import Console
2+
3+
from constants.silo_finance import SILO_FINANCE_INTEGRATION_ID_TO_START_BLOCK
4+
from constants.summary_columns import SummaryColumn
5+
from integrations.integration_ids import IntegrationID as IntID
6+
from constants.chains import Chain
7+
from utils.silo_finance import SiloFinance
8+
9+
if __name__ == "__main__":
10+
console = Console()
11+
integration_id = IntID.SILO_FINANCE_LP_SUSDE_JUL_31_EXPIRY
12+
integration = SiloFinance(
13+
integration_id=integration_id,
14+
start_block=SILO_FINANCE_INTEGRATION_ID_TO_START_BLOCK[integration_id],
15+
chain=Chain.ETHEREUM,
16+
summary_cols=[SummaryColumn.SILO_FINANCE_LP_SUSDE_JUL_31_PTS],
17+
reward_multiplier=30,
18+
balance_multiplier=1,
19+
)
20+
21+
# Without cached data
22+
without_cached_data_output = integration.get_block_balances(
23+
cached_data={}, blocks=[22726532]
24+
)
25+
console.print("Run without cached data", without_cached_data_output)
26+
# Check that the output is correct~ish
27+
assert without_cached_data_output[22726532] == {
28+
"0x791D1ec51D931186c1d4B80E753B7155DD98f741": 5.0
29+
}
30+
31+
# Use cache data to get the next blocks
32+
with_cached_data_output = integration.get_block_balances(
33+
cached_data=without_cached_data_output,
34+
blocks=[22767688],
35+
)
36+
console.print("Run with cached data", with_cached_data_output)
37+
assert with_cached_data_output[22767688] == {
38+
"0x791D1ec51D931186c1d4B80E753B7155DD98f741": 0.0,
39+
"0x62a4A8f9f5F3AaE9Ee9CEE780285A0D501C12d09": 17.71744,
40+
"0x7FDe637d685A5486CCb1B0a8eF658Ad1a08e8337": 234388.684906,
41+
}

utils/silo_finance.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,7 @@ def get_block_balances(
4343
logger.info(f"Getting block data for Silo Finance {market.address}")
4444
new_block_data: Dict[int, Dict[ChecksumAddress, float]] = {}
4545
if not blocks:
46-
logging.error(
47-
"No blocks provided to Silo Finance LP-eUSDe get_block_balances"
48-
)
46+
logger.error("No blocks provided to get_block_balances")
4947
return new_block_data
5048

5149
cache_copy: Dict[int, Dict[ChecksumAddress, float]] = deepcopy(cached_data)

0 commit comments

Comments
 (0)