Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DO NOT MERGE] feat: add zero lend #124

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions subgraphs/enzyme-core/mappings/v4/ExternalPositionManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ import {
gmxUsdDecimals,
} from '../../entities/GMXV2LeverageTradingPosition';
import { createAlicePosition, createAlicePositionChange, useAliceOrder } from '../../entities/AlicePosition';
import { aaveV3LikeDebtTypes } from '../../utils/aaveV3Like';
// import {
// createMorphoBluePosition,
// createMorphoBluePositionChange,
Expand All @@ -186,7 +187,7 @@ export function handleExternalPositionDeployedForFund(event: ExternalPositionDep
return;
}

if (type.label == 'AAVE_V3_DEBT') {
if (aaveV3LikeDebtTypes.includes(type.label)) {
createAaveV3DebtPosition(event.params.externalPosition, event.params.vaultProxy, type);
return;
}
Expand Down Expand Up @@ -397,7 +398,7 @@ export function handleCallOnExternalPositionExecutedForFund(event: CallOnExterna
return;
}

if (type.label == 'AAVE_V3_DEBT') {
if (aaveV3LikeDebtTypes.includes(type.label)) {
if (actionId == AaveV3DebtPositionActionId.AddCollateral) {
let decoded = ethereum.decode('(address[],uint256[],bool)', tuplePrefixBytes(event.params.actionArgs));

Expand Down
5 changes: 3 additions & 2 deletions subgraphs/enzyme-core/mappings/v4/VaultLib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ import { usePendleV2Position } from '../../entities/PendleV2Position';
import { useGMXV2LeverageTradingPosition } from '../../entities/GMXV2LeverageTradingPosition';
import { useAlicePosition } from '../../entities/AlicePosition';
import { useStaderWithdrawalsPosition } from '../../entities/StaderWithdrawalsPosition';
import { aaveV3LikeDebtTypes } from '../../utils/aaveV3Like';
// import { useMorphoBluePosition } from '../../entities/MorphoBluePosition';

export function handleTransfer(event: Transfer): void {
Expand Down Expand Up @@ -332,7 +333,7 @@ export function handleExternalPositionAdded(event: ExternalPositionAdded): void
adp.save();
}

if (type.label == 'AAVE_V3_DEBT') {
if (aaveV3LikeDebtTypes.includes(type.label)) {
let adp = useAaveV3DebtPosition(event.params.externalPosition.toHex());
adp.active = true;
adp.save();
Expand Down Expand Up @@ -444,7 +445,7 @@ export function handleExternalPositionRemoved(event: ExternalPositionRemoved): v
adp.save();
}

if (type.label == 'AAVE_V3_DEBT') {
if (aaveV3LikeDebtTypes.includes(type.label)) {
let adp = useAaveV3DebtPosition(event.params.externalPosition.toHex());
adp.active = false;
adp.save();
Expand Down
5 changes: 5 additions & 0 deletions subgraphs/enzyme-core/utils/aaveV3Like.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export let aaveV3LikeDebtTypes = [
'AAVE_V3_DEBT',
'ZERO_LEND_RWA_STABLECOINS_AAVE_V3_DEBT',
'ZERO_LEND_BTC_AAVE_V3_DEBT',
];