Skip to content
Merged
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

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 46 additions & 0 deletions schema-base.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,16 @@ type ERC20Balance @entity {
balance: BigInt!
}

type CurvePool @entity {
id: ID!
address: String! @index
name: String!
tokenCount: Int!
token0: String!
token1: String!
token2: String
}

type CurvePoolBalance @entity {
id: ID!
timestamp: DateTime! @index
Expand All @@ -135,6 +145,17 @@ type CurvePoolRate @entity {
rate: BigInt!
}

type BalancerPool @entity {
id: ID!
address: String! @index
name: String!
tokenCount: Int!
token0: String!
token1: String!
token2: String
token3: String
}

type BalancerPoolBalance @entity {
id: ID!
timestamp: DateTime! @index
Expand All @@ -157,6 +178,14 @@ type BalancerPoolRate @entity {
rate3: BigInt!
}

type MaverickPool @entity {
id: ID!
address: String! @index
name: String!
tokenA: String!
tokenB: String!
}

type MaverickPoolBalance @entity {
id: ID!
timestamp: DateTime! @index
Expand All @@ -165,3 +194,20 @@ type MaverickPoolBalance @entity {
binBalanceA: BigInt!
binBalanceB: BigInt!
}

enum LiquiditySourceType {
CurvePool
BalancerPool
MaverickPool
UniswapPool
Aave
Compound
}

type LiquiditySource @entity {
id: ID!
address: String!
type: LiquiditySourceType!
token: String!
}

46 changes: 46 additions & 0 deletions schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,16 @@ type ERC20Balance @entity {
balance: BigInt!
}

type CurvePool @entity {
id: ID!
address: String! @index
name: String!
tokenCount: Int!
token0: String!
token1: String!
token2: String
}

type CurvePoolBalance @entity {
id: ID!
timestamp: DateTime! @index
Expand All @@ -137,6 +147,17 @@ type CurvePoolRate @entity {
rate: BigInt!
}

type BalancerPool @entity {
id: ID!
address: String! @index
name: String!
tokenCount: Int!
token0: String!
token1: String!
token2: String
token3: String
}

type BalancerPoolBalance @entity {
id: ID!
timestamp: DateTime! @index
Expand All @@ -159,6 +180,14 @@ type BalancerPoolRate @entity {
rate3: BigInt!
}

type MaverickPool @entity {
id: ID!
address: String! @index
name: String!
tokenA: String!
tokenB: String!
}

type MaverickPoolBalance @entity {
id: ID!
timestamp: DateTime! @index
Expand All @@ -167,6 +196,23 @@ type MaverickPoolBalance @entity {
binBalanceA: BigInt!
binBalanceB: BigInt!
}

enum LiquiditySourceType {
CurvePool
BalancerPool
MaverickPool
UniswapPool
Aave
Compound
}

type LiquiditySource @entity {
id: ID!
address: String!
type: LiquiditySourceType!
token: String!
}

"""
The OETH entity tracks the change in total supply of OETH over time.
"""
Expand Down
4 changes: 3 additions & 1 deletion src/main-other.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ import * as exchangeRates from './shared/post-processors/exchange-rates'
import * as balancer from './shared/processors/balancer'
import * as curve from './shared/processors/curve'
import { erc20s } from './shared/processors/erc20s'
import * as liquiditySources from './shared/processors/liquidity-sources'
import * as maverick from './shared/processors/maverick'

export const processor = {
stateSchema: 'other-processor',
processors: [balancer, curve, ...erc20s],
processors: [balancer, curve, maverick, ...erc20s, liquiditySources],
postProcessors: [exchangeRates],
validators: [],
}
Expand Down
8 changes: 8 additions & 0 deletions src/model/generated/_liquiditySourceType.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
export enum LiquiditySourceType {
CurvePool = "CurvePool",
BalancerPool = "BalancerPool",
MaverickPool = "MaverickPool",
UniswapPool = "UniswapPool",
Aave = "Aave",
Compound = "Compound",
}
33 changes: 33 additions & 0 deletions src/model/generated/balancerPool.model.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import {Entity as Entity_, Column as Column_, PrimaryColumn as PrimaryColumn_, Index as Index_} from "typeorm"

@Entity_()
export class BalancerPool {
constructor(props?: Partial<BalancerPool>) {
Object.assign(this, props)
}

@PrimaryColumn_()
id!: string

@Index_()
@Column_("text", {nullable: false})
address!: string

@Column_("text", {nullable: false})
name!: string

@Column_("int4", {nullable: false})
tokenCount!: number

@Column_("text", {nullable: false})
token0!: string

@Column_("text", {nullable: false})
token1!: string

@Column_("text", {nullable: true})
token2!: string | undefined | null

@Column_("text", {nullable: true})
token3!: string | undefined | null
}
30 changes: 30 additions & 0 deletions src/model/generated/curvePool.model.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import {Entity as Entity_, Column as Column_, PrimaryColumn as PrimaryColumn_, Index as Index_} from "typeorm"

@Entity_()
export class CurvePool {
constructor(props?: Partial<CurvePool>) {
Object.assign(this, props)
}

@PrimaryColumn_()
id!: string

@Index_()
@Column_("text", {nullable: false})
address!: string

@Column_("text", {nullable: false})
name!: string

@Column_("int4", {nullable: false})
tokenCount!: number

@Column_("text", {nullable: false})
token0!: string

@Column_("text", {nullable: false})
token1!: string

@Column_("text", {nullable: true})
token2!: string | undefined | null
}
5 changes: 5 additions & 0 deletions src/model/generated/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,16 @@ export * from "./erc20.model"
export * from "./erc20Holder.model"
export * from "./erc20State.model"
export * from "./erc20Balance.model"
export * from "./curvePool.model"
export * from "./curvePoolBalance.model"
export * from "./curvePoolRate.model"
export * from "./balancerPool.model"
export * from "./balancerPoolBalance.model"
export * from "./balancerPoolRate.model"
export * from "./maverickPool.model"
export * from "./maverickPoolBalance.model"
export * from "./liquiditySource.model"
export * from "./_liquiditySourceType"
export * from "./oeth.model"
export * from "./oethAsset.model"
export * from "./oethAddress.model"
Expand Down
21 changes: 21 additions & 0 deletions src/model/generated/liquiditySource.model.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import {Entity as Entity_, Column as Column_, PrimaryColumn as PrimaryColumn_} from "typeorm"
import {LiquiditySourceType} from "./_liquiditySourceType"

@Entity_()
export class LiquiditySource {
constructor(props?: Partial<LiquiditySource>) {
Object.assign(this, props)
}

@PrimaryColumn_()
id!: string

@Column_("text", {nullable: false})
address!: string

@Column_("varchar", {length: 12, nullable: false})
type!: LiquiditySourceType

@Column_("text", {nullable: false})
token!: string
}
24 changes: 24 additions & 0 deletions src/model/generated/maverickPool.model.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import {Entity as Entity_, Column as Column_, PrimaryColumn as PrimaryColumn_, Index as Index_} from "typeorm"

@Entity_()
export class MaverickPool {
constructor(props?: Partial<MaverickPool>) {
Object.assign(this, props)
}

@PrimaryColumn_()
id!: string

@Index_()
@Column_("text", {nullable: false})
address!: string

@Column_("text", {nullable: false})
name!: string

@Column_("text", {nullable: false})
tokenA!: string

@Column_("text", {nullable: false})
tokenB!: string
}
2 changes: 1 addition & 1 deletion src/oeth/validators/validate-oeth/validate-oeth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ const expectations = {
apr: 0.1176475,
apy: 0.12482622,
apy14DayAvg: 0.13925279,
apy30DayAvg: 23.49825734,
apy30DayAvg: 24.47691924,
apy7DayAvg: 0.13852897,
rebasingCreditsPerToken: '973558594004638273359591150',
txHash:
Expand Down
Loading