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
12 changes: 12 additions & 0 deletions commands.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,18 @@
"lib/main-ousd.js"
]
},
"process:ogv": {
"description": "Load .env and start the squid processor",
"deps": [
"build",
"migration:apply"
],
"cmd": [
"node",
"--require=dotenv/config",
"lib/main-ogv.js"
]
},
"process:other": {
"description": "Load .env and start the squid processor",
"deps": [
Expand Down
307 changes: 307 additions & 0 deletions db/migrations/1698911538983-Data.js

Large diffs are not rendered by default.

106 changes: 85 additions & 21 deletions schema-ogv.graphql
Original file line number Diff line number Diff line change
@@ -1,35 +1,99 @@
# OGV Price (5m?)
# OGV Market Cap (5m?)
# OGV Circulating Supply
# OGV Total Supply
type OGV @entity {
id: ID!
timestamp: DateTime! @index
blockNumber: Int! @index
circulating: BigInt!
staked: BigInt!
total: BigInt!
}

# OGV Amount Staked & Percentage
# OGV Staking APY
type StakedOGV @entity { # Representing `veOGV`
type OGVAddress @entity {
id: ID! @index
balance: BigInt!
staked: BigInt!
veogvBalance: BigInt!
votingPower: BigInt!
delegatee: OGVAddress
lastUpdated: DateTime!
}

enum OGVLockupEventType {
Staked
Unstaked
Extended
}

type OGVLockupTxLog @entity {
id: ID!
timestamp: DateTime! @index
blockNumber: Int! @index
total: BigInt!
apy: BigInt!
hash: String!
event: OGVLockupEventType!
timestamp: DateTime!
ogvLockup: OGVLockup!
}

# OGV Registered Voters
# OGV Open-source contributors
# OGV Improvement proposals
type OGVGovernance @entity {
type OGVLockup @entity {
id: ID!
timestamp: DateTime! @index
blockNumber: Int! @index
registeredVoters: Int!
openSourceContributors: Int!
improvementProposals: Int!
lockupId: String! @index
address: OGVAddress! @index
logs: [OGVLockupTxLog]! @derivedFrom(field: "ogvLockup")
amount: BigInt!
end: DateTime!
veogv: BigInt! # Amount of veOGV received
timestamp: DateTime!
# active: Boolean
}

enum OGVProposalState {
Pending
Active
Canceled
Defeated
Succeeded
Queued
Expired
Executed
}

# TODO: More
enum OGVProposalEvent {
Created
Queued
Canceled
Extended
Executed
}

enum OGVVoteType {
Against
For
Abstain
}

type OGVProposalTxLog @entity {
id: ID!
hash: String!
event: OGVProposalEvent!
timestamp: DateTime!
proposal: OGVProposal! @index
}

type OGVProposal @entity {
id: ID! @index
description: String
proposer: OGVAddress!
timestamp: DateTime!
startBlock: BigInt!
endBlock: BigInt!
lastUpdated: DateTime!
status: OGVProposalState!
logs: [OGVProposalTxLog]! @derivedFrom(field: "proposal")
}

type OGVProposalVote @entity {
id: ID!
proposal: OGVProposal! @index
voter: OGVAddress! @index
weight: BigInt!
type: OGVVoteType!
txHash: String!
timestamp: DateTime!
}
108 changes: 86 additions & 22 deletions schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -321,41 +321,105 @@ type OETHRewardTokenCollected @entity {
recipient: String!
rewardToken: String!
amount: BigInt!
}# OGV Price (5m?)
# OGV Market Cap (5m?)
# OGV Circulating Supply
# OGV Total Supply
type OGV @entity {
}type OGV @entity {
id: ID!
timestamp: DateTime! @index
blockNumber: Int! @index
circulating: BigInt!
staked: BigInt!
total: BigInt!
}

# OGV Amount Staked & Percentage
# OGV Staking APY
type StakedOGV @entity { # Representing `veOGV`
type OGVAddress @entity {
id: ID! @index
balance: BigInt!
staked: BigInt!
veogvBalance: BigInt!
votingPower: BigInt!
delegatee: OGVAddress
lastUpdated: DateTime!
}

enum OGVLockupEventType {
Staked
Unstaked
Extended
}

type OGVLockupTxLog @entity {
id: ID!
timestamp: DateTime! @index
blockNumber: Int! @index
total: BigInt!
apy: BigInt!
hash: String!
event: OGVLockupEventType!
timestamp: DateTime!
ogvLockup: OGVLockup!
}

# OGV Registered Voters
# OGV Open-source contributors
# OGV Improvement proposals
type OGVGovernance @entity {
type OGVLockup @entity {
id: ID!
timestamp: DateTime! @index
blockNumber: Int! @index
registeredVoters: Int!
openSourceContributors: Int!
improvementProposals: Int!
lockupId: String! @index
address: OGVAddress! @index
logs: [OGVLockupTxLog]! @derivedFrom(field: "ogvLockup")
amount: BigInt!
end: DateTime!
veogv: BigInt! # Amount of veOGV received
timestamp: DateTime!
# active: Boolean
}

enum OGVProposalState {
Pending
Active
Canceled
Defeated
Succeeded
Queued
Expired
Executed
}

# TODO: More
enum OGVProposalEvent {
Created
Queued
Canceled
Extended
Executed
}

enum OGVVoteType {
Against
For
Abstain
}

type OGVProposalTxLog @entity {
id: ID!
hash: String!
event: OGVProposalEvent!
timestamp: DateTime!
proposal: OGVProposal! @index
}

type OGVProposal @entity {
id: ID! @index
description: String
proposer: OGVAddress!
timestamp: DateTime!
startBlock: BigInt!
endBlock: BigInt!
lastUpdated: DateTime!
status: OGVProposalState!
logs: [OGVProposalTxLog]! @derivedFrom(field: "proposal")
}

type OGVProposalVote @entity {
id: ID!
proposal: OGVProposal! @index
voter: OGVAddress! @index
weight: BigInt!
type: OGVVoteType!
txHash: String!
timestamp: DateTime!
}
"""
The OUSD entity tracks the change in total supply of OUSD over time.
"""
Expand Down
4 changes: 4 additions & 0 deletions squid.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ deploy:
# cmd: [ "node", "lib/main-ousd" ]
# env:
# RPC_ENV: RPC_ENDPOINT_999
- name: ogv-processor
cmd: [ "node", "lib/main-ogv" ]
env:
RPC_ENV: RPC_ENDPOINT_999
- name: other-processor
cmd: [ "node", "lib/main-other" ]
env:
Expand Down
Loading