Skip to content

Conversation

@stevenvaleri
Copy link
Contributor

@stevenvaleri stevenvaleri commented Jan 24, 2025

Integrate Rumpel's kpSAT-sENA pool.

kpSATs represent 1000 Ethena Sats.

Approach:
Identify kpSAT-sENA UniV3 Positions:

  1. Query all mint events that occur directly on this univ3 pool
  2. For each tx with a mint event, get the transaction receipt
  3. Access the IncreaseLiquidity event from Uni's NonFungible Position Manager to identify the token id of each univ3 position

For each univ3 position identified

  1. get the owner
  2. get the liquidity amount
  3. calculate the amount of sENA that position holds

Testing is a bit challenging to execute programatically. Printed balances can be compared to revert.fi to prove the position's sENA holdings are accurate. Also the sum of all positions nearly equal the balance of the pool, not accounting for accrued fees not sitting in the pool.

Script output on block 21695450:

21695450: 
{
'0x0E9D806e354eB4235958A294FDEf09D18862C02c': 80958.44325219445, '0xa785d5cB71EA3A74c351F5B41b5befb1b9b59d85': 16309.992983902353, '0xb8C42c0Fe5bC45336d001963b52C45Edd476438C': 9652.642765196986, '0x54dF9e11c7933a9cA3BD1E540B63dA15edAe40bf': 0
}

Output Sum: 106,919
Pool Balance: 106,922
image

0x0E9D806e354eB4235958A294FDEf09D18862C02c position: 883208
revert.fi: -
image

@deHB6 deHB6 requested a review from FJ-Riveros January 26, 2025 18:40
@FJ-Riveros FJ-Riveros merged commit ef322db into ethena-labs:main Feb 3, 2025
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants