-
Notifications
You must be signed in to change notification settings - Fork 10
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
Add support for FX pools #29
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
956a895
docker-compose setup
gmbronco dcfd0d2
more tests
gmbronco ee6e0e7
allow deleting pools with associations
gmbronco 001d1df
pool defaults for 24h volume and fees
gmbronco 9d5c936
pools data json column
gmbronco b5af3e5
add fx data to subgraph
gmbronco 827943c
subgraph to DB mappers
gmbronco 7ab4104
FX pools parsing in SOR
gmbronco 64d756b
FX pools in the graph schema
gmbronco 5d63418
subgraph pool to DB update
gmbronco 65d9451
obsolete poolSyncAllPoolTypesVersions
gmbronco 6aa8aac
include pool tokens in subgraph sync
gmbronco 9c533b2
obsolete poolReloadPoolTokenIndexes
gmbronco 5497a1d
obsolete poolReloadPoolNestedTokens
gmbronco d5fb8e8
obsolete poolSync mutations
gmbronco d6e71f0
fix pool type mapping for StablePhantom
gmbronco 63fd0b2
add nestedPool list when creating new pools
gmbronco 2dee404
renaming pool.data to pool.poolTypeSpecificData
gmbronco 64ca22b
import all of the functions directly
gmbronco 48c1f90
delete cleanup based on constraints
gmbronco 00fd3e0
renaming
franzns 8fb588a
rename column
franzns 9eb0ea2
prisma schema
franzns File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import { Chain, PrismaPoolType } from '@prisma/client'; | ||
import { BalancerPoolFragment } from '../subgraphs/balancer-subgraph/generated/balancer-subgraph-types'; | ||
import { AddressZero } from '@ethersproject/constants'; | ||
import * as dataMappers from './pool-data'; | ||
import { fx, gyro, linear, element, stableDynamic, linearDynamic } from './pool-data'; | ||
|
||
export const subgraphToPrismaCreate = ( | ||
pool: BalancerPoolFragment, | ||
|
@@ -266,24 +266,24 @@ const mapPoolTypeVersion = (poolType: string, poolTypeVersion: number): number = | |
}; | ||
|
||
const dataMapper = { | ||
ELEMENT: dataMappers.element, | ||
FX: dataMappers.fx, | ||
GYRO: dataMappers.gyro, | ||
GYRO3: dataMappers.gyro, | ||
GYROE: dataMappers.gyro, | ||
LINEAR: dataMappers.linear, | ||
ELEMENT: element, | ||
FX: fx, | ||
GYRO: gyro, | ||
GYRO3: gyro, | ||
GYROE: gyro, | ||
LINEAR: linear, | ||
}; | ||
|
||
const dynamicMapper = { | ||
STABLE: dataMappers.stableDynamic, | ||
COMPOSABLE_STABLE: dataMappers.stableDynamic, | ||
META_STABLE: dataMappers.stableDynamic, | ||
LINEAR: dataMappers.linearDynamic, | ||
STABLE: stableDynamic, | ||
COMPOSABLE_STABLE: stableDynamic, | ||
META_STABLE: stableDynamic, | ||
LINEAR: linearDynamic, | ||
}; | ||
|
||
export type FxData = ReturnType<typeof dataMappers['fx']>; | ||
export type GyroData = ReturnType<typeof dataMappers['gyro']>; | ||
export type LinearData = ReturnType<typeof dataMappers['linear']>; | ||
export type ElementData = ReturnType<typeof dataMappers['element']>; | ||
export type StableDynamicData = ReturnType<typeof dataMappers['stableDynamic']>; | ||
export type LinearDynamicData = ReturnType<typeof dataMappers['linearDynamic']>; | ||
export type FxData = ReturnType<typeof fx>; | ||
export type GyroData = ReturnType<typeof gyro>; | ||
export type LinearData = ReturnType<typeof linear>; | ||
export type ElementData = ReturnType<typeof element>; | ||
export type StableDynamicData = ReturnType<typeof stableDynamic>; | ||
export type LinearDynamicData = ReturnType<typeof linearDynamic>; | ||
Comment on lines
+290
to
+291
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we remove this? it's unused afaik. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we remove this? it's unused afaik.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mapper is subgraph schema related, so more data we parse to DB schema the better. think about it as a layer. it makes it easy to compose what is needed for any pool syncing we would want to do.
we still read these data from subgraph in pool create jobs, once removed where would it go? just keep it blank until onchain calls fill it in?