diff --git a/schema.graphql b/schema.graphql index 74ec0ca..6b9223e 100644 --- a/schema.graphql +++ b/schema.graphql @@ -494,6 +494,18 @@ type AlchemistSnapEvent implements Event @entity { yieldToken: Bytes! } +type AlchemistSweepTokensEvent implements Event @entity { + id: ID! + cursor: BigInt! + index: BigInt! + block: Block! + timestamp: BigInt! + contract: Contract! + transaction: Transaction! + amount: BigInt! + rewardToken: Bytes! +} + type AlchemistTokenAdapterUpdatedEvent implements Event @entity { id: ID! cursor: BigInt! @@ -812,6 +824,15 @@ type TransmuterBufferSetAlchemistEvent implements Event @entity { alchemist: Bytes! } +type TransmuterBufferSetTransmuter implements Event @entity { + id: ID! + cursor: BigInt! + index: BigInt! + block: Block! + timestamp: BigInt! + transmuter: Bytes! +} + type TransmuterBufferSetFlowRateEvent implements Event @entity { id: ID! cursor: BigInt! @@ -985,6 +1006,19 @@ type PoolRemoveLiquidityEvent implements PoolEvent @entity { transaction: Bytes! } +type PoolRampAEvent implements PoolEvent @entity { + id: ID! + pool: Pool! + oldA: BigInt! + newA: BigInt! + initialTime: BigInt! + futureTime: BigInt! + + block: Block! + timestamp: BigInt! + transaction: Bytes! +} + type PoolRemoveLiquidityOneEvent implements PoolEvent @entity { id: ID! pool: Pool! @@ -1481,25 +1515,25 @@ type EthAssetManagerReclaimEthEvent implements Event @entity { amount: BigInt! } -type EthAssetManagerSweepTokenEvent implements Event @entity { - id: ID! - cursor: BigInt! - index: BigInt! - block: Block! - timestamp: BigInt! - contract: Contract! - transaction: Transaction! - token: Bytes! - amount: BigInt! -} - -type EthAssetManagerSweepEthEvent implements Event @entity { - id: ID! - cursor: BigInt! - index: BigInt! - block: Block! - timestamp: BigInt! - contract: Contract! - transaction: Transaction! - amount: BigInt! -} +# type EthAssetManagerSweepTokenEvent implements Event @entity { +# id: ID! +# cursor: BigInt! +# index: BigInt! +# block: Block! +# timestamp: BigInt! +# contract: Contract! +# transaction: Transaction! +# token: Bytes! +# amount: BigInt! +# } + +# type EthAssetManagerSweepEthEvent implements Event @entity { +# id: ID! +# cursor: BigInt! +# index: BigInt! +# block: Block! +# timestamp: BigInt! +# contract: Contract! +# transaction: Transaction! +# amount: BigInt! +# } diff --git a/subgraph/handlers/Alchemist.ts b/subgraph/handlers/Alchemist.ts index 338cc91..573d74b 100644 --- a/subgraph/handlers/Alchemist.ts +++ b/subgraph/handlers/Alchemist.ts @@ -26,6 +26,7 @@ import { AlchemistRepayLimitUpdatedEvent, AlchemistSentinelSetEvent, AlchemistSnapEvent, + AlchemistSweepTokensEvent, AlchemistTokenAdapterUpdatedEvent, AlchemistTransmuterUpdatedEvent, AlchemistUnderlyingTokenEnabledEvent, @@ -58,6 +59,7 @@ import { RepayLimitUpdated, SentinelSet, Snap, + SweepTokens, TokenAdapterUpdated, TransmuterUpdated, UnderlyingTokenEnabled, @@ -82,6 +84,7 @@ import { getOrCreateAlchemistGlobalDebtHistory, getOrCreateDebtToken, } from '../utils/entities'; +import { SetTransmuter } from '../generated/TransmuterBuffer_alETH/TransmuterBuffer'; function getOrCreateAlchemist(event: ethereum.Event): Alchemist { let entity = Alchemist.load(event.address.toHex()); @@ -358,6 +361,13 @@ export function handleSnap(event: Snap): void { entity.save(); } +export function handleSweepTokens(event: SweepTokens): void { + const entity = createAlchemistEvent(event); + entity.amount = event.params.amount; + entity.rewardToken = event.params.rewardToken; + entity.save(); +} + export function handleTokenAdapterUpdated(event: TokenAdapterUpdated): void { const entity = createAlchemistEvent(event); entity.tokenAdapter = event.params.tokenAdapter; diff --git a/subgraph/handlers/FactoryPool.ts b/subgraph/handlers/FactoryPool.ts index 6ea83c6..b27c106 100644 --- a/subgraph/handlers/FactoryPool.ts +++ b/subgraph/handlers/FactoryPool.ts @@ -81,6 +81,9 @@ export function handleAddLiquidity(event: AddLiquidity): void { } } +export function handleRampA(): void {} +export function handleStopRampA(): void {} + export function handleRemoveLiquidity(event: RemoveLiquidity): void { createFactoryPoolEvent(event); let pool = getOrCreatePool(event.address, event); diff --git a/subgraph/handlers/TransmuterBuffer.ts b/subgraph/handlers/TransmuterBuffer.ts index f0bf517..ab87799 100644 --- a/subgraph/handlers/TransmuterBuffer.ts +++ b/subgraph/handlers/TransmuterBuffer.ts @@ -11,6 +11,7 @@ import { TransmuterBufferSetSourceEvent, TransmuterBufferSetAmoEvent, TransmuterBufferSetDivertToAmoEvent, + TransmuterBufferSetTransmuter, } from '../generated/schema'; import { RefreshStrategies, @@ -22,6 +23,7 @@ import { SetAmo, SetFlowRate, SetSource, + SetTransmuter, } from '../generated/TransmuterBuffer_alETH/TransmuterBuffer'; import { SetDivertToAmo } from '../generated/TransmuterBuffer_alUSD/TransmuterBuffer'; import { createEvent, getOrCreateUnderlyingToken } from '../utils/entities'; @@ -87,6 +89,12 @@ export function handleSetAlchemist(event: SetAlchemist): void { entity.save(); } +export function handleSetTransmuter(event: SetTransmuter): void { + const entity = createTransmuterBufferEvent(event); + entity.transmuter = event.params.transmuter; + entity.save(); +} + export function handleSetFlowRate(event: SetFlowRate): void { const entity = createTransmuterBufferEvent(event); entity.flowRate = event.params.flowRate;