Skip to content

Commit a6bbc76

Browse files
fetch users for compound pools also
1 parent 00f2846 commit a6bbc76

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

utils/penpieV2.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,10 +201,16 @@ def get_penpie_participants(self):
201201
contract = w3.eth.contract(
202202
address=w3.to_checksum_address(self.lp_contract), abi=erc20_abi
203203
)
204+
contract_auto_market = w3.eth.contract(
205+
address=w3.to_checksum_address(self.autoMarket_contract), abi=erc20_abi
206+
)
204207
elif self.chain == Chain.ARBITRUM:
205208
contract = w3_arb.eth.contract(
206209
address=w3_arb.to_checksum_address(self.lp_contract), abi=erc20_abi
207210
)
211+
contract_auto_market = w3_arb.eth.contract(
212+
address=w3_arb.to_checksum_address(self.autoMarket_contract), abi=erc20_abi
213+
)
208214
else:
209215
return set()
210216
page_size = 1900
@@ -230,6 +236,22 @@ def get_penpie_participants(self):
230236
):
231237
all_users.add(deposit["args"]["to"])
232238
print(deposit["args"]["to"])
239+
240+
if self.autoMarket_contract != "0x0000000000000000000000000000000000000000":
241+
deposits_auto_market = fetch_events_logs_with_retry(
242+
f"Penpie users {self.autoMarket_contract}",
243+
contract_auto_market.events.Transfer(),
244+
start,
245+
to_block,
246+
)
247+
248+
for deposit_auto_market in deposits_auto_market:
249+
if (
250+
deposit_auto_market["args"]["to"]
251+
!= "0x0000000000000000000000000000000000000000"
252+
):
253+
all_users.add(deposit_auto_market["args"]["to"])
254+
print(deposit_auto_market["args"]["to"])
233255
start += page_size
234256

235257
return all_users

0 commit comments

Comments
 (0)