Skip to content

Commit

Permalink
feat: fix lint issues,premium,collateralIn/Out,etc
Browse files Browse the repository at this point in the history
  • Loading branch information
amritkumarj committed Sep 6, 2023
1 parent e820bd9 commit 2003cfd
Show file tree
Hide file tree
Showing 24 changed files with 168 additions and 324 deletions.
24 changes: 1 addition & 23 deletions deployment/deployment.json
Original file line number Diff line number Diff line change
Expand Up @@ -459,28 +459,6 @@
}
}
},
"aave-v3-metis": {
"network": "metis",
"status": "dev",
"versions": {
"schema": "3.0.1",
"subgraph": "2.0.2",
"methodology": "1.1.0"
},
"files": {
"template": "aave.v3.template.yaml"
},
"options": {
"prepare:yaml": true,
"prepare:constants": false
},
"services": {
"hosted-service": {
"slug": "aave-v3-metis",
"query-id": "aave-v3-metis"
}
}
},
"aave-v3-ethereum": {
"network": "ethereum",
"status": "prod",
Expand Down Expand Up @@ -8825,7 +8803,7 @@
"network": "optimism",
"status": "dev",
"versions": {
"schema": "1.2.1",
"schema": "1.3.3",
"subgraph": "1.0.0",
"methodology": "1.0.0"
},
Expand Down
4 changes: 4 additions & 0 deletions subgraphs/kwenta/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,7 @@ Total Revenue = Total Fees
- Other official and unofficial data sources: https://kwenta.eth.limo/stats/, https://tokenterminal.com/terminal/projects/kwenta

- Documentation: https://docs.kwenta.io/

## Note

We are only tracking v2 markets because v1 markets are deprecated and have almost no liquidity, and the current method to calculate open interest is not supported by v1 markets
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"deployment": "KWENTA_OPTIMISM",
"network": "optimism",
"marketManagerV1": [],
"marketManagerV2": [
{
"name": "FuturesMarketManager2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,64 +10,6 @@ graft:
block: {{graftStartBlock}} # Block number
{{/graftEnabled}}
dataSources:
{{#marketManagerV1}}
- kind: ethereum/contract
name: {{ name }}
network: {{ network }}
source:
address: "{{ address }}"
abi: FuturesMarketManager
startBlock: {{ startBlock }}
mapping:
kind: ethereum/events
apiVersion: 0.0.7
language: wasm/assemblyscript
entities:
- DerivPerpProtocol
abis:
- name: FuturesMarket
file: ./abis/kwenta/FuturesMarket.json
- name: FuturesMarketManager
file: ./abis/kwenta/FuturesMarketManager.json


###########################################
############## Price Oracle ###############
###########################################
# ERC20
- name: _ERC20
file: ./abis/Prices/ERC20.json
# Curve Contracts
- name: CurvePool
file: ./abis/Prices/Curve/Pool.json
- name: CurveRegistry
file: ./abis/Prices/Curve/Registry.json
- name: CalculationsCurve
file: ./abis/Prices/Calculations/Curve.json
# YearnLens Contracts
- name: YearnLensContract
file: ./abis/Prices/YearnLens.json
# Aave Oracle Contract
- name: AaveOracleContract
file: ./abis/Prices/AaveOracle.json
# SushiSwap Contracts
- name: CalculationsSushiSwap
file: ./abis/Prices/Calculations/SushiSwap.json
# ChainLink Contracts
- name: ChainLinkContract
file: ./abis/Prices/ChainLink.json
# Uniswap Contracts
- name: UniswapRouter
file: ./abis/Prices/Uniswap/Router.json
- name: UniswapFactory
file: ./abis/Prices/Uniswap/Factory.json
- name: UniswapPair
file: ./abis/Prices/Uniswap/Pair.json
eventHandlers:
- event: 'MarketAdded(address,indexed bytes32,indexed bytes32)'
handler: 'handleV1MarketAdded'
file: ./src/mappings/handlers.ts
{{/marketManagerV1}}
{{#marketManagerV2}}
- kind: ethereum/contract
name: {{ name }}
Expand Down Expand Up @@ -123,7 +65,7 @@ dataSources:
file: ./abis/Prices/Uniswap/Pair.json
eventHandlers:
- event: 'MarketAdded(address,indexed bytes32,indexed bytes32)'
handler: 'handleV2MarketAdded'
handler: 'handleMarketAdded'
file: ./src/mappings/handlers.ts
{{/marketManagerV2}}
{{#smartMarginFactory}}
Expand Down Expand Up @@ -151,67 +93,6 @@ dataSources:


templates:
- kind: ethereum/contract
name: FuturesV1Market
network: {{ network }}
source:
abi: FuturesMarket
mapping:
kind: ethereum/events
apiVersion: 0.0.7
language: wasm/assemblyscript
entities:
- LiquidityPool
abis:
- name: FuturesMarket
file: ./abis/kwenta/FuturesMarket.json



###########################################
############## Price Oracle ###############
###########################################
# ERC20
- name: _ERC20
file: ./abis/Prices/ERC20.json
# Curve Contracts
- name: CurvePool
file: ./abis/Prices/Curve/Pool.json
- name: CurveRegistry
file: ./abis/Prices/Curve/Registry.json
- name: CalculationsCurve
file: ./abis/Prices/Calculations/Curve.json
# YearnLens Contracts
- name: YearnLensContract
file: ./abis/Prices/YearnLens.json
# Aave Oracle Contract
- name: AaveOracleContract
file: ./abis/Prices/AaveOracle.json
# SushiSwap Contracts
- name: CalculationsSushiSwap
file: ./abis/Prices/Calculations/SushiSwap.json
# ChainLink Contracts
- name: ChainLinkContract
file: ./abis/Prices/ChainLink.json
# Uniswap Contracts
- name: UniswapRouter
file: ./abis/Prices/Uniswap/Router.json
- name: UniswapFactory
file: ./abis/Prices/Uniswap/Factory.json
- name: UniswapPair
file: ./abis/Prices/Uniswap/Pair.json
eventHandlers:
- event: 'MarginTransferred(indexed address,int256)'
handler: 'handleMarginTransferred'
- event: 'PositionModified(indexed uint256,indexed address,uint256,int256,int256,uint256,uint256,uint256)'
handler: 'handlePositionModified'
- event: 'PositionLiquidated(indexed uint256,indexed address,indexed address,int256,uint256,uint256)'
handler: 'handlePositionLiquidated'
- event: 'FundingRecomputed(int256,uint256,uint256)'
handler: 'handleFundingRecomputed'
# - event: 'ParameterUpdated(bytes32,bytes32,uint256)'
# handler: handleParameterUpdated
file: ./src/mappings/handlers.ts
- kind: ethereum/contract
name: PerpsV2Market
network: {{ network }}
Expand Down Expand Up @@ -262,14 +143,10 @@ templates:
eventHandlers:
- event: 'MarginTransferred(indexed address,int256)'
handler: 'handleMarginTransferred'
- event: 'PositionModified(indexed uint256,indexed address,uint256,int256,int256,uint256,uint256,uint256)'
handler: 'handlePositionModified'
- event: 'PositionModified(indexed uint256,indexed address,uint256,int256,int256,uint256,uint256,uint256,int256)'
handler: 'handlePositionModifiedV2'
- event: 'PositionLiquidated(uint256,address,address,int256,uint256,uint256)'
handler: 'handlePositionLiquidated'
handler: 'handlePositionModified'
- event: 'PositionLiquidated(uint256,address,address,int256,uint256,uint256,uint256,uint256)'
handler: 'handlePositionLiquidatedV2'
handler: 'handlePositionLiquidated'
- event: 'FundingRecomputed(int256,int256,uint256,uint256)'
handler: 'handleFundingRecomputed'
file: ./src/mappings/handlers.ts
Loading

0 comments on commit 2003cfd

Please sign in to comment.