Skip to content

Commit

Permalink
feat: agni
Browse files Browse the repository at this point in the history
  • Loading branch information
LiHang941 committed Dec 17, 2024
1 parent 2fb11f4 commit 0f70303
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
12 changes: 6 additions & 6 deletions constants/agni.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
MAX_TICK_RANGE=887272
START_BLOCK=72629606

usde_cmeth_025 = "0x95D39c45668D59141dc5bCC940e6C191f1ebB98c"
usde_usdt_001 = "0x36A7aff497eeF6a9cd7d0e7bc243793fcb3E57E2"
susde_usde_005 = "0x07277F7c1567b5324aA50a3d2F1F003E2287fBfc"
usdc_usde_001 = "0xBCf99c834E65E8a58090E20eDc058279317865BD"
agni_position_manager = "0x218bf598D1453383e2F4AA7b14fFB9BfB102D637"
usde_address = '0x5d3a1Ff2b6BAb83b63cd9AD0787074081a52ef34'
usde_cmeth_025 = Web3.to_checksum_address("0x95D39c45668D59141dc5bCC940e6C191f1ebB98c")
usde_usdt_001 = Web3.to_checksum_address("0x36A7aff497eeF6a9cd7d0e7bc243793fcb3E57E2")
susde_usde_005 = Web3.to_checksum_address("0x07277F7c1567b5324aA50a3d2F1F003E2287fBfc")
usdc_usde_001 = Web3.to_checksum_address("0xBCf99c834E65E8a58090E20eDc058279317865BD")
agni_position_manager = Web3.to_checksum_address("0x218bf598D1453383e2F4AA7b14fFB9BfB102D637")
usde_address = Web3.to_checksum_address('0x5d3a1Ff2b6BAb83b63cd9AD0787074081a52ef34')



Expand Down
2 changes: 1 addition & 1 deletion integrations/agni_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def get_block_balances(

block_data: Dict[int, Dict[ChecksumAddress, float]] = {}
for block in blocks:
user_data = {}
user_data:Dict[ChecksumAddress, float] = {}
for pool_info in pool_info_list:
pool_user_balance = get_agni_all_user_balance(pool_info, pool_info_list[pool_info], block)
for user in pool_user_balance:
Expand Down
12 changes: 6 additions & 6 deletions utils/agni.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,23 +124,23 @@ def calculate_agni_tokens(tick, tick_lower, tick_upper, sqrt_ratio_x96, liquidit


def get_agni_all_user_balance(pool: ChecksumAddress, users: Dict[ChecksumAddress, Set[int]],
block=w3_mantle.eth.get_block_number()):
block=w3_mantle.eth.get_block_number()) -> Dict[ChecksumAddress, float]:
try:
if block < START_BLOCK:
return {}
if pool == Web3.to_checksum_address(usde_cmeth_025):
if pool == usde_cmeth_025:
contract = usde_cmeth_025_contract
elif pool == Web3.to_checksum_address(usde_usdt_001):
elif pool == usde_usdt_001:
contract = usde_usdt_001_contract
elif pool == Web3.to_checksum_address(susde_usde_005):
elif pool == susde_usde_005:
contract = susde_usde_005_contract
elif pool == Web3.to_checksum_address(usdc_usde_001):
elif pool == usdc_usde_001:
contract = usdc_usde_001_contract
else:
raise Exception("Unknown pool")

print(users)
all_user_total_balances = {}
all_user_total_balances:Dict[ChecksumAddress, float] = {}

if len(users) == 0:
return all_user_total_balances
Expand Down

0 comments on commit 0f70303

Please sign in to comment.