Skip to content

Commit

Permalink
subgraph
Browse files Browse the repository at this point in the history
  • Loading branch information
hatemua committed Feb 22, 2024
1 parent 825283e commit bf49f1f
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 2 deletions.
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,15 @@
"graph:linea-deploy": "graph deploy --node https://graph-deploy.linea.build/ --ipfs https://graph-ipfs.linea.build LedgityLabs/LedgityYield ./subgraph/linea-subgraph.yaml",
"graph:linea-remove": "graph remove --node https://graph-deploy.linea.build/ LedgityLabs/LedgityYield",
"graph:arbitrum-gen": "cd subgraph && graph codegen ./arbitrum-subgraph.yaml && graph build ./arbitrum-subgraph.yaml",
"graph:arbitrum-deploy": "graph deploy --studio ledgity-yield-arbitrum ./subgraph/arbitrum-subgraph.yaml"
"graph:arbitrum-deploy": "graph deploy --studio ledgity-yield-arbitrum ./subgraph/arbitrum-subgraph.yaml",
"graph:OKX_X1_testnet-gen": "cd subgraph && graph codegen ./OKX_X1_testnet-subgraph.yaml && graph build ./OKX_X1_testnet-subgraph.yaml",
"graph:OKX_X1_testnet-create": "graph create --node https://www.okx.com/api/v1/x1-testnet/index/subgraphs/name/LedgityLabs/LedgityYield LedgityLabs/LedgityYield",
"graph:OKX_X1_testnet-deploy": "graph deploy --node https://www.okx.com/api/v1/x1-testnet/subgraph/ LedgityLabs/LedgityYield ./subgraph/OKX_X1_testnet-subgraph.yaml"
},
"dependencies": {
"@auth/prisma-adapter": "^1.0.11",
"@graphprotocol/client-add-source-name": "2.0.0",
"@graphprotocol/graph-cli": "^0.68.0",
"@graphql-mesh/transform-prefix": "0.96.5",
"@graphql-tools/utils": "9.2.1",
"@prisma/client": "^5.7.0",
Expand Down Expand Up @@ -74,7 +78,7 @@
},
"devDependencies": {
"@graphprotocol/client-cli": "3.0.0",
"@graphprotocol/graph-ts": "0.31.0",
"@graphprotocol/graph-ts": "^0.33.0",
"@next/bundle-analyzer": "^14.0.0",
"@nomicfoundation/hardhat-verify": "^2",
"@openzeppelin/contracts": "4.9.0",
Expand Down
77 changes: 77 additions & 0 deletions subgraph/OKX_X1_testnet-subgraph.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
specVersion: 0.0.6
description: A subgraph of Ledgity Yield data
repository: https://github.com/LedgityLabs/LedgityYield
schema:
file: ./schema.graphql
dataSources:
- kind: ethereum/contract
name: LTokenSignaler
network: arbitrum-one
source:
address: "0x1e1B0bB6C182eFD7d64cdAbbF3A3E315dE26E259"
abi: LTokenSignaler
startBlock: 10172276
mapping:
kind: ethereum/events
apiVersion: 0.0.7
language: wasm/assemblyscript
file: ./mapping.ts
entities:
- LToken
abis:
- name: LTokenSignaler
file: ../contracts/abis/LTokenSignaler.json
- name: LToken
file: ../contracts/abis/LToken.json
eventHandlers:
- event: LTokenSignalEvent(indexed address)
handler: handleSignaledLToken
- kind: ethereum/contract
name: PreMining
network: arbitrum-one
source:
address: "0x2Bb79F621518BbA45dA5Ec57BC885C4686A60De9"
abi: PreMining
startBlock: 10172300
mapping:
kind: ethereum/events
apiVersion: 0.0.7
language: wasm/assemblyscript
file: ./mapping.ts
entities:
- PreMining
abis:
- name: PreMining
file: ../contracts/abis/PreMining.json
eventHandlers:
- event: Lock(indexed address,uint256,uint8)
handler: handlePreMiningLock
templates:
- kind: ethereum/contract
name: LToken
network: arbitrum-one
source:
abi: LToken
mapping:
kind: ethereum/events
apiVersion: 0.0.7
language: wasm/assemblyscript
file: ./mapping.ts
entities:
- LToken
- TVLChange
- APRChange
- Activity
- RewardsMint
abis:
- name: LToken
file: ../contracts/abis/LToken.json
eventHandlers:
- event: TVLChangeEvent(uint256)
handler: handleTVLChangeEvent
- event: APRChangeEvent(uint16)
handler: handleAPRChangeEvent
- event: ActivityEvent(indexed int256,indexed address,indexed uint8,uint256,uint256,uint8,int256)
handler: handleActivityEvent
- event: MintedRewardsEvent(indexed address,uint256,uint256)
handler: handleMintedRewardsEvent

0 comments on commit bf49f1f

Please sign in to comment.