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

feat: rwa #8

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
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 .mise.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[tools]
node = "18"
yarn = "1.20"
15 changes: 9 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,25 @@
"scripts": {
"codegen": "graph codegen --output-dir src/types/",
"build": "graph build",
"create-local": "graph create compound-finance/compound-v2 --node http://127.0.0.1:8020",
"deploy-local": "graph deploy compound-finance/compound-v2 --debug --ipfs http://localhost:5001 --node http://127.0.0.1:8020/",
"create-local": "graph create canto/clm-v2 --node http://127.0.0.1:8020",
"deploy-local": "graph deploy canto/clm-v2 --debug --ipfs http://127.0.0.1:5001 --node http://127.0.0.1:8020/",
"deploy": "graph deploy compound-finance/compound-v2 --debug --ipfs https://api.thegraph.com/ipfs/ --node https://api.thegraph.com/deploy/",
"prodtest": "graph deploy davekaj/compound-v2 --debug --ipfs https://api.thegraph.com/ipfs/ --node https://api.thegraph.com/deploy/",
"deploy-staging": "graph deploy --debug --ipfs https://api.staging.thegraph.com/ipfs/ --node https://api.staging.thegraph.com/deploy/ davekaj/compoundv2",
"watch-local": "graph deploy compound-finance/compound-v2 --watch --debug --node http://127.0.0.1:8020/ --ipfs http://localhost:5001",
"prettier": "./node_modules/.bin/prettier —-write '**/*.ts'"
},
"devDependencies": {
"@graphprotocol/graph-cli": "http://github.com/graphprotocol/graph-cli#ford/add-startblock-to-contract-source",
"@graphprotocol/graph-cli": "0.17.0",
"@graphprotocol/graph-ts": "^0.15.1",
"@typescript-eslint/eslint-plugin": "^2.0.0",
"@typescript-eslint/parser": "^2.0.0",
"eslint": "^6.2.2",
"eslint-config-prettier": "^6.1.0",
"prettier": "^1.18.2",
"typescript": "^3.5.2",
"husky": "^3.0.5",
"lint-staged": "^9.2.5"
"lint-staged": "^9.2.5",
"prettier": "^1.18.2",
"typescript": "^3.5.2"
},
"husky": {
"hooks": {
Expand All @@ -36,5 +36,8 @@
"prettier --write --config ./.prettierrc",
"git add"
]
},
"resolutions": {
"concat-stream": "github:max-mapper/concat-stream#master"
}
}
6 changes: 6 additions & 0 deletions src/mappings/consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,19 @@ export const cCantoEth_ADDRESS = '0xb49a395b39a0b410675406bee7bd06330cb503e3'
export const cCantoAtom_ADDRESS = '0xc0d6574b2fe71eed8cd305df0da2323237322557'
export const cNoteUsdc_Address = '0xd6a97e43fc885a83e97d599796458a331e580800'
export const cNoteUsdt_Address = '0xf0cd6b5ce8a01d1b81f1d8b76643866c5816b49f'
export const cfBILL_ADDRESS = '0xf1f89df149bc5f2b6b29783915d1f9fe2d24459c'
export const cifBILL_ADDRESS = '0x897709fc83ba7a4271d22ed4c01278cc1da8d6f8'
export const cUSYC_ADDRESS = '0x0355e393cf0cf5486d9caefb64407b7b1033c2f1'

export const LIQUIDITY_WHITELIST: string[] = [
cUSDT_ADDRESS,
cUSDC_ADDRESS,
cETH_ADDRESS,
cCANTO_ADDRESS,
cATOM_ADDRESS,
cfBILL_ADDRESS,
cifBILL_ADDRESS,
cUSYC_ADDRESS,
]

// export const cW_CANTO_ADDRESS = "0x5e23dc409fc2f832f83cec191e245a191a4bcc5c";
Expand Down
168 changes: 144 additions & 24 deletions subgraph.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ schema:
dataSources:
- kind: ethereum/contract
name: cNote
network: mainnet
network: canto
source:
address: "0xEe602429Ef7eCe0a13e4FfE8dBC16e101049504C"
abi: CToken
startBlock: 224957
mapping:
kind: ethereum/events
apiVersion: 0.0.3
apiVersion: 0.0.4
language: wasm/assemblyscript
file: ./src/mappings/ctoken.ts
entities:
Expand Down Expand Up @@ -46,14 +46,14 @@ dataSources:
handler: handleNewMarketInterestRateModel
- kind: ethereum/contract
name: cUSDC
network: mainnet
network: canto
source:
address: "0xdE59F060D7ee2b612E7360E6C1B97c4d8289Ca2e"
abi: CToken
startBlock: 224958
mapping:
kind: ethereum/events
apiVersion: 0.0.3
apiVersion: 0.0.4
language: wasm/assemblyscript
file: ./src/mappings/ctoken.ts
entities:
Expand Down Expand Up @@ -86,14 +86,14 @@ dataSources:
handler: handleNewMarketInterestRateModel
- kind: ethereum/contract
name: cUSDT
network: mainnet
network: canto
source:
address: "0x6b46ba92d7e94FfA658698764f5b8dfD537315A9"
abi: CToken
startBlock: 224960
mapping:
kind: ethereum/events
apiVersion: 0.0.3
apiVersion: 0.0.4
language: wasm/assemblyscript
file: ./src/mappings/ctoken.ts
entities:
Expand Down Expand Up @@ -126,14 +126,14 @@ dataSources:
handler: handleNewMarketInterestRateModel
- kind: ethereum/contract
name: cATOM
network: mainnet
network: canto
source:
address: "0x617383F201076e7cE0f6E625D1a983b3D1bd277A"
abi: CToken
startBlock: 224961
mapping:
kind: ethereum/events
apiVersion: 0.0.3
apiVersion: 0.0.4
language: wasm/assemblyscript
file: ./src/mappings/ctoken.ts
entities:
Expand Down Expand Up @@ -166,14 +166,14 @@ dataSources:
handler: handleNewMarketInterestRateModel
- kind: ethereum/contract
name: cETH
network: mainnet
network: canto
source:
address: "0x830b9849E7D79B92408a86A557e7baAACBeC6030"
abi: CToken
startBlock: 85393
mapping:
kind: ethereum/events
apiVersion: 0.0.3
apiVersion: 0.0.4
language: wasm/assemblyscript
file: ./src/mappings/ctoken.ts
entities:
Expand Down Expand Up @@ -206,14 +206,14 @@ dataSources:
handler: handleNewMarketInterestRateModel
- kind: ethereum/contract
name: cCANTO
network: mainnet
network: canto
source:
address: "0xB65Ec550ff356EcA6150F733bA9B954b2e0Ca488"
abi: CToken
startBlock: 85394
mapping:
kind: ethereum/events
apiVersion: 0.0.3
apiVersion: 0.0.4
language: wasm/assemblyscript
file: ./src/mappings/ctoken.ts
entities:
Expand Down Expand Up @@ -246,14 +246,14 @@ dataSources:
handler: handleNewMarketInterestRateModel
- kind: ethereum/contract
name: cCANTO/NOTE
network: mainnet
network: canto
source:
address: "0x3C96dCfd875253A37acB3D2B102b6f328349b16B"
abi: CToken
startBlock: 225010
mapping:
kind: ethereum/events
apiVersion: 0.0.3
apiVersion: 0.0.4
language: wasm/assemblyscript
file: ./src/mappings/ctoken.ts
entities:
Expand Down Expand Up @@ -286,14 +286,14 @@ dataSources:
handler: handleNewMarketInterestRateModel
- kind: ethereum/contract
name: cCANTO/ETH
network: mainnet
network: canto
source:
address: "0xb49A395B39A0b410675406bEE7bD06330CB503E3"
abi: CToken
startBlock: 225015
mapping:
kind: ethereum/events
apiVersion: 0.0.3
apiVersion: 0.0.4
language: wasm/assemblyscript
file: ./src/mappings/ctoken.ts
entities:
Expand Down Expand Up @@ -326,14 +326,14 @@ dataSources:
handler: handleNewMarketInterestRateModel
- kind: ethereum/contract
name: cCANTO/ATOM
network: mainnet
network: canto
source:
address: "0xC0D6574b2fe71eED8Cd305df0DA2323237322557"
abi: CToken
startBlock: 225013
mapping:
kind: ethereum/events
apiVersion: 0.0.3
apiVersion: 0.0.4
language: wasm/assemblyscript
file: ./src/mappings/ctoken.ts
entities:
Expand Down Expand Up @@ -366,14 +366,14 @@ dataSources:
handler: handleNewMarketInterestRateModel
- kind: ethereum/contract
name: cNOTE/USDC
network: mainnet
network: canto
source:
address: "0xD6a97e43FC885A83E97d599796458A331E580800"
abi: CToken
startBlock: 225011
mapping:
kind: ethereum/events
apiVersion: 0.0.3
apiVersion: 0.0.4
language: wasm/assemblyscript
file: ./src/mappings/ctoken.ts
entities:
Expand Down Expand Up @@ -406,14 +406,14 @@ dataSources:
handler: handleNewMarketInterestRateModel
- kind: ethereum/contract
name: cNOTE/USDT
network: mainnet
network: canto
source:
address: "0xf0cd6b5cE8A01D1B81F1d8B76643866c5816b49F"
abi: CToken
startBlock: 225012
mapping:
kind: ethereum/events
apiVersion: 0.0.3
apiVersion: 0.0.4
language: wasm/assemblyscript
file: ./src/mappings/ctoken.ts
entities:
Expand Down Expand Up @@ -446,14 +446,14 @@ dataSources:
handler: handleNewMarketInterestRateModel
- kind: ethereum/contract
name: Comptroller
network: mainnet
network: canto
source:
address: "0x5E23dC409Fc2F832f83CEc191E245A191a4bCc5C"
abi: Comptroller
startBlock: 224944
mapping:
kind: ethereum/events
apiVersion: 0.0.3
apiVersion: 0.0.4
language: wasm/assemblyscript
file: ./src/mappings/comptroller.ts
entities:
Expand Down Expand Up @@ -481,3 +481,123 @@ dataSources:
handler: handleNewLiquidationIncentive
- event: NewPriceOracle(address,address)
handler: handleNewPriceOracle
- kind: ethereum/contract
name: cfBILL
network: canto
source:
address: "0xf1f89df149bc5f2b6b29783915d1f9fe2d24459c"
abi: CToken
startBlock: 7095556
mapping:
kind: ethereum/events
apiVersion: 0.0.4
language: wasm/assemblyscript
file: ./src/mappings/ctoken.ts
entities:
- User
- Market
- CTokenInfo
abis:
- name: Comptroller
file: ./abis/Comptroller.json
- name: CToken
file: ./abis/CToken.json
- name: PriceOracle
file: ./abis/BaseV1Router.json
- name: ERC20
file: ./abis/ERC20.json
eventHandlers:
- event: Borrow(address,uint256,uint256,uint256)
handler: handleBorrow
- event: RepayBorrow(address,address,uint256,uint256,uint256)
handler: handleRepayBorrow
- event: LiquidateBorrow(address,address,uint256,address,uint256)
handler: handleLiquidateBorrow
- event: AccrueInterest(uint256,uint256,uint256,uint256)
handler: handleAccrueInterest
- event: NewReserveFactor(uint256,uint256)
handler: handleNewReserveFactor
- event: Transfer(indexed address,indexed address,uint256)
handler: handleTransfer
- event: NewMarketInterestRateModel(address,address)
handler: handleNewPriceOracle
- kind: ethereum/contract
name: cifBILL
network: canto
source:
address: "0x897709fc83ba7a4271d22ed4c01278cc1da8d6f8"
abi: CToken
startBlock: 7095598
mapping:
kind: ethereum/events
apiVersion: 0.0.4
language: wasm/assemblyscript
file: ./src/mappings/ctoken.ts
entities:
- User
- Market
- CTokenInfo
abis:
- name: Comptroller
file: ./abis/Comptroller.json
- name: CToken
file: ./abis/CToken.json
- name: PriceOracle
file: ./abis/BaseV1Router.json
- name: ERC20
file: ./abis/ERC20.json
eventHandlers:
- event: Borrow(address,uint256,uint256,uint256)
handler: handleBorrow
- event: RepayBorrow(address,address,uint256,uint256,uint256)
handler: handleRepayBorrow
- event: LiquidateBorrow(address,address,uint256,address,uint256)
handler: handleLiquidateBorrow
- event: AccrueInterest(uint256,uint256,uint256,uint256)
handler: handleAccrueInterest
- event: NewReserveFactor(uint256,uint256)
handler: handleNewReserveFactor
- event: Transfer(indexed address,indexed address,uint256)
handler: handleTransfer
- event: NewMarketInterestRateModel(address,address)
handler: handleNewPriceOracle
- kind: ethereum/contract
name: cUSYC
network: canto
source:
address: "0x0355e393cf0cf5486d9caefb64407b7b1033c2f1"
abi: CToken
startBlock: 6423534
mapping:
kind: ethereum/events
apiVersion: 0.0.4
language: wasm/assemblyscript
file: ./src/mappings/ctoken.ts
entities:
- User
- Market
- CTokenInfo
abis:
- name: Comptroller
file: ./abis/Comptroller.json
- name: CToken
file: ./abis/CToken.json
- name: PriceOracle
file: ./abis/BaseV1Router.json
- name: ERC20
file: ./abis/ERC20.json
eventHandlers:
- event: Borrow(address,uint256,uint256,uint256)
handler: handleBorrow
- event: RepayBorrow(address,address,uint256,uint256,uint256)
handler: handleRepayBorrow
- event: LiquidateBorrow(address,address,uint256,address,uint256)
handler: handleLiquidateBorrow
- event: AccrueInterest(uint256,uint256,uint256,uint256)
handler: handleAccrueInterest
- event: NewReserveFactor(uint256,uint256)
handler: handleNewReserveFactor
- event: Transfer(indexed address,indexed address,uint256)
handler: handleTransfer
- event: NewMarketInterestRateModel(address,address)
handler: handleNewPriceOracle
Loading