Skip to content

Commit

Permalink
Adds Camelot POL on Arbitrum
Browse files Browse the repository at this point in the history
  • Loading branch information
0xJem committed Jun 4, 2024
1 parent 854ea23 commit ad982f1
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 10 deletions.
4 changes: 4 additions & 0 deletions subgraphs/arbitrum/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Arbitrum Subgraph Changelog

## 1.7.0 (2024-06-04)

- Adds POL in Camelot

## 1.6.4 (2023-09-13)

- Apply write-off of JonesDAO token, since it cannot be sold.
Expand Down
4 changes: 2 additions & 2 deletions subgraphs/arbitrum/config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "QmRf3fo7tVsXsj9cQZSgT3Y2R67Hv41T1Ph559oQAmTLe1",
"id": "Qmb57LCGXQ6EQcDwKVgTx6U9ChuAEcdrQ63YpBkbk3yyhX",
"org": "olympusdao",
"name": "protocol-metrics-arbitrum",
"version": "1.6.4"
"version": "1.7.0"
}
18 changes: 14 additions & 4 deletions subgraphs/arbitrum/src/contracts/Constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const LP_UNISWAP_V2_JONES_GOHM_GOHM = "0x292d1587a6bb37e34574c9ad5993f221
export const LP_UNISWAP_V2_JONES_WETH = "0xe8ee01ae5959d3231506fcdef2d5f3e85987a39c".toLowerCase();
export const LP_UNISWAP_V2_LQTY_WETH = "0x8e78f0f6d116f94252d3bcd73d8ade63d415c1bf".toLowerCase();
export const LP_UNISWAP_V2_MAGIC_WETH = "0xb7e50106a5bd3cf21af210a755f9c8740890a8c9".toLowerCase();
export const LP_CAMELOT_OHM_WETH = "0x8aCd42e4B5A5750B44A28C5fb50906eBfF145359".toLowerCase();
export const LP_UNISWAP_V3_ARB_WETH = "0xc6f780497a95e246eb9449f5e4770916dcd6396a".toLowerCase();
export const LP_UNISWAP_V3_WETH_USDC = "0xc31e54c7a869b9fcbecc14363cf510d1c41fa443".toLowerCase();

Expand Down Expand Up @@ -71,19 +72,27 @@ ERC20_TOKENS_ARBITRUM.set(LP_UNISWAP_V2_GOHM_WETH, new TokenDefinition(LP_UNISWA
ERC20_TOKENS_ARBITRUM.set(LP_UNISWAP_V2_JONES_GOHM_GOHM, new TokenDefinition(LP_UNISWAP_V2_JONES_GOHM_GOHM, TokenCategoryPOL, true, false));
ERC20_TOKENS_ARBITRUM.set(LP_UNISWAP_V2_JONES_WETH, new TokenDefinition(LP_UNISWAP_V2_JONES_WETH, TokenCategoryPOL, true, false));
ERC20_TOKENS_ARBITRUM.set(LP_UNISWAP_V2_MAGIC_WETH, new TokenDefinition(LP_UNISWAP_V2_MAGIC_WETH, TokenCategoryPOL, true, false));
ERC20_TOKENS_ARBITRUM.set(LP_CAMELOT_OHM_WETH, new TokenDefinition(LP_CAMELOT_OHM_WETH, TokenCategoryPOL, true, false));
ERC20_TOKENS_ARBITRUM.set(LP_UNISWAP_V3_ARB_WETH, new TokenDefinition(LP_UNISWAP_V3_ARB_WETH, TokenCategoryPOL, true, false));
ERC20_TOKENS_ARBITRUM.set(LP_UNISWAP_V3_WETH_USDC, new TokenDefinition(LP_UNISWAP_V3_WETH_USDC, TokenCategoryPOL, true, false));

export const OHM_TOKENS = [ERC20_GOHM_SYNAPSE, ERC20_OHM];

export const DAO_MULTISIG = "0x012BBf0481b97170577745D2167ee14f63E2aD4C".toLowerCase();

export const getProtocolAddresses = (): string[] => {
// Combine the wallet addresses with DAO multisig
return WALLET_ADDRESSES.concat([DAO_MULTISIG]);
};

const TREASURY_BLACKLIST = new Map<string, string[]>();

/**
* OHM and gOHM in the following wallets are blacklisted (not indexed) as we do not want the value
* being considered as part of the protocol or DAO treasuries.
*/
TREASURY_BLACKLIST.set(ERC20_GOHM_SYNAPSE, WALLET_ADDRESSES);
TREASURY_BLACKLIST.set(ERC20_OHM, WALLET_ADDRESSES);
TREASURY_BLACKLIST.set(ERC20_GOHM_SYNAPSE, getProtocolAddresses());
TREASURY_BLACKLIST.set(ERC20_OHM, getProtocolAddresses());

/**
* Some wallets (e.g. {DAO_WALLET}) have specific treasury assets mixed into them.
Expand All @@ -96,7 +105,7 @@ TREASURY_BLACKLIST.set(ERC20_OHM, WALLET_ADDRESSES);
* @returns
*/
export const getWalletAddressesForContract = (contractAddress: string): string[] => {
const walletAddresses = WALLET_ADDRESSES.slice(0);
const walletAddresses = getProtocolAddresses().slice(0);

// If the contract isn't on the blacklist, return as normal
if (!TREASURY_BLACKLIST.has(contractAddress.toLowerCase())) {
Expand Down Expand Up @@ -124,7 +133,7 @@ export const getWalletAddressesForContract = (contractAddress: string): string[]

/**
* Defines the contract addresses that belong to the protocol & DAO treasuries.
*
*
* This is normally deducted from total supply to determine circulating supply.
*/
export const CIRCULATING_SUPPLY_WALLETS = [
Expand Down Expand Up @@ -176,6 +185,7 @@ CONTRACT_NAME_MAP.set(LP_UNISWAP_V2_JONES_GOHM_GOHM, "UniswapV2 jgOHM-gOHM Liqui
CONTRACT_NAME_MAP.set(LP_UNISWAP_V2_JONES_WETH, "UniswapV2 JONES-wETH Liquidity Pool");
CONTRACT_NAME_MAP.set(LP_UNISWAP_V2_LQTY_WETH, "Ramses LQTY-wETH Liquidity Pool");
CONTRACT_NAME_MAP.set(LP_UNISWAP_V2_MAGIC_WETH, "UniswapV2 MAGIC-wETH Liquidity Pool");
CONTRACT_NAME_MAP.set(LP_CAMELOT_OHM_WETH, "Camelot OHM-wETH Liquidity Pool");
CONTRACT_NAME_MAP.set(LP_UNISWAP_V3_ARB_WETH, "UniswapV3 ARB-wETH Liquidity Pool");
CONTRACT_NAME_MAP.set(LP_UNISWAP_V3_WETH_USDC, "UniswapV3 wETH-USDC Liquidity Pool");
CONTRACT_NAME_MAP.set(LUSD_ALLOCATOR, "LUSD Allocator");
Expand Down
5 changes: 3 additions & 2 deletions subgraphs/arbitrum/src/contracts/Contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { BigDecimal, BigInt, log } from "@graphprotocol/graph-ts";
import { ERC20 } from "../../../shared/generated/Price/ERC20";
import { TokenRecord } from "../../../shared/generated/schema";
import { getERC20TokenRecordFromWallet } from "../../../shared/src/contracts/ERC20";
import { DAO_WALLET, WALLET_ADDRESSES } from "../../../shared/src/Wallets";
import { DAO_WALLET } from "../../../shared/src/Wallets";
import {
BLOCKCHAIN,
CONTRACT_ABBREVIATION_MAP,
Expand All @@ -12,6 +12,7 @@ import {
ERC20_TOKENS_ARBITRUM,
ERC20_WETH,
JONES_WRITE_OFF_BLOCK,
getProtocolAddresses,
} from "./Constants";
import { getTokenRecordValue } from "../../../shared/src/utils/TokenRecordHelper";

Expand Down Expand Up @@ -56,7 +57,7 @@ export const getWalletAddressesForContract = (contractAddress: string): string[]
const nonTreasuryAddresses = NON_TREASURY_ASSET_WHITELIST.has(contractAddress.toLowerCase())
? NON_TREASURY_ASSET_WHITELIST.get(contractAddress.toLowerCase())
: [];
const newAddresses = WALLET_ADDRESSES.slice(0);
const newAddresses = getProtocolAddresses().slice(0);

// Add the values of nonTreasuryAddresses, but filter duplicates
for (let i = 0; i < nonTreasuryAddresses.length; i++) {
Expand Down
4 changes: 2 additions & 2 deletions subgraphs/arbitrum/subgraph.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ repository: https://github.com/OlympusDAO/olympus-protocol-metrics-subgraph
features:
- grafting
graft:
base: QmXVMuS639JzTTq9ZVkRnGFTftiYJ8c6FPrB52qCshSnFa # 1.5.3
block: 130482707 # JonesDAO write-off
base: QmRf3fo7tVsXsj9cQZSgT3Y2R67Hv41T1Ph559oQAmTLe1 # 1.6.4
block: 190428287 # POL deployment
schema:
file: ../../schema.graphql
dataSources:
Expand Down

0 comments on commit ad982f1

Please sign in to comment.