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
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ npm-debug.log

# OS Files
.DS_Store

.env
/.idea

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

26 changes: 26 additions & 0 deletions schema-base.graphql
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
type ProcessingStatus @entity {
id: ID!
timestamp: DateTime!
blockNumber: Int!
}

"""
Any entity which has a price associated with it should have that price go in here.
Prices can change very frequently and we don't want those changes on the same track
Expand Down Expand Up @@ -72,6 +78,17 @@ type StrategyDailyYield @entity {
apy: Float!
}

type NativeBalance @entity {
"""
Format: 'account:blockNumber'
"""
id: ID!
timestamp: DateTime! @index
blockNumber: Int! @index
account: String!
balance: BigInt!
}

type ERC20 @entity {
"""
Format: 'address'
Expand Down Expand Up @@ -211,3 +228,12 @@ type LiquiditySource @entity {
token: String!
}

type LiquidityDailyBalance @entity {
id: ID!
timestamp: DateTime! @index
blockNumber: Int! @index
address: String!
token: String!
balance: BigInt!
}

26 changes: 26 additions & 0 deletions schema.graphql
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# GENERATED, DO NOT MODIFY

type ProcessingStatus @entity {
id: ID!
timestamp: DateTime!
blockNumber: Int!
}

"""
Any entity which has a price associated with it should have that price go in here.
Prices can change very frequently and we don't want those changes on the same track
Expand Down Expand Up @@ -74,6 +80,17 @@ type StrategyDailyYield @entity {
apy: Float!
}

type NativeBalance @entity {
"""
Format: 'account:blockNumber'
"""
id: ID!
timestamp: DateTime! @index
blockNumber: Int! @index
account: String!
balance: BigInt!
}

type ERC20 @entity {
"""
Format: 'address'
Expand Down Expand Up @@ -213,6 +230,15 @@ type LiquiditySource @entity {
token: String!
}

type LiquidityDailyBalance @entity {
id: ID!
timestamp: DateTime! @index
blockNumber: Int! @index
address: String!
token: String!
balance: BigInt!
}

"""
The OETH entity tracks the change in total supply of OETH over time.
"""
Expand Down
7 changes: 6 additions & 1 deletion src/main-oeth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import * as vault from './oeth/processors/vault'
import * as validateOeth from './oeth/validators/validate-oeth'
import { run } from './processor'
import * as exchangeRatesPostProcessor from './shared/post-processors/exchange-rates'
import { processStatus } from './shared/processor-templates/processor-status'

export const processor = {
stateSchema: 'oeth-processor',
Expand All @@ -25,7 +26,11 @@ export const processor = {
strategies,
exchangeRates,
],
postProcessors: [exchangeRatesPostProcessor, dailyStats],
postProcessors: [
exchangeRatesPostProcessor,
dailyStats,
processStatus('oeth'),
],
validators: [validateOeth],
}
export default processor
Expand Down
3 changes: 2 additions & 1 deletion src/main-ogv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ import * as governance from './ogv/post-processors/governance'
import * as ogv from './ogv/processors/ogv'
import * as ogvSupply from './ogv/processors/ogv-supply'
import { run } from './processor'
import { processStatus } from './shared/processor-templates/processor-status'

export const processor = {
stateSchema: 'ogv-processor',
processors: [ogvSupply, ogv],
postProcessors: [governance, dailyStats],
postProcessors: [governance, dailyStats, processStatus('ogv')],
validators: [],
}
export default processor
Expand Down
22 changes: 19 additions & 3 deletions src/main-other.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,32 @@
import { run } from './processor'
import * as exchangeRates from './shared/post-processors/exchange-rates'
import * as liquidity from './shared/post-processors/liquidity'
import { processStatus } from './shared/processor-templates/processor-status'
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'
import * as native from './shared/processors/native'
import * as sushiswap from './shared/processors/sushiswap'
import * as uniswap from './shared/processors/uniswap'
import * as validate from './shared/validators/validate-shared'

sushiswap.initialize()
uniswap.initialize()

export const processor = {
stateSchema: 'other-processor',
processors: [balancer, curve, maverick, ...erc20s, liquiditySources],
postProcessors: [exchangeRates],
validators: [],
processors: [
balancer,
curve,
maverick,
native,
...erc20s(),
liquiditySources,
],
postProcessors: [exchangeRates, liquidity, processStatus('other')],
validators: [validate],
}
export default processor

Expand Down
3 changes: 2 additions & 1 deletion src/main-ousd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ import * as strategies from './ousd/processors/strategies/strategies'
import * as validateOusd from './ousd/validators/validate-ousd'
import { run } from './processor'
import * as exchangeRates from './shared/post-processors/exchange-rates'
import { processStatus } from './shared/processor-templates/processor-status'

export const processor = {
stateSchema: 'ousd-processor',
processors: [ousd, strategies],
postProcessors: [exchangeRates, dailyStats],
postProcessors: [exchangeRates, dailyStats, processStatus('ousd')],
validators: [validateOusd],
}
export default processor
Expand Down
3 changes: 3 additions & 0 deletions src/model/generated/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
export * from "./processingStatus.model"
export * from "./exchangeRate.model"
export * from "./strategyBalance.model"
export * from "./strategyYield.model"
export * from "./strategyDailyYield.model"
export * from "./nativeBalance.model"
export * from "./erc20.model"
export * from "./erc20Holder.model"
export * from "./erc20State.model"
Expand All @@ -16,6 +18,7 @@ export * from "./maverickPool.model"
export * from "./maverickPoolBalance.model"
export * from "./liquiditySource.model"
export * from "./_liquiditySourceType"
export * from "./liquidityDailyBalance.model"
export * from "./oeth.model"
export * from "./oethAsset.model"
export * from "./oethAddress.model"
Expand Down
29 changes: 29 additions & 0 deletions src/model/generated/liquidityDailyBalance.model.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import {Entity as Entity_, Column as Column_, PrimaryColumn as PrimaryColumn_, Index as Index_} from "typeorm"
import * as marshal from "./marshal"

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

@PrimaryColumn_()
id!: string

@Index_()
@Column_("timestamp with time zone", {nullable: false})
timestamp!: Date

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

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

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

@Column_("numeric", {transformer: marshal.bigintTransformer, nullable: false})
balance!: bigint
}
29 changes: 29 additions & 0 deletions src/model/generated/nativeBalance.model.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import {Entity as Entity_, Column as Column_, PrimaryColumn as PrimaryColumn_, Index as Index_} from "typeorm"
import * as marshal from "./marshal"

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

/**
* Format: 'account:blockNumber'
*/
@PrimaryColumn_()
id!: string

@Index_()
@Column_("timestamp with time zone", {nullable: false})
timestamp!: Date

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

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

@Column_("numeric", {transformer: marshal.bigintTransformer, nullable: false})
balance!: bigint
}
17 changes: 17 additions & 0 deletions src/model/generated/processingStatus.model.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import {Entity as Entity_, Column as Column_, PrimaryColumn as PrimaryColumn_} from "typeorm"

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

@PrimaryColumn_()
id!: string

@Column_("timestamp with time zone", {nullable: false})
timestamp!: Date

@Column_("int4", {nullable: false})
blockNumber!: number
}
7 changes: 4 additions & 3 deletions src/oeth/processors/strategies/strategies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@ import {
RETH_ADDRESS,
STETH_ADDRESS,
WETH_ADDRESS,
addresses,
} from '../../../utils/addresses'

export const oethStrategies: readonly IStrategyData[] = [
{
from: 17249899,
name: 'OETH Convex ETH+OETH (AMO)',
contractName: 'ConvexEthMetaStrategy',
address: '0x1827f9ea98e0bf96550b2fc20f7233277fcd7e63',
address: addresses.strategies.oeth.ConvexEthMetaStrategy,
oTokenAddress: OETH_ADDRESS,
kind: 'CurveAMO',
curvePoolInfo: {
Expand All @@ -45,7 +46,7 @@ export const oethStrategies: readonly IStrategyData[] = [
from: 17067232,
name: 'OETH Frax Staking',
contractName: 'FraxETHStrategy',
address: '0x3ff8654d633d4ea0fae24c52aec73b4a20d0d0e5',
address: addresses.strategies.oeth.FraxETHStrategy,
oTokenAddress: OETH_ADDRESS,
kind: 'Generic',
base: { address: currencies.ETH, decimals: 18 },
Expand All @@ -67,7 +68,7 @@ export const oethStrategies: readonly IStrategyData[] = [
from: 18156225,
name: 'OETH Aura rETH/WETH',
contractName: 'BalancerMetaPoolStrategy',
address: '0x49109629ac1deb03f2e9b2fe2ac4a623e0e7dfdc',
address: addresses.strategies.oeth.BalancerMetaPoolStrategy,
oTokenAddress: OETH_ADDRESS,
kind: 'BalancerMetaStablePool',
base: { address: currencies.ETH, decimals: 18 },
Expand Down
Loading