Skip to content

Commit

Permalink
handle pool initilization
Browse files Browse the repository at this point in the history
  • Loading branch information
mendesfabio committed Jul 1, 2024
1 parent ea78b65 commit 19a8827
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
16 changes: 8 additions & 8 deletions networks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -244,12 +244,12 @@ polygon:
block: 54559455
# this will be the base of the unpruned deployment, so make sure it has not been pruned
# it should be possible to run time travel queries on it going back to the vault's startBlock
base: Qmd6J5P1KYqwUmFupQ98Le7tGstDv3uUhHAwAzyPiicixw
base: QmUqS6BAVQgvstEsVrxuwsu1DwQdfAdj3Q6gz2j3DbUYQ9
graft_pruned:
# FXPoolDeployerTracker start block
block: 54559455
# this will be the base of the pruned deployment, so it is ok if it is a pruned subgraph
base: Qmd6J5P1KYqwUmFupQ98Le7tGstDv3uUhHAwAzyPiicixw
base: QmUqS6BAVQgvstEsVrxuwsu1DwQdfAdj3Q6gz2j3DbUYQ9
EventEmitter:
address: "0xcdcECFa416EE3022030E707dC3EA13a8997D74c8"
startBlock: 38152461
Expand Down Expand Up @@ -377,10 +377,10 @@ arbitrum:
network: arbitrum-one
graft:
# FXPoolDeployerTracker start block
block: 191573392
# block: 191573392
# always make sure the base subgraph has not been pruned
# it should be possible to run time travel queries on it going back to the vault's startBlock
base: Qmdwyva2Qn28ZA1NDffAajmWKG8MgruNFZH5BKs2ZWMX4b
# base: Qmdwyva2Qn28ZA1NDffAajmWKG8MgruNFZH5BKs2ZWMX4b
EventEmitter:
address: "0x8f32D631093B5418d0546f77442c5fa66187E59D"
startBlock: 53475240
Expand Down Expand Up @@ -527,8 +527,8 @@ bnb:
gnosis:
network: gnosis
graft:
block: 33759936
base: "QmSBvRxXZbusTtbLUPRreeo1GDigfEYPioYVeWZqHRMZpV"
# block: 33759936
# base: "QmSBvRxXZbusTtbLUPRreeo1GDigfEYPioYVeWZqHRMZpV"
EventEmitter:
address: "0xd8bf95b44772213905a8a74881862347acbabc48"
startBlock: 26892431
Expand Down Expand Up @@ -590,10 +590,10 @@ optimism:
network: optimism
graft:
# Apr-11-2024 03:19:37 PM +UTC
block: 118625000
# block: 118625000
# always make sure the base subgraph has not been pruned
# it should be possible to run time travel queries on it going back to the vault's startBlock
base: QmdDQKt3Q8AaWHmTKGLFXxsgrEikNSofqMu7LqYtTGntKh
# base: QmdDQKt3Q8AaWHmTKGLFXxsgrEikNSofqMu7LqYtTGntKh
EventEmitter:
address: "0x082990116f256E078572a1b69772115d2cF6b0a2"
startBlock: 99124541
Expand Down
2 changes: 2 additions & 0 deletions schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ type Pool @entity {
symbol: String
name: String

isInitialized: Boolean

"Indicates if a pool can be swapped against. Combines multiple sources, including offchain curation"
swapEnabled: Boolean!

Expand Down
1 change: 1 addition & 0 deletions src/mappings/poolFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,7 @@ function handleNewPool(event: PoolCreated, poolId: Bytes, swapFee: BigInt): Pool
pool.tx = event.transaction.hash;
pool.swapEnabled = true;
pool.swapEnabledInternal = true;
pool.isInitialized = false;
pool.isPaused = false;

let bpt = getToken(poolAddress);
Expand Down
2 changes: 2 additions & 0 deletions src/mappings/vault.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ function handlePoolJoined(event: PoolBalanceChanged): void {
return;
}

if (!pool.isInitialized) pool.isInitialized = true;

// if a pool that was paused is joined, it means it's pause has expired
// TODO: fix this for when pool.isPaused is null
// TODO: handle the case where the pool's actual swapEnabled is false
Expand Down

0 comments on commit 19a8827

Please sign in to comment.