-
Notifications
You must be signed in to change notification settings - Fork 241
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update revenue logic and add EarlyAdopterPool
- Loading branch information
Showing
11 changed files
with
1,886 additions
and
55 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
subgraphs/etherfi/protocols/etherfi/config/deployments/etherfi-ethereum/configurations.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
subgraphs/etherfi/src/mappings/earlyAdopterPoolMappings.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import { | ||
updatePoolTVL, | ||
initializeSDKFromEvent, | ||
updatePoolOutputTokenSupply, | ||
getOrCreateEarlyAdopterPool, | ||
} from "../common/initializers"; | ||
import { | ||
Withdrawn, | ||
DepositEth, | ||
DepositERC20, | ||
ERC20TVLUpdated, | ||
} from "../../generated/EarlyAdopterPool/EarlyAdopterPool"; | ||
|
||
export function handleERC20TVLUpdated(event: ERC20TVLUpdated): void { | ||
const sdk = initializeSDKFromEvent(event); | ||
const pool = getOrCreateEarlyAdopterPool(event.address, sdk); | ||
|
||
pool.setInputTokenBalances( | ||
[ | ||
event.params.rETHBal, | ||
event.params.wstETHBal, | ||
event.params.sfrxETHBal, | ||
event.params.cbETHBal, | ||
event.params.ETHBal, | ||
], | ||
true | ||
); | ||
|
||
updatePoolOutputTokenSupply(pool); | ||
updatePoolTVL(pool); | ||
} | ||
|
||
export function handleDepositEth(event: DepositEth): void { | ||
const sender = event.params.sender; | ||
const sdk = initializeSDKFromEvent(event); | ||
|
||
const account = sdk.Accounts.loadAccount(sender); | ||
account.trackActivity(); | ||
} | ||
|
||
export function handleDepositERC20(event: DepositERC20): void { | ||
const sender = event.params.sender; | ||
const sdk = initializeSDKFromEvent(event); | ||
|
||
const account = sdk.Accounts.loadAccount(sender); | ||
account.trackActivity(); | ||
} | ||
|
||
export function handleWithdrawn(event: Withdrawn): void { | ||
const sender = event.params.sender; | ||
const sdk = initializeSDKFromEvent(event); | ||
|
||
const account = sdk.Accounts.loadAccount(sender); | ||
account.trackActivity(); | ||
} |
Oops, something went wrong.