From 9065c362f62d9314e03ef3bed73a55e4642e7254 Mon Sep 17 00:00:00 2001 From: Chris Jacobs Date: Fri, 27 Sep 2024 11:29:55 -0700 Subject: [PATCH 1/9] cumulativeYield & cumulativeFees on daily stats + remove docs/ and grafana/ improve mainnet exchange rate price acquisition --- ...57088697-Data.js => 1727379829987-Data.js} | 8 +- docs/REQUIREMENTS.md | 246 - docs/daily-stats.md | 135 - docs/deprecated/README.md | 26 - docs/deprecated/dune/OUSD Apy.md | 90 - .../dune/OUSD Curve LP Gauge Deposit.md | 76 - docs/deprecated/dune/OUSD Total Supply.md | 71 - ...e & median (only accounts over 10 OUSD).md | 173 - docs/deprecated/dune/OUSD average & median.md | 173 - docs/deprecated/dune/OUSD buybacks.md | 99 - docs/deprecated/dune/OUSD holder breakdown.md | 126 - ...eries - breakdown by balance - detailed.md | 163 - ...rs - time series - breakdown by balance.md | 152 - ...- breakdown by wallet number - detailed.md | 158 - ...ime series - breakdown by wallet number.md | 157 - .../deprecated/dune/Total supply breakdown.md | 153 - grafana/README.md | 3 - grafana/aave-compound-balances.json | 755 --- grafana/alerts/balancer-weights-reth_weth.sql | 16 - grafana/balancer-pools.json | 1014 ---- grafana/curve-pools.json | 2543 ---------- grafana/exchange-rates.json | 1045 ---- grafana/maverick-pools.json | 400 -- grafana/oeth-dashboard.json | 4286 ---------------- grafana/oeth-liquidity.json | 537 -- grafana/oeth-strategy-earnings.json | 4348 ----------------- grafana/ogn-distribution.json | 521 -- grafana/origin-overview.json | 201 - grafana/ousd-dashboard.json | 1893 ------- grafana/ousd-strategy-earnings.json | 2655 ---------- schema.graphql | 5 +- schema/general.graphql | 2 + schema/otoken.graphql | 3 +- src/main-test.ts | 39 +- src/mainnet/processors/erc20s.ts | 4 +- src/model/generated/oTokenDailyStat.model.ts | 6 + src/model/generated/strategyBalance.model.ts | 6 + src/server-extension/ogn-stats.ts | 1 - src/server-extension/resolvers/index.ts | 4 +- src/server-extension/strategies.ts | 6 + src/server-extension/symbols.ts | 29 + .../exchange-rates/exchange-rates.ts | 8 + .../exchange-rates/mainnetCurrencies.ts | 18 - .../exchange-rates/price-routing-mainnet.ts | 115 +- src/templates/aerodrome/cl-pool.ts | 5 +- src/templates/aerodrome/pool.ts | 2 +- src/templates/aerodrome/prices.ts | 13 - src/templates/erc20-simple/erc20.ts | 3 +- src/templates/erc20/erc20.ts | 3 +- .../exponential-staking.ts | 2 +- src/templates/otoken/otoken.ts | 13 +- src/templates/strategy/strategy-balancer.ts | 23 +- src/templates/strategy/strategy-curve-amo.ts | 31 +- src/templates/strategy/strategy-earnings.ts | 26 +- src/templates/strategy/strategy-generic.ts | 37 +- .../strategy/strategy-native-staking.ts | 23 +- src/templates/strategy/strategy-vault.ts | 34 +- src/utils/addresses-arbitrum.ts | 5 + src/utils/addresses.ts | 8 - src/utils/symbols.ts | 19 + 60 files changed, 301 insertions(+), 22415 deletions(-) rename db/migrations/{1726857088697-Data.js => 1727379829987-Data.js} (99%) delete mode 100644 docs/REQUIREMENTS.md delete mode 100644 docs/daily-stats.md delete mode 100644 docs/deprecated/README.md delete mode 100644 docs/deprecated/dune/OUSD Apy.md delete mode 100644 docs/deprecated/dune/OUSD Curve LP Gauge Deposit.md delete mode 100644 docs/deprecated/dune/OUSD Total Supply.md delete mode 100644 docs/deprecated/dune/OUSD average & median (only accounts over 10 OUSD).md delete mode 100644 docs/deprecated/dune/OUSD average & median.md delete mode 100644 docs/deprecated/dune/OUSD buybacks.md delete mode 100644 docs/deprecated/dune/OUSD holder breakdown.md delete mode 100644 docs/deprecated/dune/Token holders - time series - breakdown by balance - detailed.md delete mode 100644 docs/deprecated/dune/Token holders - time series - breakdown by balance.md delete mode 100644 docs/deprecated/dune/Token holders - time series - breakdown by wallet number - detailed.md delete mode 100644 docs/deprecated/dune/Token holders - time series - breakdown by wallet number.md delete mode 100644 docs/deprecated/dune/Total supply breakdown.md delete mode 100644 grafana/README.md delete mode 100644 grafana/aave-compound-balances.json delete mode 100644 grafana/alerts/balancer-weights-reth_weth.sql delete mode 100644 grafana/balancer-pools.json delete mode 100644 grafana/curve-pools.json delete mode 100644 grafana/exchange-rates.json delete mode 100644 grafana/maverick-pools.json delete mode 100644 grafana/oeth-dashboard.json delete mode 100644 grafana/oeth-liquidity.json delete mode 100644 grafana/oeth-strategy-earnings.json delete mode 100644 grafana/ogn-distribution.json delete mode 100644 grafana/origin-overview.json delete mode 100644 grafana/ousd-dashboard.json delete mode 100644 grafana/ousd-strategy-earnings.json create mode 100644 src/server-extension/symbols.ts create mode 100644 src/utils/addresses-arbitrum.ts create mode 100644 src/utils/symbols.ts diff --git a/db/migrations/1726857088697-Data.js b/db/migrations/1727379829987-Data.js similarity index 99% rename from db/migrations/1726857088697-Data.js rename to db/migrations/1727379829987-Data.js index 9dacfad0..919ab12a 100644 --- a/db/migrations/1726857088697-Data.js +++ b/db/migrations/1727379829987-Data.js @@ -1,5 +1,5 @@ -module.exports = class Data1726857088697 { - name = 'Data1726857088697' +module.exports = class Data1727379829987 { + name = 'Data1727379829987' async up(db) { await db.query(`CREATE TABLE "aero_cl_gauge_claim_fees" ("id" character varying NOT NULL, "chain_id" integer NOT NULL, "block_number" integer NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "address" text NOT NULL, "from" text NOT NULL, "claimed0" numeric NOT NULL, "claimed1" numeric NOT NULL, CONSTRAINT "PK_324db7f817fe71a6a8dfc04701a" PRIMARY KEY ("id"))`) @@ -452,7 +452,7 @@ module.exports = class Data1726857088697 { await db.query(`CREATE INDEX "IDX_2b58051dcc72cf0f02aa41ff14" ON "exchange_rate" ("chain_id") `) await db.query(`CREATE INDEX "IDX_9e23a3f1bf3634820c873a0fe8" ON "exchange_rate" ("timestamp") `) await db.query(`CREATE INDEX "IDX_c61a93768eed9e58ce399bbe01" ON "exchange_rate" ("block_number") `) - await db.query(`CREATE TABLE "strategy_balance" ("id" character varying NOT NULL, "chain_id" integer NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "strategy" text NOT NULL, "asset" text NOT NULL, "balance" numeric NOT NULL, CONSTRAINT "PK_ca6f93229d1392e9546d01dae4f" PRIMARY KEY ("id"))`) + await db.query(`CREATE TABLE "strategy_balance" ("id" character varying NOT NULL, "chain_id" integer NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "block_number" integer NOT NULL, "strategy" text NOT NULL, "asset" text NOT NULL, "symbol" text NOT NULL, "balance" numeric NOT NULL, "balance_eth" numeric NOT NULL, CONSTRAINT "PK_ca6f93229d1392e9546d01dae4f" PRIMARY KEY ("id"))`) await db.query(`CREATE INDEX "IDX_bb5bbdf054deadf169e9e0330a" ON "strategy_balance" ("chain_id") `) await db.query(`CREATE INDEX "IDX_0113bf0b63183bea0d22cd0d08" ON "strategy_balance" ("timestamp") `) await db.query(`CREATE INDEX "IDX_a88065dcd92011698bbe7df7b1" ON "strategy_balance" ("block_number") `) @@ -650,7 +650,7 @@ module.exports = class Data1726857088697 { await db.query(`CREATE INDEX "IDX_57bb1f7d2fd6fe063b9cd434b2" ON "o_token_activity" ("timestamp") `) await db.query(`CREATE INDEX "IDX_d6cba0877ee9f5332e6d97e758" ON "o_token_activity" ("block_number") `) await db.query(`CREATE INDEX "IDX_b5826e68934ff671bbe28836ec" ON "o_token_activity" ("tx_hash") `) - await db.query(`CREATE TABLE "o_token_daily_stat" ("id" character varying NOT NULL, "chain_id" integer NOT NULL, "block_number" integer NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "otoken" text NOT NULL, "apr" numeric NOT NULL, "apy" numeric NOT NULL, "apy7" numeric NOT NULL, "apy14" numeric NOT NULL, "apy30" numeric NOT NULL, "rate_usd" numeric NOT NULL, "rate_eth" numeric NOT NULL, "total_supply" numeric NOT NULL, "rebasing_supply" numeric NOT NULL, "non_rebasing_supply" numeric NOT NULL, "wrapped_supply" numeric NOT NULL, "amo_supply" numeric, "dripper_weth" numeric NOT NULL, "yield" numeric NOT NULL, "fees" numeric NOT NULL, "market_cap_usd" numeric NOT NULL, CONSTRAINT "PK_eeabae008c52207e32e2171176d" PRIMARY KEY ("id"))`) + await db.query(`CREATE TABLE "o_token_daily_stat" ("id" character varying NOT NULL, "chain_id" integer NOT NULL, "block_number" integer NOT NULL, "timestamp" TIMESTAMP WITH TIME ZONE NOT NULL, "otoken" text NOT NULL, "apr" numeric NOT NULL, "apy" numeric NOT NULL, "apy7" numeric NOT NULL, "apy14" numeric NOT NULL, "apy30" numeric NOT NULL, "rate_usd" numeric NOT NULL, "rate_eth" numeric NOT NULL, "total_supply" numeric NOT NULL, "rebasing_supply" numeric NOT NULL, "non_rebasing_supply" numeric NOT NULL, "wrapped_supply" numeric NOT NULL, "amo_supply" numeric, "dripper_weth" numeric NOT NULL, "yield" numeric NOT NULL, "fees" numeric NOT NULL, "cumulative_yield" numeric NOT NULL, "cumulative_fees" numeric NOT NULL, "market_cap_usd" numeric NOT NULL, CONSTRAINT "PK_eeabae008c52207e32e2171176d" PRIMARY KEY ("id"))`) await db.query(`CREATE INDEX "IDX_98c1ae817f9436c4f602de04c7" ON "o_token_daily_stat" ("chain_id") `) await db.query(`CREATE INDEX "IDX_8da572d689803a6292f00f687c" ON "o_token_daily_stat" ("block_number") `) await db.query(`CREATE INDEX "IDX_41df5fb0657b57079c5e011578" ON "o_token_daily_stat" ("timestamp") `) diff --git a/docs/REQUIREMENTS.md b/docs/REQUIREMENTS.md deleted file mode 100644 index 031d9cfb..00000000 --- a/docs/REQUIREMENTS.md +++ /dev/null @@ -1,246 +0,0 @@ -# Requirements - -Catalog of data requirements. - -## oeth.com - -### ousd.com/ogv-dashboard - -[schema-ogv.graphql](..%2Fschema-ogv.graphql) - -- OGV Price (5m?) -- OGV Market Cap (5m?) -- OGV Circulating Supply -- OGV Total Supply -- OGV Staking APY -- OGV Amount Staked & Percentage -- OGV Registered Voters -- OGV Open-source contributors -- OGV Improvement proposals - -## oeth.com/analytics - -[schema-oeth.graphql](..%2Fschema-oeth.graphql) - -- APY (as 7/14/30 day MA) -- Total Supply - - OETH - - Protocol Owned - - Circulating Supply -- Daily Protocol Revenue (as 7/14/30 day MA) - - ETH Value - - 7-day trailing average (ETH) - - Yield Distributed (ETH) - - Fees Collected (ETH) -- Current Collateral - - Frax ETH (frxETH) - - ETH - - Rocket Pool ETH (rETH) - - Lido Staked ETH (stETH) - - Wrapped Ether (WETH) -- ETH_OETH Rate -- Exchange Rates -- Collateral Distribution - - Convex OETH - - FraxETH - - Origin Vault - - Aura OETH - - Morpho AAVE -- Revenue Sums - - 24H - - 7D - - All-time -- Balance Sheet - - Vault (WETH, stETH, rETH, frxETH) - - Convex (ETH, OETH) - - Frax Staking (sfrxETH) - - Morpho Aave (WETH) - - Aura (rETH, WETH) - - Dripper (WETH) - - Total Supply (OETH) -- Strategies - - Convex Finance - - Convex ETH+OETH - - Frax - - Staked Frax Ether (sfrxETH) - - Rocket Pool - - Rocket Pool Ether (rETH) - - Lido - - Lido Staked Ether (stETH) - - Unallocated - - Showing WETH and frxETH as of writing this. -- Dripper - - Funds held by dripper - - Available for collection - - Drip rate (1d, 1h, 1m) - -## [prometheus-monitoring](https://github.com/oplabs/prometheus-monitoring) - -### [Metrics](https://github.com/oplabs/prometheus-monitoring/blob/2ef3f67ccd88a965c67553457a265b9853c57b33/lambda-scrapers/exporters/src/utils/prometheus.js) - -#### total_supply - -Track total supply for **OUSD** ✅, **OGV** ⚠️, and **OETH** ✅. - -#### vault - -Vault price metrics for: `["USDC", "USDT", "DAI"]` ⚠️ - -- `vault.priceUnitMint(assetAddress)` -- `vault.priceUnitRedeem(assetAddress)` - -Vault holdings (`balanceOf`) for: ✅ - -- OUSD: `["USDC", "USDT", "DAI"]` -- OETH: `["WETH", "stETH", "rETH", "frxETH"]` - -#### strategies - -OUSD Holdings: `["USDC", "USDT", "DAI"]` - -- ✅ [ousd](..%2Fsrc%2Fprocessors%2Fousd) (vault holdings) - -TODO: ⚠️ - -- Compound -- Aave -- Convex -- MorphoCompound -- MorphoAave -- OUSDMeta -- LUSDMeta - -OETH Holdings: `["frxETH", "rETH", "stETH", "WETH"]` - -- ✅ [oeth](..%2Fsrc%2Fprocessors%2Foeth) (vault holdings) - -TODO: ⚠️ - -- FraxETH -- CurveAMO - -#### threePool ✅ [curve](..%2Fsrc%2Fprocessors%2Fcurve) - -Assets: `["USDC", "USDT", "DAI"]` - -```javascript -const threepoolCoinIndexMap = { - DAI: 0, - USDC: 1, - USDT: 2, -}; - -contracts.ThreePool - -contract.balances(threepoolCoinIndexMap[asset]) -``` - -#### metapools ✅ [curve](..%2Fsrc%2Fprocessors%2Fcurve) - -- `curveMetapoolBalanceMetric` - - addresses.OUSDMetapool: 0xed279fdd11ca84beef15af5d39bb4d4bee23f0ca - - OUSD: `main_coin_balance = await poolContract.balances(0)` - - ThreePoolLP: `three_crv_balance = await poolContract.balances(1)` - - addresses.LUSDMetapool: 0xed279fdd11ca84beef15af5d39bb4d4bee23f0ca - - LUSD: `main_coin_balance = await poolContract.balances(0)` - - ThreePoolLP: `three_crv_balance = await poolContract.balances(1)` -- `balancerPoolMetric` - - Here we save the **rate** and **balance** for each pool. - - If an asset doesn't have a rate provider (zero address) default to 1e18 as suggested by - Balancer: https://docs.balancer.fi/reference/contracts/rate-providers.html - - rETH_sfrxETH_wstETH - - balancerPoolId: 0x42ed016f826165c2e5976fe5bc3df540c5ad0af700000000000000000000058b - - poolAddress: 0x42ED016F826165C2e5976fe5bC3df540C5aD0Af7 - - rETH_WETH - - balancerPoolId: 0x1e19cf2d73a72ef1332c882f20534b6519be0276000200000000000000000112 - - poolAddress: 0x1E19CF2D73a72Ef1332C882F20534B6519Be0276 - -```javascript -const [tokens, balances] = await balancerVault.getPoolTokens(poolId); -const rateProviders = await getBalancerPoolRateProviders(poolAddress); -rateProvider.getRate() -const balancerMetaStablePoolABI = [ - "function getRateProviders() external view returns (address[])", -]; -``` - -#### oeth ✅ [curve](..%2Fsrc%2Fprocessors%2Fcurve) - -- curvePoolBalanceMetric: `poolContract.balances(0) or poolContract.balances(1)` - - EthFrxEthPool: "0xa1f8a6807c402e4a15ef4eba36528a3fed24e577" - ETH frxETH - - REthEthPool: "0x0f3159811670c117c372428d4e69ac32325e4d0f" - ETH rETH - - EthStEthPool: "0xDC24316b9AE028F1497c275EB9192a3Ea0f67022" - ETH stETH - - WEthStEthPool: "0x828b154032950c8ff7cf8085d841723db2696056" - WETH stETH - - OEthEthPool: "0x94B17476A93b3262d87B9a326965D1E91f9c13E7" - OETH ETH - -#### aave_comp_platforms ✅ [aave-compound](..%2Fsrc%2Fprocessors%2Faave-compound) - -- AaveCompoundBorrowableMetric: `"USDC", "USDT", "DAI"` - - For each of the below: - -```javascript -balance = await assetContract.balanceOf(address) -``` - -`assetContract` being USDC, USDT, or DAI -balanceOf `address` from the map below. - -```javascript -const aaveAssetToPlatformMap = { - USDT: { // 0xdac17f958d2ee523a2206206994597c13d831ec7 - token: "aUSDT", - address: addresses.aUSDT, // 0x3Ed3B47Dd13EC9a98b44e6204A523E766B225811 - }, - USDC: { // 0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48 - token: "aUSDC", - address: addresses.aUSDC, // 0xBcca60bB61934080951369a648Fb03DF4F96263C - }, - DAI: { // 0x6b175474e89094c44da98b954eedeac495271d0f - token: "aDAI", - address: addresses.aDAI, // 0x028171bca77440897b824ca71d1c56cac55b68a3 - }, -}; -``` - -#### rebasing_credits - -- ✅ OETH [oeth](..%2Fsrc%2Fprocessors%2Foeth) - - This is done for OETH in Subsquid. -- ✅⚠️ OUSD [ousd](..%2Fsrc%2Fprocessors%2Fousd) - - A virtually identical implementation should work for OUSD. - - TODO items exist - -For each of the above: - -- `rebasingCreditsPerTokenMetric` - - `event TotalSupplyUpdatedHighres(uint256 totalSupply, uint256 rebasingCredits, uint256 rebasingCreditsPerToken)` -- `rebasingCreditsMetric` - - `function rebasingCredits() external view returns (uint256)` -- `nonRebasingSupplyMetric` - - `function nonRebasingSupply() external view returns (uint256)` - -##### Ramblings - -- AaveCompoundBorrowableMetric - - TRACK ERC20 BALANCES - - Is this as simple as tracking transfers or do some of these receive balance in other ways? (magical rebasing, - etc...) - - cUSDT: "0xf650c3d88d12db855b8bf7d11be6c55a4e07dcc9" - - cUSDC: "0x39aa39c021dfbae8fac545936693ac917d5e7563" - - cDAI: "0x5d3a536e4d6dbd6114cc1ead35777bab948e3643" - - aUSDT: "0x3Ed3B47Dd13EC9a98b44e6204A523E766B225811" - - aUSDC: "0xBcca60bB61934080951369a648Fb03DF4F96263C" - - aDAI: "0x028171bca77440897b824ca71d1c56cac55b68a3" -- balancerPoolMetric - - balancer vault `getPoolTokens(poolId)` data - - -- curveMetapoolBalanceMetric -- curvePoolBalanceMetric -- nonRebasingSupplyMetric -- rebasingCreditsMetric -- rebasingCreditsPerTokenMetric -- strategyHoldingMetric -- threepoolBalanceMetric -- totalSupplyMetric -- vaultHoldingMetric -- vaultUSDPriceMetric \ No newline at end of file diff --git a/docs/daily-stats.md b/docs/daily-stats.md deleted file mode 100644 index 4e384bec..00000000 --- a/docs/daily-stats.md +++ /dev/null @@ -1,135 +0,0 @@ -# Daily Stats type - -This type should be able to handle most of the charts and stats for oeth.com. -Stats for today would be kept up to date in real time. - -## Definition - -```graphql -dailyStats { - id: ID! """Timestamp, eg 2023-10-17""" - blockNumber: Int! """Last block number stats were updated""" - timestamp: DateTime! """Timestamp of block number stats were updated""" - - apr: Float! - apy: Float! - apy7DayAvg: Float! - apy14DayAvg: Float! - apy30DayAvg: Float! - - totalSupply: BigInt! - totalSupplyUSD: Float! - rebasingSupply: BigInt! - nonRebasingSupply: BigInt! - amoSupply: BigInt! - - yield: BigInt! - fees: BigInt! - revenue: BigInt! - revenue7DayAvg: BigInt! - revenue7DayTotal: BigInt! - revenueAllTime: BigInt! - - pegPrice: BigInt! """Price of OETH in ETH""" - - strategies { - id: String! - name: String! - address: String! """Contract address of the strategy""" - total: BigInt! """Sum of tokens in strategy""" - tvl: BigInt! """Total ETH value""" - holdings { - symbol: String! """Token symbol""" - amount: BigInt! """Amount held""" - value: BigInt! """Total ETH value""" - } - } - - collateral { - symbol: String! """Token symbol""" - amount: BigInt! """Amount held""" - price: BigInt! """Price in ETH""" - value: BigInt! """Total ETH value""" - } -} -``` - -## Example response - -```json -{ - "dailyStats": [ - { - "id": "2023-10-17", - "blockNumber": 18361379, - "timestamp": "2023-10-16T07:15:11.000Z", - - "apr": 0.14973706558715433, - "apy": 0.16144112845098268, - "apy7DayAvg": 0.12818496009582647, - "apy14DayAvg": 0.12818496009582647, - "apy30DayAvg": 0.12818496009582647, - - "totalSupply": "40087773441569861381365", - "totalSupplyUSD": 63231.0153, - "rebasingSupply": "25361442351482631876504", - "nonRebasingSupply": "14726331090087229504861", - "amoSupply": "10070572720887441843875", - - "yield": "3247579150222815340", - "fees": "811894787555703834", - "revenue": "811894787555703834", - "revenue7DayAvg": "811894787555703834", - "revenue7DayTotal": "811894787555703834", - "revenueAllTime": "811894787555703834", - - "pegPrice": "1001212340964123876", - - "strategies": [ - { - "id": "frax_eth_strat", - "name": "FraxETH", - "address": "0x3ff8654d633d4ea0fae24c52aec73b4a20d0d0e5", - "total": "14874775157977805", - "tvl": "14874775157977805", - "holdings": [ - { - "symbol": "FRXETH", - "amount": "14874775157977805", - "value": "14874775157977805" - } - ] - } - ], - - "collateral": [ - { - "name": "ETH", - "total": "90660812201004131466148", - "price": "1000000000000000000", - "value": "90660812201004131466148" - }, - { - "name": "WETH", - "total": "618599415045049672320", - "price": "1000000000000000000", - "value": "618599415045049672320" - }, - { - "name": "FRXETH", - "total": "14874776250683471078445", - "price": "1000000000000000000", - "value": "14874776250683471078445" - }, - { - "name": "RETH", - "total": "3872976488796949771439", - "price": "1087282384391932999", - "value": "4211019111433044129729" - } - ] - } - ] -} - -``` \ No newline at end of file diff --git a/docs/deprecated/README.md b/docs/deprecated/README.md deleted file mode 100644 index 3375f89b..00000000 --- a/docs/deprecated/README.md +++ /dev/null @@ -1,26 +0,0 @@ -# Deprecated Queries (?) - -Starting cataloguing these before I realized we don't link to them anymore. - -## Dune Queries - -Sources: [dune_analytics.html](https://github.com/OriginProtocol/ousd-analytics/blob/7173bd2a1e179a3826851c8fdaeb866a48f5f5b2/eagleproject/core/templates/dune_analytics.html) - -### General Stats - -- [OUSD Apy.md](dune%2FOUSD%20Apy.md) -- [Total supply breakdown.md](dune%2FTotal%20supply%20breakdown.md) -- [OUSD Total Supply.md](dune%2FOUSD%20Total%20Supply.md) -- [OUSD buybacks.md](dune%2FOUSD%20buybacks.md) - -### OUSD Holders - -- [OUSD average & median.md](dune%2FOUSD%20average%20%26%20median.md) -- [OUSD average & median (only accounts over 10 OUSD).md](dune%2FOUSD%20average%20%26%20median%20%28only%20accounts%20over%2010%20OUSD%29.md) -- [OUSD Curve LP Gauge Deposit.md](dune%2FOUSD%20Curve%20LP%20Gauge%20Deposit.md) -- [OUSD holder breakdown.md](dune%2FOUSD%20holder%20breakdown.md) -- [Token holders - time series - breakdown by balance.md](dune%2FToken%20holders%20-%20time%20series%20-%20breakdown%20by%20balance.md) -- [Token holders - time series - breakdown by balance - detailed.md](dune%2FToken%20holders%20-%20time%20series%20-%20breakdown%20by%20balance%20-%20detailed.md) -- [Token holders - time series - breakdown by wallet number.md](dune%2FToken%20holders%20-%20time%20series%20-%20breakdown%20by%20wallet%20number.md) -- [Token holders - time series - breakdown by wallet number - detailed.md](dune%2FToken%20holders%20-%20time%20series%20-%20breakdown%20by%20wallet%20number%20-%20detailed.md) - diff --git a/docs/deprecated/dune/OUSD Apy.md b/docs/deprecated/dune/OUSD Apy.md deleted file mode 100644 index aab42b2e..00000000 --- a/docs/deprecated/dune/OUSD Apy.md +++ /dev/null @@ -1,90 +0,0 @@ -# OUSD Apy - -https://dune.xyz/embeds/271634/519050/34dc346b-e90f-4c4b-86ab-1107fe8d6a4b -https://dune.com/queries/271634/519050 - -```sql -DROP FUNCTION IF EXISTS dune_user_generated.data2bignumber(BYTEA, INT, INT); -CREATE OR REPLACE FUNCTION dune_user_generated.data2bignumber(data BYTEA, topic INT, decimals INT) RETURNS FLOAT AS $$ -BEGIN -RETURN bytea2numeric(decode(SUBSTRING(ENCODE("data",'hex'),(1+(64*"topic")),64),'hex'))/POWER(10, "decimals"); -END; $$ -LANGUAGE PLPGSQL; - --- BLOCKS_PER_DAY = 6400 -WITH rebase_logs AS ( - -- this is kind of hackish, but for some reason "DISTINCT ON" expression is not supported - SELECT block_number, - MAX(block_time) as block_time, - MAX(total_supply) as total_supply, - MAX(rebasing_credits) as rebasing_credits, - MIN(rebasing_credits_per_token) as rebasing_credits_per_token - FROM( - SELECT - dune_user_generated.data2bignumber(data, 0, 18) as total_supply, - dune_user_generated.data2bignumber(data, 1, 18) as rebasing_credits, - dune_user_generated.data2bignumber(data, 2, 18) as rebasing_credits_per_token, - * - FROM ethereum.logs - WHERE contract_address='\x2a8e1e676ec238d8a992307b495b45b3feaa5e86' -- OUSD - AND topic1='\x99e56f783b536ffacf422d59183ea321dd80dcd6d23daa13023e8afea38c3df1' -- old rebase logs - AND block_number > 11596940 -- OUSD V2 block number - - UNION ALL - - SELECT - dune_user_generated.data2bignumber(data, 0, 18) as total_supply, - dune_user_generated.data2bignumber(data, 1, 27) as rebasing_credits, - dune_user_generated.data2bignumber(data, 2, 27) as rebasing_credits_per_token, - * - FROM ethereum.logs - WHERE contract_address='\x2a8e1e676ec238d8a992307b495b45b3feaa5e86' -- OUSD - AND topic1='\x41645eb819d3011b13f97696a8109d14bfcddfaca7d063ec0564d62a3e257235' -- new rebase logs - AND block_number > 11596940 -- OUSD V2 block number - ) DATA - WHERE block_time > now() - interval '100 days' - GROUP BY 1 - ORDER BY block_number DESC -) - -SELECT -block_date, -apy, -AVG(apy) OVER (ORDER BY block_date ASC ROWS BETWEEN 29 PRECEDING AND CURRENT ROW) as _30_day_apy, -AVG(apy) OVER (ORDER BY block_date ASC ROWS BETWEEN 13 PRECEDING AND CURRENT ROW) as _14_day_apy, -AVG(apy) OVER (ORDER BY block_date ASC ROWS BETWEEN 6 PRECEDING AND CURRENT ROW) as _7_day_apy -FROM ( - SELECT - block_date, - -- Convert APR TO APY - ((1 + apr / 100 / 365.25) ^ (365.25 - 1)) * 100 - 100 as apy - FROM ( - SELECT - -- Calculate APR - (rebasing_credits_per_token_ratio - 1) * 100 * 6400 * 365.25 / block_number_diff as apr, - * - FROM - ( - -- This part deviates from the way analytics.ousd.com gets its daily APR. What we do here is pick the last TotalSuppluUpdatedHighres - -- event of each day and calculate block number difference and rebasing_credits_per_token_ratio between 2 neighbouring events. - -- - -- A better way would be to do it as we do it in analytics.ousd.com where end of each day block number is used and the rebasingCreditsPerToken - -- at that block time - SELECT - block_number - lag(block_number) over (order by block_number) as block_number_diff, - lag(rebasing_credits_per_token) over (order by block_number) / rebasing_credits_per_token as rebasing_credits_per_token_ratio, - * - FROM rebase_logs as t - JOIN ( - SELECT - date_trunc('day', block_time) as block_date, - MAX(block_number) as max_block_number - FROM rebase_logs - GROUP BY 1 - ORDER BY 1 DESC - ) t1 ON t.block_number = t1.max_block_number - ORDER BY block_number DESC - ) AS at - ) as at2 -) DATA; -``` \ No newline at end of file diff --git a/docs/deprecated/dune/OUSD Curve LP Gauge Deposit.md b/docs/deprecated/dune/OUSD Curve LP Gauge Deposit.md deleted file mode 100644 index 8869d4b7..00000000 --- a/docs/deprecated/dune/OUSD Curve LP Gauge Deposit.md +++ /dev/null @@ -1,76 +0,0 @@ -# OUSD Curve LP Gauge Deposit - -https://dune.xyz/embeds/278734/528075/c2b8b10f-9a32-495b-a5e1-bccbae2a860a -https://dune.com/queries/285485/539422 - -```sql -WITH transfers AS ( - SELECT evt_block_number as block_number, - address, - amount - FROM - ( - SELECT evt_block_number, - "to" AS address, - value AS amount - FROM ousd."OusdImplementation_evt_Transfer" - WHERE evt_block_number > 11596940 -- OUSD V2 block number - - UNION ALL - - SELECT evt_block_number, - "from" AS address, - -value AS amount - FROM ousd."OusdImplementation_evt_Transfer" - WHERE evt_block_number > 11596940 -- OUSD V2 block number - ) t -), - -curve_lp_transfers AS ( - SELECT evt_block_time, - "to" AS address, - ROUND(value / 1e18) as amount - FROM erc20."ERC20_evt_Transfer" tr - WHERE contract_address='\x25f0cE4E2F8dbA112D9b115710AC297F816087CD' - AND "to" != '\x0000000000000000000000000000000000000000' - - UNION ALL - - SELECT evt_block_time, - "from" AS address, - ROUND(-value / 1e18) as amount - FROM erc20."ERC20_evt_Transfer" tr - WHERE contract_address='\x25f0cE4E2F8dbA112D9b115710AC297F816087CD' - AND "from" != '\x0000000000000000000000000000000000000000' -), - -day_hops_3 AS ( - SELECT date_trunc('day', day) as day - FROM( - SELECT generate_series('2021-11-15'::date, 'now'::timestamp - '1 week'::interval, '3 day') AS day - UNION ALL - SELECT generate_series('now'::timestamp - '6 days'::interval, date_trunc('day', NOW()), '1 day') AS day - ) DAYS - ORDER BY day desc -), - -token_balances as ( - SELECT d.day, - t.address as wallet_address, - SUM(amount) as balance - FROM curve_lp_transfers t - INNER JOIN day_hops_3 d - ON t.evt_block_time < d.day - GROUP BY 1, 2 - ORDER BY 1 desc -) - - -select day, -ROUND(sum(balance) filter (WHERE wallet_address = '\x989aeb4d175e16225e39e87d0d97a3360524ad80')) AS "Convex", -ROUND(sum(balance) filter (WHERE wallet_address != '\x989aeb4d175e16225e39e87d0d97a3360524ad80')) AS "Other", -ROUND(sum(balance)) as amount, -count(distinct wallet_address) as holders -FROM token_balances -GROUP BY 1; -``` \ No newline at end of file diff --git a/docs/deprecated/dune/OUSD Total Supply.md b/docs/deprecated/dune/OUSD Total Supply.md deleted file mode 100644 index 19416138..00000000 --- a/docs/deprecated/dune/OUSD Total Supply.md +++ /dev/null @@ -1,71 +0,0 @@ -# OUSD Total Supply - -https://dune.com/embeds/278146/524806/476159a6-b7bb-4cf7-96e2-e74f99170b4a -https://dune.com/queries/278146/524806 - -```sql -DROP FUNCTION IF EXISTS dune_user_generated.data2bignumber(BYTEA, INT, INT); -CREATE OR REPLACE FUNCTION dune_user_generated.data2bignumber(data BYTEA, topic INT, decimals INT) RETURNS FLOAT AS $$ -BEGIN -RETURN bytea2numeric(decode(SUBSTRING(ENCODE("data",'hex'),(1+(64*"topic")),64),'hex'))/POWER(10, "decimals"); -END; $$ -LANGUAGE PLPGSQL; - -WITH rebase_logs AS ( - -- this is kind of hackish, but for some reason "DISTINCT ON" expression is not supported - SELECT block_number, - MAX(block_time) as block_time, - MAX(total_supply) as total_supply, - MAX(rebasing_credits) as rebasing_credits, - MIN(rebasing_credits_per_token) as rebasing_credits_per_token - FROM( - SELECT - dune_user_generated.data2bignumber(data, 0, 18) as total_supply, - dune_user_generated.data2bignumber(data, 1, 18) as rebasing_credits, - dune_user_generated.data2bignumber(data, 2, 18) as rebasing_credits_per_token, - * - FROM ethereum.logs - WHERE contract_address='\x2a8e1e676ec238d8a992307b495b45b3feaa5e86' -- OUSD - AND topic1='\x99e56f783b536ffacf422d59183ea321dd80dcd6d23daa13023e8afea38c3df1' -- old rebase logs - AND block_number > 11596940 -- OUSD V2 block number - - UNION ALL - - SELECT - dune_user_generated.data2bignumber(data, 0, 18) as total_supply, - dune_user_generated.data2bignumber(data, 1, 27) as rebasing_credits, - dune_user_generated.data2bignumber(data, 2, 27) as rebasing_credits_per_token, - * - FROM ethereum.logs - WHERE contract_address='\x2a8e1e676ec238d8a992307b495b45b3feaa5e86' -- OUSD - AND topic1='\x41645eb819d3011b13f97696a8109d14bfcddfaca7d063ec0564d62a3e257235' -- new rebase logs - AND block_number > 11596940 -- OUSD V2 block number - ) DATA - WHERE block_time > now() - interval '100 days' - GROUP BY 1 - ORDER BY block_number DESC -) - -SELECT -block_date, -total_supply, -ROUND(AVG(total_supply) OVER (ORDER BY block_date ASC ROWS BETWEEN 29 PRECEDING AND CURRENT ROW)) as _30_day_total_supply, -ROUND(AVG(total_supply) OVER (ORDER BY block_date ASC ROWS BETWEEN 13 PRECEDING AND CURRENT ROW)) as _14_day_total_supply, -ROUND(AVG(total_supply) OVER (ORDER BY block_date ASC ROWS BETWEEN 6 PRECEDING AND CURRENT ROW)) as _7_day_total_supply -FROM ( - SELECT - block_date, - total_supply - FROM rebase_logs as t - JOIN ( - SELECT - date_trunc('day', block_time) as block_date, - MAX(block_number) as max_block_number - FROM rebase_logs - GROUP BY 1 - ORDER BY 1 DESC - ) t1 ON t.block_number = t1.max_block_number - ORDER BY block_number DESC -) DATA -ORDER BY block_date DESC -``` \ No newline at end of file diff --git a/docs/deprecated/dune/OUSD average & median (only accounts over 10 OUSD).md b/docs/deprecated/dune/OUSD average & median (only accounts over 10 OUSD).md deleted file mode 100644 index 502ddf23..00000000 --- a/docs/deprecated/dune/OUSD average & median (only accounts over 10 OUSD).md +++ /dev/null @@ -1,173 +0,0 @@ -# OUSD average & median (only accounts over 10 OUSD) - -https://dune.xyz/embeds/283166/534275/1d88ccea-eec7-4e8f-9a86-3bc47b605053 -https://dune.com/queries/283166/534275 - -```sql -DROP FUNCTION IF EXISTS dune_user_generated.data2bignumber(BYTEA, INT, INT); -CREATE OR REPLACE FUNCTION dune_user_generated.data2bignumber(data BYTEA, topic INT, decimals INT) RETURNS FLOAT AS $$ -BEGIN -RETURN bytea2numeric(decode(SUBSTRING(ENCODE("data",'hex'),(1+(64*"topic")),64),'hex'))/POWER(10, "decimals"); -END; $$ -LANGUAGE PLPGSQL; - -WITH transfers AS ( - SELECT evt_block_number as block_number, - evt_block_time as block_time, - address, - amount - FROM - ( - SELECT evt_block_number, - "to" AS address, - evt_block_time, - value AS amount - FROM ousd."OusdImplementation_evt_Transfer" - WHERE evt_block_number > 11596940 -- OUSD V2 block number - - UNION ALL - - SELECT evt_block_number, - "from" AS address, - evt_block_time, - -value AS amount - FROM ousd."OusdImplementation_evt_Transfer" - WHERE evt_block_number > 11596940 -- OUSD V2 block number - ) t -), - -rebase_logs AS ( - -- this is kind of hackish, but for some reason "DISTINCT ON" expression is not supported - SELECT block_number, - MAX(block_time) as block_time, - MAX(total_supply) as total_supply, - MAX(rebasing_credits) as rebasing_credits, - MIN(rebasing_credits_per_token) as rebasing_credits_per_token - FROM( - SELECT - dune_user_generated.data2bignumber(data, 0, 18) as total_supply, - dune_user_generated.data2bignumber(data, 1, 18) as rebasing_credits, - dune_user_generated.data2bignumber(data, 2, 18) as rebasing_credits_per_token, - * - FROM ethereum.logs - WHERE contract_address='\x2a8e1e676ec238d8a992307b495b45b3feaa5e86' -- OUSD - AND topic1='\x99e56f783b536ffacf422d59183ea321dd80dcd6d23daa13023e8afea38c3df1' -- old rebase logs - AND block_number > 11596940 -- OUSD V2 block number - - UNION ALL - - SELECT - dune_user_generated.data2bignumber(data, 0, 18) as total_supply, - dune_user_generated.data2bignumber(data, 1, 27) as rebasing_credits, - dune_user_generated.data2bignumber(data, 2, 27) as rebasing_credits_per_token, - * - FROM ethereum.logs - WHERE contract_address='\x2a8e1e676ec238d8a992307b495b45b3feaa5e86' -- OUSD - AND topic1='\x41645eb819d3011b13f97696a8109d14bfcddfaca7d063ec0564d62a3e257235' -- new rebase logs - AND block_number > 11596940 -- OUSD V2 block number - ) DATA - GROUP BY 1 - ORDER BY block_number DESC -), - -nearest_rebase_log_to_transaction_log AS ( - SELECT t.block_number AS transaction_block_number, - MAX(r.block_number) AS rebase_block_number - FROM transfers AS t - LEFT JOIN rebase_logs AS r - ON t.block_number >= r.block_number - GROUP BY t.block_number -), - -transfer_with_credits_per_token as ( - SELECT t.*, r.rebasing_credits_per_token, - t.amount * r.rebasing_credits_per_token as credits, - r.block_number as rebase_block_number - FROM transfers t INNER JOIN nearest_rebase_log_to_transaction_log nrb - ON t.block_number = nrb.transaction_block_number - INNER JOIN rebase_logs r - ON r.block_number = nrb.rebase_block_number -), --- TODO INSPECT THIS --- last rebasing credits per token: 0.8369875568128926 --- TODO some token holders have balances way off like this account: \x96feb7b6f808dd2bbd09c9e5ccde77cabd58d019 (has a lot of transactions) --- SELECT SUM(amount / 1e18), SUM(credits / 1e18) FROM transfer_with_credits_per_token --- WHERE address = '\x96feb7b6f808dd2bbd09c9e5ccde77cabd58d019' --- GROUP BY address - --- 2 months in 3 day hops, except last 7 days that have no hops -day_hops_3 AS ( - SELECT date_trunc('day', day) as day - FROM( - SELECT generate_series('now'::timestamp - '2 month'::interval, 'now'::timestamp - '1 week'::interval, '3 day') AS day - UNION ALL - SELECT generate_series('now'::timestamp - '6 days'::interval, date_trunc('day', NOW()), '1 day') AS day - ) DAYS - ORDER BY day desc -), - -latest_rebases as ( - SELECT - max_d.day as day, - r.* - FROM ( - SELECT d.day, MAX(r.block_time) as max_block_time - FROM day_hops_3 d - LEFT JOIN rebase_logs r - ON r.block_time < d.day - GROUP BY 1 - ) max_d INNER JOIN rebase_logs r - ON max_d.max_block_time = r.block_time -), - -token_balances as ( - SELECT - b.day, - wallet_address, - credits_sum / rebasing_credits_per_token as balance - FROM latest_rebases r - INNER JOIN ( - SELECT d.day, t.address as wallet_address, SUM(t.credits / 1e18) as credits_sum - FROM transfer_with_credits_per_token t - INNER JOIN day_hops_3 d - ON t.block_time < d.day - WHERE t.address != '\x87650d7bbfc3a9f10587d7778206671719d9910d' -- Curve Metapool - AND t.address != '\x129360c964e2e13910d603043f6287e5e9383374' -- Uniswap - GROUP BY 1, 2 - HAVING SUM(t.credits / 1e18) > 0 - ) b - ON r.day = b.day - ORDER BY 1 desc -), - -token_balances_over_10 AS ( - SELECT * - FROM token_balances - WHERE balance > 10 -) - -SELECT - s.day, - s.average, - s.median --- s1.average_over_100, --- s1.median_over_100 -FROM -( - select day, - ROUND(avg(balance) filter (WHERE balance > 0)) as average, - ROUND(PERCENTILE_CONT(0.5) WITHIN GROUP(ORDER BY balance)) as median - FROM token_balances_over_10 - GROUP BY 1 -) s --- INNER JOIN --- ( --- select day, --- ROUND(avg(balance) filter (WHERE balance > 0)) as average_over_100, --- ROUND(PERCENTILE_CONT(0.5) WITHIN GROUP(ORDER BY balance)) as median_over_100 --- FROM token_balances_over_100 --- GROUP BY 1 --- ) s1 --- ON s.day = s1.day -ORDER BY day DESC -``` \ No newline at end of file diff --git a/docs/deprecated/dune/OUSD average & median.md b/docs/deprecated/dune/OUSD average & median.md deleted file mode 100644 index 0ef050ac..00000000 --- a/docs/deprecated/dune/OUSD average & median.md +++ /dev/null @@ -1,173 +0,0 @@ -# OUSD average & median - -https://dune.xyz/embeds/282755/533459/735067b4-9f41-4f4b-9ef1-6b80a1fd9f12 -https://dune.com/queries/282755/533459 - -```sql -DROP FUNCTION IF EXISTS dune_user_generated.data2bignumber(BYTEA, INT, INT); -CREATE OR REPLACE FUNCTION dune_user_generated.data2bignumber(data BYTEA, topic INT, decimals INT) RETURNS FLOAT AS $$ -BEGIN -RETURN bytea2numeric(decode(SUBSTRING(ENCODE("data",'hex'),(1+(64*"topic")),64),'hex'))/POWER(10, "decimals"); -END; $$ -LANGUAGE PLPGSQL; - -WITH transfers AS ( - SELECT evt_block_number as block_number, - evt_block_time as block_time, - address, - amount - FROM - ( - SELECT evt_block_number, - "to" AS address, - evt_block_time, - value AS amount - FROM ousd."OusdImplementation_evt_Transfer" - WHERE evt_block_number > 11596940 -- OUSD V2 block number - - UNION ALL - - SELECT evt_block_number, - "from" AS address, - evt_block_time, - -value AS amount - FROM ousd."OusdImplementation_evt_Transfer" - WHERE evt_block_number > 11596940 -- OUSD V2 block number - ) t -), - -rebase_logs AS ( - -- this is kind of hackish, but for some reason "DISTINCT ON" expression is not supported - SELECT block_number, - MAX(block_time) as block_time, - MAX(total_supply) as total_supply, - MAX(rebasing_credits) as rebasing_credits, - MIN(rebasing_credits_per_token) as rebasing_credits_per_token - FROM( - SELECT - dune_user_generated.data2bignumber(data, 0, 18) as total_supply, - dune_user_generated.data2bignumber(data, 1, 18) as rebasing_credits, - dune_user_generated.data2bignumber(data, 2, 18) as rebasing_credits_per_token, - * - FROM ethereum.logs - WHERE contract_address='\x2a8e1e676ec238d8a992307b495b45b3feaa5e86' -- OUSD - AND topic1='\x99e56f783b536ffacf422d59183ea321dd80dcd6d23daa13023e8afea38c3df1' -- old rebase logs - AND block_number > 11596940 -- OUSD V2 block number - - UNION ALL - - SELECT - dune_user_generated.data2bignumber(data, 0, 18) as total_supply, - dune_user_generated.data2bignumber(data, 1, 27) as rebasing_credits, - dune_user_generated.data2bignumber(data, 2, 27) as rebasing_credits_per_token, - * - FROM ethereum.logs - WHERE contract_address='\x2a8e1e676ec238d8a992307b495b45b3feaa5e86' -- OUSD - AND topic1='\x41645eb819d3011b13f97696a8109d14bfcddfaca7d063ec0564d62a3e257235' -- new rebase logs - AND block_number > 11596940 -- OUSD V2 block number - ) DATA - GROUP BY 1 - ORDER BY block_number DESC -), - -nearest_rebase_log_to_transaction_log AS ( - SELECT t.block_number AS transaction_block_number, - MAX(r.block_number) AS rebase_block_number - FROM transfers AS t - LEFT JOIN rebase_logs AS r - ON t.block_number >= r.block_number - GROUP BY t.block_number -), - -transfer_with_credits_per_token as ( - SELECT t.*, r.rebasing_credits_per_token, - t.amount * r.rebasing_credits_per_token as credits, - r.block_number as rebase_block_number - FROM transfers t INNER JOIN nearest_rebase_log_to_transaction_log nrb - ON t.block_number = nrb.transaction_block_number - INNER JOIN rebase_logs r - ON r.block_number = nrb.rebase_block_number -), --- TODO INSPECT THIS --- last rebasing credits per token: 0.8369875568128926 --- TODO some token holders have balances way off like this account: \x96feb7b6f808dd2bbd09c9e5ccde77cabd58d019 (has a lot of transactions) --- SELECT SUM(amount / 1e18), SUM(credits / 1e18) FROM transfer_with_credits_per_token --- WHERE address = '\x96feb7b6f808dd2bbd09c9e5ccde77cabd58d019' --- GROUP BY address - --- 2 months in 3 day hops, except last 7 days that have no hops -day_hops_3 AS ( - SELECT date_trunc('day', day) as day - FROM( - SELECT generate_series('now'::timestamp - '2 month'::interval, 'now'::timestamp - '1 week'::interval, '3 day') AS day - UNION ALL - SELECT generate_series('now'::timestamp - '6 days'::interval, date_trunc('day', NOW()), '1 day') AS day - ) DAYS - ORDER BY day desc -), - -latest_rebases as ( - SELECT - max_d.day as day, - r.* - FROM ( - SELECT d.day, MAX(r.block_time) as max_block_time - FROM day_hops_3 d - LEFT JOIN rebase_logs r - ON r.block_time < d.day - GROUP BY 1 - ) max_d INNER JOIN rebase_logs r - ON max_d.max_block_time = r.block_time -), - -token_balances as ( - SELECT - b.day, - wallet_address, - credits_sum / rebasing_credits_per_token as balance - FROM latest_rebases r - INNER JOIN ( - SELECT d.day, t.address as wallet_address, SUM(t.credits / 1e18) as credits_sum - FROM transfer_with_credits_per_token t - INNER JOIN day_hops_3 d - ON t.block_time < d.day - WHERE t.address != '\x87650d7bbfc3a9f10587d7778206671719d9910d' -- Curve Metapool - AND t.address != '\x129360c964e2e13910d603043f6287e5e9383374' -- Uniswap - GROUP BY 1, 2 - HAVING SUM(t.credits / 1e18) > 0 - ) b - ON r.day = b.day - ORDER BY 1 desc -), - -token_balances_over_100 AS ( - SELECT * - FROM token_balances - WHERE balance > 100 -) - -SELECT - s.day, - s.average, - s.median --- s1.average_over_100, --- s1.median_over_100 -FROM -( - select day, - ROUND(avg(balance) filter (WHERE balance > 0)) as average, - ROUND(PERCENTILE_CONT(0.5) WITHIN GROUP(ORDER BY balance)) as median - FROM token_balances - GROUP BY 1 -) s --- INNER JOIN --- ( --- select day, --- ROUND(avg(balance) filter (WHERE balance > 0)) as average_over_100, --- ROUND(PERCENTILE_CONT(0.5) WITHIN GROUP(ORDER BY balance)) as median_over_100 --- FROM token_balances_over_100 --- GROUP BY 1 --- ) s1 --- ON s.day = s1.day -ORDER BY day DESC -``` \ No newline at end of file diff --git a/docs/deprecated/dune/OUSD buybacks.md b/docs/deprecated/dune/OUSD buybacks.md deleted file mode 100644 index dcd69573..00000000 --- a/docs/deprecated/dune/OUSD buybacks.md +++ /dev/null @@ -1,99 +0,0 @@ -# OUSD buybacks - -https://dune.com/embeds/284111/536003/6b5abcab-4856-4590-b03f-47da6959202e -https://dune.com/queries/284111/536003 - -```sql -DROP FUNCTION IF EXISTS dune_user_generated.data2bignumber(BYTEA, INT, INT); -CREATE OR REPLACE FUNCTION dune_user_generated.data2bignumber(data BYTEA, topic INT, decimals INT) RETURNS FLOAT AS $$ -BEGIN -RETURN bytea2numeric(decode(SUBSTRING(ENCODE("data",'hex'),(1+(64*"topic")),64),'hex'))/POWER(10, "decimals"); -END; $$ -LANGUAGE PLPGSQL; - -WITH transfers AS ( - SELECT evt_block_number as block_number, - evt_block_time as block_time, - address, - amount - FROM - ( - SELECT evt_block_number, - "to" AS address, - evt_block_time, - ROUND(value / 1e18) AS amount - FROM ousd."OusdImplementation_evt_Transfer" - WHERE evt_block_number > 11596940 -- OUSD V2 block number - AND "to" = '\x77314eb392b2be47c014cde0706908b3307ad6a9' - AND "from" = '\x0000000000000000000000000000000000000000' - - -- UNION ALL - - -- SELECT evt_block_number, - -- "to" AS address, - -- evt_block_time, - -- ROUND(value / 1e18) AS amount - -- FROM ousd."OusdImplementation_evt_Transfer" - -- WHERE evt_block_number > 11596940 -- OUSD V2 block number - -- AND "to" = '\x7d82E86CF1496f9485a8ea04012afeb3C7489397' - -- AND "from" = '\x0000000000000000000000000000000000000000' - ) t -), - -ogn_transfers AS ( - SELECT evt_block_time, - ROUND(value / 1e18) as value - FROM erc20."ERC20_evt_Transfer" tr - WHERE tr."to" = '\x77314eb392b2be47c014cde0706908b3307ad6a9' - and contract_address='\x8207c1ffc5b6804f6024322ccf34f29c3541ae26' -), - -ogv_transfers AS ( - SELECT evt_block_time, - ROUND(value / 1e18) as value - FROM erc20."ERC20_evt_Transfer" tr - WHERE tr."to" = '\x7d82E86CF1496f9485a8ea04012afeb3C7489397' - and contract_address='\x9c354503C38481a7A7a51629142963F98eCC12D0' -) - -SELECT -COALESCE(OUSD_DATA.day, OGN_DATA.day, OGV_DATA.day) as day, -OUSD_DATA.amount as ousd_amount, -OGN_DATA.amount as ogn_amount, -OGV_DATA.amount as ogv_amount -FROM ( - SELECT day, - SUM(amount) OVER (ORDER BY day ASC ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) as amount - FROM ( - SELECT - date_trunc('day', block_time) as day, - SUM(amount) as amount - FROM transfers - GROUP BY 1 - ) OUSD_DATA -) OUSD_DATA FULL OUTER JOIN ( - SELECT day, - SUM(amount) OVER (ORDER BY day ASC ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) as amount - FROM ( - SELECT - date_trunc('day', evt_block_time) as day, - SUM(value) as amount - FROM ogn_transfers - GROUP BY 1 - ) OGN_DATA -) OGN_DATA -ON OUSD_DATA.day = OGN_DATA.day -FULL OUTER JOIN ( - SELECT day, - SUM(amount) OVER (ORDER BY day ASC ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) as amount - FROM ( - SELECT - date_trunc('day', evt_block_time) as day, - SUM(value) as amount - FROM ogv_transfers - GROUP BY 1 - ) OGV_DATA -) OGV_DATA -ON OUSD_DATA.day = OGV_DATA.day -ORDER BY 1 desc -``` \ No newline at end of file diff --git a/docs/deprecated/dune/OUSD holder breakdown.md b/docs/deprecated/dune/OUSD holder breakdown.md deleted file mode 100644 index 7c4ea771..00000000 --- a/docs/deprecated/dune/OUSD holder breakdown.md +++ /dev/null @@ -1,126 +0,0 @@ -# OUSD holder breakdown - -https://dune.xyz/embeds/285485/539422/ea76c2ad-232d-4001-9c78-ecf5231b9700 -https://dune.com/queries/278734/528075 - -```sql -DROP FUNCTION IF EXISTS dune_user_generated.data2bignumber(BYTEA, INT, INT); -CREATE OR REPLACE FUNCTION dune_user_generated.data2bignumber(data BYTEA, topic INT, decimals INT) RETURNS FLOAT AS $$ -BEGIN -RETURN bytea2numeric(decode(SUBSTRING(ENCODE("data",'hex'),(1+(64*"topic")),64),'hex'))/POWER(10, "decimals"); -END; $$ -LANGUAGE PLPGSQL; - -WITH transfers AS ( - SELECT evt_block_number as block_number, - address, - amount - FROM - ( - SELECT evt_block_number, - "to" AS address, - value AS amount - FROM ousd."OusdImplementation_evt_Transfer" - WHERE evt_block_number > 11596940 -- OUSD V2 block number - - UNION ALL - - SELECT evt_block_number, - "from" AS address, - -value AS amount - FROM ousd."OusdImplementation_evt_Transfer" - WHERE evt_block_number > 11596940 -- OUSD V2 block number - ) t -), - -rebase_logs AS ( - -- this is kind of hackish, but for some reason "DISTINCT ON" expression is not supported - SELECT block_number, - MAX(block_time) as block_time, - MAX(total_supply) as total_supply, - MAX(rebasing_credits) as rebasing_credits, - MIN(rebasing_credits_per_token) as rebasing_credits_per_token - FROM( - SELECT - dune_user_generated.data2bignumber(data, 0, 18) as total_supply, - dune_user_generated.data2bignumber(data, 1, 18) as rebasing_credits, - dune_user_generated.data2bignumber(data, 2, 18) as rebasing_credits_per_token, - * - FROM ethereum.logs - WHERE contract_address='\x2a8e1e676ec238d8a992307b495b45b3feaa5e86' -- OUSD - AND topic1='\x99e56f783b536ffacf422d59183ea321dd80dcd6d23daa13023e8afea38c3df1' -- old rebase logs - AND block_number > 11596940 -- OUSD V2 block number - - UNION ALL - - SELECT - dune_user_generated.data2bignumber(data, 0, 18) as total_supply, - dune_user_generated.data2bignumber(data, 1, 27) as rebasing_credits, - dune_user_generated.data2bignumber(data, 2, 27) as rebasing_credits_per_token, - * - FROM ethereum.logs - WHERE contract_address='\x2a8e1e676ec238d8a992307b495b45b3feaa5e86' -- OUSD - AND topic1='\x41645eb819d3011b13f97696a8109d14bfcddfaca7d063ec0564d62a3e257235' -- new rebase logs - AND block_number > 11596940 -- OUSD V2 block number - ) DATA - GROUP BY 1 - ORDER BY block_number DESC -), - -nearest_rebase_log_to_transaction_log AS ( - SELECT t.block_number AS transaction_block_number, - MAX(r.block_number) AS rebase_block_number - FROM transfers AS t - LEFT JOIN rebase_logs AS r - ON t.block_number >= r.block_number - GROUP BY t.block_number -), - -transfer_with_credits_per_token as ( - SELECT t.*, r.rebasing_credits_per_token, - t.amount * r.rebasing_credits_per_token as credits, - r.block_number as rebase_block_number - FROM transfers t INNER JOIN nearest_rebase_log_to_transaction_log nrb - ON t.block_number = nrb.transaction_block_number - INNER JOIN rebase_logs r - ON r.block_number = nrb.rebase_block_number -), - -latest_rebase as ( - SELECT * from rebase_logs - ORDER BY block_number DESC - LIMIT 1 -), - -token_balances as ( - SELECT address as wallet_address, SUM(credits / 1e18) / MAX(latest_rebase.rebasing_credits_per_token) as amount FROM - transfer_with_credits_per_token, - latest_rebase - GROUP BY 1 -) - --- TODO INSPECT THIS --- last rebasing credits per token: 0.8369875568128926 --- TODO some token holders have balances way off like this account: \x96feb7b6f808dd2bbd09c9e5ccde77cabd58d019 (has a lot of transactions) --- SELECT SUM(amount / 1e18), SUM(credits / 1e18) FROM transfer_with_credits_per_token --- WHERE address = '\x96feb7b6f808dd2bbd09c9e5ccde77cabd58d019' --- GROUP BY address - -Select - CASE - when wallet_address = '\x87650D7bbfC3A9F10587d7778206671719d9910D' then 'Curve Metapool' - when wallet_address = '\x129360c964e2e13910d603043f6287e5e9383374' then 'Uniswap V3: OUSD - USDT' - -- when labels.get(wallet_address, 'project', 'contract_name')::text is not NULL then labels.get(wallet_address, 'project', 'contract_name', 'ens name')::text - when amount between 0 and 100 then 'mini 0-100 OUSD' - when amount between 100 and 1000 then 'light 100-1k OUSD' - when amount between 1000 and 10000 then 'heavy 1k-10k' - when amount between 10000 and 100000 then 'full 10k-100k' - when amount > 100000 then 'enormous >100k' - end as holder_type, - sum(amount) as amount, - count(distinct wallet_address) as holders -from token_balances -where wallet_address != '\x0000000000000000000000000000000000000000' and -amount > 0 -group by 1 -``` \ No newline at end of file diff --git a/docs/deprecated/dune/Token holders - time series - breakdown by balance - detailed.md b/docs/deprecated/dune/Token holders - time series - breakdown by balance - detailed.md deleted file mode 100644 index 729a767a..00000000 --- a/docs/deprecated/dune/Token holders - time series - breakdown by balance - detailed.md +++ /dev/null @@ -1,163 +0,0 @@ -# Token holders - time series - breakdown by balance - detailed - -https://dune.com/embeds/284273/536199/c65ae6a8-90cf-4d06-8d86-84d0080aa39d -https://dune.com/queries/284273/536199 - -```sql -DROP FUNCTION IF EXISTS dune_user_generated.data2bignumber(BYTEA, INT, INT); -CREATE OR REPLACE FUNCTION dune_user_generated.data2bignumber(data BYTEA, topic INT, decimals INT) RETURNS FLOAT AS $$ -BEGIN -RETURN bytea2numeric(decode(SUBSTRING(ENCODE("data",'hex'),(1+(64*"topic")),64),'hex'))/POWER(10, "decimals"); -END; $$ -LANGUAGE PLPGSQL; - -WITH transfers AS ( - SELECT evt_block_number as block_number, - evt_block_time as block_time, - address, - amount - FROM - ( - SELECT evt_block_number, - "to" AS address, - evt_block_time, - value AS amount - FROM ousd."OusdImplementation_evt_Transfer" - WHERE evt_block_number > 11596940 -- OUSD V2 block number - - UNION ALL - - SELECT evt_block_number, - "from" AS address, - evt_block_time, - -value AS amount - FROM ousd."OusdImplementation_evt_Transfer" - WHERE evt_block_number > 11596940 -- OUSD V2 block number - ) t -), - -rebase_logs AS ( - -- this is kind of hackish, but for some reason "DISTINCT ON" expression is not supported - SELECT block_number, - MAX(block_time) as block_time, - MAX(total_supply) as total_supply, - MAX(rebasing_credits) as rebasing_credits, - MIN(rebasing_credits_per_token) as rebasing_credits_per_token - FROM( - SELECT - dune_user_generated.data2bignumber(data, 0, 18) as total_supply, - dune_user_generated.data2bignumber(data, 1, 18) as rebasing_credits, - dune_user_generated.data2bignumber(data, 2, 18) as rebasing_credits_per_token, - * - FROM ethereum.logs - WHERE contract_address='\x2a8e1e676ec238d8a992307b495b45b3feaa5e86' -- OUSD - AND topic1='\x99e56f783b536ffacf422d59183ea321dd80dcd6d23daa13023e8afea38c3df1' -- old rebase logs - AND block_number > 11596940 -- OUSD V2 block number - - UNION ALL - - SELECT - dune_user_generated.data2bignumber(data, 0, 18) as total_supply, - dune_user_generated.data2bignumber(data, 1, 27) as rebasing_credits, - dune_user_generated.data2bignumber(data, 2, 27) as rebasing_credits_per_token, - * - FROM ethereum.logs - WHERE contract_address='\x2a8e1e676ec238d8a992307b495b45b3feaa5e86' -- OUSD - AND topic1='\x41645eb819d3011b13f97696a8109d14bfcddfaca7d063ec0564d62a3e257235' -- new rebase logs - AND block_number > 11596940 -- OUSD V2 block number - ) DATA - GROUP BY 1 - ORDER BY block_number DESC -), - -nearest_rebase_log_to_transaction_log AS ( - SELECT t.block_number AS transaction_block_number, - MAX(r.block_number) AS rebase_block_number - FROM transfers AS t - LEFT JOIN rebase_logs AS r - ON t.block_number >= r.block_number - GROUP BY t.block_number -), - -transfer_with_credits_per_token as ( - SELECT t.*, r.rebasing_credits_per_token, - t.amount * r.rebasing_credits_per_token as credits, - r.block_number as rebase_block_number - FROM transfers t INNER JOIN nearest_rebase_log_to_transaction_log nrb - ON t.block_number = nrb.transaction_block_number - INNER JOIN rebase_logs r - ON r.block_number = nrb.rebase_block_number -), - --- 2 months in 3 day hops, except last 7 days that have no hops -day_hops_3 AS ( - SELECT date_trunc('day', day) as day - FROM( - SELECT generate_series('now'::timestamp - '2 month'::interval, 'now'::timestamp - '1 week'::interval, '3 day') AS day - UNION ALL - SELECT generate_series('now'::timestamp - '6 days'::interval, date_trunc('day', NOW()), '1 day') AS day - ) DAYS - ORDER BY day desc -), - -latest_rebases as ( - SELECT - max_d.day as day, - r.* - FROM ( - SELECT d.day, MAX(r.block_time) as max_block_time - FROM day_hops_3 d - LEFT JOIN rebase_logs r - ON r.block_time < d.day - GROUP BY 1 - ) max_d INNER JOIN rebase_logs r - ON max_d.max_block_time = r.block_time -), - -token_balances as ( - SELECT - b.day, - wallet_address, - credits_sum / rebasing_credits_per_token as balance - FROM latest_rebases r - INNER JOIN ( - SELECT d.day, t.address as wallet_address, SUM(t.credits / 1e18) as credits_sum - FROM transfer_with_credits_per_token t - INNER JOIN day_hops_3 d - ON t.block_time < d.day - WHERE t.address != '\x87650d7bbfc3a9f10587d7778206671719d9910d' -- Curve Metapool - AND t.address != '\x129360c964e2e13910d603043f6287e5e9383374' -- Uniswap - GROUP BY 1, 2 - ) b - ON r.day = b.day - ORDER BY 1 desc -) - --- TODO INSPECT THIS --- last rebasing credits per token: 0.8369875568128926 --- TODO some token holders have balances way off like this account: \x96feb7b6f808dd2bbd09c9e5ccde77cabd58d019 (has a lot of transactions) --- SELECT SUM(amount / 1e18), SUM(credits / 1e18) FROM transfer_with_credits_per_token --- WHERE address = '\x96feb7b6f808dd2bbd09c9e5ccde77cabd58d019' --- GROUP BY address - -select day, -ROUND(sum(balance) filter (WHERE balance > 0 AND balance < 100)) AS "0-100 OUSD", -ROUND(sum(balance) filter (WHERE balance > 100 AND balance < 1000)) AS "100-1k OUSD", -ROUND(sum(balance) filter (WHERE balance > 1000 AND balance < 3000)) AS "1k-3k OUSD", -ROUND(sum(balance) filter (WHERE balance > 3000 AND balance < 9000)) AS "3k-9k OUSD", -ROUND(sum(balance) filter (WHERE balance > 9000 AND balance < 15000)) AS "9k-15k OUSD", -ROUND(sum(balance) filter (WHERE balance > 15000 AND balance < 25000)) AS "15k-25k OUSD", -ROUND(sum(balance) filter (WHERE balance > 25000 AND balance < 40000)) AS "25k-40k OUSD", -ROUND(sum(balance) filter (WHERE balance > 40000 AND balance < 70000)) AS "40k-70k OUSD", -ROUND(sum(balance) filter (WHERE balance > 70000 AND balance < 110000)) AS "70k-110k OUSD", -ROUND(sum(balance) filter (WHERE balance > 110000 AND balance < 150000)) AS "110k-150k OUSD", -ROUND(sum(balance) filter (WHERE balance > 150000 AND balance < 250000)) AS "150k-250k OUSD", -ROUND(sum(balance) filter (WHERE balance > 250000 AND balance < 500000)) AS "250k-500k OUSD", -ROUND(sum(balance) filter (WHERE balance > 500000 AND balance < 750000)) AS "500k-750k OUSD", -ROUND(sum(balance) filter (WHERE balance > 750000 AND balance < 2000000)) AS "750k-2m OUSD", -ROUND(sum(balance) filter (WHERE balance > 2000000)) AS ">2m OUSD", -sum(balance) as amount, -count(distinct wallet_address) as holders -FROM token_balances -GROUP BY 1; -``` \ No newline at end of file diff --git a/docs/deprecated/dune/Token holders - time series - breakdown by balance.md b/docs/deprecated/dune/Token holders - time series - breakdown by balance.md deleted file mode 100644 index 0e1cf2a0..00000000 --- a/docs/deprecated/dune/Token holders - time series - breakdown by balance.md +++ /dev/null @@ -1,152 +0,0 @@ -# Token holders - time series - breakdown by balance - -https://dune.com/embeds/280055/532120/dac10a6c-e731-44bf-a394-cbfe4c2903ae -https://dune.com/queries/280055/532120 - -```sql -DROP FUNCTION IF EXISTS dune_user_generated.data2bignumber(BYTEA, INT, INT); -CREATE OR REPLACE FUNCTION dune_user_generated.data2bignumber(data BYTEA, topic INT, decimals INT) RETURNS FLOAT AS $$ -BEGIN -RETURN bytea2numeric(decode(SUBSTRING(ENCODE("data",'hex'),(1+(64*"topic")),64),'hex'))/POWER(10, "decimals"); -END; $$ -LANGUAGE PLPGSQL; - -WITH transfers AS ( - SELECT evt_block_number as block_number, - evt_block_time as block_time, - address, - amount - FROM - ( - SELECT evt_block_number, - "to" AS address, - evt_block_time, - value AS amount - FROM ousd."OusdImplementation_evt_Transfer" - WHERE evt_block_number > 11596940 -- OUSD V2 block number - - UNION ALL - - SELECT evt_block_number, - "from" AS address, - evt_block_time, - -value AS amount - FROM ousd."OusdImplementation_evt_Transfer" - WHERE evt_block_number > 11596940 -- OUSD V2 block number - ) t -), - -rebase_logs AS ( - -- this is kind of hackish, but for some reason "DISTINCT ON" expression is not supported - SELECT block_number, - MAX(block_time) as block_time, - MAX(total_supply) as total_supply, - MAX(rebasing_credits) as rebasing_credits, - MIN(rebasing_credits_per_token) as rebasing_credits_per_token - FROM( - SELECT - dune_user_generated.data2bignumber(data, 0, 18) as total_supply, - dune_user_generated.data2bignumber(data, 1, 18) as rebasing_credits, - dune_user_generated.data2bignumber(data, 2, 18) as rebasing_credits_per_token, - * - FROM ethereum.logs - WHERE contract_address='\x2a8e1e676ec238d8a992307b495b45b3feaa5e86' -- OUSD - AND topic1='\x99e56f783b536ffacf422d59183ea321dd80dcd6d23daa13023e8afea38c3df1' -- old rebase logs - AND block_number > 11596940 -- OUSD V2 block number - - UNION ALL - - SELECT - dune_user_generated.data2bignumber(data, 0, 18) as total_supply, - dune_user_generated.data2bignumber(data, 1, 27) as rebasing_credits, - dune_user_generated.data2bignumber(data, 2, 27) as rebasing_credits_per_token, - * - FROM ethereum.logs - WHERE contract_address='\x2a8e1e676ec238d8a992307b495b45b3feaa5e86' -- OUSD - AND topic1='\x41645eb819d3011b13f97696a8109d14bfcddfaca7d063ec0564d62a3e257235' -- new rebase logs - AND block_number > 11596940 -- OUSD V2 block number - ) DATA - GROUP BY 1 - ORDER BY block_number DESC -), - -nearest_rebase_log_to_transaction_log AS ( - SELECT t.block_number AS transaction_block_number, - MAX(r.block_number) AS rebase_block_number - FROM transfers AS t - LEFT JOIN rebase_logs AS r - ON t.block_number >= r.block_number - GROUP BY t.block_number -), - -transfer_with_credits_per_token as ( - SELECT t.*, r.rebasing_credits_per_token, - t.amount * r.rebasing_credits_per_token as credits, - r.block_number as rebase_block_number - FROM transfers t INNER JOIN nearest_rebase_log_to_transaction_log nrb - ON t.block_number = nrb.transaction_block_number - INNER JOIN rebase_logs r - ON r.block_number = nrb.rebase_block_number -), --- TODO INSPECT THIS --- last rebasing credits per token: 0.8369875568128926 --- TODO some token holders have balances way off like this account: \x96feb7b6f808dd2bbd09c9e5ccde77cabd58d019 (has a lot of transactions) --- SELECT SUM(amount / 1e18), SUM(credits / 1e18) FROM transfer_with_credits_per_token --- WHERE address = '\x96feb7b6f808dd2bbd09c9e5ccde77cabd58d019' --- GROUP BY address - --- 2 months in 3 day hops, except last 7 days that have no hops -day_hops_3 AS ( - SELECT date_trunc('day', day) as day - FROM( - SELECT generate_series('now'::timestamp - '2 month'::interval, 'now'::timestamp - '1 week'::interval, '3 day') AS day - UNION ALL - SELECT generate_series('now'::timestamp - '6 days'::interval, date_trunc('day', NOW()), '1 day') AS day - ) DAYS - ORDER BY day desc -), - -latest_rebases as ( - SELECT - max_d.day as day, - r.* - FROM ( - SELECT d.day, MAX(r.block_time) as max_block_time - FROM day_hops_3 d - LEFT JOIN rebase_logs r - ON r.block_time < d.day - GROUP BY 1 - ) max_d INNER JOIN rebase_logs r - ON max_d.max_block_time = r.block_time -), - -token_balances as ( - SELECT - b.day, - wallet_address, - credits_sum / rebasing_credits_per_token as balance - FROM latest_rebases r - INNER JOIN ( - SELECT d.day, t.address as wallet_address, SUM(t.credits / 1e18) as credits_sum - FROM transfer_with_credits_per_token t - INNER JOIN day_hops_3 d - ON t.block_time < d.day - WHERE t.address != '\x87650d7bbfc3a9f10587d7778206671719d9910d' -- Curve Metapool - AND t.address != '\x129360c964e2e13910d603043f6287e5e9383374' -- Uniswap - GROUP BY 1, 2 - ) b - ON r.day = b.day - ORDER BY 1 desc -) - -select day, -sum(balance) filter (WHERE balance > 0 AND balance < 100) AS "mini 0-100 OUSD", -sum(balance) filter (WHERE balance > 100 AND balance < 1000) AS "light 100-1k OUSD", -sum(balance) filter (WHERE balance > 1000 AND balance < 10000) AS "heavy 1k-10k", -sum(balance) filter (WHERE balance > 10000 AND balance < 100000) AS "full 10k-100k", -sum(balance) filter (WHERE balance > 100000) AS "enormous >100k", -sum(balance) as amount, -count(distinct wallet_address) as holders -FROM token_balances -GROUP BY 1; -``` \ No newline at end of file diff --git a/docs/deprecated/dune/Token holders - time series - breakdown by wallet number - detailed.md b/docs/deprecated/dune/Token holders - time series - breakdown by wallet number - detailed.md deleted file mode 100644 index 01af2fc9..00000000 --- a/docs/deprecated/dune/Token holders - time series - breakdown by wallet number - detailed.md +++ /dev/null @@ -1,158 +0,0 @@ -# Token holders - time series - breakdown by wallet number - detailed - -## DEPRECATED DATASET ACCORDING TO DUNE - -https://dune.com/embeds/284704/537456/a450c5db-957f-4832-8e5b-b91dd8c5db55 -https://dune.com/queries/284704/537456 - -```sql -DROP FUNCTION IF EXISTS dune_user_generated.data2bignumber(BYTEA, INT, INT); -CREATE OR REPLACE FUNCTION dune_user_generated.data2bignumber(data BYTEA, topic INT, decimals INT) RETURNS FLOAT AS $$ -BEGIN -RETURN bytea2numeric(decode(SUBSTRING(ENCODE("data",'hex'),(1+(64*"topic")),64),'hex'))/POWER(10, "decimals"); -END; $$ -LANGUAGE PLPGSQL; - -WITH transfers AS ( - SELECT evt_block_number as block_number, - evt_block_time as block_time, - address, - amount - FROM - ( - SELECT evt_block_number, - "to" AS address, - evt_block_time, - value AS amount - FROM ousd."OusdImplementation_evt_Transfer" - WHERE evt_block_number > 11596940 -- OUSD V2 block number - - UNION ALL - - SELECT evt_block_number, - "from" AS address, - evt_block_time, - -value AS amount - FROM ousd."OusdImplementation_evt_Transfer" - WHERE evt_block_number > 11596940 -- OUSD V2 block number - ) t -), - -rebase_logs AS ( - -- this is kind of hackish, but for some reason "DISTINCT ON" expression is not supported - SELECT block_number, - MAX(block_time) as block_time, - MAX(total_supply) as total_supply, - MAX(rebasing_credits) as rebasing_credits, - MIN(rebasing_credits_per_token) as rebasing_credits_per_token - FROM( - SELECT - dune_user_generated.data2bignumber(data, 0, 18) as total_supply, - dune_user_generated.data2bignumber(data, 1, 18) as rebasing_credits, - dune_user_generated.data2bignumber(data, 2, 18) as rebasing_credits_per_token, - * - FROM ethereum.logs - WHERE contract_address='\x2a8e1e676ec238d8a992307b495b45b3feaa5e86' -- OUSD - AND topic1='\x99e56f783b536ffacf422d59183ea321dd80dcd6d23daa13023e8afea38c3df1' -- old rebase logs - AND block_number > 11596940 -- OUSD V2 block number - - UNION ALL - - SELECT - dune_user_generated.data2bignumber(data, 0, 18) as total_supply, - dune_user_generated.data2bignumber(data, 1, 27) as rebasing_credits, - dune_user_generated.data2bignumber(data, 2, 27) as rebasing_credits_per_token, - * - FROM ethereum.logs - WHERE contract_address='\x2a8e1e676ec238d8a992307b495b45b3feaa5e86' -- OUSD - AND topic1='\x41645eb819d3011b13f97696a8109d14bfcddfaca7d063ec0564d62a3e257235' -- new rebase logs - AND block_number > 11596940 -- OUSD V2 block number - ) DATA - GROUP BY 1 - ORDER BY block_number DESC -), - -nearest_rebase_log_to_transaction_log AS ( - SELECT t.block_number AS transaction_block_number, - MAX(r.block_number) AS rebase_block_number - FROM transfers AS t - LEFT JOIN rebase_logs AS r - ON t.block_number >= r.block_number - GROUP BY t.block_number -), - -transfer_with_credits_per_token as ( - SELECT t.*, r.rebasing_credits_per_token, - t.amount * r.rebasing_credits_per_token as credits, - r.block_number as rebase_block_number - FROM transfers t INNER JOIN nearest_rebase_log_to_transaction_log nrb - ON t.block_number = nrb.transaction_block_number - INNER JOIN rebase_logs r - ON r.block_number = nrb.rebase_block_number -), - --- 2 months in 3 day hops, except last 7 days that have no hops -day_hops_3 AS ( - SELECT date_trunc('day', day) as day - FROM( - SELECT generate_series('now'::timestamp - '2 month'::interval, 'now'::timestamp - '1 week'::interval, '3 day') AS day - UNION ALL - SELECT generate_series('now'::timestamp - '6 days'::interval, date_trunc('day', NOW()), '1 day') AS day - ) DAYS - ORDER BY day desc -), - -latest_rebases as ( - SELECT - max_d.day as day, - r.* - FROM ( - SELECT d.day, MAX(r.block_time) as max_block_time - FROM day_hops_3 d - LEFT JOIN rebase_logs r - ON r.block_time < d.day - GROUP BY 1 - ) max_d INNER JOIN rebase_logs r - ON max_d.max_block_time = r.block_time -), - -token_balances as ( - SELECT - b.day, - wallet_address, - credits_sum / rebasing_credits_per_token as balance - FROM latest_rebases r - INNER JOIN ( - SELECT d.day, t.address as wallet_address, SUM(t.credits / 1e18) as credits_sum - FROM transfer_with_credits_per_token t - INNER JOIN day_hops_3 d - ON t.block_time < d.day - WHERE t.address != '\x87650d7bbfc3a9f10587d7778206671719d9910d' -- Curve Metapool - AND t.address != '\x129360c964e2e13910d603043f6287e5e9383374' -- Uniswap - GROUP BY 1, 2 - ) b - ON r.day = b.day - ORDER BY 1 desc -) - -select day, -ROUND(count(1) filter (WHERE balance > 0 AND balance < 100)) AS "0-100 OUSD", -ROUND(count(1) filter (WHERE balance > 100 AND balance < 1000)) AS "100-1k OUSD", -ROUND(count(1) filter (WHERE balance > 1000 AND balance < 3000)) AS "1k-3k OUSD", -ROUND(count(1) filter (WHERE balance > 3000 AND balance < 9000)) AS "3k-9k OUSD", -ROUND(count(1) filter (WHERE balance > 9000 AND balance < 15000)) AS "9k-15k OUSD", -ROUND(count(1) filter (WHERE balance > 15000 AND balance < 25000)) AS "15k-25k OUSD", -ROUND(count(1) filter (WHERE balance > 25000 AND balance < 40000)) AS "25k-40k OUSD", -ROUND(count(1) filter (WHERE balance > 40000 AND balance < 70000)) AS "40k-70k OUSD", -ROUND(count(1) filter (WHERE balance > 70000 AND balance < 110000)) AS "70k-110k OUSD", -ROUND(count(1) filter (WHERE balance > 110000 AND balance < 150000)) AS "110k-150k OUSD", -ROUND(count(1) filter (WHERE balance > 150000 AND balance < 250000)) AS "150k-250k OUSD", -ROUND(count(1) filter (WHERE balance > 250000 AND balance < 500000)) AS "250k-500k OUSD", -ROUND(count(1) filter (WHERE balance > 500000 AND balance < 750000)) AS "500k-750k OUSD", -ROUND(count(1) filter (WHERE balance > 750000 AND balance < 2000000)) AS "750k-2m OUSD", -ROUND(count(1) filter (WHERE balance > 2000000)) AS ">2m OUSD", -sum(balance) as amount, -count(distinct wallet_address) as holders -FROM token_balances -GROUP BY 1; -``` \ No newline at end of file diff --git a/docs/deprecated/dune/Token holders - time series - breakdown by wallet number.md b/docs/deprecated/dune/Token holders - time series - breakdown by wallet number.md deleted file mode 100644 index 81352efc..00000000 --- a/docs/deprecated/dune/Token holders - time series - breakdown by wallet number.md +++ /dev/null @@ -1,157 +0,0 @@ -# Token holders - time series - breakdown by wallet number - -## DEPRECATED DATASET ACCORDING TO DUNE - -https://dune.com/embeds/282332/532634/55ca01e1-77f3-4394-86f3-139765492a27 -https://dune.com/queries/282332/532634 - -DROP FUNCTION IF EXISTS dune_user_generated.data2bignumber(BYTEA, INT, INT); -CREATE OR REPLACE FUNCTION dune_user_generated.data2bignumber(data BYTEA, topic INT, decimals INT) RETURNS FLOAT AS $$ -BEGIN -RETURN bytea2numeric(decode(SUBSTRING(ENCODE("data",'hex'),(1+(64*"topic")),64),'hex'))/POWER(10, "decimals"); -END; $$ -LANGUAGE PLPGSQL; - -WITH transfers AS ( -SELECT evt_block_number as block_number, -evt_block_time as block_time, -address, -amount -FROM -( -SELECT evt_block_number, -"to" AS address, -evt_block_time, -value AS amount -FROM ousd."OusdImplementation_evt_Transfer" -WHERE evt_block_number > 11596940 -- OUSD V2 block number - - UNION ALL - - SELECT evt_block_number, - "from" AS address, - evt_block_time, - -value AS amount - FROM ousd."OusdImplementation_evt_Transfer" - WHERE evt_block_number > 11596940 -- OUSD V2 block number - ) t - -), - -rebase_logs AS ( --- this is kind of hackish, but for some reason "DISTINCT ON" expression is not supported -SELECT block_number, -MAX(block_time) as block_time, -MAX(total_supply) as total_supply, -MAX(rebasing_credits) as rebasing_credits, -MIN(rebasing_credits_per_token) as rebasing_credits_per_token -FROM( -SELECT -dune_user_generated.data2bignumber(data, 0, 18) as total_supply, -dune_user_generated.data2bignumber(data, 1, 18) as rebasing_credits, -dune_user_generated.data2bignumber(data, 2, 18) as rebasing_credits_per_token, - -* - -FROM ethereum.logs -WHERE contract_address='\x2a8e1e676ec238d8a992307b495b45b3feaa5e86' -- OUSD -AND topic1='\x99e56f783b536ffacf422d59183ea321dd80dcd6d23daa13023e8afea38c3df1' -- old rebase logs -AND block_number > 11596940 -- OUSD V2 block number - - UNION ALL - - SELECT - dune_user_generated.data2bignumber(data, 0, 18) as total_supply, - dune_user_generated.data2bignumber(data, 1, 27) as rebasing_credits, - dune_user_generated.data2bignumber(data, 2, 27) as rebasing_credits_per_token, - * - FROM ethereum.logs - WHERE contract_address='\x2a8e1e676ec238d8a992307b495b45b3feaa5e86' -- OUSD - AND topic1='\x41645eb819d3011b13f97696a8109d14bfcddfaca7d063ec0564d62a3e257235' -- new rebase logs - AND block_number > 11596940 -- OUSD V2 block number - ) DATA - GROUP BY 1 - ORDER BY block_number DESC - -), - -nearest_rebase_log_to_transaction_log AS ( -SELECT t.block_number AS transaction_block_number, -MAX(r.block_number) AS rebase_block_number -FROM transfers AS t -LEFT JOIN rebase_logs AS r -ON t.block_number >= r.block_number -GROUP BY t.block_number -), - -transfer_with_credits_per_token as ( -SELECT t.*, r.rebasing_credits_per_token, -t.amount * r.rebasing_credits_per_token as credits, -r.block_number as rebase_block_number -FROM transfers t INNER JOIN nearest_rebase_log_to_transaction_log nrb -ON t.block_number = nrb.transaction_block_number -INNER JOIN rebase_logs r -ON r.block_number = nrb.rebase_block_number -), --- TODO INSPECT THIS --- last rebasing credits per token: 0.8369875568128926 --- TODO some token holders have balances way off like this account: \x96feb7b6f808dd2bbd09c9e5ccde77cabd58d019 (has a -lot of transactions) --- SELECT SUM(amount / 1e18), SUM(credits / 1e18) FROM transfer_with_credits_per_token --- WHERE address = '\x96feb7b6f808dd2bbd09c9e5ccde77cabd58d019' --- GROUP BY address - --- 2 months in 3 day hops, except last 7 days that have no hops -day_hops_3 AS ( -SELECT date_trunc('day', day) as day -FROM( -SELECT generate_series('now'::timestamp - '2 month'::interval, 'now'::timestamp - '1 week'::interval, '3 day') AS day -UNION ALL -SELECT generate_series('now'::timestamp - '6 days'::interval, date_trunc('day', NOW()), '1 day') AS day -) DAYS -ORDER BY day desc -), - -latest_rebases as ( -SELECT -max_d.day as day, -r.* -FROM ( -SELECT d.day, MAX(r.block_time) as max_block_time -FROM day_hops_3 d -LEFT JOIN rebase_logs r -ON r.block_time < d.day -GROUP BY 1 -) max_d INNER JOIN rebase_logs r -ON max_d.max_block_time = r.block_time -), - -token_balances as ( -SELECT -b.day, -wallet_address, -credits_sum / rebasing_credits_per_token as balance -FROM latest_rebases r -INNER JOIN ( -SELECT d.day, t.address as wallet_address, SUM(t.credits / 1e18) as credits_sum -FROM transfer_with_credits_per_token t -INNER JOIN day_hops_3 d -ON t.block_time < d.day -WHERE t.address != '\x87650d7bbfc3a9f10587d7778206671719d9910d' -- Curve Metapool -AND t.address != '\x129360c964e2e13910d603043f6287e5e9383374' -- Uniswap -GROUP BY 1, 2 -) b -ON r.day = b.day -ORDER BY 1 desc -) - -select day, -count(1) filter (WHERE balance > 0 AND balance < 100) AS "mini 0-100 OUSD", -count(1) filter (WHERE balance > 100 AND balance < 1000) AS "light 100-1k OUSD", -count(1) filter (WHERE balance > 1000 AND balance < 10000) AS "heavy 1k-10k", -count(1) filter (WHERE balance > 10000 AND balance < 100000) AS "full 10k-100k", -count(1) filter (WHERE balance > 100000) AS "enormous >100k", -count(1) as amount, -count(distinct wallet_address) as holders -FROM token_balances -GROUP BY 1; \ No newline at end of file diff --git a/docs/deprecated/dune/Total supply breakdown.md b/docs/deprecated/dune/Total supply breakdown.md deleted file mode 100644 index 06ae90ff..00000000 --- a/docs/deprecated/dune/Total supply breakdown.md +++ /dev/null @@ -1,153 +0,0 @@ -# Total supply breakdown - -https://dune.com/embeds/284182/536054/8efedf92-132d-43f9-974c-d6aaa2ad53b -https://dune.com/queries/284182/536054 - -```sql -DROP FUNCTION IF EXISTS dune_user_generated.data2bignumber(BYTEA, INT, INT); -CREATE OR REPLACE FUNCTION dune_user_generated.data2bignumber(data BYTEA, topic INT, decimals INT) RETURNS FLOAT AS $$ -BEGIN -RETURN bytea2numeric(decode(SUBSTRING(ENCODE("data",'hex'),(1+(64*"topic")),64),'hex'))/POWER(10, "decimals"); -END; $$ -LANGUAGE PLPGSQL; - -WITH transfers AS ( - SELECT evt_block_number as block_number, - evt_block_time as block_time, - address, - amount - FROM - ( - SELECT evt_block_number, - "to" AS address, - evt_block_time, - value AS amount - FROM ousd."OusdImplementation_evt_Transfer" - WHERE evt_block_number > 11596940 -- OUSD V2 block number - - UNION ALL - - SELECT evt_block_number, - "from" AS address, - evt_block_time, - -value AS amount - FROM ousd."OusdImplementation_evt_Transfer" - WHERE evt_block_number > 11596940 -- OUSD V2 block number - ) t -), - -rebase_logs AS ( - -- this is kind of hackish, but for some reason "DISTINCT ON" expression is not supported - SELECT block_number, - MAX(block_time) as block_time, - MAX(total_supply) as total_supply, - MAX(rebasing_credits) as rebasing_credits, - MIN(rebasing_credits_per_token) as rebasing_credits_per_token - FROM( - SELECT - dune_user_generated.data2bignumber(data, 0, 18) as total_supply, - dune_user_generated.data2bignumber(data, 1, 18) as rebasing_credits, - dune_user_generated.data2bignumber(data, 2, 18) as rebasing_credits_per_token, - * - FROM ethereum.logs - WHERE contract_address='\x2a8e1e676ec238d8a992307b495b45b3feaa5e86' -- OUSD - AND topic1='\x99e56f783b536ffacf422d59183ea321dd80dcd6d23daa13023e8afea38c3df1' -- old rebase logs - AND block_number > 11596940 -- OUSD V2 block number - - UNION ALL - - SELECT - dune_user_generated.data2bignumber(data, 0, 18) as total_supply, - dune_user_generated.data2bignumber(data, 1, 27) as rebasing_credits, - dune_user_generated.data2bignumber(data, 2, 27) as rebasing_credits_per_token, - * - FROM ethereum.logs - WHERE contract_address='\x2a8e1e676ec238d8a992307b495b45b3feaa5e86' -- OUSD - AND topic1='\x41645eb819d3011b13f97696a8109d14bfcddfaca7d063ec0564d62a3e257235' -- new rebase logs - AND block_number > 11596940 -- OUSD V2 block number - ) DATA - GROUP BY 1 - ORDER BY block_number DESC -), - -nearest_rebase_log_to_transaction_log AS ( - SELECT t.block_number AS transaction_block_number, - MAX(r.block_number) AS rebase_block_number - FROM transfers AS t - LEFT JOIN rebase_logs AS r - ON t.block_number >= r.block_number - GROUP BY t.block_number -), - -transfer_with_credits_per_token as ( - SELECT t.*, r.rebasing_credits_per_token, - t.amount * r.rebasing_credits_per_token as credits, - r.block_number as rebase_block_number - FROM transfers t INNER JOIN nearest_rebase_log_to_transaction_log nrb - ON t.block_number = nrb.transaction_block_number - INNER JOIN rebase_logs r - ON r.block_number = nrb.rebase_block_number -), --- TODO INSPECT THIS --- last rebasing credits per token: 0.8369875568128926 --- TODO some token holders have balances way off like this account: \x96feb7b6f808dd2bbd09c9e5ccde77cabd58d019 (has a lot of transactions) --- SELECT SUM(amount / 1e18), SUM(credits / 1e18) FROM transfer_with_credits_per_token --- WHERE address = '\x96feb7b6f808dd2bbd09c9e5ccde77cabd58d019' --- GROUP BY address - --- 2 months in 3 day hops, except last 7 days that have no hops -day_hops_3 AS ( - SELECT date_trunc('day', day) as day - FROM( - SELECT generate_series('now'::timestamp - '2 month'::interval, 'now'::timestamp - '1 week'::interval, '3 day') AS day - UNION ALL - SELECT generate_series('now'::timestamp - '6 days'::interval, date_trunc('day', NOW()), '1 day') AS day - ) DAYS - ORDER BY day desc -), - -latest_rebases as ( - SELECT - max_d.day as day, - r.* - FROM ( - SELECT d.day, MAX(r.block_time) as max_block_time - FROM day_hops_3 d - LEFT JOIN rebase_logs r - ON r.block_time < d.day - GROUP BY 1 - ) max_d INNER JOIN rebase_logs r - ON max_d.max_block_time = r.block_time -), - -token_balances as ( - SELECT - b.day, - wallet_address, - credits_sum / rebasing_credits_per_token as balance - FROM latest_rebases r - INNER JOIN ( - SELECT d.day, t.address as wallet_address, SUM(t.credits / 1e18) as credits_sum - FROM transfer_with_credits_per_token t - INNER JOIN day_hops_3 d - ON t.block_time < d.day - GROUP BY 1, 2 - HAVING SUM(t.credits / 1e18) > 0 - ) b - ON r.day = b.day - ORDER BY 1 desc -) - -SELECT * -FROM -( - select day, - ROUND(SUM (balance) filter (WHERE wallet_address = '\x87650d7bbfc3a9f10587d7778206671719d9910d')) AS curve, - ROUND(SUM (balance) filter (WHERE wallet_address = '\x129360c964e2e13910d603043f6287e5e9383374')) AS uniswap, - ROUND(SUM (balance) filter (WHERE wallet_address = '\xcecad69d7d4ed6d52efcfa028af8732f27e08f70')) AS flipper, - ROUND(SUM (balance) filter (WHERE wallet_address != '\xcecad69d7d4ed6d52efcfa028af8732f27e08f70' AND wallet_address != '\x87650d7bbfc3a9f10587d7778206671719d9910d' AND wallet_address != '\x129360c964e2e13910d603043f6287e5e9383374')) AS other - FROM token_balances - GROUP BY 1 -) s -ORDER BY day DESC -``` \ No newline at end of file diff --git a/grafana/README.md b/grafana/README.md deleted file mode 100644 index 8a259460..00000000 --- a/grafana/README.md +++ /dev/null @@ -1,3 +0,0 @@ -The grafana dashboard JSON models found here may be out of date. - -Reference the live version and consider these as backups. \ No newline at end of file diff --git a/grafana/aave-compound-balances.json b/grafana/aave-compound-balances.json deleted file mode 100644 index 87b8395f..00000000 --- a/grafana/aave-compound-balances.json +++ /dev/null @@ -1,755 +0,0 @@ -{ - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": { - "type": "grafana", - "uid": "-- Grafana --" - }, - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "type": "dashboard" - } - ] - }, - "editable": true, - "fiscalYearStartMonth": 0, - "graphTooltip": 0, - "id": 26, - "links": [], - "liveNow": false, - "panels": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "currencyUSD" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 8, - "x": 0, - "y": 0 - }, - "id": 1, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "table", - "rawQuery": true, - "rawSql": "SELECT\n timestamp as time,\n balance / 1e6 as balance\nFROM\n erc20_balance\nwhere\n $__timeFilter(timestamp) and address = '0xdac17f958d2ee523a2206206994597c13d831ec7' and account = '0x3ed3b47dd13ec9a98b44e6204a523e766b225811'\norder by\n timestamp asc", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "\"timestamp\"", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "erc20_balance" - } - ], - "title": "Aave - USDT", - "type": "timeseries" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "currencyUSD" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 8, - "x": 8, - "y": 0 - }, - "id": 2, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "table", - "rawQuery": true, - "rawSql": "SELECT\n timestamp as time,\n balance / 1e6 as balance\nFROM\n erc20_balance\nwhere\n $__timeFilter(timestamp) and address = '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' and account = '0xbcca60bb61934080951369a648fb03df4f96263c'\norder by\n timestamp asc", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "\"timestamp\"", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "erc20_balance" - } - ], - "title": "Aave - USDC", - "type": "timeseries" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "currencyUSD" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 8, - "x": 16, - "y": 0 - }, - "id": 3, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "table", - "rawQuery": true, - "rawSql": "SELECT\n timestamp as time,\n balance / 1e18 as balance\nFROM\n erc20_balance\nwhere\n $__timeFilter(timestamp) and address = '0x6b175474e89094c44da98b954eedeac495271d0f' and account = '0x028171bca77440897b824ca71d1c56cac55b68a3'\norder by\n timestamp asc", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "\"timestamp\"", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "erc20_balance" - } - ], - "title": "Aave - DAI", - "type": "timeseries" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "currencyUSD" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 8, - "x": 0, - "y": 8 - }, - "id": 4, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "table", - "rawQuery": true, - "rawSql": "SELECT\n timestamp as time,\n balance / 1e6 as balance\nFROM\n erc20_balance\nwhere\n $__timeFilter(timestamp) and address = '0xdac17f958d2ee523a2206206994597c13d831ec7' and account = '0xf650c3d88d12db855b8bf7d11be6c55a4e07dcc9'\norder by\n timestamp asc", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "\"timestamp\"", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "erc20_balance" - } - ], - "title": "Compound - USDT", - "type": "timeseries" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "currencyUSD" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 8, - "x": 8, - "y": 8 - }, - "id": 5, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "table", - "rawQuery": true, - "rawSql": "SELECT\n timestamp as time,\n balance / 1e6 as balance\nFROM\n erc20_balance\nwhere\n $__timeFilter(timestamp) and address = '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' and account = '0x39aa39c021dfbae8fac545936693ac917d5e7563'\norder by\n timestamp asc", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "\"timestamp\"", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "erc20_balance" - } - ], - "title": "Compound - USDC", - "type": "timeseries" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "currencyUSD" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 8, - "x": 16, - "y": 8 - }, - "id": 6, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "table", - "rawQuery": true, - "rawSql": "SELECT\n timestamp as time,\n balance / 1e18 as balance\nFROM\n erc20_balance\nwhere\n $__timeFilter(timestamp) and address = '0x6b175474e89094c44da98b954eedeac495271d0f' and account = '0x5d3a536e4d6dbd6114cc1ead35777bab948e3643'\norder by\n timestamp asc", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "\"timestamp\"", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "erc20_balance" - } - ], - "title": "Compound - DAI", - "type": "timeseries" - } - ], - "refresh": "", - "schemaVersion": 39, - "tags": [ - "ousd", - "aave", - "compound" - ], - "templating": { - "list": [] - }, - "time": { - "from": "now-6h", - "to": "now" - }, - "timeRangeUpdatedDuringEditOrView": false, - "timepicker": {}, - "timezone": "", - "title": "Aave & Compound Balances", - "uid": "c747b6d7-c0f3-4317-8bd5-5b434f88a86e", - "version": 5, - "weekStart": "" -} \ No newline at end of file diff --git a/grafana/alerts/balancer-weights-reth_weth.sql b/grafana/alerts/balancer-weights-reth_weth.sql deleted file mode 100644 index fd7609f6..00000000 --- a/grafana/alerts/balancer-weights-reth_weth.sql +++ /dev/null @@ -1,16 +0,0 @@ -WITH base as ( - SELECT - timestamp as time, - address, - balance0 / 1e18 / ((balance0 / 1e18) + (balance1 / 1e18) + (balance2 / 1e18)) as weight - FROM balancer_pool_balance -) - -select - max(weight) as highest_weight -from base -where - address = '0x1e19cf2d73a72ef1332c882f20534b6519be0276' -group by time, address -order by time desc, highest_weight desc -limit 1 \ No newline at end of file diff --git a/grafana/balancer-pools.json b/grafana/balancer-pools.json deleted file mode 100644 index b3367295..00000000 --- a/grafana/balancer-pools.json +++ /dev/null @@ -1,1014 +0,0 @@ -{ - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": { - "type": "grafana", - "uid": "-- Grafana --" - }, - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "type": "dashboard" - } - ] - }, - "editable": true, - "fiscalYearStartMonth": 0, - "graphTooltip": 0, - "id": 21, - "links": [], - "liveNow": false, - "panels": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 2, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/.*_p/" - }, - "properties": [ - { - "id": "custom.axisPlacement", - "value": "right" - }, - { - "id": "custom.stacking", - "value": { - "group": "A", - "mode": "percent" - } - }, - { - "id": "custom.fillOpacity", - "value": 30 - }, - { - "id": "custom.lineWidth", - "value": 0 - } - ] - }, - { - "matcher": { - "id": "byRegexp", - "options": "/balance0.*/" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "green", - "mode": "fixed" - } - } - ] - }, - { - "matcher": { - "id": "byRegexp", - "options": "/balance1.*/" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "blue", - "mode": "fixed" - } - } - ] - }, - { - "matcher": { - "id": "byRegexp", - "options": "/balance2.*/" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "red", - "mode": "fixed" - } - } - ] - } - ] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 0 - }, - "id": 39, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "table", - "rawQuery": true, - "rawSql": "WITH base as (\n SELECT \n timestamp as time, \n address,\n balance0 / 1e18 as balance0, \n balance1 / 1e18 as balance1,\n (balance0 + balance1) / 1e18 as total\n FROM balancer_pool_balance\n)\n\nselect\n time,\n balance0,\n balance1,\n balance0 / nullif(total, 0) as balance0_p,\n balance1 / nullif(total, 0) as balance1_p\nfrom base\nwhere address = '0x1e19cf2d73a72ef1332c882f20534b6519be0276'\nand $__timeFilter(time) \norder by time", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "address", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "balancer_pool_balance" - } - ], - "title": "B-rETH-STABLE - 0x1e19cf2d73a72ef1332c882f20534b6519be0276", - "type": "timeseries" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 2, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/.*_p/" - }, - "properties": [ - { - "id": "custom.axisPlacement", - "value": "right" - }, - { - "id": "custom.stacking", - "value": { - "group": "A", - "mode": "percent" - } - }, - { - "id": "custom.fillOpacity", - "value": 30 - }, - { - "id": "custom.lineWidth", - "value": 0 - } - ] - }, - { - "matcher": { - "id": "byRegexp", - "options": "/balance0.*/" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "green", - "mode": "fixed" - } - } - ] - }, - { - "matcher": { - "id": "byRegexp", - "options": "/balance1.*/" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "blue", - "mode": "fixed" - } - } - ] - }, - { - "matcher": { - "id": "byRegexp", - "options": "/balance2.*/" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "red", - "mode": "fixed" - } - } - ] - }, - { - "matcher": { - "id": "byRegexp", - "options": "/balance3.*/" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "orange", - "mode": "fixed" - } - } - ] - } - ] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 0 - }, - "id": 42, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "table", - "rawQuery": true, - "rawSql": "WITH base as (\n SELECT \n timestamp as time, \n address,\n balance0 / 1e18 as balance0, \n balance1 / 1e18 as balance1,\n balance2 / 1e18 as balance2,\n balance3 / 1e18 as balance3,\n (balance1 + balance2 + balance3) / 1e18 as total\n FROM balancer_pool_balance\n)\n\nselect\n time,\n balance1,\n balance2,\n balance3,\n balance1 / nullif(total, 0) as balance1_p,\n balance2 / nullif(total, 0) as balance2_p,\n balance3 / nullif(total, 0) as balance3_p\nfrom base\nwhere address = '0x42ed016f826165c2e5976fe5bc3df540c5ad0af7'\nand $__timeFilter(time) \norder by time", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "address", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "balancer_pool_balance" - } - ], - "title": "wstETH-rETH-sfrxETH-BPT - 0x42ed016f826165c2e5976fe5bc3df540c5ad0af7", - "type": "timeseries" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 2, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/.*_p/" - }, - "properties": [ - { - "id": "custom.axisPlacement", - "value": "right" - }, - { - "id": "custom.stacking", - "value": { - "group": "A", - "mode": "percent" - } - }, - { - "id": "custom.fillOpacity", - "value": 30 - }, - { - "id": "custom.lineWidth", - "value": 0 - } - ] - }, - { - "matcher": { - "id": "byRegexp", - "options": "/balance0.*/" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "green", - "mode": "fixed" - } - } - ] - }, - { - "matcher": { - "id": "byRegexp", - "options": "/balance1.*/" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "blue", - "mode": "fixed" - } - } - ] - }, - { - "matcher": { - "id": "byRegexp", - "options": "/balance2.*/" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "red", - "mode": "fixed" - } - } - ] - } - ] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 8 - }, - "id": 41, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "table", - "rawQuery": true, - "rawSql": "WITH base as (\n SELECT \n timestamp as time, \n address,\n balance0 / 1e18 as balance0, \n balance1 / 1e18 as balance1,\n balance2 / 1e18 as balance2,\n (balance0 + balance2) / 1e18 as total\n FROM balancer_pool_balance\n)\n\nselect\n time,\n balance0,\n -- balance1,\n balance2,\n balance0 / nullif(total, 0) as balance0_p,\n -- balance1 / nullif(total, 0) as balance1_p,\n balance2 / nullif(total, 0) as balance2_p\nfrom base\nwhere address = '0x93d199263632a4ef4bb438f1feb99e57b4b5f0bd'\nand $__timeFilter(time) \norder by time", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "address", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "balancer_pool_balance" - } - ], - "title": "wstETH-WETH-BPT - 0x93d199263632a4ef4bb438f1feb99e57b4b5f0bd", - "type": "timeseries" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "description": "We're using exchange rates from Chainlink to convert the value of BAL into ETH. Values are shown in ETH.", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 2, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/.*_p/" - }, - "properties": [ - { - "id": "custom.axisPlacement", - "value": "right" - }, - { - "id": "custom.stacking", - "value": { - "group": "A", - "mode": "percent" - } - }, - { - "id": "custom.fillOpacity", - "value": 30 - }, - { - "id": "custom.lineWidth", - "value": 0 - } - ] - }, - { - "matcher": { - "id": "byRegexp", - "options": "/balance0.*/" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "green", - "mode": "fixed" - } - } - ] - }, - { - "matcher": { - "id": "byRegexp", - "options": "/balance1.*/" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "blue", - "mode": "fixed" - } - } - ] - }, - { - "matcher": { - "id": "byRegexp", - "options": "/balance2.*/" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "red", - "mode": "fixed" - } - } - ] - } - ] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 8 - }, - "id": 40, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "table", - "rawQuery": true, - "rawSql": "WITH base as (\n SELECT \n balancer_pool_balance.timestamp as time, \n balancer_pool_balance.address,\n balance0 / 1e18 * exchange_rate.rate / 1e18 as balance0, \n balance1 / 1e18 as balance1,\n (balance0 / 1e18 * exchange_rate.rate / 1e18 + balance1 / 1e18) as total\n FROM balancer_pool_balance\n INNER JOIN balancer_pool_rate\n ON balancer_pool_rate.timestamp = balancer_pool_balance.timestamp and balancer_pool_rate.address = balancer_pool_balance.address\n INNER JOIN exchange_rate\n ON exchange_rate.timestamp = balancer_pool_balance.timestamp and exchange_rate.pair = 'BAL_ETH'\n)\n\nselect\n time,\n balance0,\n balance1,\n balance0 / nullif(total, 0) as balance0_p,\n balance1 / nullif(total, 0) as balance1_p\nfrom base\nwhere address = '0x5c6ee304399dbdb9c8ef030ab642b10820db8f56'\nand $__timeFilter(time) \norder by time", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "address", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "balancer_pool_balance" - } - ], - "title": "B-80BAL-20WETH - 0x5c6ee304399dbdb9c8ef030ab642b10820db8f56", - "type": "timeseries" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 2, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "decimals": 2, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/.*_p/" - }, - "properties": [ - { - "id": "custom.axisPlacement", - "value": "right" - }, - { - "id": "custom.stacking", - "value": { - "group": "A", - "mode": "percent" - } - }, - { - "id": "custom.fillOpacity", - "value": 30 - }, - { - "id": "custom.lineWidth", - "value": 0 - } - ] - }, - { - "matcher": { - "id": "byRegexp", - "options": "/balance0.*/" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "green", - "mode": "fixed" - } - } - ] - }, - { - "matcher": { - "id": "byRegexp", - "options": "/balance1.*/" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "blue", - "mode": "fixed" - } - } - ] - }, - { - "matcher": { - "id": "byRegexp", - "options": "/balance2.*/" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "red", - "mode": "fixed" - } - } - ] - } - ] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 16 - }, - "id": 43, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "table", - "rawQuery": true, - "rawSql": "WITH base as (\n SELECT \n timestamp as time, \n address,\n balance0 / 1e18 as balance0, \n balance1 / 1e18 as balance1,\n (balance0 + balance1) / 1e18 as total\n FROM balancer_pool_balance\n)\n\nselect\n time,\n balance0,\n balance1,\n balance0 / nullif(total, 0) as balance0_p,\n balance1 / nullif(total, 0) as balance1_p\nfrom base\nwhere address = '0xf01b0684c98cd7ada480bfdf6e43876422fa1fc1'\nand $__timeFilter(time) \norder by time", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "address", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "balancer_pool_balance" - } - ], - "title": "Gyroscope ECLP wstETH/wETH - 0xf01b0684c98cd7ada480bfdf6e43876422fa1fc1", - "type": "timeseries" - } - ], - "refresh": "", - "schemaVersion": 39, - "tags": [ - "oeth", - "balancer" - ], - "templating": { - "list": [] - }, - "time": { - "from": "now-6h", - "to": "now" - }, - "timeRangeUpdatedDuringEditOrView": false, - "timepicker": {}, - "timezone": "", - "title": "Balancer Pools", - "uid": "c9a4fb60-6982-4d06-a9a6-c5d4d43bcc84", - "version": 16, - "weekStart": "" -} \ No newline at end of file diff --git a/grafana/curve-pools.json b/grafana/curve-pools.json deleted file mode 100644 index da778e75..00000000 --- a/grafana/curve-pools.json +++ /dev/null @@ -1,2543 +0,0 @@ -{ - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": { - "type": "grafana", - "uid": "-- Grafana --" - }, - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "type": "dashboard" - } - ] - }, - "editable": true, - "fiscalYearStartMonth": 0, - "graphTooltip": 0, - "id": 19, - "links": [], - "liveNow": false, - "panels": [ - { - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 0 - }, - "id": 6, - "title": "ETH Curve Pools", - "type": "row" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/.*_p/" - }, - "properties": [ - { - "id": "custom.axisPlacement", - "value": "right" - }, - { - "id": "custom.stacking", - "value": { - "group": "A", - "mode": "percent" - } - }, - { - "id": "custom.fillOpacity", - "value": 40 - }, - { - "id": "custom.lineWidth", - "value": 0 - }, - { - "id": "unit", - "value": "percentunit" - } - ] - } - ] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 1 - }, - "id": 10, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "rawQuery": true, - "rawSql": "WITH base as (\nSELECT \n timestamp as time, \n balance0 / 1e18 as balance0, \n balance1 / 1e18 as balance1, \n ((balance0 / 1e18) + (balance1 / 1e18)) as total\nFROM curve_pool_balance\nwhere address = '0x94b17476a93b3262d87b9a326965d1e91f9c13e7'\norder by time\n)\n\nselect \n time,\n balance0,\n balance1,\n balance0 / nullif(total, 0) as balance0_p,\n balance1 / nullif(total, 0) as balance1_p\nfrom base\n", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "address", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "balance0", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "balance1", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "balance2", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "curve_pool_balance" - } - ], - "title": "factory-v2-298: ETH/OETH - 0x94b17476a93b3262d87b9a326965d1e91f9c13e7", - "type": "timeseries" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/.*_p/" - }, - "properties": [ - { - "id": "custom.axisPlacement", - "value": "right" - }, - { - "id": "custom.stacking", - "value": { - "group": "A", - "mode": "percent" - } - }, - { - "id": "custom.fillOpacity", - "value": 40 - }, - { - "id": "custom.lineWidth", - "value": 0 - }, - { - "id": "unit", - "value": "percentunit" - } - ] - } - ] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 1 - }, - "id": 7, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "rawQuery": true, - "rawSql": "WITH base as (\nSELECT \n timestamp as time, \n balance0 / 1e18 as balance0, \n balance1 / 1e18 as balance1, \n ((balance0 / 1e18) + (balance1 / 1e18)) as total\nFROM curve_pool_balance\nwhere address = '0x0f3159811670c117c372428d4e69ac32325e4d0f'\norder by time\n)\n\nselect \n time,\n balance0,\n balance1,\n balance0 / nullif(total, 0) as balance0_p,\n balance1 / nullif(total, 0) as balance1_p\nfrom base\n", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "address", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "balance0", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "balance1", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "balance2", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "curve_pool_balance" - } - ], - "title": "factory-crypto-210: ETH/rETH - 0x0f3159811670c117c372428d4e69ac32325e4d0f", - "type": "timeseries" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/.*_p/" - }, - "properties": [ - { - "id": "custom.axisPlacement", - "value": "right" - }, - { - "id": "custom.stacking", - "value": { - "group": "A", - "mode": "percent" - } - }, - { - "id": "custom.fillOpacity", - "value": 40 - }, - { - "id": "custom.lineWidth", - "value": 0 - }, - { - "id": "unit", - "value": "percentunit" - } - ] - } - ] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 9 - }, - "id": 4, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "rawQuery": true, - "rawSql": "WITH base as (\nSELECT \n timestamp as time, \n balance0 / 1e18 as balance0, \n balance1 / 1e18 as balance1, \n ((balance0 / 1e18) + (balance1 / 1e18)) as total\nFROM curve_pool_balance\nwhere address = '0xa1f8a6807c402e4a15ef4eba36528a3fed24e577'\norder by time\n)\n\nselect \n time,\n balance0,\n balance1,\n balance0 / nullif(total, 0) as balance0_p,\n balance1 / nullif(total, 0) as balance1_p\nfrom base\n", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "address", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "balance0", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "balance1", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "balance2", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "curve_pool_balance" - } - ], - "title": "frxeth: ETH/frxETH - 0xa1f8a6807c402e4a15ef4eba36528a3fed24e577", - "type": "timeseries" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/.*_p/" - }, - "properties": [ - { - "id": "custom.axisPlacement", - "value": "right" - }, - { - "id": "custom.stacking", - "value": { - "group": "A", - "mode": "percent" - } - }, - { - "id": "custom.fillOpacity", - "value": 40 - }, - { - "id": "custom.lineWidth", - "value": 0 - }, - { - "id": "unit", - "value": "percentunit" - } - ] - } - ] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 9 - }, - "id": 14, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "rawQuery": true, - "rawSql": "WITH base as (\nSELECT \n timestamp as time, \n balance0 / 1e18 as balance0, \n balance1 / 1e18 as balance1, \n ((balance0 / 1e18) + (balance1 / 1e18)) as total\nFROM curve_pool_balance\nwhere address = '0x828b154032950c8ff7cf8085d841723db2696056'\norder by time\n)\n\nselect \n time,\n balance0,\n balance1,\n balance0 / nullif(total, 0) as balance0_p,\n balance1 / nullif(total, 0) as balance1_p\nfrom base\n", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "address", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "balance0", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "balance1", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "balance2", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "curve_pool_balance" - } - ], - "title": "factory-v2-117: WETH/stETH - 0x828b154032950c8ff7cf8085d841723db2696056", - "type": "timeseries" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/.*_p/" - }, - "properties": [ - { - "id": "custom.axisPlacement", - "value": "right" - }, - { - "id": "custom.stacking", - "value": { - "group": "A", - "mode": "percent" - } - }, - { - "id": "custom.fillOpacity", - "value": 40 - }, - { - "id": "custom.lineWidth", - "value": 0 - }, - { - "id": "unit", - "value": "percentunit" - } - ] - } - ] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 17 - }, - "id": 8, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "rawQuery": true, - "rawSql": "WITH base as (\nSELECT \n timestamp as time, \n balance0 / 1e18 as balance0, \n balance1 / 1e18 as balance1, \n ((balance0 / 1e18) + (balance1 / 1e18)) as total\nFROM curve_pool_balance\nwhere address = '0xdc24316b9ae028f1497c275eb9192a3ea0f67022'\norder by time\n)\n\nselect \n time,\n balance0,\n balance1,\n balance0 / nullif(total, 0) as balance0_p,\n balance1 / nullif(total, 0) as balance1_p\nfrom base\n", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "address", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "balance0", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "balance1", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "balance2", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "curve_pool_balance" - } - ], - "title": "steth: ETH/stETH - 0xdc24316b9ae028f1497c275eb9192a3ea0f67022", - "type": "timeseries" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/.*_p/" - }, - "properties": [ - { - "id": "custom.axisPlacement", - "value": "right" - }, - { - "id": "custom.stacking", - "value": { - "group": "A", - "mode": "percent" - } - }, - { - "id": "custom.fillOpacity", - "value": 40 - }, - { - "id": "custom.lineWidth", - "value": 0 - }, - { - "id": "unit", - "value": "percentunit" - } - ] - } - ] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 17 - }, - "id": 11, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "rawQuery": true, - "rawSql": "WITH base as (\nSELECT \n timestamp as time, \n balance0 / 1e18 as balance0, \n balance1 / 1e18 as balance1, \n ((balance0 / 1e18) + (balance1 / 1e18)) as total\nFROM curve_pool_balance\nwhere address = '0x9c3b46c0ceb5b9e304fcd6d88fc50f7dd24b31bc'\norder by time\n)\n\nselect \n time,\n balance0,\n balance1,\n balance0 / nullif(total, 0) as balance0_p,\n balance1 / nullif(total, 0) as balance1_p\nfrom base\n", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "address", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "balance0", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "balance1", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "balance2", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "curve_pool_balance" - } - ], - "title": "factory-crvusd-15: WETH/frxETH - 0x9c3b46c0ceb5b9e304fcd6d88fc50f7dd24b31bc", - "type": "timeseries" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/.*_p/" - }, - "properties": [ - { - "id": "custom.axisPlacement", - "value": "right" - }, - { - "id": "custom.stacking", - "value": { - "group": "A", - "mode": "percent" - } - }, - { - "id": "custom.fillOpacity", - "value": 40 - }, - { - "id": "custom.lineWidth", - "value": 0 - }, - { - "id": "unit", - "value": "percentunit" - } - ] - } - ] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 25 - }, - "id": 12, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "rawQuery": true, - "rawSql": "WITH base as (\nSELECT \n timestamp as time, \n balance0 / 1e18 as balance0, \n balance1 / 1e18 as balance1, \n ((balance0 / 1e18) + (balance1 / 1e18)) as total\nFROM curve_pool_balance\nwhere address = '0x21e27a5e5513d6e65c4f830167390997aa84843a'\norder by time\n)\n\nselect \n time,\n balance0,\n balance1,\n balance0 / nullif(total, 0) as balance0_p,\n balance1 / nullif(total, 0) as balance1_p\nfrom base\n", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "address", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "balance0", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "balance1", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "balance2", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "curve_pool_balance" - } - ], - "title": "stETH-ng: ETH/stETH - 0x21e27a5e5513d6e65c4f830167390997aa84843a", - "type": "timeseries" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/.*_p/" - }, - "properties": [ - { - "id": "custom.axisPlacement", - "value": "right" - }, - { - "id": "custom.stacking", - "value": { - "group": "A", - "mode": "percent" - } - }, - { - "id": "custom.fillOpacity", - "value": 40 - }, - { - "id": "custom.lineWidth", - "value": 0 - }, - { - "id": "unit", - "value": "percentunit" - } - ] - } - ] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 25 - }, - "id": 13, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "rawQuery": true, - "rawSql": "WITH base as (\nSELECT \n timestamp as time, \n balance0 / 1e18 as balance0, \n balance1 / 1e18 as balance1, \n ((balance0 / 1e18) + (balance1 / 1e18)) as total\nFROM curve_pool_balance\nwhere address = '0x4d9f9d15101eec665f77210cb999639f760f831e'\norder by time\n)\n\nselect \n time,\n balance0,\n balance1,\n balance0 / nullif(total, 0) as balance0_p,\n balance1 / nullif(total, 0) as balance1_p\nfrom base\n", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "address", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "balance0", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "balance1", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "balance2", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "curve_pool_balance" - } - ], - "title": "factory-v2-274: stETH/frxETH - 0x4d9f9d15101eec665f77210cb999639f760f831e", - "type": "timeseries" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/.*_p/" - }, - "properties": [ - { - "id": "custom.axisPlacement", - "value": "right" - }, - { - "id": "custom.stacking", - "value": { - "group": "A", - "mode": "percent" - } - }, - { - "id": "custom.fillOpacity", - "value": 40 - }, - { - "id": "custom.lineWidth", - "value": 0 - }, - { - "id": "unit", - "value": "percentunit" - } - ] - } - ] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 33 - }, - "id": 16, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "rawQuery": true, - "rawSql": "WITH base as (\nSELECT \n timestamp as time, \n balance0 / 1e18 as balance0, \n balance1 / 1e18 as balance1, \n ((balance0 / 1e18) + (balance1 / 1e18)) as total\nFROM curve_pool_balance\nwhere address = '0xe7c6e0a739021cdba7aac21b4b728779eef974d9'\norder by time\n)\n\nselect \n time,\n balance0,\n balance1,\n balance0 / nullif(total, 0) as balance0_p,\n balance1 / nullif(total, 0) as balance1_p\nfrom base\n", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "address", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "balance0", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "balance1", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "balance2", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "curve_pool_balance" - } - ], - "title": "factory-crypto-218: rETH/frxETH - 0xe7c6e0a739021cdba7aac21b4b728779eef974d9", - "type": "timeseries" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/.*_p/" - }, - "properties": [ - { - "id": "custom.axisPlacement", - "value": "right" - }, - { - "id": "custom.stacking", - "value": { - "group": "A", - "mode": "percent" - } - }, - { - "id": "custom.fillOpacity", - "value": 40 - }, - { - "id": "custom.lineWidth", - "value": 0 - }, - { - "id": "unit", - "value": "percentunit" - } - ] - } - ] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 33 - }, - "id": 15, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "rawQuery": true, - "rawSql": "WITH base as (\nSELECT \n timestamp as time, \n balance0 / 1e18 as balance0, \n balance1 / 1e18 as balance1, \n ((balance0 / 1e18) + (balance1 / 1e18)) as total\nFROM curve_pool_balance\nwhere address = '0x447ddd4960d9fdbf6af9a790560d0af76795cb08'\norder by time\n)\n\nselect \n time,\n balance0,\n balance1,\n balance0 / nullif(total, 0) as balance0_p,\n balance1 / nullif(total, 0) as balance1_p\nfrom base\n", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "address", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "balance0", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "balance1", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "balance2", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "curve_pool_balance" - } - ], - "title": "factory-v2-89: rETH/wstETH - 0x447ddd4960d9fdbf6af9a790560d0af76795cb08", - "type": "timeseries" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/.*_p/" - }, - "properties": [ - { - "id": "custom.axisPlacement", - "value": "right" - }, - { - "id": "custom.stacking", - "value": { - "group": "A", - "mode": "percent" - } - }, - { - "id": "custom.fillOpacity", - "value": 40 - }, - { - "id": "custom.lineWidth", - "value": 0 - }, - { - "id": "unit", - "value": "percentunit" - } - ] - } - ] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 41 - }, - "id": 17, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "rawQuery": true, - "rawSql": "WITH base as (\nSELECT \n timestamp as time, \n balance0 / 1e18 as balance0, \n balance1 / 1e18 as balance1, \n balance2 / 1e18 as balance2, \n ((balance0 / 1e18) + (balance1 / 1e18) + (balance2 / 1e18)) as total\nFROM curve_pool_balance\nwhere address = '0x2570f1bd5d2735314fc102eb12fc1afe9e6e7193'\norder by time\n)\n\nselect \n time,\n balance0,\n balance1,\n balance2,\n balance0 / nullif(total, 0) as balance0_p,\n balance1 / nullif(total, 0) as balance1_p,\n balance2 / nullif(total, 0) as balance2_p\nfrom base\n", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "address", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "balance0", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "balance1", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "balance2", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "curve_pool_balance" - } - ], - "title": "factory-tricrypto-14: wstETH/rETH/sfrxETH - 0x2570f1bd5d2735314fc102eb12fc1afe9e6e7193", - "type": "timeseries" - }, - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 49 - }, - "id": 5, - "panels": [], - "title": "USD Curve Pools", - "type": "row" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/.*_p/" - }, - "properties": [ - { - "id": "custom.axisPlacement", - "value": "right" - }, - { - "id": "custom.stacking", - "value": { - "group": "A", - "mode": "percent" - } - }, - { - "id": "custom.fillOpacity", - "value": 40 - }, - { - "id": "custom.lineWidth", - "value": 0 - }, - { - "id": "unit", - "value": "percentunit" - } - ] - } - ] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 50 - }, - "id": 1, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "rawQuery": true, - "rawSql": "WITH base as (\nSELECT \n timestamp as time, \n balance0 / 1e18 as balance0, \n balance1 / 1e6 as balance1, \n balance2 / 1e6 as balance2, \n ((balance0 / 1e18) + (balance1 / 1e6) + (balance2 / 1e6)) as total\nFROM curve_pool_balance\nwhere address = '0xbebc44782c7db0a1a60cb6fe97d0b483032ff1c7'\norder by time\n)\n\nselect \n time,\n balance0,\n balance1,\n balance2,\n balance0 / nullif(total, 0) as balance0_p,\n balance1 / nullif(total, 0) as balance1_p,\n balance2 / nullif(total, 0) as balance2_p\nfrom base\n", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "address", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "balance0", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "balance1", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "balance2", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "curve_pool_balance" - } - ], - "title": "3pool - 0xbebc44782c7db0a1a60cb6fe97d0b483032ff1c7 (DAI, USDC, USDT)", - "type": "timeseries" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/.*_p/" - }, - "properties": [ - { - "id": "custom.axisPlacement", - "value": "right" - }, - { - "id": "custom.stacking", - "value": { - "group": "A", - "mode": "percent" - } - }, - { - "id": "custom.fillOpacity", - "value": 40 - }, - { - "id": "custom.lineWidth", - "value": 0 - }, - { - "id": "unit", - "value": "percentunit" - } - ] - } - ] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 50 - }, - "id": 2, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "rawQuery": true, - "rawSql": "WITH base as (\nSELECT \n timestamp as time, \n balance0 / 1e18 as balance0, \n balance1 / 1e18 as balance1, \n ((balance0 / 1e18) + (balance1 / 1e18)) as total\nFROM curve_pool_balance\nwhere address = '0x87650d7bbfc3a9f10587d7778206671719d9910d'\norder by time\n)\n\nselect \n time,\n balance0,\n balance1,\n balance0 / nullif(total, 0) as balance0_p,\n balance1 / nullif(total, 0) as balance1_p\nfrom base\n", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "address", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "balance0", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "balance1", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "balance2", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "curve_pool_balance" - } - ], - "title": "OUSDMetapool - 0x87650d7bbfc3a9f10587d7778206671719d9910d", - "type": "timeseries" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/.*_p/" - }, - "properties": [ - { - "id": "custom.axisPlacement", - "value": "right" - }, - { - "id": "custom.stacking", - "value": { - "group": "A", - "mode": "percent" - } - }, - { - "id": "custom.fillOpacity", - "value": 40 - }, - { - "id": "custom.lineWidth", - "value": 0 - }, - { - "id": "unit", - "value": "percentunit" - } - ] - } - ] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 58 - }, - "id": 3, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "rawQuery": true, - "rawSql": "WITH base as (\nSELECT \n timestamp as time, \n balance0 / 1e18 as balance0, \n balance1 / 1e18 as balance1, \n ((balance0 / 1e18) + (balance1 / 1e18)) as total\nFROM curve_pool_balance\nwhere address = '0xed279fdd11ca84beef15af5d39bb4d4bee23f0ca'\norder by time\n)\n\nselect \n time,\n balance0,\n balance1,\n balance0 / nullif(total, 0) as balance0_p,\n balance1 / nullif(total, 0) as balance1_p\nfrom base\n", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "address", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "balance0", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "balance1", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "balance2", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "curve_pool_balance" - } - ], - "title": "LUSDMetapool - 0xed279fdd11ca84beef15af5d39bb4d4bee23f0ca", - "type": "timeseries" - } - ], - "refresh": "", - "schemaVersion": 39, - "tags": [ - "oeth", - "ousd", - "curve" - ], - "templating": { - "list": [] - }, - "time": { - "from": "now-90d", - "to": "now" - }, - "timeRangeUpdatedDuringEditOrView": false, - "timepicker": {}, - "timezone": "", - "title": "Curve Pools", - "uid": "a79db0c4-3bdc-4f7c-9e65-32fa76d6ff30", - "version": 22, - "weekStart": "" -} \ No newline at end of file diff --git a/grafana/exchange-rates.json b/grafana/exchange-rates.json deleted file mode 100644 index 57c0be99..00000000 --- a/grafana/exchange-rates.json +++ /dev/null @@ -1,1045 +0,0 @@ -{ - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": { - "type": "grafana", - "uid": "-- Grafana --" - }, - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "type": "dashboard" - } - ] - }, - "editable": true, - "fiscalYearStartMonth": 0, - "graphTooltip": 0, - "id": 25, - "links": [], - "liveNow": false, - "panels": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "gridPos": { - "h": 2, - "w": 24, - "x": 0, - "y": 0 - }, - "id": 11, - "options": { - "code": { - "language": "plaintext", - "showLineNumbers": false, - "showMiniMap": false - }, - "content": "
\n\n Note: Some of the data seen here in Grafana \n and used in alerting uses these rates.\n It is important to understand the rates we use and validate them.\n
", - "mode": "html" - }, - "pluginVersion": "11.1.0-69622", - "type": "text" - }, - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 2 - }, - "id": 8, - "panels": [], - "title": "ETH", - "type": "row" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "decimals": 4, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 3 - }, - "id": 1, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "rawQuery": true, - "rawSql": "SELECT\n timestamp as time,\n pair,\n rate / case when quote = 'USD' then 1e8 else 1e18 end as rate\nFROM exchange_rate \nWHERE $__timeFilter(timestamp) AND base = 'ETH' and quote = 'USD'\norder by timestamp asc", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "\"timestamp\"", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "exchange_rate" - } - ], - "title": "Rate - ETH_USD", - "type": "timeseries" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "decimals": 4, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 3 - }, - "id": 2, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "rawQuery": true, - "rawSql": "SELECT\n timestamp as time,\n pair,\n rate / case when quote = 'USD' then 1e8 else 1e18 end as rate\nFROM exchange_rate \nWHERE $__timeFilter(timestamp) AND base = 'ETH' and quote = 'sfrxETH'\norder by timestamp asc", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "\"timestamp\"", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "exchange_rate" - } - ], - "title": "Rate - ETH_sfrxETH", - "type": "timeseries" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "decimals": 4, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 11 - }, - "id": 4, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "rawQuery": true, - "rawSql": "SELECT\n timestamp as time,\n pair,\n rate / case when quote = 'USD' then 1e8 else 1e18 end as rate\nFROM exchange_rate \nWHERE $__timeFilter(timestamp) AND base = 'ETH' and quote = 'frxETH'\norder by timestamp asc", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "\"timestamp\"", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "exchange_rate" - } - ], - "title": "Rate - ETH_frxETH", - "type": "timeseries" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "description": "This rate is derived from the rETH balancer pool.\nhttps://app.balancer.fi/#/ethereum/pool/0x1e19cf2d73a72ef1332c882f20534b6519be0276000200000000000000000112", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "decimals": 4, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 11 - }, - "id": 3, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "rawQuery": true, - "rawSql": "SELECT\n timestamp as time,\n pair,\n rate / case when quote = 'USD' then 1e8 else 1e18 end as rate\nFROM exchange_rate \nWHERE $__timeFilter(timestamp) AND base = 'ETH' and quote = 'rETH'\norder by timestamp asc", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "\"timestamp\"", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "exchange_rate" - } - ], - "title": "Rate - ETH_rETH", - "type": "timeseries" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "description": "We currently assume 1:1 between ETH and WETH.", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "decimals": 4, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 19 - }, - "id": 5, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "rawQuery": true, - "rawSql": "SELECT\n timestamp as time,\n pair,\n rate / case when quote = 'USD' then 1e8 else 1e18 end as rate\nFROM exchange_rate \nWHERE $__timeFilter(timestamp) AND base = 'ETH' and quote = 'WETH'\norder by timestamp asc", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "\"timestamp\"", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "exchange_rate" - } - ], - "title": "Rate - ETH_WETH", - "type": "timeseries" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "description": "This rate is derived from the stETH balancer pool.", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "decimals": 4, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 19 - }, - "id": 7, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "rawQuery": true, - "rawSql": "SELECT\n timestamp as time,\n pair,\n rate / case when quote = 'USD' then 1e8 else 1e18 end as rate\nFROM exchange_rate \nWHERE $__timeFilter(timestamp) AND base = 'ETH' and quote = 'stETH'\norder by timestamp asc", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "\"timestamp\"", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "exchange_rate" - } - ], - "title": "Rate - ETH_stETH", - "type": "timeseries" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "decimals": 4, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 16, - "w": 24, - "x": 0, - "y": 27 - }, - "id": 6, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "rawQuery": true, - "rawSql": "SELECT\n timestamp as time,\n pair,\n rate / case when quote = 'USD' then 1e8 else 1e18 end as rate\nFROM exchange_rate \nWHERE $__timeFilter(timestamp) AND base = 'ETH'\norder by timestamp asc", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "\"timestamp\"", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "exchange_rate" - } - ], - "title": "Rate - All (ETH)", - "type": "timeseries" - }, - { - "collapsed": true, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 43 - }, - "id": 9, - "panels": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "decimals": 4, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 10 - }, - "id": 10, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "rawQuery": true, - "rawSql": "SELECT\n timestamp as time,\n pair,\n rate\nFROM exchange_rate \nWHERE $__timeFilter(timestamp) AND base = 'USD'\norder by timestamp asc", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "\"timestamp\"", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "exchange_rate" - } - ], - "title": "Rate - All (USD) - Currently None", - "type": "timeseries" - } - ], - "title": "USD (None)", - "type": "row" - } - ], - "refresh": "", - "schemaVersion": 39, - "tags": [ - "oeth", - "ousd", - "rates" - ], - "templating": { - "list": [] - }, - "time": { - "from": "now-1y", - "to": "now" - }, - "timeRangeUpdatedDuringEditOrView": false, - "timepicker": {}, - "timezone": "", - "title": "Exchange Rates", - "uid": "b9b1f9e2-a3b3-45da-9b5a-61edc5c2aee9", - "version": 15, - "weekStart": "" -} \ No newline at end of file diff --git a/grafana/maverick-pools.json b/grafana/maverick-pools.json deleted file mode 100644 index 6fcf281f..00000000 --- a/grafana/maverick-pools.json +++ /dev/null @@ -1,400 +0,0 @@ -{ - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": { - "type": "grafana", - "uid": "-- Grafana --" - }, - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "type": "dashboard" - } - ] - }, - "editable": true, - "fiscalYearStartMonth": 0, - "graphTooltip": 0, - "id": 30, - "links": [], - "liveNow": false, - "panels": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/.*_p/" - }, - "properties": [ - { - "id": "custom.axisPlacement", - "value": "right" - }, - { - "id": "custom.stacking", - "value": { - "group": "A", - "mode": "percent" - } - }, - { - "id": "custom.fillOpacity", - "value": 40 - }, - { - "id": "custom.lineWidth", - "value": 0 - }, - { - "id": "unit", - "value": "percentunit" - } - ] - } - ] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 0 - }, - "id": 1, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "rawQuery": true, - "rawSql": "WITH base as (\nSELECT \n timestamp as time, \n bin_balance_a / 1e18 as bin_balance_a, \n bin_balance_b / 1e18 as bin_balance_b, \n ((bin_balance_a / 1e18) + (bin_balance_b / 1e18)) as total\nFROM maverick_pool_balance \nwhere address = '0x0eb1c92f9f5ec9d817968afddb4b46c564cdedbe'\norder by time\n)\n\nselect \n time,\n bin_balance_a,\n bin_balance_b,\n bin_balance_a / nullif(total, 0) as bin_balance_a_p,\n bin_balance_b / nullif(total, 0) as bin_balance_b_p\nfrom base\n", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "address", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "balance0", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "balance1", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "balance2", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "curve_pool_balance" - } - ], - "title": "wstETH-ETH - 0x0eb1c92f9f5ec9d817968afddb4b46c564cdedbe", - "type": "timeseries" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/.*_p/" - }, - "properties": [ - { - "id": "custom.axisPlacement", - "value": "right" - }, - { - "id": "custom.stacking", - "value": { - "group": "A", - "mode": "percent" - } - }, - { - "id": "custom.fillOpacity", - "value": 40 - }, - { - "id": "custom.lineWidth", - "value": 0 - }, - { - "id": "unit", - "value": "percentunit" - } - ] - } - ] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 0 - }, - "id": 2, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "rawQuery": true, - "rawSql": "WITH base as (\nSELECT \n timestamp as time, \n bin_balance_a / 1e18 as bin_balance_a, \n bin_balance_b / 1e18 as bin_balance_b, \n ((bin_balance_a / 1e18) + (bin_balance_b / 1e18)) as total\nFROM maverick_pool_balance \nwhere address = '0xeb061a4e1ad3f1983655281cb8019ebbf8b30b29'\norder by time\n)\n\nselect \n time,\n bin_balance_a,\n bin_balance_b,\n bin_balance_a / nullif(total, 0) as bin_balance_a_p,\n bin_balance_b / nullif(total, 0) as bin_balance_b_p\nfrom base\n", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "address", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "balance0", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "balance1", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "balance2", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "curve_pool_balance" - } - ], - "title": "rETH-ETH - 0xeb061a4e1ad3f1983655281cb8019ebbf8b30b29", - "type": "timeseries" - } - ], - "refresh": "", - "schemaVersion": 39, - "tags": [ - "maverick", - "oeth" - ], - "templating": { - "list": [] - }, - "time": { - "from": "now-6h", - "to": "now" - }, - "timeRangeUpdatedDuringEditOrView": false, - "timepicker": {}, - "timezone": "", - "title": "Maverick Pools", - "uid": "d4fc9b05-54b6-45b8-93b2-aaf9e7706da7", - "version": 5, - "weekStart": "" -} \ No newline at end of file diff --git a/grafana/oeth-dashboard.json b/grafana/oeth-dashboard.json deleted file mode 100644 index 74727f5b..00000000 --- a/grafana/oeth-dashboard.json +++ /dev/null @@ -1,4286 +0,0 @@ -{ - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": { - "type": "datasource", - "uid": "grafana" - }, - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "target": { - "limit": 100, - "matchAny": false, - "tags": [], - "type": "dashboard" - }, - "type": "dashboard" - } - ] - }, - "editable": true, - "fiscalYearStartMonth": 0, - "graphTooltip": 0, - "id": 17, - "links": [], - "liveNow": false, - "panels": [ - { - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 0 - }, - "id": 47, - "title": "Holder Info", - "type": "row" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "fixedColor": "green", - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 9, - "w": 18, - "x": 0, - "y": 1 - }, - "id": 45, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "rawQuery": true, - "rawSql": "WITH date_series AS (\n SELECT generate_series(MIN(DATE(timestamp)), MAX(DATE(timestamp)), '1 day')::date AS date\n FROM erc20_balance\n),\ngrouped_data AS (\n SELECT \n address,\n account,\n DATE(timestamp) as entry_date,\n balance,\n ROW_NUMBER() OVER (PARTITION BY address, account, DATE(timestamp) ORDER BY timestamp DESC) as rn\n FROM \n erc20_balance \n WHERE address = '0x856c4efb76c1d1ae02e20ceb03a2a6a08b0b8dc3'\n)\nSELECT \n ds.date as time,\n COUNT(*) FILTER (WHERE balance >= 1e6 AND balance < 1e12) AS \">= .000000000001\",\n COUNT(*) FILTER (WHERE balance >= 1e12 AND balance < 1e13) AS \">= .000001\",\n COUNT(*) FILTER (WHERE balance >= 1e13 AND balance < 1e14) AS \">= .00001\",\n COUNT(*) FILTER (WHERE balance >= 1e14 AND balance < 1e15) AS \">= .0001\",\n COUNT(*) FILTER (WHERE balance >= 1e15 AND balance < 1e16) AS \">= .001\",\n COUNT(*) FILTER (WHERE balance >= 1e16 AND balance < 1e17) AS \">= .01\",\n COUNT(*) FILTER (WHERE balance >= 1e17 AND balance < 1e18) AS \">= .1\",\n COUNT(*) FILTER (WHERE balance >= 1e18 AND balance < 1e19) AS \">= 1\",\n COUNT(*) FILTER (WHERE balance >= 1e19 AND balance < 1e20) AS \">= 10\",\n COUNT(*) FILTER (WHERE balance >= 1e20 AND balance < 1e21) AS \">= 100\",\n COUNT(*) FILTER (WHERE balance >= 1e21) AS \">= 1000\"\nFROM \n date_series ds\nLEFT JOIN \n grouped_data gd ON ds.date = gd.entry_date AND gd.rn = 1\nWHERE address = '0x856c4efb76c1d1ae02e20ceb03a2a6a08b0b8dc3'\n and $__timeFilter(ds.date) \nGROUP BY ds.date\nORDER BY ds.date asc;", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "erc20_balance" - } - ], - "title": "Holder Counts", - "type": "timeseries" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "description": "Origin held OETH not yet excluded.", - "fieldConfig": { - "defaults": { - "color": { - "fixedColor": "light-blue", - "mode": "palette-classic" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "text", - "value": null - } - ] - }, - "unit": "none" - }, - "overrides": [] - }, - "gridPos": { - "h": 9, - "w": 6, - "x": 18, - "y": 1 - }, - "id": 46, - "options": { - "displayMode": "basic", - "maxVizHeight": 300, - "minVizHeight": 15, - "minVizWidth": 30, - "namePlacement": "left", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showUnfilled": true, - "sizing": "manual", - "valueMode": "color" - }, - "pluginVersion": "11.1.0-69622", - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "rawQuery": true, - "rawSql": "WITH date_series AS (\n SELECT generate_series(MIN(DATE(timestamp)), MAX(DATE(timestamp)), '1 day')::date AS date\n FROM erc20_balance\n),\ngrouped_data AS (\n SELECT \n address,\n account,\n DATE(timestamp) as entry_date,\n balance,\n ROW_NUMBER() OVER (PARTITION BY address, account, DATE(timestamp) ORDER BY timestamp DESC) as rn\n FROM \n erc20_balance \n WHERE address = '0x856c4efb76c1d1ae02e20ceb03a2a6a08b0b8dc3'\n)\nSELECT \n ds.date as time,\n COUNT(*) FILTER (WHERE balance >= 1e6 AND balance < 1e12) AS \">= .000000000001\",\n COUNT(*) FILTER (WHERE balance >= 1e12 AND balance < 1e13) AS \">= .000001\",\n COUNT(*) FILTER (WHERE balance >= 1e13 AND balance < 1e14) AS \">= .00001\",\n COUNT(*) FILTER (WHERE balance >= 1e14 AND balance < 1e15) AS \">= .0001\",\n COUNT(*) FILTER (WHERE balance >= 1e15 AND balance < 1e16) AS \">= .001\",\n COUNT(*) FILTER (WHERE balance >= 1e16 AND balance < 1e17) AS \">= .01\",\n COUNT(*) FILTER (WHERE balance >= 1e17 AND balance < 1e18) AS \">= .1\",\n COUNT(*) FILTER (WHERE balance >= 1e18 AND balance < 1e19) AS \">= 1\",\n COUNT(*) FILTER (WHERE balance >= 1e19 AND balance < 1e20) AS \">= 10\",\n COUNT(*) FILTER (WHERE balance >= 1e20 AND balance < 1e21) AS \">= 100\",\n COUNT(*) FILTER (WHERE balance >= 1e21) AS \">= 1000\"\nFROM \n date_series ds\nLEFT JOIN \n grouped_data gd ON ds.date = gd.entry_date AND gd.rn = 1\nWHERE address = '0x856c4efb76c1d1ae02e20ceb03a2a6a08b0b8dc3'\n and $__timeFilter(ds.date) \nGROUP BY ds.date\nORDER BY ds.date desc\nLIMIT 1;", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "erc20_balance" - } - ], - "title": "Holder Counts", - "type": "bargauge" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "fixedColor": "green", - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "percentunit" - }, - "overrides": [] - }, - "gridPos": { - "h": 9, - "w": 18, - "x": 0, - "y": 10 - }, - "id": 49, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "rawQuery": true, - "rawSql": "WITH date_series AS (\n SELECT generate_series(MIN(DATE(timestamp)), MAX(DATE(timestamp)), '1 day')::date AS date\n FROM erc20_balance\n),\ngrouped_data AS (\n SELECT \n address,\n account,\n DATE(timestamp) as entry_date,\n balance,\n ROW_NUMBER() OVER (PARTITION BY address, account, DATE(timestamp) ORDER BY timestamp DESC) as rn\n FROM \n erc20_balance \n WHERE address = '0x856c4efb76c1d1ae02e20ceb03a2a6a08b0b8dc3'\n)\nSELECT \n ds.date as time,\n SUM(balance / 1e18) FILTER (WHERE balance >= 1e6 AND balance < 1e12) / SUM(balance / 1e18) AS \">= .000000000001\",\n SUM(balance / 1e18) FILTER (WHERE balance >= 1e12 AND balance < 1e13) / SUM(balance / 1e18) AS \">= .000001\",\n SUM(balance / 1e18) FILTER (WHERE balance >= 1e13 AND balance < 1e14) / SUM(balance / 1e18) AS \">= .00001\",\n SUM(balance / 1e18) FILTER (WHERE balance >= 1e14 AND balance < 1e15) / SUM(balance / 1e18) AS \">= .0001\",\n SUM(balance / 1e18) FILTER (WHERE balance >= 1e15 AND balance < 1e16) / SUM(balance / 1e18) AS \">= .001\",\n SUM(balance / 1e18) FILTER (WHERE balance >= 1e16 AND balance < 1e17) / SUM(balance / 1e18) AS \">= .01\",\n SUM(balance / 1e18) FILTER (WHERE balance >= 1e17 AND balance < 1e18) / SUM(balance / 1e18) AS \">= .1\",\n SUM(balance / 1e18) FILTER (WHERE balance >= 1e18 AND balance < 1e19) / SUM(balance / 1e18) AS \">= 1\",\n SUM(balance / 1e18) FILTER (WHERE balance >= 1e19 AND balance < 1e20) / SUM(balance / 1e18) AS \">= 10\",\n SUM(balance / 1e18) FILTER (WHERE balance >= 1e20 AND balance < 1e21) / SUM(balance / 1e18) AS \">= 100\",\n SUM(balance / 1e18) FILTER (WHERE balance >= 1e21) / SUM(balance / 1e18) AS \">= 1000\"\nFROM \n date_series ds\nLEFT JOIN \n grouped_data gd ON ds.date = gd.entry_date AND gd.rn = 1\nWHERE address = '0x856c4efb76c1d1ae02e20ceb03a2a6a08b0b8dc3'\n and $__timeFilter(ds.date) \nGROUP BY ds.date\nORDER BY ds.date asc;", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "erc20_balance" - } - ], - "title": "Holder TVL %", - "type": "timeseries" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "description": "Origin held OETH not yet excluded.", - "fieldConfig": { - "defaults": { - "color": { - "fixedColor": "light-blue", - "mode": "palette-classic" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "text", - "value": null - } - ] - }, - "unit": "percentunit" - }, - "overrides": [] - }, - "gridPos": { - "h": 9, - "w": 6, - "x": 18, - "y": 10 - }, - "id": 48, - "options": { - "displayMode": "basic", - "maxVizHeight": 300, - "minVizHeight": 15, - "minVizWidth": 30, - "namePlacement": "left", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showUnfilled": true, - "sizing": "manual", - "valueMode": "color" - }, - "pluginVersion": "11.1.0-69622", - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "rawQuery": true, - "rawSql": "WITH date_series AS (\n SELECT generate_series(MIN(DATE(timestamp)), MAX(DATE(timestamp)), '1 day')::date AS date\n FROM erc20_balance\n),\ngrouped_data AS (\n SELECT \n address,\n account,\n DATE(timestamp) as entry_date,\n balance,\n ROW_NUMBER() OVER (PARTITION BY address, account, DATE(timestamp) ORDER BY timestamp DESC) as rn\n FROM \n erc20_balance \n WHERE address = '0x856c4efb76c1d1ae02e20ceb03a2a6a08b0b8dc3'\n)\nSELECT \n ds.date as time,\n SUM(balance / 1e18) FILTER (WHERE balance >= 1e6 AND balance < 1e12) / SUM(balance / 1e18) AS \">= .000000000001\",\n SUM(balance / 1e18) FILTER (WHERE balance >= 1e12 AND balance < 1e13) / SUM(balance / 1e18) AS \">= .000001\",\n SUM(balance / 1e18) FILTER (WHERE balance >= 1e13 AND balance < 1e14) / SUM(balance / 1e18) AS \">= .00001\",\n SUM(balance / 1e18) FILTER (WHERE balance >= 1e14 AND balance < 1e15) / SUM(balance / 1e18) AS \">= .0001\",\n SUM(balance / 1e18) FILTER (WHERE balance >= 1e15 AND balance < 1e16) / SUM(balance / 1e18) AS \">= .001\",\n SUM(balance / 1e18) FILTER (WHERE balance >= 1e16 AND balance < 1e17) / SUM(balance / 1e18) AS \">= .01\",\n SUM(balance / 1e18) FILTER (WHERE balance >= 1e17 AND balance < 1e18) / SUM(balance / 1e18) AS \">= .1\",\n SUM(balance / 1e18) FILTER (WHERE balance >= 1e18 AND balance < 1e19) / SUM(balance / 1e18) AS \">= 1\",\n SUM(balance / 1e18) FILTER (WHERE balance >= 1e19 AND balance < 1e20) / SUM(balance / 1e18) AS \">= 10\",\n SUM(balance / 1e18) FILTER (WHERE balance >= 1e20 AND balance < 1e21) / SUM(balance / 1e18) AS \">= 100\",\n SUM(balance / 1e18) FILTER (WHERE balance >= 1e21) / SUM(balance / 1e18) AS \">= 1000\"\nFROM \n date_series ds\nLEFT JOIN \n grouped_data gd ON ds.date = gd.entry_date AND gd.rn = 1\nWHERE address = '0x856c4efb76c1d1ae02e20ceb03a2a6a08b0b8dc3'\n and $__timeFilter(ds.date)\nGROUP BY ds.date\nORDER BY ds.date desc\nLIMIT 1;", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "erc20_balance" - } - ], - "title": "Holder TVL %", - "type": "bargauge" - }, - { - "collapsed": false, - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 19 - }, - "id": 8, - "panels": [], - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "refId": "A" - } - ], - "title": "OETH General", - "type": "row" - }, - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 9, - "w": 12, - "x": 0, - "y": 20 - }, - "id": 2, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "group": [], - "metricColumn": "none", - "rawQuery": true, - "rawSql": "SELECT\n \"timestamp\" AS \"time\",\n frx_eth / 1000000000000000000 as frx_eth,\n r_eth / 1000000000000000000 as r_eth,\n st_eth / 1000000000000000000 as st_eth,\n weth / 1000000000000000000 as weth\nFROM oeth_vault\nWHERE\n $__timeFilter(\"timestamp\")\nORDER BY 1", - "refId": "A", - "select": [ - [ - { - "params": [ - "frx_eth" - ], - "type": "column" - } - ], - [ - { - "params": [ - "r_eth" - ], - "type": "column" - } - ], - [ - { - "params": [ - "st_eth" - ], - "type": "column" - } - ], - [ - { - "params": [ - "weth" - ], - "type": "column" - } - ] - ], - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "oeth_vault", - "timeColumn": "\"timestamp\"", - "timeColumnType": "timestamptz", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - } - ] - } - ], - "title": "Vault Balances", - "type": "timeseries" - }, - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisGridShow": true, - "axisLabel": "", - "axisPlacement": "auto", - "axisSoftMin": 0, - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 9, - "w": 12, - "x": 12, - "y": 20 - }, - "id": 4, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "group": [], - "metricColumn": "none", - "rawQuery": true, - "rawSql": "SELECT\n \"timestamp\" AS \"time\",\n total_supply / 1e18 as total_supply,\n rebasing_supply / 1e18 as rebasing_supply,\n non_rebasing_supply / 1e18 as non_rebasing_supply\nFROM oeth\nWHERE\n $__timeFilter(\"timestamp\")\nORDER BY 1", - "refId": "A", - "select": [ - [ - { - "params": [ - "total_supply" - ], - "type": "column" - } - ], - [ - { - "params": [ - "rebasing_supply" - ], - "type": "column" - } - ], - [ - { - "params": [ - "non_rebasing_supply" - ], - "type": "column" - } - ] - ], - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "oeth", - "timeColumn": "\"timestamp\"", - "timeColumnType": "timestamptz", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - } - ] - } - ], - "title": "OETH Supply", - "type": "timeseries" - }, - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "max": 0.25, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "percentunit" - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "apy" - }, - "properties": [ - { - "id": "custom.lineWidth", - "value": 0 - }, - { - "id": "custom.fillOpacity", - "value": 16 - }, - { - "id": "custom.barAlignment", - "value": 0 - }, - { - "id": "custom.lineInterpolation", - "value": "stepBefore" - } - ] - } - ] - }, - "gridPos": { - "h": 12, - "w": 24, - "x": 0, - "y": 29 - }, - "id": 6, - "options": { - "legend": { - "calcs": [ - "lastNotNull" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "format": "time_series", - "group": [], - "metricColumn": "none", - "rawQuery": false, - "rawSql": "SELECT\n \"timestamp\" AS \"time\",\n apy7_day_avg,\n apy14_day_avg,\n apy30_day_avg,\n apy\nFROM oethapy\nWHERE\n $__timeFilter(\"timestamp\")\nORDER BY 1", - "refId": "A", - "select": [ - [ - { - "params": [ - "apy7_day_avg" - ], - "type": "column" - } - ], - [ - { - "params": [ - "apy14_day_avg" - ], - "type": "column" - } - ], - [ - { - "params": [ - "apy30_day_avg" - ], - "type": "column" - } - ], - [ - { - "params": [ - "apy" - ], - "type": "column" - } - ] - ], - "table": "oethapy", - "timeColumn": "\"timestamp\"", - "timeColumnType": "timestamptz", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - } - ] - } - ], - "title": "APY", - "type": "timeseries" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "decimals": 2, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 11, - "w": 12, - "x": 0, - "y": 41 - }, - "id": 38, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "group": [], - "metricColumn": "none", - "rawQuery": true, - "rawSql": "SELECT\n \"timestamp\" AS \"time\",\n yield_eth / 1e18 as yield\nFROM o_token_rebase\nWHERE\n $__timeFilter(\"timestamp\") AND chain_id = 1 AND otoken = '0x856c4efb76c1d1ae02e20ceb03a2a6a08b0b8dc3'\nORDER BY 1", - "refId": "A", - "select": [ - [ - { - "params": [ - "yield" - ], - "type": "column" - }, - { - "params": [ - "sum" - ], - "type": "window" - }, - { - "params": [ - "yield" - ], - "type": "alias" - } - ] - ], - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "oeth_rebase", - "timeColumn": "\"timestamp\"", - "timeColumnType": "timestamptz", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - } - ] - } - ], - "title": "Yield", - "type": "timeseries" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "decimals": 2, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 11, - "w": 12, - "x": 12, - "y": 41 - }, - "id": 37, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "group": [], - "metricColumn": "none", - "rawQuery": true, - "rawSql": "SELECT\n \"timestamp\" AS \"time\",\n fee_eth / 1e18 as fee\nFROM o_token_rebase\nWHERE\n $__timeFilter(\"timestamp\") AND chain_id = 1 AND otoken = '0x856c4efb76c1d1ae02e20ceb03a2a6a08b0b8dc3'\nORDER BY 1", - "refId": "A", - "select": [ - [ - { - "params": [ - "fee" - ], - "type": "column" - }, - { - "params": [ - "sum" - ], - "type": "window" - }, - { - "params": [ - "fee" - ], - "type": "alias" - } - ] - ], - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "oeth_rebase", - "timeColumn": "\"timestamp\"", - "timeColumnType": "timestamptz", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - } - ] - } - ], - "title": "Fees", - "type": "timeseries" - }, - { - "collapsed": false, - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 52 - }, - "id": 40, - "panels": [], - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "refId": "A" - } - ], - "title": "OETH Strategies", - "type": "row" - }, - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 53 - }, - "id": 44, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "group": [], - "metricColumn": "asset", - "rawQuery": true, - "rawSql": "SELECT\n \"timestamp\" AS \"time\",\n asset AS metric,\n balance / 1e18 as balance\nFROM strategy_balance\nWHERE\n $__timeFilter(\"timestamp\") AND\n strategy = '0x1827f9ea98e0bf96550b2fc20f7233277fcd7e63'\nORDER BY 1,2", - "refId": "A", - "select": [ - [ - { - "params": [ - "balance" - ], - "type": "column" - } - ] - ], - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "strategy_balance", - "timeColumn": "\"timestamp\"", - "timeColumnType": "timestamptz", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - }, - { - "datatype": "text", - "name": "", - "params": [ - "strategy", - "=", - "'0x1827f9ea98e0bf96550b2fc20f7233277fcd7e63'" - ], - "type": "expression" - } - ] - } - ], - "title": "Convex ETH+OETH (AMO)", - "type": "timeseries" - }, - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 53 - }, - "id": 43, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "group": [], - "metricColumn": "asset", - "rawQuery": true, - "rawSql": "SELECT\n \"timestamp\" AS \"time\",\n asset AS metric,\n balance / 1e18 as balance\nFROM strategy_balance\nWHERE\n $__timeFilter(\"timestamp\") AND\n strategy = '0x3ff8654d633d4ea0fae24c52aec73b4a20d0d0e5'\nORDER BY 1,2", - "refId": "A", - "select": [ - [ - { - "params": [ - "balance" - ], - "type": "column" - } - ] - ], - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "strategy_balance", - "timeColumn": "\"timestamp\"", - "timeColumnType": "timestamptz", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - }, - { - "datatype": "text", - "name": "", - "params": [ - "strategy", - "=", - "'0x3ff8654d633d4ea0fae24c52aec73b4a20d0d0e5'" - ], - "type": "expression" - } - ] - } - ], - "title": "Frax Staking", - "type": "timeseries" - }, - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 61 - }, - "id": 42, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "group": [], - "metricColumn": "asset", - "rawQuery": true, - "rawSql": "SELECT\n \"timestamp\" AS \"time\",\n asset AS metric,\n balance / 1e18 as balance\nFROM strategy_balance\nWHERE\n $__timeFilter(\"timestamp\") AND\n strategy = '0xc1fc9e5ec3058921ea5025d703cbe31764756319'\nORDER BY 1,2", - "refId": "A", - "select": [ - [ - { - "params": [ - "balance" - ], - "type": "column" - } - ] - ], - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "strategy_balance", - "timeColumn": "\"timestamp\"", - "timeColumnType": "timestamptz", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - }, - { - "datatype": "text", - "name": "", - "params": [ - "strategy", - "=", - "'0xc1fc9e5ec3058921ea5025d703cbe31764756319'" - ], - "type": "expression" - } - ] - } - ], - "title": "Morpho Aave", - "type": "timeseries" - }, - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "decimals": 2, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "__systemRef": "hideSeriesFrom", - "matcher": { - "id": "byNames", - "options": { - "mode": "exclude", - "names": [ - "rETH", - "WETH" - ], - "prefix": "All except:", - "readOnly": true - } - }, - "properties": [ - { - "id": "custom.hideFrom", - "value": { - "legend": true, - "tooltip": true, - "viz": true - } - } - ] - } - ] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 61 - }, - "id": 41, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "group": [], - "metricColumn": "asset", - "rawQuery": true, - "rawSql": "SELECT\n \"timestamp\" AS \"time\",\n asset AS metric,\n balance / 1e18 as balance\nFROM strategy_balance\nWHERE\n $__timeFilter(\"timestamp\") AND\n strategy = '0x49109629ac1deb03f2e9b2fe2ac4a623e0e7dfdc'\nORDER BY 1,2", - "refId": "A", - "select": [ - [ - { - "params": [ - "balance" - ], - "type": "column" - } - ] - ], - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "strategy_balance", - "timeColumn": "\"timestamp\"", - "timeColumnType": "timestamptz", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - }, - { - "datatype": "text", - "name": "", - "params": [ - "strategy", - "=", - "'0x49109629ac1deb03f2e9b2fe2ac4a623e0e7dfdc'" - ], - "type": "expression" - } - ] - } - ], - "title": "Aura Balancer Metapool", - "transformations": [ - { - "id": "calculateField", - "options": { - "alias": "WETH", - "binary": { - "left": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2", - "operator": "/", - "reducer": "sum", - "right": "1000000000000000000" - }, - "mode": "binary", - "reduce": { - "reducer": "sum" - } - } - }, - { - "id": "calculateField", - "options": { - "alias": "rETH", - "binary": { - "left": "0xae78736Cd615f374D3085123A210448E74Fc6393", - "operator": "/", - "reducer": "sum", - "right": "1000000000000000000" - }, - "mode": "binary", - "reduce": { - "reducer": "sum" - } - } - } - ], - "type": "timeseries" - }, - { - "collapsed": false, - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 69 - }, - "id": 10, - "panels": [], - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "refId": "A" - } - ], - "title": "OETH/ETH Curve Metapool", - "type": "row" - }, - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 70 - }, - "id": 12, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "group": [], - "metricColumn": "none", - "rawQuery": true, - "rawSql": "SELECT\n \"timestamp\" AS \"time\",\n balance0 / 1e18 as balance0,\n balance1 / 1e18 as balance1\nFROM curve_pool_balance\nWHERE\n $__timeFilter(\"timestamp\") AND\n address = '0x94b17476a93b3262d87b9a326965d1e91f9c13e7'\nORDER BY 1", - "refId": "A", - "select": [ - [ - { - "params": [ - "balance0" - ], - "type": "column" - } - ], - [ - { - "params": [ - "balance1" - ], - "type": "column" - } - ] - ], - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "curve_pool_balance", - "timeColumn": "\"timestamp\"", - "timeColumnType": "timestamptz", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - }, - { - "datatype": "text", - "name": "", - "params": [ - "address", - "=", - "'0x94b17476a93b3262d87b9a326965d1e91f9c13e7'" - ], - "type": "expression" - } - ] - } - ], - "title": "Balances", - "type": "timeseries" - }, - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "__systemRef": "hideSeriesFrom", - "matcher": { - "id": "byNames", - "options": { - "mode": "exclude", - "names": [ - "balance0_p", - "balance1_p" - ], - "prefix": "All except:", - "readOnly": true - } - }, - "properties": [ - { - "id": "custom.hideFrom", - "value": { - "legend": true, - "tooltip": true, - "viz": true - } - } - ] - } - ] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 70 - }, - "id": 13, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "format": "time_series", - "group": [], - "hide": false, - "metricColumn": "none", - "rawQuery": false, - "rawSql": "SELECT\n \"timestamp\" AS \"time\",\n balance0,\n balance1\nFROM curve_pool_balance\nWHERE\n $__timeFilter(\"timestamp\") AND\n address = '0x94b17476a93b3262d87b9a326965d1e91f9c13e7'\nORDER BY 1", - "refId": "A", - "select": [ - [ - { - "params": [ - "balance0" - ], - "type": "column" - } - ], - [ - { - "params": [ - "balance1" - ], - "type": "column" - } - ] - ], - "table": "curve_pool_balance", - "timeColumn": "\"timestamp\"", - "timeColumnType": "timestamptz", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - }, - { - "datatype": "text", - "name": "", - "params": [ - "address", - "=", - "'0x94b17476a93b3262d87b9a326965d1e91f9c13e7'" - ], - "type": "expression" - } - ] - } - ], - "title": "Balance %", - "transformations": [ - { - "id": "calculateField", - "options": { - "binary": { - "left": "balance0", - "operator": "+", - "reducer": "sum", - "right": "balance1" - }, - "mode": "binary", - "reduce": { - "reducer": "sum" - } - } - }, - { - "id": "calculateField", - "options": { - "alias": "balance0_p", - "binary": { - "left": "balance0", - "operator": "/", - "reducer": "sum", - "right": "balance0 + balance1" - }, - "mode": "binary", - "reduce": { - "reducer": "sum" - } - } - }, - { - "id": "calculateField", - "options": { - "alias": "balance1_p", - "binary": { - "left": "balance1", - "operator": "/", - "reducer": "sum", - "right": "balance0 + balance1" - }, - "mode": "binary", - "reduce": { - "reducer": "sum" - } - } - } - ], - "type": "timeseries" - }, - { - "collapsed": false, - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 78 - }, - "id": 15, - "panels": [], - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "refId": "A" - } - ], - "title": "WETH/stETH Curve Metapool", - "type": "row" - }, - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 79 - }, - "id": 16, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "group": [], - "metricColumn": "none", - "rawQuery": true, - "rawSql": "SELECT\n \"timestamp\" AS \"time\",\n balance0 / 1e18 as balance0,\n balance1 / 1e18 as balance1\nFROM curve_pool_balance\nWHERE\n $__timeFilter(\"timestamp\") AND\n address = '0x828b154032950c8ff7cf8085d841723db2696056'\nORDER BY 1", - "refId": "A", - "select": [ - [ - { - "params": [ - "balance0" - ], - "type": "column" - } - ], - [ - { - "params": [ - "balance1" - ], - "type": "column" - } - ] - ], - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "curve_pool_balance", - "timeColumn": "\"timestamp\"", - "timeColumnType": "timestamptz", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - }, - { - "datatype": "text", - "name": "", - "params": [ - "address", - "=", - "'0x828b154032950c8ff7cf8085d841723db2696056'" - ], - "type": "expression" - } - ] - } - ], - "title": "Balances", - "type": "timeseries" - }, - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "__systemRef": "hideSeriesFrom", - "matcher": { - "id": "byNames", - "options": { - "mode": "exclude", - "names": [ - "balance0_p", - "balance1_p" - ], - "prefix": "All except:", - "readOnly": true - } - }, - "properties": [ - { - "id": "custom.hideFrom", - "value": { - "legend": true, - "tooltip": true, - "viz": true - } - } - ] - } - ] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 79 - }, - "id": 17, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "format": "time_series", - "group": [], - "hide": false, - "metricColumn": "none", - "rawQuery": false, - "rawSql": "SELECT\n \"timestamp\" AS \"time\",\n balance0,\n balance1\nFROM curve_pool_balance\nWHERE\n $__timeFilter(\"timestamp\") AND\n address = '0x828b154032950c8ff7cf8085d841723db2696056'\nORDER BY 1", - "refId": "A", - "select": [ - [ - { - "params": [ - "balance0" - ], - "type": "column" - } - ], - [ - { - "params": [ - "balance1" - ], - "type": "column" - } - ] - ], - "table": "curve_pool_balance", - "timeColumn": "\"timestamp\"", - "timeColumnType": "timestamptz", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - }, - { - "datatype": "text", - "name": "", - "params": [ - "address", - "=", - "'0x828b154032950c8ff7cf8085d841723db2696056'" - ], - "type": "expression" - } - ] - } - ], - "title": "Balance %", - "transformations": [ - { - "id": "calculateField", - "options": { - "binary": { - "left": "balance0", - "operator": "+", - "reducer": "sum", - "right": "balance1" - }, - "mode": "binary", - "reduce": { - "reducer": "sum" - } - } - }, - { - "id": "calculateField", - "options": { - "alias": "balance0_p", - "binary": { - "left": "balance0", - "operator": "/", - "reducer": "sum", - "right": "balance0 + balance1" - }, - "mode": "binary", - "reduce": { - "reducer": "sum" - } - } - }, - { - "id": "calculateField", - "options": { - "alias": "balance1_p", - "binary": { - "left": "balance1", - "operator": "/", - "reducer": "sum", - "right": "balance0 + balance1" - }, - "mode": "binary", - "reduce": { - "reducer": "sum" - } - } - } - ], - "type": "timeseries" - }, - { - "collapsed": false, - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 87 - }, - "id": 19, - "panels": [], - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "refId": "A" - } - ], - "title": "ETH/stETH Curve Metapool", - "type": "row" - }, - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 88 - }, - "id": 20, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "group": [], - "metricColumn": "none", - "rawQuery": true, - "rawSql": "SELECT\n \"timestamp\" AS \"time\",\n balance0 / 1e18 as balance0,\n balance1 / 1e18 as balance1\nFROM curve_pool_balance\nWHERE\n $__timeFilter(\"timestamp\") AND\n address = '0xdc24316b9ae028f1497c275eb9192a3ea0f67022'\nORDER BY 1", - "refId": "A", - "select": [ - [ - { - "params": [ - "balance0" - ], - "type": "column" - } - ], - [ - { - "params": [ - "balance1" - ], - "type": "column" - } - ] - ], - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "curve_pool_balance", - "timeColumn": "\"timestamp\"", - "timeColumnType": "timestamptz", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - }, - { - "datatype": "text", - "name": "", - "params": [ - "address", - "=", - "'0xdc24316b9ae028f1497c275eb9192a3ea0f67022'" - ], - "type": "expression" - } - ] - } - ], - "title": "Balances", - "type": "timeseries" - }, - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "__systemRef": "hideSeriesFrom", - "matcher": { - "id": "byNames", - "options": { - "mode": "exclude", - "names": [ - "balance0_p", - "balance1_p" - ], - "prefix": "All except:", - "readOnly": true - } - }, - "properties": [ - { - "id": "custom.hideFrom", - "value": { - "legend": true, - "tooltip": true, - "viz": true - } - } - ] - } - ] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 88 - }, - "id": 21, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "format": "time_series", - "group": [], - "hide": false, - "metricColumn": "none", - "rawQuery": false, - "rawSql": "SELECT\n \"timestamp\" AS \"time\",\n balance0,\n balance1\nFROM curve_pool_balance\nWHERE\n $__timeFilter(\"timestamp\") AND\n address = '0xdc24316b9ae028f1497c275eb9192a3ea0f67022'\nORDER BY 1", - "refId": "A", - "select": [ - [ - { - "params": [ - "balance0" - ], - "type": "column" - } - ], - [ - { - "params": [ - "balance1" - ], - "type": "column" - } - ] - ], - "table": "curve_pool_balance", - "timeColumn": "\"timestamp\"", - "timeColumnType": "timestamptz", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - }, - { - "datatype": "text", - "name": "", - "params": [ - "address", - "=", - "'0xdc24316b9ae028f1497c275eb9192a3ea0f67022'" - ], - "type": "expression" - } - ] - } - ], - "title": "Balance %", - "transformations": [ - { - "id": "calculateField", - "options": { - "binary": { - "left": "balance0", - "operator": "+", - "reducer": "sum", - "right": "balance1" - }, - "mode": "binary", - "reduce": { - "reducer": "sum" - } - } - }, - { - "id": "calculateField", - "options": { - "alias": "balance0_p", - "binary": { - "left": "balance0", - "operator": "/", - "reducer": "sum", - "right": "balance0 + balance1" - }, - "mode": "binary", - "reduce": { - "reducer": "sum" - } - } - }, - { - "id": "calculateField", - "options": { - "alias": "balance1_p", - "binary": { - "left": "balance1", - "operator": "/", - "reducer": "sum", - "right": "balance0 + balance1" - }, - "mode": "binary", - "reduce": { - "reducer": "sum" - } - } - } - ], - "type": "timeseries" - }, - { - "collapsed": false, - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 96 - }, - "id": 23, - "panels": [], - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "refId": "A" - } - ], - "title": "ETH/frxETH Curve Metapool", - "type": "row" - }, - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 97 - }, - "id": 24, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "group": [], - "metricColumn": "none", - "rawQuery": true, - "rawSql": "SELECT\n \"timestamp\" AS \"time\",\n balance0 / 1e18 as balance0,\n balance1 / 1e18 as balance1\nFROM curve_pool_balance\nWHERE\n $__timeFilter(\"timestamp\") AND\n address = '0xa1f8a6807c402e4a15ef4eba36528a3fed24e577'\nORDER BY 1", - "refId": "A", - "select": [ - [ - { - "params": [ - "balance0" - ], - "type": "column" - } - ], - [ - { - "params": [ - "balance1" - ], - "type": "column" - } - ] - ], - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "curve_pool_balance", - "timeColumn": "\"timestamp\"", - "timeColumnType": "timestamptz", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - }, - { - "datatype": "text", - "name": "", - "params": [ - "address", - "=", - "'0xa1f8a6807c402e4a15ef4eba36528a3fed24e577'" - ], - "type": "expression" - } - ] - } - ], - "title": "Balances", - "type": "timeseries" - }, - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "__systemRef": "hideSeriesFrom", - "matcher": { - "id": "byNames", - "options": { - "mode": "exclude", - "names": [ - "balance0_p", - "balance1_p" - ], - "prefix": "All except:", - "readOnly": true - } - }, - "properties": [ - { - "id": "custom.hideFrom", - "value": { - "legend": true, - "tooltip": true, - "viz": true - } - } - ] - } - ] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 97 - }, - "id": 25, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "format": "time_series", - "group": [], - "hide": false, - "metricColumn": "none", - "rawQuery": false, - "rawSql": "SELECT\n \"timestamp\" AS \"time\",\n balance0,\n balance1\nFROM curve_pool_balance\nWHERE\n $__timeFilter(\"timestamp\") AND\n address = '0xa1f8a6807c402e4a15ef4eba36528a3fed24e577'\nORDER BY 1", - "refId": "A", - "select": [ - [ - { - "params": [ - "balance0" - ], - "type": "column" - } - ], - [ - { - "params": [ - "balance1" - ], - "type": "column" - } - ] - ], - "table": "curve_pool_balance", - "timeColumn": "\"timestamp\"", - "timeColumnType": "timestamptz", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - }, - { - "datatype": "text", - "name": "", - "params": [ - "address", - "=", - "'0xa1f8a6807c402e4a15ef4eba36528a3fed24e577'" - ], - "type": "expression" - } - ] - } - ], - "title": "Balance %", - "transformations": [ - { - "id": "calculateField", - "options": { - "binary": { - "left": "balance0", - "operator": "+", - "reducer": "sum", - "right": "balance1" - }, - "mode": "binary", - "reduce": { - "reducer": "sum" - } - } - }, - { - "id": "calculateField", - "options": { - "alias": "balance0_p", - "binary": { - "left": "balance0", - "operator": "/", - "reducer": "sum", - "right": "balance0 + balance1" - }, - "mode": "binary", - "reduce": { - "reducer": "sum" - } - } - }, - { - "id": "calculateField", - "options": { - "alias": "balance1_p", - "binary": { - "left": "balance1", - "operator": "/", - "reducer": "sum", - "right": "balance0 + balance1" - }, - "mode": "binary", - "reduce": { - "reducer": "sum" - } - } - } - ], - "type": "timeseries" - }, - { - "collapsed": false, - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 105 - }, - "id": 27, - "panels": [], - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "refId": "A" - } - ], - "title": "ETH/rETH Curve Metapool", - "type": "row" - }, - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 106 - }, - "id": 28, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "group": [], - "metricColumn": "none", - "rawQuery": true, - "rawSql": "SELECT\n \"timestamp\" AS \"time\",\n balance0 / 1e18 as balance0,\n balance1 / 1e18 as balance1\nFROM curve_pool_balance\nWHERE\n $__timeFilter(\"timestamp\") AND\n address = '0x0f3159811670c117c372428d4e69ac32325e4d0f'\nORDER BY 1", - "refId": "A", - "select": [ - [ - { - "params": [ - "balance0" - ], - "type": "column" - } - ], - [ - { - "params": [ - "balance1" - ], - "type": "column" - } - ] - ], - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "curve_pool_balance", - "timeColumn": "\"timestamp\"", - "timeColumnType": "timestamptz", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - }, - { - "datatype": "text", - "name": "", - "params": [ - "address", - "=", - "'0x0f3159811670c117c372428d4e69ac32325e4d0f'" - ], - "type": "expression" - } - ] - } - ], - "title": "Balances", - "type": "timeseries" - }, - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "__systemRef": "hideSeriesFrom", - "matcher": { - "id": "byNames", - "options": { - "mode": "exclude", - "names": [ - "balance0_p", - "balance1_p" - ], - "prefix": "All except:", - "readOnly": true - } - }, - "properties": [ - { - "id": "custom.hideFrom", - "value": { - "legend": true, - "tooltip": true, - "viz": true - } - } - ] - } - ] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 106 - }, - "id": 29, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "format": "time_series", - "group": [], - "hide": false, - "metricColumn": "none", - "rawQuery": false, - "rawSql": "SELECT\n \"timestamp\" AS \"time\",\n balance0,\n balance1\nFROM curve_pool_balance\nWHERE\n $__timeFilter(\"timestamp\") AND\n address = '0x0f3159811670c117c372428d4e69ac32325e4d0f'\nORDER BY 1", - "refId": "A", - "select": [ - [ - { - "params": [ - "balance0" - ], - "type": "column" - } - ], - [ - { - "params": [ - "balance1" - ], - "type": "column" - } - ] - ], - "table": "curve_pool_balance", - "timeColumn": "\"timestamp\"", - "timeColumnType": "timestamptz", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - }, - { - "datatype": "text", - "name": "", - "params": [ - "address", - "=", - "'0x0f3159811670c117c372428d4e69ac32325e4d0f'" - ], - "type": "expression" - } - ] - } - ], - "title": "Balance %", - "transformations": [ - { - "id": "calculateField", - "options": { - "binary": { - "left": "balance0", - "operator": "+", - "reducer": "sum", - "right": "balance1" - }, - "mode": "binary", - "reduce": { - "reducer": "sum" - } - } - }, - { - "id": "calculateField", - "options": { - "alias": "balance0_p", - "binary": { - "left": "balance0", - "operator": "/", - "reducer": "sum", - "right": "balance0 + balance1" - }, - "mode": "binary", - "reduce": { - "reducer": "sum" - } - } - }, - { - "id": "calculateField", - "options": { - "alias": "balance1_p", - "binary": { - "left": "balance1", - "operator": "/", - "reducer": "sum", - "right": "balance0 + balance1" - }, - "mode": "binary", - "reduce": { - "reducer": "sum" - } - } - } - ], - "type": "timeseries" - }, - { - "collapsed": true, - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 114 - }, - "id": 31, - "panels": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 104 - }, - "id": 34, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "group": [], - "metricColumn": "none", - "rawQuery": true, - "rawSql": "SELECT\n \"timestamp\" AS \"time\",\n eth_owned / 1e18 as eth_owned,\n oeth_owned / 1e18 as oeth_owned\nFROM oeth_curve_lp\nWHERE\n $__timeFilter(\"timestamp\")\nORDER BY 1", - "refId": "A", - "select": [ - [ - { - "params": [ - "eth_owned" - ], - "type": "column" - } - ], - [ - { - "params": [ - "oeth_owned" - ], - "type": "column" - } - ] - ], - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "oeth_curve_lp", - "timeColumn": "\"timestamp\"", - "timeColumnType": "timestamptz", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - } - ] - } - ], - "title": "Curve AMO", - "transformations": [], - "type": "timeseries" - }, - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 104 - }, - "id": 33, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "group": [], - "metricColumn": "none", - "rawQuery": true, - "rawSql": "SELECT\n \"timestamp\" AS \"time\",\n sfrx_eth / 1e18 as sfrx_eth\nFROM oeth_frax_staking\nWHERE\n $__timeFilter(\"timestamp\")\nORDER BY 1", - "refId": "A", - "select": [ - [ - { - "params": [ - "sfrx_eth" - ], - "type": "column" - } - ] - ], - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "oeth_frax_staking", - "timeColumn": "\"timestamp\"", - "timeColumnType": "timestamptz", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - } - ] - } - ], - "title": "FraxETH", - "transformations": [], - "type": "timeseries" - }, - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 112 - }, - "id": 35, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "group": [], - "metricColumn": "none", - "rawQuery": true, - "rawSql": "SELECT\n \"timestamp\" AS \"time\",\n r_eth / 1e18 as r_eth,\n weth / 1e18 as weth\nFROM oeth_balancer_meta_pool_strategy\nWHERE\n $__timeFilter(\"timestamp\")\nORDER BY 1", - "refId": "A", - "select": [ - [ - { - "params": [ - "r_eth" - ], - "type": "column" - } - ], - [ - { - "params": [ - "weth" - ], - "type": "column" - } - ] - ], - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "oeth_balancer_meta_pool_strategy", - "timeColumn": "\"timestamp\"", - "timeColumnType": "timestamptz", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - } - ] - } - ], - "title": "Aura Balancer Metapool", - "transformations": [], - "type": "timeseries" - } - ], - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "refId": "A" - } - ], - "title": "OETH Strategies (Old method)", - "type": "row" - } - ], - "refresh": "", - "schemaVersion": 39, - "tags": [ - "oeth" - ], - "templating": { - "list": [] - }, - "time": { - "from": "now-30d", - "to": "now" - }, - "timeRangeUpdatedDuringEditOrView": false, - "timepicker": {}, - "timezone": "", - "title": "OETH Dashboard", - "uid": "5RW4zO7Sk", - "version": 28, - "weekStart": "" -} \ No newline at end of file diff --git a/grafana/oeth-liquidity.json b/grafana/oeth-liquidity.json deleted file mode 100644 index 6c85f0ee..00000000 --- a/grafana/oeth-liquidity.json +++ /dev/null @@ -1,537 +0,0 @@ -{ - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": { - "type": "grafana", - "uid": "-- Grafana --" - }, - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "type": "dashboard" - } - ] - }, - "editable": true, - "fiscalYearStartMonth": 0, - "graphTooltip": 0, - "id": 32, - "links": [], - "liveNow": false, - "panels": [ - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 0 - }, - "id": 6, - "panels": [], - "title": "LST Details", - "type": "row" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "description": "For details on what this is comprised of, see below.", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 9, - "w": 12, - "x": 0, - "y": 1 - }, - "id": 2, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "10.3.0-64399", - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "rawQuery": true, - "rawSql": "with balances as (\n select\n pb.timestamp as time,\n pb.address,\n p.name,\n p.token0 as token,\n pb.balance0 / 1e18 as balance\n from curve_pool p\n inner join curve_pool_balance pb\n on p.address = pb.address\n union all\n select\n pb.timestamp as time,\n pb.address,\n p.name,\n p.token1 as token,\n pb.balance1 / 1e18 as balance\n from curve_pool p\n inner join curve_pool_balance pb\n on p.address = pb.address\n union all\n select\n pb.timestamp as time,\n pb.address,\n p.name,\n p.token2 as token,\n pb.balance2 / 1e18 as balance\n from curve_pool p\n inner join curve_pool_balance pb\n on p.address = pb.address\n union all\n select\n pb.timestamp as time,\n pb.address,\n p.name,\n p.token0 as token,\n pb.balance0 / 1e18 as balance\n from balancer_pool p\n inner join balancer_pool_balance pb\n on p.address = pb.address\n union all\n select\n pb.timestamp as time,\n pb.address,\n p.name,\n p.token1 as token,\n pb.balance1 / 1e18 as balance\n from balancer_pool p\n inner join balancer_pool_balance pb\n on p.address = pb.address\n union all\n select\n pb.timestamp as time,\n pb.address,\n p.name,\n p.token2 as token,\n pb.balance2 / 1e18 as balance\n from balancer_pool p\n inner join balancer_pool_balance pb\n on p.address = pb.address\n union all\n select\n pb.timestamp as time,\n pb.address,\n p.name,\n p.token3 as token,\n pb.balance3 / 1e18 as balance\n from balancer_pool p\n inner join balancer_pool_balance pb\n on p.address = pb.address\n union all\n select\n pb.timestamp as time,\n pb.address,\n p.name,\n p.token_a as token,\n pb.bin_balance_a / 1e18 as balance\n from maverick_pool p\n inner join maverick_pool_balance pb\n on p.address = pb.address\n union all\n select\n pb.timestamp as time,\n pb.address,\n p.name,\n p.token_b as token,\n pb.bin_balance_b / 1e18 as balance\n from maverick_pool p\n inner join maverick_pool_balance pb\n on p.address = pb.address\n),\n pathways as (\n select\n b_entry.time,\n b_entry.address,\n b_entry.name,\n b_entry.token as entry_token,\n b_entry.balance as entry_balance,\n b_exit.token as exit_token,\n b_exit.balance as exit_balance\n from balances b_entry\n inner join balances b_exit\n on b_entry.time = b_exit.time and b_entry.address = b_exit.address and b_entry.token != b_exit.token\n),\n result as (\n select\n date(p.time) as time,\n ls.type,\n ls.address,\n p.name,\n p.entry_token,\n entry_a.symbol as entry_symbol,\n p.entry_balance,\n p.exit_token,\n exit_a.symbol as exit_symbol,\n p.exit_balance,\n ROW_NUMBER()\n OVER (PARTITION BY ls.type, ls.address, p.name, entry_a.symbol, exit_a.symbol, DATE(p.time) ORDER BY p.time DESC) as rn\n from liquidity_source ls\n inner join pathways p\n on (ls.token = p.entry_token or ls.token = p.exit_token) and p.address = ls.address\n inner join oeth_asset entry_a\n on entry_a.address = p.entry_token\n inner join oeth_asset exit_a\n on exit_a.address = p.exit_token\n)\n\nselect\n time,\n case\n when exit_symbol = 'WETH' then 'ETH/WETH'\n when exit_symbol = 'ETH' then 'ETH/WETH'\n else exit_symbol end as symbol,\n sum(exit_balance) as balance\nfrom result\nwhere rn = 1 and $__timeFilter(time) \ngroup by time, symbol\norder by time", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - } - } - ], - "title": "LST Liquidity", - "type": "timeseries" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 9, - "w": 12, - "x": 12, - "y": 1 - }, - "id": 3, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "desc" - } - }, - "pluginVersion": "10.3.0-64399", - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "rawQuery": true, - "rawSql": "with balances as (\n select\n pb.timestamp as time,\n pb.address,\n p.name,\n p.token0 as token,\n pb.balance0 / 1e18 as balance\n from curve_pool p\n inner join curve_pool_balance pb\n on p.address = pb.address\n union all\n select\n pb.timestamp as time,\n pb.address,\n p.name,\n p.token1 as token,\n pb.balance1 / 1e18 as balance\n from curve_pool p\n inner join curve_pool_balance pb\n on p.address = pb.address\n union all\n select\n pb.timestamp as time,\n pb.address,\n p.name,\n p.token2 as token,\n pb.balance2 / 1e18 as balance\n from curve_pool p\n inner join curve_pool_balance pb\n on p.address = pb.address\n union all\n select\n pb.timestamp as time,\n pb.address,\n p.name,\n p.token0 as token,\n pb.balance0 / 1e18 as balance\n from balancer_pool p\n inner join balancer_pool_balance pb\n on p.address = pb.address\n union all\n select\n pb.timestamp as time,\n pb.address,\n p.name,\n p.token1 as token,\n pb.balance1 / 1e18 as balance\n from balancer_pool p\n inner join balancer_pool_balance pb\n on p.address = pb.address\n union all\n select\n pb.timestamp as time,\n pb.address,\n p.name,\n p.token2 as token,\n pb.balance2 / 1e18 as balance\n from balancer_pool p\n inner join balancer_pool_balance pb\n on p.address = pb.address\n union all\n select\n pb.timestamp as time,\n pb.address,\n p.name,\n p.token3 as token,\n pb.balance3 / 1e18 as balance\n from balancer_pool p\n inner join balancer_pool_balance pb\n on p.address = pb.address\n union all\n select\n pb.timestamp as time,\n pb.address,\n p.name,\n p.token_a as token,\n pb.bin_balance_a / 1e18 as balance\n from maverick_pool p\n inner join maverick_pool_balance pb\n on p.address = pb.address\n union all\n select\n pb.timestamp as time,\n pb.address,\n p.name,\n p.token_b as token,\n pb.bin_balance_b / 1e18 as balance\n from maverick_pool p\n inner join maverick_pool_balance pb\n on p.address = pb.address\n),\n pathways as (\n select\n b_entry.time,\n b_entry.address,\n b_entry.name,\n b_entry.token as entry_token,\n b_entry.balance as entry_balance,\n b_exit.token as exit_token,\n b_exit.balance as exit_balance\n from balances b_entry\n inner join balances b_exit\n on b_entry.time = b_exit.time and b_entry.address = b_exit.address and b_entry.token != b_exit.token\n),\n result as (\n select\n date(p.time) as time,\n ls.type,\n ls.address,\n p.name,\n p.entry_token,\n entry_a.symbol as entry_symbol,\n p.entry_balance,\n p.exit_token,\n exit_a.symbol as exit_symbol,\n p.exit_balance,\n ROW_NUMBER()\n OVER (PARTITION BY ls.type, ls.address, p.name, entry_a.symbol, exit_a.symbol, DATE(p.time) ORDER BY p.time DESC) as rn\n from liquidity_source ls\n inner join pathways p\n on (ls.token = p.entry_token or ls.token = p.exit_token) and p.address = ls.address\n inner join oeth_asset entry_a\n on entry_a.address = p.entry_token\n inner join oeth_asset exit_a\n on exit_a.address = p.exit_token\n),\n totals as (\n select\n date(time) as time,\n sum(exit_balance) as total\n from result\n where rn = 1\n group by date(time)\n)\n\n\nselect\n result.time,\n case\n when exit_symbol = 'WETH' then 'ETH/WETH'\n when exit_symbol = 'ETH' then 'ETH/WETH'\n else exit_symbol end as symbol,\n sum(exit_balance) / total as \"%\"\nfrom result\ninner join totals\n on result.time = totals.time\nwhere rn = 1 and $__timeFilter(result.time) \ngroup by result.time,\n symbol,\n totals.total\norder by time", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - } - } - ], - "title": "LST Liquidity %", - "type": "timeseries" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "custom": { - "align": "center", - "cellOptions": { - "type": "auto" - }, - "inspect": false - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "address" - }, - "properties": [ - { - "id": "custom.width", - "value": 300 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "name" - }, - "properties": [ - { - "id": "custom.width", - "value": 300 - } - ] - }, - { - "matcher": { - "id": "byRegexp", - "options": "/.*_balance/" - }, - "properties": [ - { - "id": "custom.align", - "value": "right" - } - ] - } - ] - }, - "gridPos": { - "h": 16, - "w": 18, - "x": 0, - "y": 10 - }, - "id": 1, - "options": { - "cellHeight": "sm", - "footer": { - "countRows": false, - "fields": "", - "reducer": [ - "sum" - ], - "show": false - }, - "showHeader": true, - "sortBy": [] - }, - "pluginVersion": "11.1.0-69622", - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "table", - "rawQuery": true, - "rawSql": "with balances as (\n select\n pb.timestamp as time,\n pb.address,\n p.name,\n p.token0 as token,\n pb.balance0 / 1e18 as balance\n from curve_pool p\n inner join curve_pool_balance pb\n on p.address = pb.address\n union all\n select\n pb.timestamp as time,\n pb.address,\n p.name,\n p.token1 as token,\n pb.balance1 / 1e18 as balance\n from curve_pool p\n inner join curve_pool_balance pb\n on p.address = pb.address\n union all\n select\n pb.timestamp as time,\n pb.address,\n p.name,\n p.token2 as token,\n pb.balance2 / 1e18 as balance\n from curve_pool p\n inner join curve_pool_balance pb\n on p.address = pb.address\n union all\n select\n pb.timestamp as time,\n pb.address,\n p.name,\n p.token0 as token,\n pb.balance0 / 1e18 as balance\n from balancer_pool p\n inner join balancer_pool_balance pb\n on p.address = pb.address\n union all\n select\n pb.timestamp as time,\n pb.address,\n p.name,\n p.token1 as token,\n pb.balance1 / 1e18 as balance\n from balancer_pool p\n inner join balancer_pool_balance pb\n on p.address = pb.address\n union all\n select\n pb.timestamp as time,\n pb.address,\n p.name,\n p.token2 as token,\n pb.balance2 / 1e18 as balance\n from balancer_pool p\n inner join balancer_pool_balance pb\n on p.address = pb.address\n union all\n select\n pb.timestamp as time,\n pb.address,\n p.name,\n p.token3 as token,\n pb.balance3 / 1e18 as balance\n from balancer_pool p\n inner join balancer_pool_balance pb\n on p.address = pb.address\n union all\n select\n pb.timestamp as time,\n pb.address,\n p.name,\n p.token_a as token,\n pb.bin_balance_a / 1e18 as balance\n from maverick_pool p\n inner join maverick_pool_balance pb\n on p.address = pb.address\n union all\n select\n pb.timestamp as time,\n pb.address,\n p.name,\n p.token_b as token,\n pb.bin_balance_b / 1e18 as balance\n from maverick_pool p\n inner join maverick_pool_balance pb\n on p.address = pb.address\n),\n pathways as (\n select\n b_entry.time,\n b_entry.address,\n b_entry.name,\n b_entry.token as left_token,\n b_entry.balance as left_balance,\n b_exit.token as right_token,\n b_exit.balance as right_balance\n from balances b_entry\n inner join balances b_exit\n on b_entry.time = b_exit.time and b_entry.address = b_exit.address and b_entry.token != b_exit.token\n),\n result as (\n select\n p.time,\n ls.type,\n ls.address,\n p.name,\n p.left_token,\n left_a.symbol as left_symbol,\n p.left_balance,\n p.right_token,\n right_a.symbol as right_symbol,\n p.right_balance,\n ROW_NUMBER()\n OVER (PARTITION BY ls.type, ls.address, p.name, left_a.symbol, right_a.symbol, DATE(p.time) ORDER BY p.time DESC) as rn\n from liquidity_source ls\n inner join pathways p\n on (ls.token = p.left_token or ls.token = p.right_token) and p.address = ls.address\n inner join oeth_asset left_a\n on left_a.address = p.left_token\n inner join oeth_asset right_a\n on right_a.address = p.right_token\n)\n\nselect\n left_symbol,\n left_balance,\n right_symbol,\n right_balance,\n type,\n name,\n address\nfrom result\nwhere rn = 1\n and date(time) = current_date\n and left_symbol not in ('WETH', 'ETH', 'OETH')\norder by left_symbol, right_symbol, address", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - } - } - ], - "title": "Liquidity By Pool", - "type": "table" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "custom": { - "align": "auto", - "cellOptions": { - "type": "auto" - }, - "inspect": false - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 16, - "w": 6, - "x": 18, - "y": 10 - }, - "id": 4, - "options": { - "cellHeight": "sm", - "footer": { - "countRows": false, - "fields": "", - "reducer": [ - "sum" - ], - "show": false - }, - "showHeader": true - }, - "pluginVersion": "11.1.0-69622", - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "table", - "rawQuery": true, - "rawSql": "select\n ls.address,\n type,\n symbol\nfrom\n liquidity_source ls\n inner join oeth_asset oa on ls.token = oa.address\norder by ls.type, ls.address, symbol", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - } - } - ], - "title": "Liquidity Sources", - "type": "table" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "ac0aaf4a-7c06-46fe-a735-3cd43be451a8" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 2, - "w": 24, - "x": 0, - "y": 26 - }, - "id": 5, - "options": { - "infinitePan": false, - "inlineEditing": true, - "panZoom": false, - "showAdvancedTypes": true - }, - "pluginVersion": "11.1.0-69622", - "type": "canvas" - } - ], - "refresh": "", - "schemaVersion": 39, - "tags": [], - "templating": { - "list": [] - }, - "time": { - "from": "now-6h", - "to": "now" - }, - "timeRangeUpdatedDuringEditOrView": false, - "timepicker": {}, - "timezone": "", - "title": "OETH Liquidity", - "uid": "e45f1fdb-43f2-43b5-b6ce-2a41fda42796", - "version": 14, - "weekStart": "" -} \ No newline at end of file diff --git a/grafana/oeth-strategy-earnings.json b/grafana/oeth-strategy-earnings.json deleted file mode 100644 index fd929a2b..00000000 --- a/grafana/oeth-strategy-earnings.json +++ /dev/null @@ -1,4348 +0,0 @@ -{ - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": { - "type": "grafana", - "uid": "-- Grafana --" - }, - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "type": "dashboard" - } - ] - }, - "editable": true, - "fiscalYearStartMonth": 0, - "graphTooltip": 1, - "id": 15, - "links": [], - "liveNow": false, - "panels": [ - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 0 - }, - "id": 43, - "panels": [], - "title": "Aggregate APY", - "type": "row" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic", - "seriesBy": "last" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepBefore", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "decimals": 2, - "fieldMinMax": false, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "percentunit" - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "apy" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "green", - "mode": "fixed" - } - }, - { - "id": "custom.fillOpacity", - "value": 10 - } - ] - } - ] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 1 - }, - "id": 44, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "rawQuery": true, - "rawSql": "SELECT\n \"timestamp\" AS \"time\",\n apy\nFROM\n oeth_daily_stat\nWHERE\n $__timeFilter(\"timestamp\")\n and timestamp > '2023-05-29' -- Because prior APY values mess up the chart and are *** nonsense *** to look at. \nORDER BY\n \"timestamp\" ASC", - "refId": "A", - "sql": { - "columns": [ - { - "alias": "\"time\"", - "parameters": [ - { - "name": "\"timestamp\"", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "apy7_day_avg", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "apy14_day_avg", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "apy30_day_avg", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "orderBy": { - "property": { - "name": [ - "\"timestamp\"" - ], - "type": "string" - }, - "type": "property" - }, - "orderByDirection": "ASC", - "whereJsonTree": { - "children1": [ - { - "id": "aa98bb98-4567-489a-bcde-f18c4a965f07", - "properties": { - "field": "\"timestamp\"", - "fieldSrc": "field", - "operator": "macros", - "value": [ - "timeFilter" - ], - "valueSrc": [ - "value" - ], - "valueType": [ - "datetime" - ] - }, - "type": "rule" - } - ], - "id": "ab89ab9b-0123-4456-b89a-b18c46223bed", - "type": "group" - }, - "whereString": "$__timeFilter(\"timestamp\")" - }, - "table": "oeth_daily_stat" - } - ], - "title": "APY", - "type": "timeseries" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic", - "seriesBy": "last" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepBefore", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "decimals": 2, - "fieldMinMax": false, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "percentunit" - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "apy7_day_avg" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "super-light-green", - "mode": "fixed" - } - }, - { - "id": "custom.fillOpacity", - "value": 10 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "apy14_day_avg" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "green", - "mode": "fixed" - } - }, - { - "id": "custom.fillOpacity", - "value": 10 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "apy30_day_avg" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "dark-green", - "mode": "fixed" - } - }, - { - "id": "custom.fillOpacity", - "value": 10 - } - ] - } - ] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 1 - }, - "id": 45, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "rawQuery": true, - "rawSql": "SELECT\n \"timestamp\" AS \"time\",\n apy7_day_avg,\n apy14_day_avg,\n apy30_day_avg\nFROM\n oeth_daily_stat\nWHERE\n $__timeFilter(\"timestamp\")\n and timestamp > '2023-05-29' -- Because prior APY values mess up the chart and are *** nonsense *** to look at. \nORDER BY\n \"timestamp\" ASC", - "refId": "A", - "sql": { - "columns": [ - { - "alias": "\"time\"", - "parameters": [ - { - "name": "\"timestamp\"", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "apy7_day_avg", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "apy14_day_avg", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "apy30_day_avg", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "orderBy": { - "property": { - "name": [ - "\"timestamp\"" - ], - "type": "string" - }, - "type": "property" - }, - "orderByDirection": "ASC", - "whereJsonTree": { - "children1": [ - { - "id": "aa98bb98-4567-489a-bcde-f18c4a965f07", - "properties": { - "field": "\"timestamp\"", - "fieldSrc": "field", - "operator": "macros", - "value": [ - "timeFilter" - ], - "valueSrc": [ - "value" - ], - "valueType": [ - "datetime" - ] - }, - "type": "rule" - } - ], - "id": "ab89ab9b-0123-4456-b89a-b18c46223bed", - "type": "group" - }, - "whereString": "$__timeFilter(\"timestamp\")" - }, - "table": "oeth_daily_stat" - } - ], - "title": "APY Moving Averages", - "type": "timeseries" - }, - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 9 - }, - "id": 53, - "panels": [], - "title": "Distribution (wip)", - "type": "row" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "description": "WETH includes ETH", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "normal" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "fieldMinMax": false, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "percentunit" - }, - "overrides": [] - }, - "gridPos": { - "h": 9, - "w": 12, - "x": 0, - "y": 10 - }, - "id": 51, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "rawQuery": true, - "rawSql": "WITH _daily_strategy_balance as (\n select\n DATE(timestamp) as date,\n strategy,\n case\n when asset = '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee' then '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'\n else asset end as asset,\n balance,\n ROW_NUMBER()\n OVER (PARTITION BY strategy, asset, DATE(timestamp) ORDER BY timestamp DESC) as rn\n from strategy_balance\n where asset in (\n select\n address\n from o_token_asset\n where symbol != 'OETH' AND chain_id = 1 AND otoken = '0x856c4efb76c1d1ae02e20ceb03a2a6a08b0b8dc3'\n )\n),\n _daily_exchange_rate as (\n select\n DATE(timestamp) as date,\n base,\n quote,\n rate,\n ROW_NUMBER()\n OVER (PARTITION BY base, quote, DATE(timestamp) ORDER BY timestamp DESC) as rn\n from exchange_rate\n),\n daily_strategy_balance as (\n select\n b.date,\n strategy,\n symbol,\n balance * (r.rate / 1e18) as balance,\n (r.rate / 1e18) as rate\n from _daily_strategy_balance b\n inner join o_token_asset oa\n on b.asset = oa.address AND chain_id = 1 AND otoken = '0x856c4efb76c1d1ae02e20ceb03a2a6a08b0b8dc3'\n left join _daily_exchange_rate r\n on r.date = b.date and r.base = 'ETH' and r.quote = oa.symbol and r.rn = 1\n where b.rn = 1\n),\n daily_total as (\n select\n date,\n sum(balance) as total_balance\n from daily_strategy_balance\n group by date\n),\n daily_strategy_asset_total as (\n select\n date,\n symbol,\n rate,\n sum(balance) as asset_balance\n from daily_strategy_balance\n group by date, symbol, rate\n)\n\nselect\n t.date as time,\n -- t.total_balance,\n case when a.symbol = 'WETH' then 'ETH / WETH' else a.symbol end as symbol,\n -- a.asset_balance,\n a.asset_balance / nullif(t.total_balance, 0) as \"%\"\n -- a.rate\nfrom daily_total t\ninner join daily_strategy_asset_total a\n on t.date = a.date\nwhere $__timeFilter(t.date) \norder by t.date asc", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - } - } - ], - "title": "Asset Distribution", - "type": "timeseries" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 20, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "normal" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "percentunit" - }, - "overrides": [] - }, - "gridPos": { - "h": 9, - "w": 12, - "x": 12, - "y": 10 - }, - "id": 54, - "options": { - "legend": { - "calcs": [ - "lastNotNull" - ], - "displayMode": "table", - "placement": "right", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "rawQuery": true, - "rawSql": "WITH _daily_strategy_balance as (\n select\n DATE(timestamp) as date,\n case\n when strategy = '0x1827f9ea98e0bf96550b2fc20f7233277fcd7e63' then 'AMO'\n when strategy = '0x3ff8654d633d4ea0fae24c52aec73b4a20d0d0e5' then 'Frax'\n when strategy = '0x49109629ac1deb03f2e9b2fe2ac4a623e0e7dfdc' then 'Aura'\n when strategy = '0xc1fc9e5ec3058921ea5025d703cbe31764756319' then 'Morpho Aave'\n when strategy = '0x39254033945aa2e4809cc2977e7087bee48bd7ab'\n and asset = '0xae78736cd615f374d3085123a210448e74fc6393' then 'Vault rETH'\n when strategy = '0x39254033945aa2e4809cc2977e7087bee48bd7ab'\n and asset = '0xae7ab96520de3a18e5e111b5eaab095312d7fe84' then 'Vault stETH'\n when strategy = '0x39254033945aa2e4809cc2977e7087bee48bd7ab'\n and asset = '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2' then 'Vault WETH'\n else strategy\n end as strategy,\n asset,\n balance,\n ROW_NUMBER() OVER (\n PARTITION BY strategy,\n asset,\n DATE(timestamp)\n ORDER BY\n timestamp DESC\n ) as rn\n from strategy_balance\n where asset in (\n select\n address\n from o_token_asset\n where symbol != 'OETH' AND chain_id = 1 AND otoken = '0x856c4efb76c1d1ae02e20ceb03a2a6a08b0b8dc3'\n )\n),\n _daily_exchange_rate as (\n select\n DATE(timestamp) as date,\n base,\n quote,\n rate,\n ROW_NUMBER() OVER (\n PARTITION BY base,\n quote,\n DATE(timestamp)\n ORDER BY\n timestamp DESC\n ) as rn\n from exchange_rate\n),\n daily_strategy_balance as (\n select\n b.date,\n strategy,\n balance * coalesce(rate, 1e18) / 1e18 as balance\n from _daily_strategy_balance b\n inner join o_token_asset oa\n on b.asset = oa.address AND chain_id = 1 AND otoken = '0x856c4efb76c1d1ae02e20ceb03a2a6a08b0b8dc3'\n left join _daily_exchange_rate r\n on r.date = b.date and r.base = 'ETH' and r.quote = oa.symbol and r.rn = 1\n where b.rn = 1\n),\n daily_total as (\n select\n date,\n sum(balance) as balance\n from daily_strategy_balance\n group by date\n),\n daily_per_strategy_total as (\n select\n date,\n strategy,\n sum(balance) as strategy_balance\n from daily_strategy_balance\n group by date,\n strategy\n)\nselect\n t.date as time,\n a.strategy,\n a.strategy_balance / nullif(t.balance, 0) as \"%\"\nfrom daily_total t\ninner join daily_per_strategy_total a\n on t.date = a.date\nwhere $__timeFilter(t.date)\norder by t.date asc", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - } - } - ], - "title": "Strategy Distribution", - "type": "timeseries" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "description": "WETH includes ETH", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "axisSoftMax": 0.7, - "axisSoftMin": 5, - "fillOpacity": 80, - "gradientMode": "scheme", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineWidth": 1, - "scaleDistribution": { - "type": "linear" - }, - "thresholdsStyle": { - "mode": "area" - } - }, - "fieldMinMax": false, - "mappings": [], - "min": 0, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "red", - "value": null - }, - { - "color": "green", - "value": 0.05 - }, - { - "color": "red", - "value": 0.66 - } - ] - }, - "unit": "percentunit" - }, - "overrides": [] - }, - "gridPos": { - "h": 9, - "w": 12, - "x": 0, - "y": 19 - }, - "id": 56, - "options": { - "barRadius": 0, - "barWidth": 0.7, - "colorByField": "%", - "fullHighlight": false, - "groupWidth": 1, - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "orientation": "horizontal", - "showValue": "auto", - "stacking": "none", - "text": {}, - "tooltip": { - "mode": "none", - "sort": "none" - }, - "xTickLabelRotation": 0, - "xTickLabelSpacing": 0 - }, - "pluginVersion": "10.3.0-64399", - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "table", - "rawQuery": true, - "rawSql": "WITH _daily_strategy_balance as (\n select\n DATE(timestamp) as date,\n strategy,\n case\n when asset = '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee' then '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'\n else asset end as asset,\n balance,\n ROW_NUMBER()\n OVER (PARTITION BY strategy, asset, DATE(timestamp) ORDER BY timestamp DESC) as rn\n from strategy_balance\n where asset in (\n select\n address\n from o_token_asset\n where symbol != 'OETH' AND chain_id = 1 AND otoken = '0x856c4efb76c1d1ae02e20ceb03a2a6a08b0b8dc3'\n )\n),\n _daily_exchange_rate as (\n select\n DATE(timestamp) as date,\n base,\n quote,\n rate,\n ROW_NUMBER()\n OVER (PARTITION BY base, quote, DATE(timestamp) ORDER BY timestamp DESC) as rn\n from exchange_rate\n),\n daily_strategy_balance as (\n select\n b.date,\n strategy,\n symbol,\n balance * (r.rate / 1e18) as balance,\n (r.rate / 1e18) as rate\n from _daily_strategy_balance b\n inner join o_token_asset oa\n on b.asset = oa.address AND chain_id = 1 AND otoken = '0x856c4efb76c1d1ae02e20ceb03a2a6a08b0b8dc3'\n left join _daily_exchange_rate r\n on r.date = b.date and r.base = 'ETH' and r.quote = oa.symbol and r.rn = 1\n where b.rn = 1\n),\n daily_total as (\n select\n date,\n sum(balance) as total_balance\n from daily_strategy_balance\n group by date\n),\n daily_strategy_asset_total as (\n select\n date,\n symbol,\n rate,\n sum(balance) as asset_balance\n from daily_strategy_balance\n group by date, symbol, rate\n)\n\nselect\n t.date as time,\n -- t.total_balance,\n case when a.symbol = 'WETH' then 'ETH / WETH' else a.symbol end as symbol,\n -- a.asset_balance,\n a.asset_balance / nullif(t.total_balance, 0) as \"%\"\n -- a.rate\nfrom daily_total t\ninner join daily_strategy_asset_total a\n on t.date = a.date\nwhere t.date = current_date\norder by t.date asc", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - } - } - ], - "title": "Current Asset Distribution %", - "type": "barchart" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "description": "WETH includes ETH", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "custom": { - "align": "auto", - "cellOptions": { - "type": "auto" - }, - "inspect": false - }, - "decimals": 3, - "fieldMinMax": false, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "none" - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "balance_usd" - }, - "properties": [ - { - "id": "unit", - "value": "currencyUSD" - }, - { - "id": "decimals", - "value": 2 - } - ] - } - ] - }, - "gridPos": { - "h": 9, - "w": 12, - "x": 12, - "y": 19 - }, - "id": 57, - "options": { - "cellHeight": "sm", - "footer": { - "countRows": false, - "fields": [ - "balance_eth", - "balance_usd" - ], - "reducer": [ - "sum" - ], - "show": true - }, - "showHeader": true, - "sortBy": [] - }, - "pluginVersion": "11.1.0-69622", - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "table", - "rawQuery": true, - "rawSql": "WITH _daily_strategy_balance as (\n select\n DATE(timestamp) as date,\n strategy,\n case\n when asset = '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee' then '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2'\n else asset end as asset,\n balance,\n ROW_NUMBER()\n OVER (PARTITION BY strategy, asset, DATE(timestamp) ORDER BY timestamp DESC) as rn\n from strategy_balance\n where asset in (\n select\n address\n from o_token_asset\n where symbol != 'OETH' AND chain_id = 1 AND otoken = '0x856c4efb76c1d1ae02e20ceb03a2a6a08b0b8dc3'\n )\n),\n _daily_exchange_rate as (\n select\n DATE(timestamp) as date,\n base,\n quote,\n rate,\n ROW_NUMBER()\n OVER (PARTITION BY base, quote, DATE(timestamp) ORDER BY timestamp DESC) as rn\n from exchange_rate\n),\n daily_strategy_balance as (\n select\n b.date,\n strategy,\n symbol,\n balance,\n balance * coalesce(r.rate / 1e18, 1) as balance_eth,\n balance * coalesce(r.rate / 1e18, 1) * coalesce(r_usd.rate / 1e8, 1) as balance_usd,\n coalesce(r.rate / 1e18, 1) as rate,\n coalesce(r_usd.rate / 1e18, 1) as rate_usd\n from _daily_strategy_balance b\n inner join o_token_asset oa\n on b.asset = oa.address AND chain_id = 1 AND otoken = '0x856c4efb76c1d1ae02e20ceb03a2a6a08b0b8dc3'\n left join _daily_exchange_rate r\n on r.date = b.date and r.base = 'ETH' and r.quote = oa.symbol and r.rn = 1\n left join _daily_exchange_rate r_usd\n on r_usd.date = b.date and r_usd.base = 'ETH' and r_usd.quote = 'USD' and r_usd.rn = 1\n where b.rn = 1\n),\n daily_strategy_asset_total as (\n select\n date,\n symbol,\n rate,\n sum(balance) as balance,\n sum(balance_eth) as balance_eth,\n sum(balance_usd) as balance_usd\n from daily_strategy_balance\n group by date, symbol, rate\n)\n\nselect\n symbol,\n balance / 1e18 as balance,\n balance_eth / 1e18 as balance_eth,\n balance_usd / 1e18 as balance_usd\nfrom daily_strategy_asset_total\nwhere date = current_date\norder by date ", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - } - } - ], - "title": "Current Asset Distribution", - "type": "table" - }, - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 28 - }, - "id": 9, - "panels": [], - "title": "OETH Convex ETH+OETH", - "type": "row" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "earnings_change" - }, - "properties": [ - { - "id": "custom.axisPlacement", - "value": "right" - }, - { - "id": "custom.fillOpacity", - "value": 25 - }, - { - "id": "custom.lineWidth", - "value": 0 - } - ] - } - ] - }, - "gridPos": { - "h": 9, - "w": 11, - "x": 0, - "y": 29 - }, - "id": 17, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "table", - "rawQuery": true, - "rawSql": "SELECT timestamp as time, earnings_change / 1000000000000000000 as earnings_change, balance / 1000000000000000000 as balance\nFROM strategy_daily_yield\nWHERE strategy = '0x1827f9ea98e0bf96550b2fc20f7233277fcd7e63'\n and $__timeFilter(timestamp)\n", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "strategy", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "asset", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "earnings", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "strategy_daily_yield" - } - ], - "title": "OETH Convex ETH+OETH (AMO) - Earnings", - "type": "timeseries" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "axisSoftMax": -4, - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "hue", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "max": 0.75, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/apy.*/" - }, - "properties": [ - { - "id": "custom.axisPlacement", - "value": "auto" - }, - { - "id": "custom.showPoints", - "value": "never" - }, - { - "id": "custom.lineWidth", - "value": 1 - }, - { - "id": "custom.lineInterpolation", - "value": "stepBefore" - }, - { - "id": "unit", - "value": "percentunit" - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "apy" - }, - "properties": [ - { - "id": "custom.fillOpacity", - "value": 32 - }, - { - "id": "custom.lineWidth", - "value": 0 - } - ] - } - ] - }, - "gridPos": { - "h": 13, - "w": 11, - "x": 11, - "y": 29 - }, - "id": 13, - "options": { - "legend": { - "calcs": [ - "lastNotNull" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "hide": false, - "rawQuery": true, - "rawSql": "SELECT\n \"timestamp\" AS \"time\",\n -- earnings / 1000000000000000000 as earnings,\n apy,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 6 PRECEDING AND CURRENT ROW) AS apy7,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 13 PRECEDING AND CURRENT ROW) AS apy14,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 29 PRECEDING AND CURRENT ROW) AS apy30\nFROM\n strategy_daily_yield \n where strategy = '0x1827f9ea98e0bf96550b2fc20f7233277fcd7e63'\n and $__timeFilter(timestamp)\n\nORDER BY timestamp", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "earnings", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "asset", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "alias": "\"time\"", - "parameters": [ - { - "name": "\"timestamp\"", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "strategy_yield" - } - ], - "title": "OETH Convex ETH+OETH (AMO) - APY by Day", - "type": "timeseries" - }, - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "percentunit" - }, - "overrides": [] - }, - "gridPos": { - "h": 13, - "w": 2, - "x": 22, - "y": 29 - }, - "id": 36, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showPercentChange": false, - "textMode": "auto", - "wideLayout": true - }, - "pluginVersion": "11.1.0-69622", - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "table", - "rawQuery": true, - "rawSql": "SELECT \n \"timestamp\" as time,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 1 PRECEDING AND 1 PRECEDING) AS previous,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 6 PRECEDING AND CURRENT ROW) AS apy7,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 13 PRECEDING AND CURRENT ROW) AS apy14,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 29 PRECEDING AND CURRENT ROW) AS apy30\nFROM strategy_daily_yield\nwhere strategy = '0x1827f9ea98e0bf96550b2fc20f7233277fcd7e63'\nORDER by timestamp desc\nLIMIT 1 ", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "apy", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "strategy_daily_yield" - } - ], - "title": "Latest APY", - "type": "stat" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "percentunit" - }, - "overrides": [] - }, - "gridPos": { - "h": 4, - "w": 11, - "x": 0, - "y": 38 - }, - "id": 42, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": false - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "table", - "rawQuery": true, - "rawSql": "SELECT timestamp as time, 1-balance_weight as percentage_oeth\nFROM strategy_daily_yield\nWHERE strategy = '0x1827f9ea98e0bf96550b2fc20f7233277fcd7e63'\n and $__timeFilter(timestamp)\n", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - } - } - ], - "title": "Percent of OETH in Pool", - "type": "timeseries" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/.*_p/" - }, - "properties": [ - { - "id": "custom.axisPlacement", - "value": "right" - }, - { - "id": "custom.stacking", - "value": { - "group": "A", - "mode": "percent" - } - }, - { - "id": "custom.fillOpacity", - "value": 35 - }, - { - "id": "custom.lineWidth", - "value": 0 - }, - { - "id": "unit", - "value": "percentunit" - } - ] - }, - { - "matcher": { - "id": "byRegexp", - "options": "/balance0.*/" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "green", - "mode": "fixed" - } - } - ] - }, - { - "matcher": { - "id": "byRegexp", - "options": "/balance1.*/" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "blue", - "mode": "fixed" - } - } - ] - } - ] - }, - "gridPos": { - "h": 9, - "w": 11, - "x": 0, - "y": 42 - }, - "id": 49, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "rawQuery": true, - "rawSql": "WITH base as (\nSELECT \n timestamp as time, \n balance0 / 1e18 as balance0, \n balance1 / 1e18 as balance1, \n ((balance0 / 1e18) + (balance1 / 1e18)) as total\nFROM curve_pool_balance\nwhere address = '0x94b17476a93b3262d87b9a326965d1e91f9c13e7'\norder by time\n)\n\nselect \n time,\n balance0,\n balance1,\n balance0 / nullif(total, 0) as balance0_p,\n balance1 / nullif(total, 0) as balance1_p\nfrom base\n", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "address", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "balance0", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "balance1", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "balance2", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "curve_pool_balance" - } - ], - "title": "Pool Balance", - "type": "timeseries" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "description": "Retrieved using `get_dy(1, 0, 1000000000000000000)`", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "line+area" - } - }, - "decimals": 5, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "dark-red", - "value": null - }, - { - "color": "transparent", - "value": 0.996 - }, - { - "color": "dark-red", - "value": 1 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 9, - "w": 11, - "x": 11, - "y": 42 - }, - "id": 52, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "rawQuery": true, - "rawSql": "select\n timestamp as time,\n rate / 1e18 as rate\nfrom\n curve_pool_rate\nwhere\n address = '0x94b17476a93b3262d87b9a326965d1e91f9c13e7'\n and name = '1-0-1000000000000000000'\n and $__timeFilter(timestamp)\n and timestamp > '2023-05-01' -- omit some initial funky values\norder by\n time asc", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - } - } - ], - "title": "OETH / ETH Rate - get_dy(1, 0, 1e18)", - "type": "timeseries" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "decimals": 5, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "red", - "value": null - }, - { - "color": "green", - "value": 0.996 - }, - { - "color": "red", - "value": 1 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 9, - "w": 2, - "x": 22, - "y": 42 - }, - "id": 50, - "options": { - "colorMode": "value", - "graphMode": "none", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showPercentChange": false, - "textMode": "auto", - "wideLayout": true - }, - "pluginVersion": "11.1.0-69622", - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "rawQuery": true, - "rawSql": "select\n timestamp as time,\n rate / 1e18 as rate\nfrom\n curve_pool_rate\nwhere\n address = '0x94b17476a93b3262d87b9a326965d1e91f9c13e7'\n and name = '1-0-1000000000000000000'\n and $__timeFilter(timestamp)\n and timestamp > '2023-05-01' -- omit some initial funky values\norder by\n time asc", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "address", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "balance0", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "balance1", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "balance2", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "curve_pool_balance" - } - ], - "title": "Current Rate", - "type": "stat" - }, - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 51 - }, - "id": 10, - "panels": [], - "title": "OETH Frax Staking", - "type": "row" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "earnings_change" - }, - "properties": [ - { - "id": "custom.axisPlacement", - "value": "right" - }, - { - "id": "custom.fillOpacity", - "value": 25 - }, - { - "id": "custom.lineWidth", - "value": 0 - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 11, - "x": 0, - "y": 52 - }, - "id": 2, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "rawQuery": true, - "rawSql": "SELECT timestamp as time, earnings_change / 1000000000000000000 as earnings_change, balance / 1000000000000000000 as balance\nFROM strategy_daily_yield\nwhere strategy = '0x3ff8654d633d4ea0fae24c52aec73b4a20d0d0e5'\n and $__timeFilter(timestamp)\norder by time", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "earnings", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "asset", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "alias": "\"time\"", - "parameters": [ - { - "name": "\"timestamp\"", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "strategy_yield" - } - ], - "title": "OETH Frax Staking - Earnings", - "type": "timeseries" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "axisSoftMax": -4, - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "hue", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/apy.*/" - }, - "properties": [ - { - "id": "custom.axisPlacement", - "value": "auto" - }, - { - "id": "custom.showPoints", - "value": "never" - }, - { - "id": "custom.lineWidth", - "value": 1 - }, - { - "id": "custom.lineInterpolation", - "value": "stepBefore" - }, - { - "id": "unit", - "value": "percentunit" - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "apy" - }, - "properties": [ - { - "id": "custom.fillOpacity", - "value": 25 - }, - { - "id": "custom.lineWidth", - "value": 0 - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 11, - "x": 11, - "y": 52 - }, - "id": 6, - "options": { - "legend": { - "calcs": [ - "lastNotNull" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "hide": false, - "rawQuery": true, - "rawSql": "SELECT\n \"timestamp\" AS \"time\",\n -- earnings / 1000000000000000000 as earnings,\n apy,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 6 PRECEDING AND CURRENT ROW) AS apy7,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 13 PRECEDING AND CURRENT ROW) AS apy14,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 29 PRECEDING AND CURRENT ROW) AS apy30\nFROM\n strategy_daily_yield \n where strategy = '0x3ff8654d633d4ea0fae24c52aec73b4a20d0d0e5'\n and $__timeFilter(timestamp)\n\nORDER BY timestamp", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "earnings", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "asset", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "alias": "\"time\"", - "parameters": [ - { - "name": "\"timestamp\"", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "strategy_yield" - } - ], - "title": "OETH Frax Staking - APY by Day", - "type": "timeseries" - }, - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "percentunit" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 2, - "x": 22, - "y": 52 - }, - "id": 38, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showPercentChange": false, - "textMode": "auto", - "wideLayout": true - }, - "pluginVersion": "11.1.0-69622", - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "table", - "rawQuery": true, - "rawSql": "SELECT \n \"timestamp\" as time,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 1 PRECEDING AND 1 PRECEDING) AS previous,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 6 PRECEDING AND CURRENT ROW) AS apy7,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 13 PRECEDING AND CURRENT ROW) AS apy14,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 29 PRECEDING AND CURRENT ROW) AS apy30\nFROM strategy_daily_yield\nwhere strategy = '0x3ff8654d633d4ea0fae24c52aec73b4a20d0d0e5'\nORDER by timestamp desc\nLIMIT 1 ", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "apy", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "strategy_daily_yield" - } - ], - "title": "Latest APY", - "type": "stat" - }, - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 62 - }, - "id": 11, - "panels": [], - "title": "OETH Morpho Aave V2", - "type": "row" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "earnings_change" - }, - "properties": [ - { - "id": "custom.axisPlacement", - "value": "right" - }, - { - "id": "custom.fillOpacity", - "value": 25 - }, - { - "id": "custom.lineWidth", - "value": 0 - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 11, - "x": 0, - "y": 63 - }, - "id": 4, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "rawQuery": true, - "rawSql": "SELECT timestamp as time, earnings_change / 1000000000000000000 as earnings_change, balance / 1000000000000000000 as balance\nFROM strategy_daily_yield\nwhere strategy = '0xc1fc9e5ec3058921ea5025d703cbe31764756319'\n and $__timeFilter(timestamp)\norder by time", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "earnings", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "asset", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "alias": "\"time\"", - "parameters": [ - { - "name": "\"timestamp\"", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "strategy_yield" - } - ], - "title": "OETH Morpho Aave V2 - Earnings", - "type": "timeseries" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "axisSoftMax": -4, - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "hue", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/apy.*/" - }, - "properties": [ - { - "id": "custom.axisPlacement", - "value": "auto" - }, - { - "id": "custom.showPoints", - "value": "never" - }, - { - "id": "custom.lineWidth", - "value": 1 - }, - { - "id": "custom.lineInterpolation", - "value": "stepBefore" - }, - { - "id": "unit", - "value": "percentunit" - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "apy" - }, - "properties": [ - { - "id": "custom.fillOpacity", - "value": 25 - }, - { - "id": "custom.lineWidth", - "value": 0 - }, - { - "id": "custom.axisPlacement", - "value": "auto" - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 11, - "x": 11, - "y": 63 - }, - "id": 14, - "options": { - "legend": { - "calcs": [ - "lastNotNull" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "hide": false, - "rawQuery": true, - "rawSql": "SELECT\n \"timestamp\" AS \"time\",\n -- earnings / 1000000000000000000 as earnings,\n apy,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 6 PRECEDING AND CURRENT ROW) AS apy7,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 13 PRECEDING AND CURRENT ROW) AS apy14,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 29 PRECEDING AND CURRENT ROW) AS apy30\nFROM strategy_daily_yield \nwhere strategy = '0xc1fc9e5ec3058921ea5025d703cbe31764756319'\n and $__timeFilter(timestamp)\nORDER BY timestamp", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "earnings", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "asset", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "alias": "\"time\"", - "parameters": [ - { - "name": "\"timestamp\"", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "strategy_yield" - } - ], - "title": "OETH Morpho Aave V2 - APY by Day", - "type": "timeseries" - }, - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "percentunit" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 2, - "x": 22, - "y": 63 - }, - "id": 37, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showPercentChange": false, - "textMode": "auto", - "wideLayout": true - }, - "pluginVersion": "11.1.0-69622", - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "table", - "rawQuery": true, - "rawSql": "SELECT \n \"timestamp\" as time,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 1 PRECEDING AND 1 PRECEDING) AS previous,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 6 PRECEDING AND CURRENT ROW) AS apy7,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 13 PRECEDING AND CURRENT ROW) AS apy14,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 29 PRECEDING AND CURRENT ROW) AS apy30\nFROM strategy_daily_yield\nwhere strategy = '0xc1fc9e5ec3058921ea5025d703cbe31764756319'\nORDER by timestamp desc\nLIMIT 1 ", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "apy", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "strategy_daily_yield" - } - ], - "title": "Latest APY", - "type": "stat" - }, - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 73 - }, - "id": 31, - "panels": [], - "title": "OETH Vault Strategies", - "type": "row" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "earnings_change" - }, - "properties": [ - { - "id": "custom.axisPlacement", - "value": "right" - }, - { - "id": "custom.fillOpacity", - "value": 25 - }, - { - "id": "custom.lineWidth", - "value": 0 - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 11, - "x": 0, - "y": 74 - }, - "id": 32, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "table", - "rawQuery": true, - "rawSql": "SELECT timestamp as time, earnings_change / 1000000000000000000 as earnings_change, balance / 1000000000000000000 as balance\nFROM strategy_daily_yield\nWHERE strategy = '0x39254033945aa2e4809cc2977e7087bee48bd7ab' and asset = '0xae78736cd615f374d3085123a210448e74fc6393'\n and $__timeFilter(timestamp)\n\nORDER BY timestamp", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "strategy", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "asset", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "earnings", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "strategy_daily_yield" - } - ], - "title": "OETH Vault (rETH) - Earnings", - "type": "timeseries" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "description": "These values are based on the ETH/rETH exchange rate which is why we see APY values that are quite variable.", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "axisSoftMax": -4, - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "hue", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/apy.*/" - }, - "properties": [ - { - "id": "custom.axisPlacement", - "value": "auto" - }, - { - "id": "custom.showPoints", - "value": "never" - }, - { - "id": "custom.lineWidth", - "value": 1 - }, - { - "id": "custom.lineInterpolation", - "value": "stepBefore" - }, - { - "id": "unit", - "value": "percentunit" - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "apy" - }, - "properties": [ - { - "id": "custom.fillOpacity", - "value": 25 - }, - { - "id": "custom.lineWidth", - "value": 0 - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 11, - "x": 11, - "y": 74 - }, - "id": 33, - "options": { - "legend": { - "calcs": [ - "lastNotNull" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "hide": false, - "rawQuery": true, - "rawSql": "SELECT\n \"timestamp\" AS \"time\",\n -- earnings / 1000000000000000000 as earnings,\n apy,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 6 PRECEDING AND CURRENT ROW) AS apy7,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 13 PRECEDING AND CURRENT ROW) AS apy14,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 29 PRECEDING AND CURRENT ROW) AS apy30\nFROM\n strategy_daily_yield \n where strategy = '0x39254033945aa2e4809cc2977e7087bee48bd7ab' and asset = '0xae78736cd615f374d3085123a210448e74fc6393'\n and $__timeFilter(timestamp)\nORDER BY timestamp", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "earnings", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "asset", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "alias": "\"time\"", - "parameters": [ - { - "name": "\"timestamp\"", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "strategy_yield" - } - ], - "title": "OETH Vault (rETH) - APY", - "type": "timeseries" - }, - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "percentunit" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 2, - "x": 22, - "y": 74 - }, - "id": 39, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showPercentChange": false, - "textMode": "auto", - "wideLayout": true - }, - "pluginVersion": "11.1.0-69622", - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "table", - "rawQuery": true, - "rawSql": "SELECT \n \"timestamp\" as time,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 1 PRECEDING AND 1 PRECEDING) AS previous,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 6 PRECEDING AND CURRENT ROW) AS apy7,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 13 PRECEDING AND CURRENT ROW) AS apy14,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 29 PRECEDING AND CURRENT ROW) AS apy30\nFROM strategy_daily_yield\nwhere strategy = '0x39254033945aa2e4809cc2977e7087bee48bd7ab' and asset = '0xae78736cd615f374d3085123a210448e74fc6393'\nORDER by timestamp desc\nLIMIT 1 ", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "apy", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "strategy_daily_yield" - } - ], - "title": "Latest APY", - "type": "stat" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "earnings_change" - }, - "properties": [ - { - "id": "custom.axisPlacement", - "value": "right" - }, - { - "id": "custom.fillOpacity", - "value": 25 - }, - { - "id": "custom.lineWidth", - "value": 0 - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 11, - "x": 0, - "y": 84 - }, - "id": 34, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "table", - "rawQuery": true, - "rawSql": "SELECT timestamp as time, earnings_change / 1000000000000000000 as earnings_change, balance / 1000000000000000000 as balance\nFROM strategy_daily_yield\nWHERE strategy = '0x39254033945aa2e4809cc2977e7087bee48bd7ab' and asset = '0xae7ab96520de3a18e5e111b5eaab095312d7fe84'\n and $__timeFilter(timestamp)\n\nORDER BY timestamp", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "strategy", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "asset", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "earnings", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "strategy_daily_yield" - } - ], - "title": "OETH Vault (stETH) - Earnings", - "type": "timeseries" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "hue", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "max": 0.2, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/apy.*/" - }, - "properties": [ - { - "id": "custom.axisPlacement", - "value": "auto" - }, - { - "id": "custom.showPoints", - "value": "never" - }, - { - "id": "custom.lineWidth", - "value": 1 - }, - { - "id": "custom.lineInterpolation", - "value": "stepBefore" - }, - { - "id": "unit", - "value": "percentunit" - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "apy" - }, - "properties": [ - { - "id": "custom.fillOpacity", - "value": 25 - }, - { - "id": "custom.lineWidth", - "value": 0 - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 11, - "x": 11, - "y": 84 - }, - "id": 35, - "options": { - "legend": { - "calcs": [ - "lastNotNull" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "hide": false, - "rawQuery": true, - "rawSql": "SELECT\n \"timestamp\" AS \"time\",\n -- earnings / 1000000000000000000 as earnings,\n apy,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 6 PRECEDING AND CURRENT ROW) AS apy7,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 13 PRECEDING AND CURRENT ROW) AS apy14,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 29 PRECEDING AND CURRENT ROW) AS apy30\nFROM\n strategy_daily_yield \nwhere strategy = '0x39254033945aa2e4809cc2977e7087bee48bd7ab' and asset = '0xae7ab96520de3a18e5e111b5eaab095312d7fe84'\n and $__timeFilter(timestamp)\n\nORDER BY timestamp", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "earnings", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "asset", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "alias": "\"time\"", - "parameters": [ - { - "name": "\"timestamp\"", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "strategy_yield" - } - ], - "title": "OETH Vault (stETH) - APY", - "type": "timeseries" - }, - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "percentunit" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 2, - "x": 22, - "y": 84 - }, - "id": 41, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showPercentChange": false, - "textMode": "auto", - "wideLayout": true - }, - "pluginVersion": "11.1.0-69622", - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "table", - "rawQuery": true, - "rawSql": "SELECT \n \"timestamp\" as time,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 1 PRECEDING AND 1 PRECEDING) AS previous,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 6 PRECEDING AND CURRENT ROW) AS apy7,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 13 PRECEDING AND CURRENT ROW) AS apy14,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 29 PRECEDING AND CURRENT ROW) AS apy30\nFROM strategy_daily_yield\nwhere strategy = '0x39254033945aa2e4809cc2977e7087bee48bd7ab' and asset = '0xae7ab96520de3a18e5e111b5eaab095312d7fe84'\nORDER by timestamp desc\nLIMIT 1 ", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "apy", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "strategy_daily_yield" - } - ], - "title": "Latest APY", - "type": "stat" - }, - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 94 - }, - "id": 12, - "panels": [], - "title": "OETH Aura rETH/WETH", - "type": "row" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "earnings_change" - }, - "properties": [ - { - "id": "custom.axisPlacement", - "value": "right" - }, - { - "id": "custom.fillOpacity", - "value": 25 - }, - { - "id": "custom.lineWidth", - "value": 0 - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 11, - "x": 0, - "y": 95 - }, - "id": 3, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "rawQuery": true, - "rawSql": "SELECT\n \"timestamp\" AS \"time\",\n earnings_change / 1000000000000000000 as earnings_change,\n balance / 1000000000000000000 as balance\nFROM\n strategy_daily_yield\nwhere strategy = '0x49109629ac1deb03f2e9b2fe2ac4a623e0e7dfdc'\n and $__timeFilter(timestamp)\nORDER BY timestamp", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "earnings", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "asset", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "alias": "\"time\"", - "parameters": [ - { - "name": "\"timestamp\"", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "strategy_yield" - } - ], - "title": "OETH Aura rETH/WETH - Earnings", - "type": "timeseries" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "axisSoftMax": -2, - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "hue", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/apy.*/" - }, - "properties": [ - { - "id": "custom.showPoints", - "value": "never" - }, - { - "id": "custom.lineWidth", - "value": 1 - }, - { - "id": "custom.lineInterpolation", - "value": "stepBefore" - }, - { - "id": "unit", - "value": "percentunit" - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "apy" - }, - "properties": [ - { - "id": "custom.fillOpacity", - "value": 25 - }, - { - "id": "custom.lineWidth", - "value": 0 - } - ] - } - ] - }, - "gridPos": { - "h": 10, - "w": 11, - "x": 11, - "y": 95 - }, - "id": 15, - "options": { - "legend": { - "calcs": [ - "lastNotNull" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "hide": false, - "rawQuery": true, - "rawSql": "SELECT\n \"timestamp\" AS \"time\",\n apy,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 6 PRECEDING AND CURRENT ROW) AS apy7,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 13 PRECEDING AND CURRENT ROW) AS apy14,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 29 PRECEDING AND CURRENT ROW) AS apy30\nFROM\n strategy_daily_yield \nwhere strategy = '0x49109629ac1deb03f2e9b2fe2ac4a623e0e7dfdc'\n and $__timeFilter(timestamp)\nORDER BY timestamp", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "earnings", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "asset", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "alias": "\"time\"", - "parameters": [ - { - "name": "\"timestamp\"", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "strategy_yield" - } - ], - "title": "OETH Aura rETH/WETH - APY by Day", - "type": "timeseries" - }, - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "percentunit" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 2, - "x": 22, - "y": 95 - }, - "id": 40, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showPercentChange": false, - "textMode": "auto", - "wideLayout": true - }, - "pluginVersion": "11.1.0-69622", - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "table", - "rawQuery": true, - "rawSql": "SELECT \n \"timestamp\" as time,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 1 PRECEDING AND 1 PRECEDING) AS previous,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 6 PRECEDING AND CURRENT ROW) AS apy7,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 13 PRECEDING AND CURRENT ROW) AS apy14,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 29 PRECEDING AND CURRENT ROW) AS apy30\nFROM strategy_daily_yield\nwhere strategy = '0x49109629ac1deb03f2e9b2fe2ac4a623e0e7dfdc'\nORDER by timestamp desc\nLIMIT 1 ", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "apy", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "strategy_daily_yield" - } - ], - "title": "Latest APY", - "type": "stat" - }, - { - "collapsed": true, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 105 - }, - "id": 55, - "panels": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 25, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "normal" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "decimals": 2, - "fieldMinMax": false, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "percentunit" - }, - "overrides": [] - }, - "gridPos": { - "h": 10, - "w": 24, - "x": 0, - "y": 17 - }, - "id": 46, - "options": { - "legend": { - "calcs": [ - "lastNotNull" - ], - "displayMode": "table", - "placement": "right", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "pluginVersion": "10.3.0-64082", - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "rawQuery": true, - "rawSql": "WITH totals as (\n select\n DATE(daily_stat_id_id) as time,\n sum(tvl / 1e18) as tvl\n from\n oeth_strategy_daily_stat\n group by\n DATE(daily_stat_id_id)\n order by\n DATE(daily_stat_id_id) asc\n),\nmix as (\n select\n DATE(daily_stat_id_id) as time,\n name,\n tvl / 1e18 as tvl,\n (\n select\n tvl\n from\n totals\n where\n time = DATE(daily_stat_id_id)\n ) as total\n from\n oeth_strategy_daily_stat sds\n order by\n DATE(daily_stat_id_id) asc\n)\nselect\n time,\n lower(name) as name,\n -- tvl,\n -- total,\n tvl / total as \"%\"\nfrom\n mix\nwhere $__timeFilter(time) \norder by\n time", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "oeth_strategy_daily_stat" - } - ], - "title": "Allocation", - "type": "timeseries" - } - ], - "title": "Discard", - "type": "row" - } - ], - "refresh": "30s", - "schemaVersion": 39, - "tags": [ - "oeth" - ], - "templating": { - "list": [] - }, - "time": { - "from": "now-6M", - "to": "now" - }, - "timeRangeUpdatedDuringEditOrView": false, - "timepicker": {}, - "timezone": "", - "title": "OETH Strategy Earnings", - "uid": "c178206e-0cd7-4b2c-98c3-8f16e0d3b58b", - "version": 112, - "weekStart": "" -} \ No newline at end of file diff --git a/grafana/ogn-distribution.json b/grafana/ogn-distribution.json deleted file mode 100644 index 6adf6308..00000000 --- a/grafana/ogn-distribution.json +++ /dev/null @@ -1,521 +0,0 @@ -{ - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": { - "type": "grafana", - "uid": "-- Grafana --" - }, - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "type": "dashboard" - } - ] - }, - "editable": true, - "fiscalYearStartMonth": 0, - "graphTooltip": 0, - "id": 28, - "links": [], - "liveNow": false, - "panels": [ - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 0 - }, - "id": 3, - "panels": [], - "title": "Team Wallet", - "type": "row" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "line" - } - }, - "fieldMinMax": false, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 500000 - } - ] - }, - "unit": "none" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 1 - }, - "id": 1, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "rawQuery": true, - "rawSql": "select\n timestamp as time,\n case address\n when '0x8207c1ffc5b6804f6024322ccf34f29c3541ae26' then 'OGN'\n when '0x9c354503c38481a7a7a51629142963f98ecc12d0' then 'OGV'\n else address end,\n balance / 1e18 as balance\nfrom erc20_balance\nwhere account = '0x2eae0cae2323167abf78462e0c0686865c67a655'\n and address in ('0x8207c1ffc5b6804f6024322ccf34f29c3541ae26')\n and $__timeFilter(timestamp) \norder by time", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - } - } - ], - "title": "OGN Balance (Team)", - "type": "timeseries" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "line" - } - }, - "fieldMinMax": false, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 5000000 - } - ] - }, - "unit": "none" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 1 - }, - "id": 2, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "rawQuery": true, - "rawSql": "select\n timestamp as time,\n case address\n when '0x8207c1ffc5b6804f6024322ccf34f29c3541ae26' then 'OGN'\n when '0x9c354503c38481a7a7a51629142963f98ecc12d0' then 'OGV'\n else address end,\n balance / 1e18 as balance\nfrom erc20_balance\nwhere account = '0x2eae0cae2323167abf78462e0c0686865c67a655'\n and address in ('0x9c354503c38481a7a7a51629142963f98ecc12d0')\n and $__timeFilter(timestamp) \norder by time", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - } - } - ], - "title": "OGV Balance (Team)", - "type": "timeseries" - }, - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 9 - }, - "id": 4, - "panels": [], - "title": "Investor Wallet", - "type": "row" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "line" - } - }, - "fieldMinMax": false, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 500000 - } - ] - }, - "unit": "none" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 10 - }, - "id": 5, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "rawQuery": true, - "rawSql": "select\n timestamp as time,\n case address\n when '0x8207c1ffc5b6804f6024322ccf34f29c3541ae26' then 'OGN'\n when '0x9c354503c38481a7a7a51629142963f98ecc12d0' then 'OGV'\n else address end,\n balance / 1e18 as balance\nfrom erc20_balance\nwhere account = '0xfe730b3cf80ca7b31905f70241f7c786baf443e3'\n and address in ('0x8207c1ffc5b6804f6024322ccf34f29c3541ae26')\n and $__timeFilter(timestamp) \norder by time", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - } - } - ], - "title": "OGN Balance (Investor)", - "type": "timeseries" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "line" - } - }, - "fieldMinMax": false, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 5000000 - } - ] - }, - "unit": "none" - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 10 - }, - "id": 6, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "rawQuery": true, - "rawSql": "select\n timestamp as time,\n case address\n when '0x8207c1ffc5b6804f6024322ccf34f29c3541ae26' then 'OGN'\n when '0x9c354503c38481a7a7a51629142963f98ecc12d0' then 'OGV'\n else address end,\n balance / 1e18 as balance\nfrom erc20_balance\nwhere account = '0xfe730b3cf80ca7b31905f70241f7c786baf443e3'\n and address in ('0x9c354503c38481a7a7a51629142963f98ecc12d0')\n and $__timeFilter(timestamp) \norder by time", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - } - } - ], - "title": "OGV Balance (Investor)", - "type": "timeseries" - } - ], - "refresh": "", - "schemaVersion": 39, - "tags": [], - "templating": { - "list": [] - }, - "time": { - "from": "now-1y", - "to": "now" - }, - "timeRangeUpdatedDuringEditOrView": false, - "timepicker": {}, - "timezone": "", - "title": "OGN / OGV Distribution", - "uid": "cf5ee9c7-1110-4b83-9f74-a57dfc07cf27", - "version": 16, - "weekStart": "" -} \ No newline at end of file diff --git a/grafana/origin-overview.json b/grafana/origin-overview.json deleted file mode 100644 index 0acad40a..00000000 --- a/grafana/origin-overview.json +++ /dev/null @@ -1,201 +0,0 @@ -{ - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": { - "type": "grafana", - "uid": "-- Grafana --" - }, - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "type": "dashboard" - } - ] - }, - "editable": true, - "fiscalYearStartMonth": 0, - "graphTooltip": 0, - "id": 38, - "links": [], - "panels": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisGridShow": true, - "axisLabel": "", - "axisPlacement": "left", - "fillOpacity": 30, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "lineWidth": 1, - "scaleDistribution": { - "type": "linear" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "decimals": 2, - "fieldMinMax": false, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - } - ] - }, - "unit": "currencyUSD" - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "oeth" - }, - "properties": [ - { - "id": "color", - "value": { - "fixedColor": "blue", - "mode": "fixed" - } - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "ousd" - }, - "properties": [ - { - "id": "color", - "value": { - "mode": "fixed" - } - } - ] - } - ] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 0 - }, - "id": 1, - "options": { - "barRadius": 0, - "barWidth": 0.97, - "fullHighlight": true, - "groupWidth": 0.66, - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "orientation": "vertical", - "showValue": "always", - "stacking": "normal", - "text": {}, - "tooltip": { - "maxHeight": 600, - "mode": "multi", - "sort": "desc" - }, - "xField": "date", - "xTickLabelRotation": 0, - "xTickLabelSpacing": 100 - }, - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "table", - "rawQuery": true, - "rawSql": "SELECT\n oeth_daily_stat.fees_usd / 1e18 as OETH,\n ousd_daily_stat.fees_usd / 1e18 as OUSD,\n oeth_daily_stat.id as date\nFROM\n oeth_daily_stat\nFULL JOIN\n ousd_daily_stat ON oeth_daily_stat.id = ousd_daily_stat.id\n\nWHERE\n $__timeFilter(oeth_daily_stat.id) AND $__timeFilter(ousd_daily_stat.id) \n", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "fees_usd", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "\"timestamp\"", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "oeth_daily_stat" - } - ], - "title": "Origin Revenue", - "transparent": true, - "type": "barchart" - } - ], - "refresh": "", - "schemaVersion": 39, - "tags": [], - "templating": { - "list": [] - }, - "time": { - "from": "now-30d", - "to": "now" - }, - "timeRangeUpdatedDuringEditOrView": false, - "timepicker": {}, - "timezone": "browser", - "title": "Origin Overview", - "uid": "ddibja6u9hn28e", - "version": 4, - "weekStart": "" -} \ No newline at end of file diff --git a/grafana/ousd-dashboard.json b/grafana/ousd-dashboard.json deleted file mode 100644 index 535ffef9..00000000 --- a/grafana/ousd-dashboard.json +++ /dev/null @@ -1,1893 +0,0 @@ -{ - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": { - "type": "datasource", - "uid": "grafana" - }, - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "target": { - "limit": 100, - "matchAny": false, - "tags": [], - "type": "dashboard" - }, - "type": "dashboard" - } - ] - }, - "editable": true, - "fiscalYearStartMonth": 0, - "graphTooltip": 0, - "id": 18, - "links": [], - "liveNow": false, - "panels": [ - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 0 - }, - "id": 47, - "panels": [], - "title": "OUSD Health", - "type": "row" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "description": "Retrieved using `get_dy(a, b, decimals)`", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "line+area" - } - }, - "decimals": 5, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "dark-red", - "value": null - }, - { - "color": "transparent", - "value": 0.996 - }, - { - "color": "dark-red", - "value": 1.004 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 9, - "w": 11, - "x": 0, - "y": 1 - }, - "id": 48, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "rawQuery": true, - "rawSql": "select\n timestamp as time,\n name,\n rate / 1e18\nfrom\n curve_pool_rate\nwhere\n address = '0xbebc44782c7db0a1a60cb6fe97d0b483032ff1c7'\n and $__timeFilter(timestamp)\n and timestamp > '2021-02-01'\norder by\n time asc", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - } - } - ], - "title": "ThreePool Rates - get_dy(a, b, decimals)", - "type": "timeseries" - }, - { - "collapsed": false, - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 10 - }, - "id": 8, - "panels": [], - "targets": [ - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "refId": "A" - } - ], - "title": "OUSD General", - "type": "row" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 9, - "w": 12, - "x": 0, - "y": 11 - }, - "id": 2, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "group": [], - "metricColumn": "none", - "rawQuery": true, - "rawSql": "SELECT\n \"timestamp\" AS \"time\",\n dai / 1000000000000000000 as dai,\n usdc / 1000000000000000000 as usdc,\n usdt / 1000000000000000000 as usdt\nFROM ousd_vault\n where $__timeFilter(timestamp)\nORDER BY 1", - "refId": "A", - "select": [ - [ - { - "params": [ - "frx_eth" - ], - "type": "column" - } - ], - [ - { - "params": [ - "r_eth" - ], - "type": "column" - } - ], - [ - { - "params": [ - "st_eth" - ], - "type": "column" - } - ], - [ - { - "params": [ - "weth" - ], - "type": "column" - } - ] - ], - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "ousd_vault", - "timeColumn": "\"timestamp\"", - "timeColumnType": "timestamptz", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - } - ] - } - ], - "title": "Vault Balances", - "type": "timeseries" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisGridShow": true, - "axisLabel": "", - "axisPlacement": "auto", - "axisSoftMin": 0, - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 9, - "w": 12, - "x": 12, - "y": 11 - }, - "id": 4, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "group": [], - "metricColumn": "none", - "rawQuery": true, - "rawSql": "SELECT\n \"timestamp\" AS \"time\",\n total_supply / 1e18 as total_supply,\n rebasing_supply / 1e18 as rebasing_supply,\n non_rebasing_supply / 1e18 as non_rebasing_supply\nFROM o_token\nWHERE\n $__timeFilter(\"timestamp\") and chain_id = 1 and otoken = '0x2a8e1e676ec238d8a992307b495b45b3feaa5e86'\nORDER BY 1", - "refId": "A", - "select": [ - [ - { - "params": [ - "total_supply" - ], - "type": "column" - } - ], - [ - { - "params": [ - "rebasing_supply" - ], - "type": "column" - } - ], - [ - { - "params": [ - "non_rebasing_supply" - ], - "type": "column" - } - ] - ], - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "ousd", - "timeColumn": "\"timestamp\"", - "timeColumnType": "timestamptz", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - } - ] - } - ], - "title": "OUSD Supply", - "type": "timeseries" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "smooth", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "max": 0.25, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "percentunit" - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "apy" - }, - "properties": [ - { - "id": "custom.lineWidth", - "value": 0 - }, - { - "id": "custom.fillOpacity", - "value": 16 - }, - { - "id": "custom.barAlignment", - "value": 0 - }, - { - "id": "custom.lineInterpolation", - "value": "stepBefore" - } - ] - } - ] - }, - "gridPos": { - "h": 12, - "w": 22, - "x": 0, - "y": 20 - }, - "id": 6, - "options": { - "legend": { - "calcs": [ - "lastNotNull" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "group": [], - "metricColumn": "none", - "rawQuery": true, - "rawSql": "SELECT\n \"timestamp\" AS \"time\",\n apy7_day_avg,\n apy14_day_avg,\n apy30_day_avg,\n apy\nFROM o_token_apy\nWHERE\n $__timeFilter(\"timestamp\") and chain_id = 1 and otoken = '0x2a8e1e676ec238d8a992307b495b45b3feaa5e86'\nORDER BY 1", - "refId": "A", - "select": [ - [ - { - "params": [ - "apy7_day_avg" - ], - "type": "column" - } - ], - [ - { - "params": [ - "apy14_day_avg" - ], - "type": "column" - } - ], - [ - { - "params": [ - "apy30_day_avg" - ], - "type": "column" - } - ], - [ - { - "params": [ - "apy" - ], - "type": "column" - } - ] - ], - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "ousdapy", - "timeColumn": "\"timestamp\"", - "timeColumnType": "timestamptz", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - } - ] - } - ], - "title": "APY", - "type": "timeseries" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "percentunit" - }, - "overrides": [] - }, - "gridPos": { - "h": 12, - "w": 2, - "x": 22, - "y": 20 - }, - "id": 39, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "auto", - "orientation": "auto", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showPercentChange": false, - "textMode": "auto", - "wideLayout": true - }, - "pluginVersion": "11.1.0-69622", - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "table", - "rawQuery": true, - "rawSql": "select timestamp as time, apy, apy7_day_avg, apy14_day_avg, apy30_day_avg from o_token_apy where chain_id = 1 and otoken = '0x2a8e1e676ec238d8a992307b495b45b3feaa5e86' order by id desc limit 1", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - } - } - ], - "title": "Panel Title", - "type": "stat" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "decimals": 2, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 11, - "w": 12, - "x": 0, - "y": 32 - }, - "id": 38, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "group": [], - "metricColumn": "none", - "rawQuery": true, - "rawSql": "SELECT\n \"timestamp\" AS \"time\",\n yield_usd / 1e18 as yield\nFROM o_token_rebase\nWHERE\n $__timeFilter(\"timestamp\") and chain_id = 1 and otoken = '0x2a8e1e676ec238d8a992307b495b45b3feaa5e86'\nORDER BY 1", - "refId": "A", - "select": [ - [ - { - "params": [ - "yield" - ], - "type": "column" - }, - { - "params": [ - "sum" - ], - "type": "window" - }, - { - "params": [ - "yield" - ], - "type": "alias" - } - ] - ], - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "ousd_rebase", - "timeColumn": "\"timestamp\"", - "timeColumnType": "timestamptz", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - } - ] - } - ], - "title": "Yield Accrual", - "type": "timeseries" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "decimals": 2, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 11, - "w": 12, - "x": 12, - "y": 32 - }, - "id": 37, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "single", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "group": [], - "metricColumn": "none", - "rawQuery": true, - "rawSql": "SELECT\n \"timestamp\" AS \"time\",\n fee_usd / 1e18 as fee\nFROM o_token_rebase\nWHERE\n $__timeFilter(\"timestamp\") and chain_id = 1 and otoken = '0x2a8e1e676ec238d8a992307b495b45b3feaa5e86'\nORDER BY 1", - "refId": "A", - "select": [ - [ - { - "params": [ - "fee" - ], - "type": "column" - }, - { - "params": [ - "sum" - ], - "type": "window" - }, - { - "params": [ - "fee" - ], - "type": "alias" - } - ] - ], - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "ousd_rebase", - "timeColumn": "\"timestamp\"", - "timeColumnType": "timestamptz", - "where": [ - { - "name": "$__timeFilter", - "params": [], - "type": "macro" - } - ] - } - ], - "title": "Fee Accrual", - "type": "timeseries" - }, - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 43 - }, - "id": 46, - "panels": [], - "title": "OUSD Strategy Balances", - "type": "row" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 44 - }, - "id": 41, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "rawQuery": true, - "rawSql": "SELECT \ntimestamp as time, \ncase asset \n when '0x6b175474e89094c44da98b954eedeac495271d0f' then 'DAI' \n when '0xdac17f958d2ee523a2206206994597c13d831ec7' then 'USDT' \n when '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' then 'USDC' \nend as asset, \nbalance / case asset \n when '0x6b175474e89094c44da98b954eedeac495271d0f' then 1e18 \n when '0xdac17f958d2ee523a2206206994597c13d831ec7' then 1e6 \n when '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' then 1e6 \nend as balance\nFROM strategy_balance where strategy = '0x89eb88fedc50fc77ae8a18aad1ca0ac27f777a90'\n and $__timeFilter(timestamp)\norder by time", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "asset", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "balance", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "strategy_balance" - } - ], - "title": "OUSD Convex OUSD+3Crv (AMO)", - "type": "timeseries" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "decimals": 2, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 44 - }, - "id": 45, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "rawQuery": true, - "rawSql": "SELECT \ntimestamp as time, \ncase asset \n when '0x6b175474e89094c44da98b954eedeac495271d0f' then 'DAI' \n when '0xdac17f958d2ee523a2206206994597c13d831ec7' then 'USDT' \n when '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' then 'USDC' \nend as asset, \nbalance / case asset \n when '0x6b175474e89094c44da98b954eedeac495271d0f' then 1e18 \n when '0xdac17f958d2ee523a2206206994597c13d831ec7' then 1e6 \n when '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' then 1e6 \nend as balance\nFROM strategy_balance where strategy = '0x76bf500b6305dc4ea851384d3d5502f1c7a0ed44'\n and $__timeFilter(timestamp)\norder by timestamp, asset desc", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "asset", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "balance", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "\"timestamp\"", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "strategy_balance" - } - ], - "title": "OUSD Flux", - "type": "timeseries" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 52 - }, - "id": 40, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "rawQuery": true, - "rawSql": "SELECT \ntimestamp as time, \ncase asset \n when '0x6b175474e89094c44da98b954eedeac495271d0f' then 'DAI' \n when '0xdac17f958d2ee523a2206206994597c13d831ec7' then 'USDT' \n when '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' then 'USDC' \nend as asset, \nbalance / case asset \n when '0x6b175474e89094c44da98b954eedeac495271d0f' then 1e18 \n when '0xdac17f958d2ee523a2206206994597c13d831ec7' then 1e6 \n when '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' then 1e6 \nend as balance\nFROM strategy_balance where strategy = '0x6b69b755c629590ed59618a2712d8a2957ca98fc'\n and $__timeFilter(timestamp)\norder by timestamp, asset desc", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "asset", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "balance", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "\"timestamp\"", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "strategy_balance" - } - ], - "title": "OUSD Maker DSR", - "type": "timeseries" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 52 - }, - "id": 43, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "rawQuery": true, - "rawSql": "SELECT \ntimestamp as time, \ncase asset \n when '0x6b175474e89094c44da98b954eedeac495271d0f' then 'DAI' \n when '0xdac17f958d2ee523a2206206994597c13d831ec7' then 'USDT' \n when '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' then 'USDC' \nend as asset, \nbalance / case asset \n when '0x6b175474e89094c44da98b954eedeac495271d0f' then 1e18 \n when '0xdac17f958d2ee523a2206206994597c13d831ec7' then 1e6 \n when '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' then 1e6 \nend as balance\nFROM strategy_balance where strategy = '0x5a4eee58744d1430876d5ca93cab5ccb763c037d'\n and $__timeFilter(timestamp)\norder by timestamp, asset desc", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "asset", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "balance", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "\"timestamp\"", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "strategy_balance" - } - ], - "title": "OUSD Morpho Compound", - "type": "timeseries" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 0, - "y": 60 - }, - "id": 44, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "rawQuery": true, - "rawSql": "SELECT \ntimestamp as time, \ncase asset \n when '0x6b175474e89094c44da98b954eedeac495271d0f' then 'DAI' \n when '0xdac17f958d2ee523a2206206994597c13d831ec7' then 'USDT' \n when '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' then 'USDC' \nend as asset, \nbalance / case asset \n when '0x6b175474e89094c44da98b954eedeac495271d0f' then 1e18 \n when '0xdac17f958d2ee523a2206206994597c13d831ec7' then 1e6 \n when '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' then 1e6 \nend as balance\nFROM strategy_balance where strategy = '0x79f2188ef9350a1dc11a062cca0abe90684b0197'\n and $__timeFilter(timestamp)\norder by timestamp, asset desc", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "asset", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "balance", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "\"timestamp\"", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "strategy_balance" - } - ], - "title": "OUSD Morpho Aave", - "type": "timeseries" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "linear", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [] - }, - "gridPos": { - "h": 8, - "w": 12, - "x": 12, - "y": 60 - }, - "id": 42, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "rawQuery": true, - "rawSql": "SELECT \ntimestamp as time, \ncase asset \n when '0x6b175474e89094c44da98b954eedeac495271d0f' then 'DAI' \n when '0xdac17f958d2ee523a2206206994597c13d831ec7' then 'USDT' \n when '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' then 'USDC' \nend as asset, \nbalance / case asset \n when '0x6b175474e89094c44da98b954eedeac495271d0f' then 1e18 \n when '0xdac17f958d2ee523a2206206994597c13d831ec7' then 1e6 \n when '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48' then 1e6 \nend as balance\nFROM strategy_balance where strategy = '0x5e3646a1db86993f73e6b74a57d8640b69f7e259'\n and $__timeFilter(timestamp)\norder by time", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "asset", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "balance", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "strategy_balance" - } - ], - "title": "OUSD Aave", - "type": "timeseries" - } - ], - "refresh": "", - "schemaVersion": 39, - "tags": [ - "ousd" - ], - "templating": { - "list": [] - }, - "time": { - "from": "now-6M", - "to": "now" - }, - "timeRangeUpdatedDuringEditOrView": false, - "timepicker": {}, - "timezone": "", - "title": "OUSD Dashboard", - "uid": "5RW4zO7Sj", - "version": 33, - "weekStart": "" -} \ No newline at end of file diff --git a/grafana/ousd-strategy-earnings.json b/grafana/ousd-strategy-earnings.json deleted file mode 100644 index 844d965d..00000000 --- a/grafana/ousd-strategy-earnings.json +++ /dev/null @@ -1,2655 +0,0 @@ -{ - "annotations": { - "list": [ - { - "builtIn": 1, - "datasource": { - "type": "grafana", - "uid": "-- Grafana --" - }, - "enable": true, - "hide": true, - "iconColor": "rgba(0, 211, 255, 1)", - "name": "Annotations & Alerts", - "type": "dashboard" - } - ] - }, - "editable": true, - "fiscalYearStartMonth": 0, - "graphTooltip": 1, - "id": 16, - "links": [], - "liveNow": false, - "panels": [ - { - "collapsed": false, - "gridPos": { - "h": 1, - "w": 24, - "x": 0, - "y": 0 - }, - "id": 30, - "panels": [], - "title": "OUSD Strategies", - "type": "row" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "earnings_change" - }, - "properties": [ - { - "id": "custom.axisPlacement", - "value": "right" - }, - { - "id": "custom.fillOpacity", - "value": 25 - }, - { - "id": "custom.lineWidth", - "value": 0 - } - ] - } - ] - }, - "gridPos": { - "h": 9, - "w": 11, - "x": 0, - "y": 1 - }, - "id": 31, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "table", - "rawQuery": true, - "rawSql": "SELECT timestamp as time, earnings_change / 1000000000000000000 as earnings_change, balance / 1000000000000000000 as balance\nFROM strategy_daily_yield\nWHERE strategy = '0x6b69b755c629590ed59618a2712d8a2957ca98fc'\n and $__timeFilter(timestamp)\nORDER BY timestamp", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "strategy", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "asset", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "earnings", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "strategy_daily_yield" - } - ], - "title": "OUSD Maker DSR - Earnings", - "type": "timeseries" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "axisSoftMax": -4, - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "hue", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/apy.*/" - }, - "properties": [ - { - "id": "custom.axisPlacement", - "value": "auto" - }, - { - "id": "custom.showPoints", - "value": "never" - }, - { - "id": "custom.lineWidth", - "value": 1 - }, - { - "id": "custom.lineInterpolation", - "value": "stepBefore" - }, - { - "id": "unit", - "value": "percentunit" - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "earnings" - }, - "properties": [ - { - "id": "custom.fillOpacity", - "value": 10 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "apy" - }, - "properties": [ - { - "id": "custom.fillOpacity", - "value": 25 - }, - { - "id": "custom.lineWidth", - "value": 0 - } - ] - } - ] - }, - "gridPos": { - "h": 9, - "w": 11, - "x": 11, - "y": 1 - }, - "id": 20, - "options": { - "legend": { - "calcs": [ - "lastNotNull" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "hide": false, - "rawQuery": true, - "rawSql": "SELECT\n \"timestamp\" AS \"time\",\n -- earnings_change / 1000000000000000000 as earnings_change,\n apy,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 6 PRECEDING AND CURRENT ROW) AS apy7,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 13 PRECEDING AND CURRENT ROW) AS apy14,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 29 PRECEDING AND CURRENT ROW) AS apy30\nFROM\n strategy_daily_yield \n where strategy = '0x6b69b755c629590ed59618a2712d8a2957ca98fc'\n and $__timeFilter(timestamp)\nORDER BY timestamp", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "earnings", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "asset", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "alias": "\"time\"", - "parameters": [ - { - "name": "\"timestamp\"", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "strategy_yield" - } - ], - "title": "OUSD Maker DSR - APY", - "type": "timeseries" - }, - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "percentunit" - }, - "overrides": [] - }, - "gridPos": { - "h": 9, - "w": 2, - "x": 22, - "y": 1 - }, - "id": 33, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "center", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showPercentChange": false, - "textMode": "auto", - "wideLayout": true - }, - "pluginVersion": "11.1.0-69622", - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "table", - "rawQuery": true, - "rawSql": "SELECT\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 1 PRECEDING AND 1 PRECEDING) AS apy,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 6 PRECEDING AND CURRENT ROW) AS apy7,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 13 PRECEDING AND CURRENT ROW) AS apy14,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 29 PRECEDING AND CURRENT ROW) AS apy30\nFROM\n strategy_daily_yield \n where strategy = '0x6b69b755c629590ed59618a2712d8a2957ca98fc'\nORDER BY timestamp desc\nlimit 1", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - } - } - ], - "title": "Latest APY", - "type": "stat" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "earnings_change" - }, - "properties": [ - { - "id": "custom.axisPlacement", - "value": "right" - }, - { - "id": "custom.fillOpacity", - "value": 25 - }, - { - "id": "custom.lineWidth", - "value": 0 - } - ] - } - ] - }, - "gridPos": { - "h": 9, - "w": 11, - "x": 0, - "y": 10 - }, - "id": 27, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "table", - "rawQuery": true, - "rawSql": "SELECT timestamp as time, earnings_change / 1000000000000000000 as earnings_change, balance / 1000000000000000000 as balance\nFROM strategy_daily_yield\nWHERE strategy = '0x76bf500b6305dc4ea851384d3d5502f1c7a0ed44'\n and $__timeFilter(timestamp)\nORDER BY timestamp", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "strategy", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "asset", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "earnings", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "strategy_daily_yield" - } - ], - "title": "OUSD Flux - Earnings", - "type": "timeseries" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "axisSoftMax": -4, - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "hue", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/apy.*/" - }, - "properties": [ - { - "id": "custom.axisPlacement", - "value": "auto" - }, - { - "id": "custom.showPoints", - "value": "never" - }, - { - "id": "custom.lineWidth", - "value": 1 - }, - { - "id": "custom.lineInterpolation", - "value": "stepBefore" - }, - { - "id": "unit", - "value": "percentunit" - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "earnings" - }, - "properties": [ - { - "id": "custom.fillOpacity", - "value": 10 - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "apy" - }, - "properties": [ - { - "id": "custom.lineWidth", - "value": 0 - }, - { - "id": "custom.fillOpacity", - "value": 25 - } - ] - } - ] - }, - "gridPos": { - "h": 9, - "w": 11, - "x": 11, - "y": 10 - }, - "id": 32, - "options": { - "legend": { - "calcs": [ - "lastNotNull" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "hide": false, - "rawQuery": true, - "rawSql": "SELECT\n \"timestamp\" AS \"time\",\n -- earnings_change / 1000000000000000000 as earnings_change,\n apy,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 6 PRECEDING AND CURRENT ROW) AS apy7,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 13 PRECEDING AND CURRENT ROW) AS apy14,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 29 PRECEDING AND CURRENT ROW) AS apy30\nFROM\n strategy_daily_yield \n where strategy = '0x76bf500b6305dc4ea851384d3d5502f1c7a0ed44'\n and $__timeFilter(timestamp)\nORDER BY timestamp", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "earnings", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "asset", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "alias": "\"time\"", - "parameters": [ - { - "name": "\"timestamp\"", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "strategy_yield" - } - ], - "title": "OUSD Flux - APY", - "type": "timeseries" - }, - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "percentunit" - }, - "overrides": [] - }, - "gridPos": { - "h": 9, - "w": 2, - "x": 22, - "y": 10 - }, - "id": 36, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "center", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showPercentChange": false, - "textMode": "auto", - "wideLayout": true - }, - "pluginVersion": "11.1.0-69622", - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "table", - "rawQuery": true, - "rawSql": "SELECT\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 1 PRECEDING AND 1 PRECEDING) AS apy,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 6 PRECEDING AND CURRENT ROW) AS apy7,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 13 PRECEDING AND CURRENT ROW) AS apy14,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 29 PRECEDING AND CURRENT ROW) AS apy30\nFROM\n strategy_daily_yield \n where strategy = '0x76bf500b6305dc4ea851384d3d5502f1c7a0ed44'\nORDER BY timestamp desc\nlimit 1", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - } - } - ], - "title": "Latest APY", - "type": "stat" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "earnings_change" - }, - "properties": [ - { - "id": "custom.axisPlacement", - "value": "right" - }, - { - "id": "custom.fillOpacity", - "value": 25 - }, - { - "id": "custom.lineWidth", - "value": 0 - } - ] - } - ] - }, - "gridPos": { - "h": 9, - "w": 11, - "x": 0, - "y": 19 - }, - "id": 29, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "table", - "rawQuery": true, - "rawSql": "SELECT timestamp as time, earnings_change / 1000000000000000000 as earnings_change, balance / 1000000000000000000 as balance\nFROM strategy_daily_yield\nWHERE strategy = '0x79f2188ef9350a1dc11a062cca0abe90684b0197'\n and $__timeFilter(timestamp)\nORDER BY timestamp", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "strategy", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "asset", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "earnings", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "strategy_daily_yield" - } - ], - "title": "OUSD Morpho Aave - Earnings", - "type": "timeseries" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "axisSoftMax": -4, - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "hue", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/apy.*/" - }, - "properties": [ - { - "id": "custom.axisPlacement", - "value": "auto" - }, - { - "id": "custom.showPoints", - "value": "never" - }, - { - "id": "custom.lineWidth", - "value": 1 - }, - { - "id": "custom.lineInterpolation", - "value": "stepBefore" - }, - { - "id": "unit", - "value": "percentunit" - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "apy" - }, - "properties": [ - { - "id": "custom.fillOpacity", - "value": 25 - }, - { - "id": "custom.lineWidth", - "value": 0 - } - ] - } - ] - }, - "gridPos": { - "h": 9, - "w": 11, - "x": 11, - "y": 19 - }, - "id": 28, - "options": { - "legend": { - "calcs": [ - "lastNotNull" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "hide": false, - "rawQuery": true, - "rawSql": "SELECT\n \"timestamp\" AS \"time\",\n -- earnings_change / 1000000000000000000 as earnings_change,\n apy,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 6 PRECEDING AND CURRENT ROW) AS apy7,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 13 PRECEDING AND CURRENT ROW) AS apy14,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 29 PRECEDING AND CURRENT ROW) AS apy30\nFROM\n strategy_daily_yield \n where strategy = '0x79f2188ef9350a1dc11a062cca0abe90684b0197'\n and $__timeFilter(timestamp)\nORDER BY timestamp", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "earnings", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "asset", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "alias": "\"time\"", - "parameters": [ - { - "name": "\"timestamp\"", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "strategy_yield" - } - ], - "title": "OUSD Morpho Aave - APY", - "type": "timeseries" - }, - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "percentunit" - }, - "overrides": [] - }, - "gridPos": { - "h": 9, - "w": 2, - "x": 22, - "y": 19 - }, - "id": 35, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "center", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showPercentChange": false, - "textMode": "auto", - "wideLayout": true - }, - "pluginVersion": "11.1.0-69622", - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "table", - "rawQuery": true, - "rawSql": "SELECT\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 1 PRECEDING AND 1 PRECEDING) AS apy,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 6 PRECEDING AND CURRENT ROW) AS apy7,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 13 PRECEDING AND CURRENT ROW) AS apy14,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 29 PRECEDING AND CURRENT ROW) AS apy30\nFROM\n strategy_daily_yield \n where strategy = '0x79f2188ef9350a1dc11a062cca0abe90684b0197'\nORDER BY timestamp desc\nlimit 1", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - } - } - ], - "title": "Latest APY", - "type": "stat" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "earnings_change" - }, - "properties": [ - { - "id": "custom.axisPlacement", - "value": "right" - }, - { - "id": "custom.fillOpacity", - "value": 25 - }, - { - "id": "custom.lineWidth", - "value": 0 - } - ] - } - ] - }, - "gridPos": { - "h": 9, - "w": 11, - "x": 0, - "y": 28 - }, - "id": 22, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "table", - "rawQuery": true, - "rawSql": "SELECT timestamp as time, earnings_change / 1000000000000000000 as earnings_change, balance / 1000000000000000000 as balance\nFROM strategy_daily_yield\nWHERE strategy = '0x5a4eee58744d1430876d5ca93cab5ccb763c037d'\n and $__timeFilter(timestamp)\nORDER BY timestamp", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "strategy", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "asset", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "earnings", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "strategy_daily_yield" - } - ], - "title": "OUSD Morpho Compound - Earnings", - "type": "timeseries" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "axisSoftMax": -4, - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "hue", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/apy.*/" - }, - "properties": [ - { - "id": "custom.axisPlacement", - "value": "auto" - }, - { - "id": "custom.showPoints", - "value": "never" - }, - { - "id": "custom.lineWidth", - "value": 1 - }, - { - "id": "custom.lineInterpolation", - "value": "stepBefore" - }, - { - "id": "unit", - "value": "percentunit" - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "apy" - }, - "properties": [ - { - "id": "custom.fillOpacity", - "value": 25 - }, - { - "id": "custom.lineWidth", - "value": 0 - } - ] - } - ] - }, - "gridPos": { - "h": 9, - "w": 11, - "x": 11, - "y": 28 - }, - "id": 26, - "options": { - "legend": { - "calcs": [ - "lastNotNull" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "hide": false, - "rawQuery": true, - "rawSql": "SELECT\n \"timestamp\" AS \"time\",\n -- earnings_change / 1000000000000000000 as earnings_change,\n apy,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 6 PRECEDING AND CURRENT ROW) AS apy7,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 13 PRECEDING AND CURRENT ROW) AS apy14,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 29 PRECEDING AND CURRENT ROW) AS apy30\nFROM\n strategy_daily_yield \n where strategy = '0x5a4eee58744d1430876d5ca93cab5ccb763c037d'\n and $__timeFilter(timestamp)\nORDER BY timestamp", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "earnings", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "asset", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "alias": "\"time\"", - "parameters": [ - { - "name": "\"timestamp\"", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "strategy_yield" - } - ], - "title": "OUSD Morpho Compound - APY by Day", - "type": "timeseries" - }, - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green", - "value": null - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "percentunit" - }, - "overrides": [] - }, - "gridPos": { - "h": 9, - "w": 2, - "x": 22, - "y": 28 - }, - "id": 34, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "center", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "showPercentChange": false, - "textMode": "auto", - "wideLayout": true - }, - "pluginVersion": "11.1.0-69622", - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "table", - "rawQuery": true, - "rawSql": "SELECT\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 1 PRECEDING AND 1 PRECEDING) AS apy,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 6 PRECEDING AND CURRENT ROW) AS apy7,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 13 PRECEDING AND CURRENT ROW) AS apy14,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 29 PRECEDING AND CURRENT ROW) AS apy30\nFROM\n strategy_daily_yield \n where strategy = '0x5a4eee58744d1430876d5ca93cab5ccb763c037d'\nORDER BY timestamp desc\nlimit 1", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - } - } - ], - "title": "Latest APY", - "type": "stat" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "earnings_change" - }, - "properties": [ - { - "id": "custom.axisPlacement", - "value": "right" - }, - { - "id": "custom.fillOpacity", - "value": 25 - }, - { - "id": "custom.lineWidth", - "value": 0 - } - ] - } - ] - }, - "gridPos": { - "h": 9, - "w": 11, - "x": 0, - "y": 37 - }, - "id": 24, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "table", - "rawQuery": true, - "rawSql": "SELECT timestamp as time, earnings_change / 1000000000000000000 as earnings_change, balance / 1000000000000000000 as balance\nFROM strategy_daily_yield\nWHERE strategy = '0x89eb88fedc50fc77ae8a18aad1ca0ac27f777a90'\n and $__timeFilter(timestamp)\nORDER BY timestamp", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "strategy", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "asset", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "earnings", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "strategy_daily_yield" - } - ], - "title": "OUSD Convex OUSD+3Crv (AMO) - Earnings", - "type": "timeseries" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "axisSoftMax": -4, - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "hue", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "max": 0.12, - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/apy.*/" - }, - "properties": [ - { - "id": "custom.axisPlacement", - "value": "auto" - }, - { - "id": "custom.showPoints", - "value": "never" - }, - { - "id": "custom.lineWidth", - "value": 1 - }, - { - "id": "custom.lineInterpolation", - "value": "stepBefore" - }, - { - "id": "unit", - "value": "percentunit" - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "apy" - }, - "properties": [ - { - "id": "custom.fillOpacity", - "value": 25 - }, - { - "id": "custom.lineWidth", - "value": 0 - } - ] - } - ] - }, - "gridPos": { - "h": 9, - "w": 11, - "x": 11, - "y": 37 - }, - "id": 25, - "options": { - "legend": { - "calcs": [ - "lastNotNull" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "hide": false, - "rawQuery": true, - "rawSql": "SELECT\n \"timestamp\" AS \"time\",\n -- earnings_change / 1000000000000000000 as earnings_change,\n apy,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 6 PRECEDING AND CURRENT ROW) AS apy7,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 13 PRECEDING AND CURRENT ROW) AS apy14,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 29 PRECEDING AND CURRENT ROW) AS apy30\nFROM\n strategy_daily_yield \n where strategy = '0x89eb88fedc50fc77ae8a18aad1ca0ac27f777a90'\n and $__timeFilter(timestamp)\nORDER BY timestamp", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "earnings", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "asset", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "alias": "\"time\"", - "parameters": [ - { - "name": "\"timestamp\"", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "strategy_yield" - } - ], - "title": "OUSD Convex OUSD+3Crv (AMO) - APY by Day", - "type": "timeseries" - }, - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "percentunit" - }, - "overrides": [] - }, - "gridPos": { - "h": 9, - "w": 2, - "x": 22, - "y": 37 - }, - "id": 38, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "center", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "textMode": "auto", - "wideLayout": true - }, - "pluginVersion": "10.3.0-63985", - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "table", - "rawQuery": true, - "rawSql": "SELECT\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 1 PRECEDING AND 1 PRECEDING) AS apy,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 6 PRECEDING AND CURRENT ROW) AS apy7,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 13 PRECEDING AND CURRENT ROW) AS apy14,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 29 PRECEDING AND CURRENT ROW) AS apy30\nFROM\n strategy_daily_yield \n where strategy = '0x89eb88fedc50fc77ae8a18aad1ca0ac27f777a90'\nORDER BY timestamp desc\nlimit 1", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - } - } - ], - "title": "Latest APY", - "type": "stat" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "none", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": false, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byName", - "options": "earnings_change" - }, - "properties": [ - { - "id": "custom.axisPlacement", - "value": "right" - }, - { - "id": "custom.fillOpacity", - "value": 25 - }, - { - "id": "custom.lineWidth", - "value": 0 - } - ] - } - ] - }, - "gridPos": { - "h": 9, - "w": 11, - "x": 0, - "y": 46 - }, - "id": 21, - "options": { - "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "table", - "rawQuery": true, - "rawSql": "SELECT timestamp as time, earnings_change / 1000000000000000000 as earnings_change, balance / 1000000000000000000 as balance\nFROM strategy_daily_yield\nWHERE strategy = '0x5e3646a1db86993f73e6b74a57d8640b69f7e259'\n and $__timeFilter(timestamp)\norder by timestamp", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "strategy", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "asset", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "earnings", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "strategy_daily_yield" - } - ], - "title": "OUSD Aave - Earnings", - "type": "timeseries" - }, - { - "datasource": { - "type": "grafana-postgresql-datasource", - "uid": "cdjqw6cqd1gqob" - }, - "description": "", - "fieldConfig": { - "defaults": { - "color": { - "mode": "palette-classic" - }, - "custom": { - "axisBorderShow": false, - "axisCenteredZero": false, - "axisColorMode": "text", - "axisLabel": "", - "axisPlacement": "auto", - "axisSoftMax": -4, - "barAlignment": 0, - "drawStyle": "line", - "fillOpacity": 0, - "gradientMode": "hue", - "hideFrom": { - "legend": false, - "tooltip": false, - "viz": false - }, - "insertNulls": false, - "lineInterpolation": "stepAfter", - "lineStyle": { - "fill": "solid" - }, - "lineWidth": 1, - "pointSize": 5, - "scaleDistribution": { - "type": "linear" - }, - "showPoints": "auto", - "spanNulls": true, - "stacking": { - "group": "A", - "mode": "none" - }, - "thresholdsStyle": { - "mode": "off" - } - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - } - }, - "overrides": [ - { - "matcher": { - "id": "byRegexp", - "options": "/apy.*/" - }, - "properties": [ - { - "id": "custom.axisPlacement", - "value": "auto" - }, - { - "id": "custom.showPoints", - "value": "never" - }, - { - "id": "custom.lineWidth", - "value": 1 - }, - { - "id": "custom.lineInterpolation", - "value": "stepBefore" - }, - { - "id": "unit", - "value": "percentunit" - } - ] - }, - { - "matcher": { - "id": "byName", - "options": "apy" - }, - "properties": [ - { - "id": "custom.fillOpacity", - "value": 25 - }, - { - "id": "custom.lineWidth", - "value": 0 - } - ] - } - ] - }, - "gridPos": { - "h": 9, - "w": 11, - "x": 11, - "y": 46 - }, - "id": 23, - "options": { - "legend": { - "calcs": [ - "lastNotNull" - ], - "displayMode": "table", - "placement": "bottom", - "showLegend": true - }, - "tooltip": { - "mode": "multi", - "sort": "none" - } - }, - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "time_series", - "hide": false, - "rawQuery": true, - "rawSql": "SELECT\n \"timestamp\" AS \"time\",\n -- earnings_change / 1000000000000000000 as earnings_change,\n apy,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 6 PRECEDING AND CURRENT ROW) AS apy7,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 13 PRECEDING AND CURRENT ROW) AS apy14,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 29 PRECEDING AND CURRENT ROW) AS apy30\nFROM\n strategy_daily_yield \n where strategy = '0x5e3646a1db86993f73e6b74a57d8640b69f7e259'\n and $__timeFilter(timestamp)\nORDER BY timestamp", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [ - { - "name": "earnings", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "parameters": [ - { - "name": "asset", - "type": "functionParameter" - } - ], - "type": "function" - }, - { - "alias": "\"time\"", - "parameters": [ - { - "name": "\"timestamp\"", - "type": "functionParameter" - } - ], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - }, - "table": "strategy_yield" - } - ], - "title": "OUSD Aave - APY by Day", - "type": "timeseries" - }, - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "fieldConfig": { - "defaults": { - "color": { - "mode": "thresholds" - }, - "mappings": [], - "thresholds": { - "mode": "absolute", - "steps": [ - { - "color": "green" - }, - { - "color": "red", - "value": 80 - } - ] - }, - "unit": "percentunit" - }, - "overrides": [] - }, - "gridPos": { - "h": 9, - "w": 2, - "x": 22, - "y": 46 - }, - "id": 37, - "options": { - "colorMode": "value", - "graphMode": "area", - "justifyMode": "center", - "orientation": "horizontal", - "reduceOptions": { - "calcs": [ - "lastNotNull" - ], - "fields": "", - "values": false - }, - "textMode": "auto", - "wideLayout": true - }, - "pluginVersion": "10.3.0-63985", - "targets": [ - { - "datasource": { - "type": "postgres", - "uid": "cdjqw6cqd1gqob" - }, - "editorMode": "code", - "format": "table", - "rawQuery": true, - "rawSql": "SELECT\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 1 PRECEDING AND 1 PRECEDING) AS apy,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 6 PRECEDING AND CURRENT ROW) AS apy7,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 13 PRECEDING AND CURRENT ROW) AS apy14,\n AVG(apy) OVER(ORDER BY timestamp ROWS BETWEEN 29 PRECEDING AND CURRENT ROW) AS apy30\nFROM\n strategy_daily_yield \n where strategy = '0x5e3646a1db86993f73e6b74a57d8640b69f7e259'\nORDER BY timestamp desc\nlimit 1", - "refId": "A", - "sql": { - "columns": [ - { - "parameters": [], - "type": "function" - } - ], - "groupBy": [ - { - "property": { - "type": "string" - }, - "type": "groupBy" - } - ], - "limit": 50 - } - } - ], - "title": "Latest APY", - "type": "stat" - } - ], - "refresh": "", - "schemaVersion": 39, - "tags": [ - "ousd" - ], - "templating": { - "list": [] - }, - "time": { - "from": "now-6M", - "to": "now" - }, - "timeRangeUpdatedDuringEditOrView": false, - "timepicker": {}, - "timezone": "", - "title": "OUSD Strategy Earnings", - "uid": "f40d88db-86e6-43c6-933d-e7bc1ad5ced0", - "version": 28, - "weekStart": "" -} \ No newline at end of file diff --git a/schema.graphql b/schema.graphql index 351931bc..5852fa3d 100644 --- a/schema.graphql +++ b/schema.graphql @@ -980,7 +980,9 @@ type StrategyBalance @entity { blockNumber: Int! @index strategy: String! asset: String! + symbol: String! balance: BigInt! + balanceETH: BigInt! } type StrategyYield @entity { @@ -1746,7 +1748,6 @@ type OTokenActivity @entity { data: JSON } - enum OTokenActivityType { Approval Bridge @@ -1792,6 +1793,8 @@ type OTokenDailyStat @entity { yield: BigInt! fees: BigInt! + cumulativeYield: BigInt! + cumulativeFees: BigInt! marketCapUSD: Float! } diff --git a/schema/general.graphql b/schema/general.graphql index 073b18bd..8e31cf84 100644 --- a/schema/general.graphql +++ b/schema/general.graphql @@ -44,7 +44,9 @@ type StrategyBalance @entity { blockNumber: Int! @index strategy: String! asset: String! + symbol: String! balance: BigInt! + balanceETH: BigInt! } type StrategyYield @entity { diff --git a/schema/otoken.graphql b/schema/otoken.graphql index 0f70ee73..f1ffbaea 100644 --- a/schema/otoken.graphql +++ b/schema/otoken.graphql @@ -111,7 +111,6 @@ type OTokenActivity @entity { data: JSON } - enum OTokenActivityType { Approval Bridge @@ -157,6 +156,8 @@ type OTokenDailyStat @entity { yield: BigInt! fees: BigInt! + cumulativeYield: BigInt! + cumulativeFees: BigInt! marketCapUSD: Float! } diff --git a/src/main-test.ts b/src/main-test.ts index f0aa7fbc..abeb320e 100644 --- a/src/main-test.ts +++ b/src/main-test.ts @@ -2,38 +2,43 @@ import 'tsconfig-paths/register' import { run } from '@processor' import { ensureExchangeRate } from '@shared/post-processors/exchange-rates' -import { OETH_ADDRESS, OUSD_ADDRESS } from '@utils/addresses' +import { CurrencySymbol } from '@shared/post-processors/exchange-rates/mainnetCurrencies' +import { priceMap } from '@shared/post-processors/exchange-rates/price-routing-mainnet' if (require.main === module) { console.log('process:test running') run({ - chainId: 8453, + chainId: 1, stateSchema: 'test-processor', processors: [ { name: 'test', - from: 19642044, + from: 20837855, setup: (p) => { - p.includeAllBlocks({ from: 19642044 }) + p.includeAllBlocks({ from: 20837855 }) }, process: async (ctx) => { // Validate that we're getting otoken rates the way we want to. - // OUSD - // OUSD - // const OUSD_USD = await ensureExchangeRate(ctx, ctx.blocks[0], OUSD_ADDRESS, 'USD') - // const OUSD_ETH = await ensureExchangeRate(ctx, ctx.blocks[0], OUSD_ADDRESS, 'ETH') - // // OETH - // const OETH_USD = await ensureExchangeRate(ctx, ctx.blocks[0], OETH_ADDRESS, 'USD') - // const OETH_ETH = await ensureExchangeRate(ctx, ctx.blocks[0], OETH_ADDRESS, 'ETH') - // const ETH_OETH = await ensureExchangeRate(ctx, ctx.blocks[0], 'ETH', OETH_ADDRESS) - // - // const ETH_USD = await ensureExchangeRate(ctx, ctx.blocks[0], 'ETH', 'USD') + for (const pair of Object.keys(priceMap)) { + const rate = await ensureExchangeRate( + ctx, + ctx.blocks[0], + pair.split('_')[0] as CurrencySymbol, + pair.split('_')[1] as CurrencySymbol, + ) + console.log(`${pair} = ${Number(rate?.rate) / 1e18}`) - const ETH_superOETHb = await ensureExchangeRate(ctx, ctx.blocks[0], 'ETH', 'superOETHb') - const superOETHb_ETH = await ensureExchangeRate(ctx, ctx.blocks[0], 'superOETHb', 'ETH') + const rate2 = await ensureExchangeRate( + ctx, + ctx.blocks[0], + pair.split('_')[1] as CurrencySymbol, + pair.split('_')[0] as CurrencySymbol, + ) + console.log(`${pair.split('_').reverse().join('_')} = ${Number(rate2?.rate) / 1e18}`) + } - debugger + process.exit(0) }, }, ], diff --git a/src/mainnet/processors/erc20s.ts b/src/mainnet/processors/erc20s.ts index bc7a852b..42e8c45b 100644 --- a/src/mainnet/processors/erc20s.ts +++ b/src/mainnet/processors/erc20s.ts @@ -5,14 +5,12 @@ import { OETH_ADDRESS, OETH_DRIPPER_ADDRESS, OETH_VAULT_ADDRESS, - OUSD_VAULT_ADDRESS, - TokenSymbol, WOETH_ADDRESS, oethStrategyArray, - ousdStrategyArray, tokens, } from '@utils/addresses' import { logFilter } from '@utils/logFilter' +import { TokenSymbol } from '@utils/symbols' // TODO: Would be nice if interested parties could register their desires here from other parts of the code, // allowing multiple declarations of need without issue. diff --git a/src/model/generated/oTokenDailyStat.model.ts b/src/model/generated/oTokenDailyStat.model.ts index c8c62acc..efc1f975 100644 --- a/src/model/generated/oTokenDailyStat.model.ts +++ b/src/model/generated/oTokenDailyStat.model.ts @@ -70,6 +70,12 @@ export class OTokenDailyStat { @BigIntColumn_({nullable: false}) fees!: bigint + @BigIntColumn_({nullable: false}) + cumulativeYield!: bigint + + @BigIntColumn_({nullable: false}) + cumulativeFees!: bigint + @FloatColumn_({nullable: false}) marketCapUSD!: number } diff --git a/src/model/generated/strategyBalance.model.ts b/src/model/generated/strategyBalance.model.ts index f70d76b1..344f93ac 100644 --- a/src/model/generated/strategyBalance.model.ts +++ b/src/model/generated/strategyBalance.model.ts @@ -30,6 +30,12 @@ export class StrategyBalance { @StringColumn_({nullable: false}) asset!: string + @StringColumn_({nullable: false}) + symbol!: string + @BigIntColumn_({nullable: false}) balance!: bigint + + @BigIntColumn_({nullable: false}) + balanceETH!: bigint } diff --git a/src/server-extension/ogn-stats.ts b/src/server-extension/ogn-stats.ts index bb996fda..aa36b66c 100644 --- a/src/server-extension/ogn-stats.ts +++ b/src/server-extension/ogn-stats.ts @@ -1,5 +1,4 @@ import { GraphQLResolveInfo } from 'graphql' -import 'reflect-metadata' import { Field, Info, ObjectType, Query, Resolver } from 'type-graphql' import type { EntityManager } from 'typeorm' import { createPublicClient, fallback, formatEther, getContract, http, parseAbi } from 'viem' diff --git a/src/server-extension/resolvers/index.ts b/src/server-extension/resolvers/index.ts index 3981fde0..33f60262 100644 --- a/src/server-extension/resolvers/index.ts +++ b/src/server-extension/resolvers/index.ts @@ -1,5 +1,7 @@ +import 'reflect-metadata' import 'tsconfig-paths/register' +export { ERC20Resolver } from '../erc20' export { OGNStatsResolver } from '../ogn-stats' export { StrategyResolver } from '../strategies' -export { ERC20Resolver } from '../erc20' +export { SymbolResolver } from '../symbols' diff --git a/src/server-extension/strategies.ts b/src/server-extension/strategies.ts index 461b4951..c29e73cb 100644 --- a/src/server-extension/strategies.ts +++ b/src/server-extension/strategies.ts @@ -42,10 +42,14 @@ export class Balance { asset!: string @Field(() => Date, { nullable: false }) timestamp!: Date + @Field(() => String, { nullable: false }) + symbol!: string @Field(() => Int, { nullable: false }) blockNumber!: number @Field(() => BigInt, { nullable: false }) balance!: bigint + @Field(() => BigInt, { nullable: false }) + balanceETH!: bigint constructor(props: Partial) { Object.assign(this, props) @@ -99,9 +103,11 @@ export class StrategyResolver { ), ).map((b) => ({ asset: b.asset, + symbol: b.symbol, timestamp: b.timestamp, blockNumber: b.blockNumber, balance: b.balance, + balanceETH: b.balanceETH, })), } }), diff --git a/src/server-extension/symbols.ts b/src/server-extension/symbols.ts new file mode 100644 index 00000000..9243b525 --- /dev/null +++ b/src/server-extension/symbols.ts @@ -0,0 +1,29 @@ +import { GraphQLResolveInfo } from 'graphql' +import { Field, Info, ObjectType, Query, Resolver } from 'type-graphql' +import { EntityManager } from 'typeorm' + +import { symbols } from '@utils/symbols' + +@ObjectType() +export class Symbol { + @Field(() => String, { nullable: false }) + chainId!: number + @Field(() => String, { nullable: false }) + address!: string + @Field(() => String, { nullable: false }) + symbol!: string + + constructor(props: Partial) { + Object.assign(this, props) + } +} + +@Resolver() +export class SymbolResolver { + constructor(private tx: () => Promise) {} + + @Query(() => [Symbol]) + async symbols(@Info() info: GraphQLResolveInfo): Promise { + return symbols.map((symbol) => new Symbol(symbol)) + } +} diff --git a/src/shared/post-processors/exchange-rates/exchange-rates.ts b/src/shared/post-processors/exchange-rates/exchange-rates.ts index cfd3431e..89c9f03f 100644 --- a/src/shared/post-processors/exchange-rates/exchange-rates.ts +++ b/src/shared/post-processors/exchange-rates/exchange-rates.ts @@ -52,3 +52,11 @@ export const ensureExchangeRate = async (ctx: Context, block: Block, base: Curre export const ensureExchangeRates = async (ctx: Context, block: Block, pairs: [Currency, Currency][]) => { return await Promise.all(pairs.map(([base, quote]) => ensureExchangeRate(ctx, block, base, quote))).then(compact) } + +const E18 = 10n ** 18n +export const convertUsingRate = (value: bigint, rate: bigint) => (value * rate) / E18 +export const convertRate = async (ctx: Context, block: Block, from: Currency, to: Currency, value: bigint) => { + const exchangeRate = await ensureExchangeRate(ctx, block, from, to) + if (!exchangeRate) return 0n + return convertUsingRate(value, exchangeRate.rate) +} diff --git a/src/shared/post-processors/exchange-rates/mainnetCurrencies.ts b/src/shared/post-processors/exchange-rates/mainnetCurrencies.ts index abcf8980..982980b1 100644 --- a/src/shared/post-processors/exchange-rates/mainnetCurrencies.ts +++ b/src/shared/post-processors/exchange-rates/mainnetCurrencies.ts @@ -1,4 +1,3 @@ -import { ExchangeRate } from '@model' import { BaseCurrencyAddress, BaseCurrencySymbol, @@ -32,23 +31,6 @@ export const currenciesByAddress = { ...baseCurrenciesByAddress, } as const -const eth1 = 1000000000000000000n -export const convertRate = ( - rates: Pick[], - base: MainnetCurrency, - quote: MainnetCurrency, - balance: bigint, -) => { - base = currenciesByAddress[base.toLowerCase() as MainnetCurrencyAddress] ?? base - quote = currenciesByAddress[quote.toLowerCase() as MainnetCurrencyAddress] ?? quote - const rate = rates.find((r) => r.base === base && r.quote === quote) - if (rate) { - return (balance * rate.rate) / eth1 - } else { - return 0n - } -} - export type MainnetCurrencySymbol = keyof typeof mainnetCurrencies export type MainnetCurrencyAddress = (typeof mainnetCurrencies)[keyof typeof mainnetCurrencies] diff --git a/src/shared/post-processors/exchange-rates/price-routing-mainnet.ts b/src/shared/post-processors/exchange-rates/price-routing-mainnet.ts index 6b4e904c..cc2a4f12 100644 --- a/src/shared/post-processors/exchange-rates/price-routing-mainnet.ts +++ b/src/shared/post-processors/exchange-rates/price-routing-mainnet.ts @@ -13,6 +13,7 @@ import { Context } from '@processor' import { CURVE_ETH_OETH_POOL_ADDRESS, STETH_ADDRESS } from '@utils/addresses' import { + CurrencySymbol, MainnetCurrency, MainnetCurrencyAddress, MainnetCurrencySymbol, @@ -21,41 +22,12 @@ import { } from './mainnetCurrencies' export const getMainnetPrice = async (ctx: Context, height: number, base: MainnetCurrency, quote: MainnetCurrency) => { - if (base === 'ETH' && quote === 'OETH') { - return await getETHOETHPrice(ctx, height) - } - if (base === 'OETH' && quote === 'ETH') { - return await getOETHETHPrice(ctx, height) - } - if (base === 'ETH' && quote === 'WETH') { - return 1_000_000_000_000_000_000n - } - if (base === 'ETH' && quote === 'ETH') { - return 1_000_000_000_000_000_000n - } - if (base === 'ETH' && quote === 'sfrxETH') { - return getStakedFraxPrice(ctx, height) - } - if (base === 'ETH' && quote === 'rETH') { - return getRETHPrice(ctx, height) - } - if (base === 'ETH' && quote === 'frxETH') { - return getFrxEthPrice(ctx, height) - } - if (base === 'wOETH' && quote === 'OETH') { - return getPrice_wOETH_OETH(ctx, height) - } - if (base === 'ETH' && oethOracleCurrencies.has(quote) && height >= 18032298) { - return getOethOraclePrice(ctx, height, quote) - } - if (base === 'OUSD' && quote === 'USD') { - return getPrice_OUSD_USD(ctx, height) - } - if (base === 'OUSD' && quote === 'ETH') { - const ousdusd = await getPrice_OUSD_USD(ctx, height) - const ethusd = await getChainlinkPrice(ctx, height, 'ETH', 'USD') - if (!ethusd) return 0n - return (ousdusd * 10n ** 8n) / ethusd + base = translateMainnetSymbol(base) + quote = translateMainnetSymbol(quote) + + const getPrice = priceMap[`${base}_${quote}`] + if (getPrice) { + return getPrice(ctx, height) } if (base === 'OETH' && quote === 'USD') { const ethusd = await getChainlinkPrice(ctx, height, 'ETH', 'USD') @@ -64,20 +36,20 @@ export const getMainnetPrice = async (ctx: Context, height: number, base: Mainne return getChainlinkPrice(ctx, height, base, quote) } -export const getOETHETHPrice = async (ctx: Context, height: number) => { +const getOETHETHPrice = async (ctx: Context, height: number) => { if (height < 17230232) return 10n ** 18n const contract = new curveLpToken.Contract(ctx, { height }, CURVE_ETH_OETH_POOL_ADDRESS) return await contract.get_dy(0n, 1n, 1000000000000000000n) } -export const getETHOETHPrice = async (ctx: Context, height: number) => { +const getETHOETHPrice = async (ctx: Context, height: number) => { if (height < 17230232) return 10n ** 18n const contract = new curveLpToken.Contract(ctx, { height }, CURVE_ETH_OETH_POOL_ADDRESS) return await contract.get_dy(1n, 0n, 1000000000000000000n) } -export const getRETHPrice = async (ctx: Context, height: number) => { - if (height < 13846138) return undefined +const getRETHPrice = async (ctx: Context, height: number) => { + if (height < 13846138) return 0n // Balancer rETH Stable Pool Rate Provider const rateProvider = await getBalancePoolRateProviders(ctx, { height }, '0x1e19cf2d73a72ef1332c882f20534b6519be0276') // Balancer Vault `getPoolTokens` https://etherscan.io/address/0xba12222222228d8ba445958a75a0704d566bf2c8#readContract#F10 @@ -90,12 +62,7 @@ export const getRETHPrice = async (ctx: Context, height: number) => { } const registryAddress = '0x47fb2585d2c56fe188d0e6ec628a38b74fceeedf' -export const getChainlinkPrice = async ( - ctx: Context, - height: number, - base: MainnetCurrency, - quote: MainnetCurrency, -) => { +const getChainlinkPrice = async (ctx: Context, height: number, base: MainnetCurrency, quote: MainnetCurrency) => { if (height < 12864088) return 0n const registry = new chainlinkFeedRegistry.Contract(ctx, { height }, registryAddress) try { @@ -125,23 +92,22 @@ export const getChainlinkPrice = async ( } } -export const oethOracleCurrencies = new Set(['WETH', 'stETH', 'frxETH']) - +const oethOracleCurrencies = new Set(['WETH', 'stETH', 'frxETH']) const oethOracleAddress = '0xbE19cC5654e30dAF04AD3B5E06213D70F4e882eE' -export const getOethOraclePrice = (ctx: Context, height: number, quote: MainnetCurrency) => { +const getOethOraclePrice = (ctx: Context, height: number, quote: MainnetCurrency) => { const router = new oethOracleRouter.Contract(ctx, { height }, oethOracleAddress) return router.price(mainnetCurrencies[quote as MainnetCurrencySymbol] ?? quote) } const stakedFraxAddress = '0xac3e018457b222d93114458476f3e3416abbe38f' -export const getStakedFraxPrice = (ctx: Context, height: number) => { - if (height < 15686046) return undefined +const getStakedFraxPrice = async (ctx: Context, height: number) => { + if (height < 15686046) return 0n const router = new stakedFraxEth.Contract(ctx, { height }, stakedFraxAddress) return router.previewRedeem(1_000_000_000_000_000_000n) } const frxEthFraxOracleAddress = '0xC58F3385FBc1C8AD2c0C9a061D7c13b141D7A5Df' -export const getFrxEthPrice = (ctx: Context, height: number) => { +const getFrxEthPrice = async (ctx: Context, height: number) => { // Deploy block of 17571367 doesn't work, so we wait until it is functional. if (height < 17571500) return 1_000_000_000_000_000_000n const frxEth = new frxEthFraxOracle.Contract(ctx, { height }, frxEthFraxOracleAddress) @@ -156,19 +122,62 @@ export const getBalancePoolRateProviders = memoize( (_ctx, _block, address) => address.toLowerCase(), ) -export const getPrice_OUSD_USD = (ctx: Context, height: number) => { +const getPrice_OUSD_USD = async (ctx: Context, height: number) => { if (height < 18071236) return 1_000_000_000_000_000_000n const diaOracle = new diaOracleAbi.Contract(ctx, { height }, '0xafa00e7eff2ea6d216e432d99807c159d08c2b79') return diaOracle.getValue('OUSD/USD').then((d) => d._0 * 10n ** 10n) } -export const getPrice_wOETH_OETH = (ctx: Context, height: number) => { +const getPrice_wOETH_OETH = async (ctx: Context, height: number) => { if (height < 17141658) return 1_000_000_000_000_000_000n const woeth = new woethAbi.Contract(ctx, { height }, mainnetCurrencies.wOETH) return woeth.previewRedeem(1_000_000_000_000_000_000n) } +const getPrice_OUSD_ETH = async (ctx: Context, height: number) => { + const ousdusd = await getPrice_OUSD_USD(ctx, height) + const ethusd = await getChainlinkPrice(ctx, height, 'ETH', 'USD') + if (!ethusd) return 0n + return (ousdusd * 10n ** 8n) / ethusd +} + +const getPrice_OETH_USD = async (ctx: Context, height: number) => { + const ethusd = await getChainlinkPrice(ctx, height, 'ETH', 'USD') + return ethusd * 10n ** 10n +} + export const translateMainnetSymbol = (symbol: MainnetCurrency): MainnetCurrencySymbol => { symbol = mainnetCurrenciesByAddress[symbol as MainnetCurrencyAddress] || symbol return symbol } + +export const invertRate = (rate: bigint, decimals = 18) => 10n ** BigInt(2 * decimals) / rate +export const twoWay = ( + base: Base, + quote: Quote, + getPrice: (ctx: Context, height: number) => Promise, +) => + ({ + [`${base}_${quote}`]: async (ctx: Context, height: number) => getPrice(ctx, height), + [`${quote}_${base}`]: async (ctx: Context, height: number) => getPrice(ctx, height).then(invertRate), + }) as Record<`${Base}_${Quote}` | `${Quote}_${Base}`, (ctx: Context, height: number) => Promise> + +export const priceMap: Partial< + Record<`${CurrencySymbol}_${CurrencySymbol}`, (ctx: Context, height: number) => Promise> +> = { + ETH_WETH: async () => 1_000_000_000_000_000_000n, + WETH_ETH: async () => 1_000_000_000_000_000_000n, + ETH_ETH: async () => 1_000_000_000_000_000_000n, + ETH_OETH: getETHOETHPrice, + OETH_ETH: getOETHETHPrice, + ...twoWay('ETH', 'sfrxETH', getStakedFraxPrice), + ...twoWay('ETH', 'rETH', getRETHPrice), + ...twoWay('ETH', 'frxETH', getFrxEthPrice), + ...twoWay('wOETH', 'OETH', getPrice_wOETH_OETH), + ...twoWay('OUSD', 'USD', getPrice_OUSD_USD), + ...twoWay('OUSD', 'ETH', getPrice_OUSD_ETH), + ...twoWay('ETH', 'stETH', (ctx, height) => getOethOraclePrice(ctx, height, 'stETH')), + ...twoWay('OETH', 'USD', getPrice_OETH_USD), + ETH_USD: (ctx, height) => getChainlinkPrice(ctx, height, 'ETH', 'USD'), + // ...twoWay('ETH', 'USD', (ctx, height) => getChainlinkPrice(ctx, height, 'ETH', 'USD').then((p) => p * 10n ** 10n)), +} as const diff --git a/src/templates/aerodrome/cl-pool.ts b/src/templates/aerodrome/cl-pool.ts index b90d52b4..e8019e13 100644 --- a/src/templates/aerodrome/cl-pool.ts +++ b/src/templates/aerodrome/cl-pool.ts @@ -2,10 +2,11 @@ import * as aerodromeCLPoolAbi from '@abi/aerodrome-cl-pool' import * as aerodromeVoterAbi from '@abi/aerodrome-voter' import * as erc20Abi from '@abi/erc20' import * as models from '@model' -import { AeroCLPoolState, AeroCLPoolTick, AeroPoolEpochState, AeroPoolState, TokenAmount } from '@model' +import { AeroCLPoolState, AeroCLPoolTick, AeroPoolEpochState } from '@model' import { Block, Context, Log, Processor } from '@processor' +import { convertRate } from '@shared/post-processors/exchange-rates' import { createAeroPoolEpoch } from '@templates/aerodrome/epoch' -import { convertRate, getPriceFromSqrtPriceX96 } from '@templates/aerodrome/prices' +import { getPriceFromSqrtPriceX96 } from '@templates/aerodrome/prices' import { getVoterTotalWeight } from '@templates/aerodrome/shared' import { PoolDefinition, baseAddresses } from '@utils/addresses-base' import { blockFrequencyUpdater } from '@utils/blockFrequencyUpdater' diff --git a/src/templates/aerodrome/pool.ts b/src/templates/aerodrome/pool.ts index 4974dcf1..fd54b270 100644 --- a/src/templates/aerodrome/pool.ts +++ b/src/templates/aerodrome/pool.ts @@ -3,8 +3,8 @@ import * as aerodromeVoterAbi from '@abi/aerodrome-voter' import * as models from '@model' import { AeroPoolEpochState, AeroPoolState } from '@model' import { Block, Context, Log, Processor } from '@processor' +import { convertRate } from '@shared/post-processors/exchange-rates' import { createAeroPoolEpoch } from '@templates/aerodrome/epoch' -import { convertRate } from '@templates/aerodrome/prices' import { getVoterTotalWeight } from '@templates/aerodrome/shared' import { PoolDefinition, baseAddresses } from '@utils/addresses-base' import { blockFrequencyUpdater } from '@utils/blockFrequencyUpdater' diff --git a/src/templates/aerodrome/prices.ts b/src/templates/aerodrome/prices.ts index 1f3d5c47..897a4c19 100644 --- a/src/templates/aerodrome/prices.ts +++ b/src/templates/aerodrome/prices.ts @@ -1,16 +1,3 @@ -import { Block, Context } from '@processor' -import { ensureExchangeRate } from '@shared/post-processors/exchange-rates' -import { BaseCurrency } from '@shared/post-processors/exchange-rates/price-routing-base' - -const E18 = 10n ** 18n - -export const convertUsingRate = (value: bigint, rate: bigint) => (value * rate) / E18 -export const convertRate = async (ctx: Context, block: Block, from: BaseCurrency, to: BaseCurrency, value: bigint) => { - const exchangeRate = await ensureExchangeRate(ctx, block, from, to) - if (!exchangeRate) return 0n - return convertUsingRate(value, exchangeRate.rate) -} - export const getTickFromSqrtPriceX96 = (sqrtPriceX96: bigint) => { const Q96 = 2n ** 96n return Math.floor(Math.log((Number(sqrtPriceX96) / Number(Q96)) ** 2) / Math.log(1.0001)) diff --git a/src/templates/erc20-simple/erc20.ts b/src/templates/erc20-simple/erc20.ts index e6111e3c..ac7dcd31 100644 --- a/src/templates/erc20-simple/erc20.ts +++ b/src/templates/erc20-simple/erc20.ts @@ -3,8 +3,9 @@ import { ERC20, ERC20Balance, ERC20Holder, ERC20State, ERC20Transfer } from '@mo import { Block, Context } from '@processor' import { publishERC20State } from '@shared/erc20' import { EvmBatchProcessor } from '@subsquid/evm-processor' -import { ADDRESS_ZERO, TokenAddress } from '@utils/addresses' +import { ADDRESS_ZERO } from '@utils/addresses' import { logFilter } from '@utils/logFilter' +import { TokenAddress } from '@utils/symbols' export const createERC20SimpleTracker = ({ from, address }: { from: number; address: TokenAddress | string }) => { let erc20: ERC20 | undefined diff --git a/src/templates/erc20/erc20.ts b/src/templates/erc20/erc20.ts index 1ad3615e..2e8af726 100644 --- a/src/templates/erc20/erc20.ts +++ b/src/templates/erc20/erc20.ts @@ -3,10 +3,11 @@ import { ERC20, ERC20Balance, ERC20Holder, ERC20State, ERC20Transfer } from '@mo import { Context } from '@processor' import { publishERC20State } from '@shared/erc20' import { EvmBatchProcessor } from '@subsquid/evm-processor' -import { ADDRESS_ZERO, TokenAddress } from '@utils/addresses' +import { ADDRESS_ZERO } from '@utils/addresses' import { blockFrequencyTracker } from '@utils/blockFrequencyUpdater' import { LogFilter, logFilter } from '@utils/logFilter' import { multicall } from '@utils/multicall' +import { TokenAddress } from '@utils/symbols' const duplicateTracker = new Set() diff --git a/src/templates/exponential-staking/exponential-staking.ts b/src/templates/exponential-staking/exponential-staking.ts index b080dfde..3f15f34f 100644 --- a/src/templates/exponential-staking/exponential-staking.ts +++ b/src/templates/exponential-staking/exponential-staking.ts @@ -18,9 +18,9 @@ import { import { Block, Context, Log } from '@processor' import { waitForERC20State } from '@shared/erc20' import { EvmBatchProcessor } from '@subsquid/evm-processor' -import { TokenAddress } from '@utils/addresses' import { calculateAPY2, convertApyToApr } from '@utils/calculateAPY' import { LogFilter, logFilter } from '@utils/logFilter' +import { TokenAddress } from '@utils/symbols' interface State { // State Entities diff --git a/src/templates/otoken/otoken.ts b/src/templates/otoken/otoken.ts index a06f8541..a12b818c 100644 --- a/src/templates/otoken/otoken.ts +++ b/src/templates/otoken/otoken.ts @@ -272,8 +272,14 @@ export const createOTokenProcessor = (params: { }, })), ) - entity.fees = rebases.reduce((sum, current) => sum + current.fee, 0n) entity.yield = rebases.reduce((sum, current) => sum + current.yield - current.fee, 0n) + entity.fees = rebases.reduce((sum, current) => sum + current.fee, 0n) + + const lastDayString = dayjs(block.header.timestamp).subtract(1, 'day').toISOString().substring(0, 10) + const lastId = `${ctx.chain.id}-${params.otokenAddress}-${lastDayString}` + const last = result.dailyStats.get(lastId)?.entity ?? (await ctx.store.get(OTokenDailyStat, lastId)) + entity.cumulativeYield = (last?.cumulativeYield ?? 0n) + entity.yield + entity.cumulativeFees = (last?.cumulativeFees ?? 0n) + entity.fees const getDripperAvailableFunds = async () => { if (!params.dripper || params.dripper.from > block.header.height) return 0n @@ -649,8 +655,7 @@ export const createOTokenProcessor = (params: { } const getOTokenDailyStat = async (ctx: Context, result: ProcessResult, block: Block) => { - const blockDate = new Date(block.header.timestamp) - const dayString = blockDate.toISOString().substring(0, 10) + const dayString = new Date(block.header.timestamp).toISOString().substring(0, 10) const id = `${ctx.chain.id}-${params.otokenAddress}-${dayString}` let entity = result.dailyStats.get(id)?.entity ?? (await ctx.store.get(OTokenDailyStat, id)) @@ -681,6 +686,8 @@ export const createOTokenProcessor = (params: { yield: 0n, fees: 0n, + cumulativeYield: 0n, + cumulativeFees: 0n, marketCapUSD: 0, }) diff --git a/src/templates/strategy/strategy-balancer.ts b/src/templates/strategy/strategy-balancer.ts index 9ea5cf3f..db48b54f 100644 --- a/src/templates/strategy/strategy-balancer.ts +++ b/src/templates/strategy/strategy-balancer.ts @@ -3,10 +3,13 @@ import * as balancerRateProvider from '@abi/balancer-rate-provider' import * as balancerVaultAbi from '@abi/balancer-vault' import { StrategyBalance } from '@model' import { Context } from '@processor' +import { convertRate } from '@shared/post-processors/exchange-rates' +import { CurrencyAddress } from '@shared/post-processors/exchange-rates/mainnetCurrencies' import { getBalancePoolRateProviders } from '@shared/post-processors/exchange-rates/price-routing-mainnet' import { EvmBatchProcessor } from '@subsquid/evm-processor' import { ADDRESS_ZERO, BALANCER_VAULT, ETH_ADDRESS, WETH_ADDRESS } from '@utils/addresses' import { blockFrequencyUpdater } from '@utils/blockFrequencyUpdater' +import { addressToSymbol } from '@utils/symbols' import { IStrategyData } from './index' import { processStrategyEarnings, setupStrategyEarnings } from './strategy-earnings' @@ -24,20 +27,22 @@ export const process = async (ctx: Context, strategyData: IStrategyData) => { const blockFrequencyUpdate = trackers.get(strategyData.address)! const data: StrategyBalance[] = [] await blockFrequencyUpdate(ctx, async (ctx, block) => { - const results = await getBalancerStrategyHoldings(ctx, block.header, strategyData).then((holdings) => - holdings.map(({ address, asset, balance }) => { - return new StrategyBalance({ + const balances = await getBalancerStrategyHoldings(ctx, block.header, strategyData) + for (const { address, asset, balance } of balances) { + data.push( + new StrategyBalance({ id: `${ctx.chain.id}:${address}:${asset}:${block.header.height}`, chainId: ctx.chain.id, + blockNumber: block.header.height, + timestamp: new Date(block.header.timestamp), strategy: address, asset, + symbol: addressToSymbol(asset), balance, - blockNumber: block.header.height, - timestamp: new Date(block.header.timestamp), - }) - }), - ) - data.push(...results) + balanceETH: await convertRate(ctx, block, asset as CurrencyAddress, 'ETH', balance), + }), + ) + } }) await ctx.store.insert(data) await processStrategyEarnings(ctx, strategyData, getStrategyETHBalance) diff --git a/src/templates/strategy/strategy-curve-amo.ts b/src/templates/strategy/strategy-curve-amo.ts index 6d5a2920..18d2ea30 100644 --- a/src/templates/strategy/strategy-curve-amo.ts +++ b/src/templates/strategy/strategy-curve-amo.ts @@ -3,9 +3,12 @@ import * as erc20 from '@abi/erc20' import * as abstractStrategyAbi from '@abi/initializable-abstract-strategy' import { StrategyBalance } from '@model' import { Block, Context } from '@processor' +import { convertRate } from '@shared/post-processors/exchange-rates' +import { CurrencyAddress } from '@shared/post-processors/exchange-rates/mainnetCurrencies' import { EvmBatchProcessor } from '@subsquid/evm-processor' import { ETH_ADDRESS, WETH_ADDRESS } from '@utils/addresses' import { blockFrequencyUpdater } from '@utils/blockFrequencyUpdater' +import { addressToSymbol } from '@utils/symbols' import { IStrategyData } from './index' import { processStrategyEarnings, setupStrategyEarnings } from './strategy-earnings' @@ -36,17 +39,23 @@ const getCurveAMOStrategyHoldings = async ( strategyData: IStrategyData, ): Promise => { const balances = await getStrategyBalances(ctx, block.header, strategyData) - return balances.map(({ address, asset, balance }) => { - return new StrategyBalance({ - id: `${ctx.chain.id}:${address}:${asset}:${block.header.height}`, - chainId: ctx.chain.id, - strategy: address, - asset, - balance, - blockNumber: block.header.height, - timestamp: new Date(block.header.timestamp), - }) - }) + let strategyBalances: StrategyBalance[] = [] + for (const { address, asset, balance } of balances) { + strategyBalances.push( + new StrategyBalance({ + id: `${ctx.chain.id}:${address}:${asset}:${block.header.height}`, + chainId: ctx.chain.id, + strategy: address, + asset, + symbol: addressToSymbol(asset), + balance, + balanceETH: await convertRate(ctx, block, asset as CurrencyAddress, 'ETH', balance), + blockNumber: block.header.height, + timestamp: new Date(block.header.timestamp), + }), + ) + } + return strategyBalances } export const getStrategyBalances = async (ctx: Context, block: { height: number }, strategyData: IStrategyData) => { diff --git a/src/templates/strategy/strategy-earnings.ts b/src/templates/strategy/strategy-earnings.ts index 05c03e41..41785aa7 100644 --- a/src/templates/strategy/strategy-earnings.ts +++ b/src/templates/strategy/strategy-earnings.ts @@ -7,8 +7,8 @@ import * as erc20 from '@abi/erc20' import * as abstractStrategyAbi from '@abi/initializable-abstract-strategy' import { StrategyYield } from '@model' import { Block, Context } from '@processor' -import { ensureExchangeRates } from '@shared/post-processors/exchange-rates' -import { MainnetCurrency, convertRate } from '@shared/post-processors/exchange-rates/mainnetCurrencies' +import { convertRate, ensureExchangeRates } from '@shared/post-processors/exchange-rates' +import { MainnetCurrency } from '@shared/post-processors/exchange-rates/mainnetCurrencies' import { EvmBatchProcessor } from '@subsquid/evm-processor' import { OETH_ADDRESS, @@ -332,18 +332,20 @@ const processDepositWithdrawal = async ( MainnetCurrency, ][] const rates = await ensureExchangeRates(ctx, block, desiredRates) - const previousBalance = assets.reduce((sum, a, index) => { + let previousBalance = 0n + for (let index = 0; index < assets.length; index++) { + const a = assets[index] const asset = strategyData.assets[index] - const compareBalance = asset.convertTo - ? convertRate(rates, 'ETH', a.asset as MainnetCurrency, a.compareBalance) + previousBalance += asset.convertTo + ? await convertRate(ctx, block, 'ETH', a.asset as MainnetCurrency, a.compareBalance) : a.compareBalance - return sum + compareBalance - }, 0n) - const balance = assets.reduce((sum, a, index) => { + } + let balance = 0n + for (let index = 0; index < assets.length; index++) { + const a = assets[index] const asset = strategyData.assets[index] - const balance = asset.convertTo ? convertRate(rates, 'ETH', a.asset as MainnetCurrency, a.balance) : a.balance - return sum + balance - }, 0n) + balance += asset.convertTo ? await convertRate(ctx, block, 'ETH', a.asset as MainnetCurrency, a.balance) : a.balance + } const otokenBalance = assets.find((a) => a.asset.toLowerCase() === strategyData.oTokenAddress)?.balance ?? 0n @@ -351,7 +353,7 @@ const processDepositWithdrawal = async ( const balanceWeight = Number(formatEther(balanceWeightN)) const timestamp = new Date(block.header.timestamp) - let earningsChange = previousBalance - (latest?.balance ?? previousBalance) ?? 0n + let earningsChange = previousBalance - (latest?.balance ?? previousBalance) // TODO: ??? Probably should listen for add/remove liquidity events // and calculate earnings changes from fees rather than relying on this diff --git a/src/templates/strategy/strategy-generic.ts b/src/templates/strategy/strategy-generic.ts index 09003b2b..a3abeea6 100644 --- a/src/templates/strategy/strategy-generic.ts +++ b/src/templates/strategy/strategy-generic.ts @@ -1,10 +1,11 @@ import * as abstractStrategyAbi from '@abi/initializable-abstract-strategy' import { StrategyBalance } from '@model' import { Block, Context } from '@processor' -import { ensureExchangeRates } from '@shared/post-processors/exchange-rates' -import { MainnetCurrencyAddress } from '@shared/post-processors/exchange-rates/mainnetCurrencies' +import { convertRate, ensureExchangeRates } from '@shared/post-processors/exchange-rates' +import { CurrencyAddress, MainnetCurrencyAddress } from '@shared/post-processors/exchange-rates/mainnetCurrencies' import { EvmBatchProcessor } from '@subsquid/evm-processor' import { blockFrequencyUpdater } from '@utils/blockFrequencyUpdater' +import { addressToSymbol } from '@utils/symbols' import { IStrategyData } from './index' import { processStrategyEarnings, setupStrategyEarnings } from './strategy-earnings' @@ -39,20 +40,24 @@ const getStrategyHoldings = async ( block: Block, strategyData: IStrategyData, ): Promise => { - const { assets, address } = strategyData - const promises = assets.map(async (asset) => { - const balances = await getStrategyBalances(ctx, block.header, strategyData) - return new StrategyBalance({ - id: `${ctx.chain.id}:${address}:${asset.address}:${block.header.height}`, - chainId: ctx.chain.id, - strategy: address, - asset: asset.address, - balance: balances.find((b) => b.asset === asset.address)?.balance, - blockNumber: block.header.height, - timestamp: new Date(block.header.timestamp), - }) - }) - return Promise.all(promises) + const data: StrategyBalance[] = [] + const balances = await getStrategyBalances(ctx, block.header, strategyData) + for (const { address, asset, balance } of balances) { + data.push( + new StrategyBalance({ + id: `${ctx.chain.id}:${address}:${asset}:${block.header.height}`, + chainId: ctx.chain.id, + blockNumber: block.header.height, + timestamp: new Date(block.header.timestamp), + strategy: address, + asset, + symbol: addressToSymbol(asset), + balance, + balanceETH: await convertRate(ctx, block, asset as CurrencyAddress, 'ETH', balance), + }), + ) + } + return data } const getStrategyBalances = async (ctx: Context, block: { height: number }, strategyData: IStrategyData) => { diff --git a/src/templates/strategy/strategy-native-staking.ts b/src/templates/strategy/strategy-native-staking.ts index dbd3d91c..c874e170 100644 --- a/src/templates/strategy/strategy-native-staking.ts +++ b/src/templates/strategy/strategy-native-staking.ts @@ -1,10 +1,13 @@ import * as abstractStrategyAbi from '@abi/initializable-abstract-strategy' import { StrategyBalance } from '@model' import { Context } from '@processor' +import { convertRate } from '@shared/post-processors/exchange-rates' +import { CurrencyAddress } from '@shared/post-processors/exchange-rates/mainnetCurrencies' import { EvmBatchProcessor } from '@subsquid/evm-processor' import { IStrategyData } from '@templates/strategy/strategy' import { processStrategyEarnings, setupStrategyEarnings } from '@templates/strategy/strategy-earnings' import { blockFrequencyUpdater } from '@utils/blockFrequencyUpdater' +import { addressToSymbol } from '@utils/symbols' export const setup = (processor: EvmBatchProcessor, strategyData: IStrategyData) => { processor.includeAllBlocks({ from: strategyData.from }) @@ -19,20 +22,22 @@ export const process = async (ctx: Context, strategyData: IStrategyData) => { const blockFrequencyUpdate = trackers.get(strategyData.address)! const data: StrategyBalance[] = [] await blockFrequencyUpdate(ctx, async (ctx, block) => { - const results = await getStrategyBalances(ctx, block.header, strategyData) - data.push( - ...results.map(({ address, asset, balance }) => { - return new StrategyBalance({ + const balances = await getStrategyBalances(ctx, block.header, strategyData) + for (const { address, asset, balance } of balances) { + data.push( + new StrategyBalance({ id: `${ctx.chain.id}:${address}:${asset}:${block.header.height}`, chainId: ctx.chain.id, + blockNumber: block.header.height, + timestamp: new Date(block.header.timestamp), strategy: address, asset, + symbol: addressToSymbol(asset), balance, - blockNumber: block.header.height, - timestamp: new Date(block.header.timestamp), - }) - }), - ) + balanceETH: await convertRate(ctx, block, asset as CurrencyAddress, 'ETH', balance), + }), + ) + } }) await ctx.store.insert(data) await processStrategyEarnings(ctx, strategyData, getStrategyBalances) diff --git a/src/templates/strategy/strategy-vault.ts b/src/templates/strategy/strategy-vault.ts index 99cfc37d..07477fc8 100644 --- a/src/templates/strategy/strategy-vault.ts +++ b/src/templates/strategy/strategy-vault.ts @@ -1,8 +1,11 @@ import * as erc20 from '@abi/erc20' import { StrategyBalance } from '@model' import { Block, Context } from '@processor' +import { convertRate } from '@shared/post-processors/exchange-rates' +import { CurrencyAddress } from '@shared/post-processors/exchange-rates/mainnetCurrencies' import { EvmBatchProcessor } from '@subsquid/evm-processor' import { blockFrequencyUpdater } from '@utils/blockFrequencyUpdater' +import { addressToSymbol } from '@utils/symbols' import { convertDecimals } from '@utils/utils' import { IStrategyData } from './index' @@ -33,21 +36,24 @@ const getStrategyHoldings = async ( block: Block, strategyData: IStrategyData, ): Promise => { - const { assets, address } = strategyData + const data: StrategyBalance[] = [] const balances = await getStrategyBalances(ctx, block.header, strategyData) - const promises = assets.map(async (asset) => { - return new StrategyBalance({ - id: `${ctx.chain.id}:${address}:${asset.address}:${block.header.height}`, - chainId: ctx.chain.id, - strategy: address, - asset: asset.address, - balance: balances.find((b) => b.asset === asset.address)?.balance, - blockNumber: block.header.height, - timestamp: new Date(block.header.timestamp), - }) - }) - - return await Promise.all(promises) + for (const { address, asset, balance } of balances) { + data.push( + new StrategyBalance({ + id: `${ctx.chain.id}:${address}:${asset}:${block.header.height}`, + chainId: ctx.chain.id, + blockNumber: block.header.height, + timestamp: new Date(block.header.timestamp), + strategy: address, + asset, + symbol: addressToSymbol(asset), + balance, + balanceETH: await convertRate(ctx, block, asset as CurrencyAddress, 'ETH', balance), + }), + ) + } + return data } const getStrategyBalances = async ( diff --git a/src/utils/addresses-arbitrum.ts b/src/utils/addresses-arbitrum.ts new file mode 100644 index 00000000..82e522dc --- /dev/null +++ b/src/utils/addresses-arbitrum.ts @@ -0,0 +1,5 @@ +import { WOETH_ARBITRUM_ADDRESS } from './addresses' + +export const tokens = { + wOETH: WOETH_ARBITRUM_ADDRESS, +} diff --git a/src/utils/addresses.ts b/src/utils/addresses.ts index 8f22b2c2..82ef4e11 100644 --- a/src/utils/addresses.ts +++ b/src/utils/addresses.ts @@ -1,5 +1,4 @@ // Lowercase Addresses -import { baseAddresses } from '@utils/addresses-base' export const ADDRESS_ZERO = '0x0000000000000000000000000000000000000000' export const ETH_ADDRESS = '0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee' @@ -98,10 +97,7 @@ export const tokens = { // Origin OTokens OETH: OETH_ADDRESS, OUSD: OUSD_ADDRESS, - superOETHb_base: baseAddresses.tokens.superOETHb, - wsuperOETHb_base: baseAddresses.tokens.wsuperOETHb, wOETH: WOETH_ADDRESS, - wOETH_arbitrum: WOETH_ARBITRUM_ADDRESS, // Dollar DAI: DAI_ADDRESS, @@ -113,7 +109,6 @@ export const tokens = { // Ether ETH: ETH_ADDRESS, WETH: WETH_ADDRESS, - WETH_base: baseAddresses.tokens.WETH, stETH: STETH_ADDRESS, wstETH: WSTETH_ADDRESS, rETH: RETH_ADDRESS, @@ -123,10 +118,7 @@ export const tokens = { // Non-stable BAL: BAL_ADDRESS, - AERO: baseAddresses.tokens.AERO, } as const -export type TokenSymbol = keyof typeof tokens -export type TokenAddress = (typeof tokens)[TokenSymbol] // Strategy Helper Objects & Types export const strategies = { diff --git a/src/utils/symbols.ts b/src/utils/symbols.ts new file mode 100644 index 00000000..5b151e5a --- /dev/null +++ b/src/utils/symbols.ts @@ -0,0 +1,19 @@ +import { arbitrum, base, mainnet } from 'viem/chains' + +import { tokens as mainnetTokens } from './addresses' +import { tokens as arbitrumTokens } from './addresses-arbitrum' +import { tokens as baseTokens } from './addresses-base' + +export const symbols = [ + ...Object.entries(mainnetTokens).map(([symbol, address]) => ({ chainId: mainnet.id, address, symbol })), + ...Object.entries(baseTokens).map(([symbol, address]) => ({ chainId: base.id, address, symbol })), + ...Object.entries(arbitrumTokens).map(([symbol, address]) => ({ chainId: arbitrum.id, address, symbol })), +] + +export type TokenSymbol = (typeof symbols)[number]['symbol'] +export type TokenAddress = (typeof symbols)[number]['address'] + +const addressSymbolMap = new Map(symbols.map((symbol) => [symbol.address, symbol.symbol])) +export const addressToSymbol = (address: TokenAddress) => { + return addressSymbolMap.get(address) +} From 450274c959d6e28c2ad4395c9e1a94c57b05c7c6 Mon Sep 17 00:00:00 2001 From: Chris Jacobs Date: Fri, 27 Sep 2024 13:14:37 -0700 Subject: [PATCH 2/9] fix oeth oracle price fn --- src/main-test.ts | 8 -------- .../exchange-rates/price-routing-mainnet.ts | 9 +++------ 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/src/main-test.ts b/src/main-test.ts index abeb320e..78a0cf09 100644 --- a/src/main-test.ts +++ b/src/main-test.ts @@ -28,14 +28,6 @@ if (require.main === module) { pair.split('_')[1] as CurrencySymbol, ) console.log(`${pair} = ${Number(rate?.rate) / 1e18}`) - - const rate2 = await ensureExchangeRate( - ctx, - ctx.blocks[0], - pair.split('_')[1] as CurrencySymbol, - pair.split('_')[0] as CurrencySymbol, - ) - console.log(`${pair.split('_').reverse().join('_')} = ${Number(rate2?.rate) / 1e18}`) } process.exit(0) diff --git a/src/shared/post-processors/exchange-rates/price-routing-mainnet.ts b/src/shared/post-processors/exchange-rates/price-routing-mainnet.ts index cc2a4f12..74d0d596 100644 --- a/src/shared/post-processors/exchange-rates/price-routing-mainnet.ts +++ b/src/shared/post-processors/exchange-rates/price-routing-mainnet.ts @@ -29,11 +29,7 @@ export const getMainnetPrice = async (ctx: Context, height: number, base: Mainne if (getPrice) { return getPrice(ctx, height) } - if (base === 'OETH' && quote === 'USD') { - const ethusd = await getChainlinkPrice(ctx, height, 'ETH', 'USD') - return ethusd * 10n ** 10n - } - return getChainlinkPrice(ctx, height, base, quote) + throw new Error(`No price for ${base}_${quote}`) } const getOETHETHPrice = async (ctx: Context, height: number) => { @@ -94,7 +90,8 @@ const getChainlinkPrice = async (ctx: Context, height: number, base: MainnetCurr const oethOracleCurrencies = new Set(['WETH', 'stETH', 'frxETH']) const oethOracleAddress = '0xbE19cC5654e30dAF04AD3B5E06213D70F4e882eE' -const getOethOraclePrice = (ctx: Context, height: number, quote: MainnetCurrency) => { +const getOethOraclePrice = async (ctx: Context, height: number, quote: MainnetCurrency) => { + if (height < 18032300) return 0n const router = new oethOracleRouter.Contract(ctx, { height }, oethOracleAddress) return router.price(mainnetCurrencies[quote as MainnetCurrencySymbol] ?? quote) } From c23a021a4889db9c3170f62735071fa8a44187e6 Mon Sep 17 00:00:00 2001 From: Chris Jacobs Date: Fri, 27 Sep 2024 13:24:54 -0700 Subject: [PATCH 3/9] div zero fix --- .../post-processors/exchange-rates/price-routing-mainnet.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/shared/post-processors/exchange-rates/price-routing-mainnet.ts b/src/shared/post-processors/exchange-rates/price-routing-mainnet.ts index 74d0d596..9958f2fa 100644 --- a/src/shared/post-processors/exchange-rates/price-routing-mainnet.ts +++ b/src/shared/post-processors/exchange-rates/price-routing-mainnet.ts @@ -148,7 +148,7 @@ export const translateMainnetSymbol = (symbol: MainnetCurrency): MainnetCurrency return symbol } -export const invertRate = (rate: bigint, decimals = 18) => 10n ** BigInt(2 * decimals) / rate +export const invertRate = (rate: bigint, decimals = 18) => (rate > 0n ? 10n ** BigInt(2 * decimals) / rate : 0n) export const twoWay = ( base: Base, quote: Quote, From a207487ee2ab5f461973e8c7dead1d01fa87ebcf Mon Sep 17 00:00:00 2001 From: Chris Jacobs Date: Fri, 27 Sep 2024 15:10:55 -0700 Subject: [PATCH 4/9] more improvements to pricing, with decimals more strictly defined --- src/main-test.ts | 4 +- .../exchange-rates/price-routing-mainnet.ts | 65 ++++++++++++++----- 2 files changed, 52 insertions(+), 17 deletions(-) diff --git a/src/main-test.ts b/src/main-test.ts index 78a0cf09..d6d71eb0 100644 --- a/src/main-test.ts +++ b/src/main-test.ts @@ -20,14 +20,14 @@ if (require.main === module) { process: async (ctx) => { // Validate that we're getting otoken rates the way we want to. - for (const pair of Object.keys(priceMap)) { + for (const [pair, [getPrice, decimals]] of Object.entries(priceMap)) { const rate = await ensureExchangeRate( ctx, ctx.blocks[0], pair.split('_')[0] as CurrencySymbol, pair.split('_')[1] as CurrencySymbol, ) - console.log(`${pair} = ${Number(rate?.rate) / 1e18}`) + console.log(`${pair} = ${Number(rate?.rate) / 10 ** decimals}`) } process.exit(0) diff --git a/src/shared/post-processors/exchange-rates/price-routing-mainnet.ts b/src/shared/post-processors/exchange-rates/price-routing-mainnet.ts index 9958f2fa..1aff65a9 100644 --- a/src/shared/post-processors/exchange-rates/price-routing-mainnet.ts +++ b/src/shared/post-processors/exchange-rates/price-routing-mainnet.ts @@ -25,8 +25,9 @@ export const getMainnetPrice = async (ctx: Context, height: number, base: Mainne base = translateMainnetSymbol(base) quote = translateMainnetSymbol(quote) - const getPrice = priceMap[`${base}_${quote}`] - if (getPrice) { + const priceEntry = priceMap[`${base}_${quote}`] + if (priceEntry) { + const [getPrice] = priceEntry return getPrice(ctx, height) } throw new Error(`No price for ${base}_${quote}`) @@ -148,25 +149,46 @@ export const translateMainnetSymbol = (symbol: MainnetCurrency): MainnetCurrency return symbol } +export const derived = ( + base: Base, + quote: Quote, + connections: { base: MainnetCurrencySymbol; quote: MainnetCurrencySymbol }[], + decimals: number = 18, +) => { + return twoWay( + base, + quote, + async (ctx: Context, height: number) => { + const baseExponent = 10n ** BigInt(decimals) + const rates = await Promise.all(connections.map(({ base, quote }) => getMainnetPrice(ctx, height, base, quote))) + return rates.reduce((acc, rate) => (acc * rate) / baseExponent, baseExponent) + }, + decimals, + ) +} export const invertRate = (rate: bigint, decimals = 18) => (rate > 0n ? 10n ** BigInt(2 * decimals) / rate : 0n) -export const twoWay = ( +export const twoWay = ( base: Base, quote: Quote, getPrice: (ctx: Context, height: number) => Promise, + decimals: number = 18, ) => ({ - [`${base}_${quote}`]: async (ctx: Context, height: number) => getPrice(ctx, height), - [`${quote}_${base}`]: async (ctx: Context, height: number) => getPrice(ctx, height).then(invertRate), - }) as Record<`${Base}_${Quote}` | `${Quote}_${Base}`, (ctx: Context, height: number) => Promise> + [`${base}_${quote}`]: [async (ctx: Context, height: number) => getPrice(ctx, height), decimals], + [`${quote}_${base}`]: [ + async (ctx: Context, height: number) => getPrice(ctx, height).then((rate) => invertRate(rate, decimals)), + decimals, + ], + }) as Record<`${Base}_${Quote}` | `${Quote}_${Base}`, [(ctx: Context, height: number) => Promise, number]> export const priceMap: Partial< - Record<`${CurrencySymbol}_${CurrencySymbol}`, (ctx: Context, height: number) => Promise> + Record<`${CurrencySymbol}_${CurrencySymbol}`, [(ctx: Context, height: number) => Promise, number]> > = { - ETH_WETH: async () => 1_000_000_000_000_000_000n, - WETH_ETH: async () => 1_000_000_000_000_000_000n, - ETH_ETH: async () => 1_000_000_000_000_000_000n, - ETH_OETH: getETHOETHPrice, - OETH_ETH: getOETHETHPrice, + ETH_WETH: [async () => 1_000_000_000_000_000_000n, 18], + WETH_ETH: [async () => 1_000_000_000_000_000_000n, 18], + ETH_ETH: [async () => 1_000_000_000_000_000_000n, 18], + ETH_OETH: [getETHOETHPrice, 18], + OETH_ETH: [getOETHETHPrice, 18], ...twoWay('ETH', 'sfrxETH', getStakedFraxPrice), ...twoWay('ETH', 'rETH', getRETHPrice), ...twoWay('ETH', 'frxETH', getFrxEthPrice), @@ -175,6 +197,19 @@ export const priceMap: Partial< ...twoWay('OUSD', 'ETH', getPrice_OUSD_ETH), ...twoWay('ETH', 'stETH', (ctx, height) => getOethOraclePrice(ctx, height, 'stETH')), ...twoWay('OETH', 'USD', getPrice_OETH_USD), - ETH_USD: (ctx, height) => getChainlinkPrice(ctx, height, 'ETH', 'USD'), - // ...twoWay('ETH', 'USD', (ctx, height) => getChainlinkPrice(ctx, height, 'ETH', 'USD').then((p) => p * 10n ** 10n)), -} as const + ...twoWay('ETH', 'USD', (ctx, height) => getChainlinkPrice(ctx, height, 'ETH', 'USD'), 8), + ...twoWay('DAI', 'USD', (ctx, height) => getChainlinkPrice(ctx, height, 'DAI', 'USD'), 8), + ...twoWay('USDC', 'USD', (ctx, height) => getChainlinkPrice(ctx, height, 'USDC', 'USD'), 8), + ...twoWay('USDT', 'USD', (ctx, height) => getChainlinkPrice(ctx, height, 'USDT', 'USD'), 8), + ...derived( + 'DAI', + 'ETH', + [ + { base: 'DAI', quote: 'USD' }, + { base: 'USD', quote: 'ETH' }, + ], + 8, + ), + ...twoWay('USDC', 'ETH', (ctx, height) => getChainlinkPrice(ctx, height, 'USDC', 'ETH')), + ...twoWay('USDT', 'ETH', (ctx, height) => getChainlinkPrice(ctx, height, 'USDT', 'ETH')), +} From cc7bae8d7205e8f4b5293dd49329568418bdd726 Mon Sep 17 00:00:00 2001 From: Chris Jacobs Date: Mon, 30 Sep 2024 09:59:14 -0700 Subject: [PATCH 5/9] v52 --- squid.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/squid.yaml b/squid.yaml index d4772402..c88a45b1 100644 --- a/squid.yaml +++ b/squid.yaml @@ -1,6 +1,6 @@ manifestVersion: subsquid.io/v0.1 name: origin-squid -version: 999 +version: 52 description: 'Origin Protocol 🦑' build: deploy: From cfc29f2385e1dd9e98b583bb609167fe425c5c5b Mon Sep 17 00:00:00 2001 From: toniocodo Date: Wed, 2 Oct 2024 20:18:05 +0200 Subject: [PATCH 6/9] feat: add WOUSD support for ousd --- src/ousd/processors/ousd/ousd.ts | 5 +++++ src/utils/addresses.ts | 1 + 2 files changed, 6 insertions(+) diff --git a/src/ousd/processors/ousd/ousd.ts b/src/ousd/processors/ousd/ousd.ts index e2f34845..2d6a2d45 100644 --- a/src/ousd/processors/ousd/ousd.ts +++ b/src/ousd/processors/ousd/ousd.ts @@ -6,6 +6,7 @@ import { OUSD_VAULT_ADDRESS, USDC_ADDRESS, USDT_ADDRESS, + WOUSD_ADDRESS, } from '@utils/addresses' // export const from = 10884563 // https://etherscan.io/tx/0x9141921f5ebf072e58c00fe56332b6bee0c02f0ae4f54c42999b8a3a88662681 @@ -17,6 +18,10 @@ export const { from, setup, process } = createOTokenProcessor({ vaultFrom: 11596942, Upgrade_CreditsBalanceOfHighRes: 13533937, // https://etherscan.io/tx/0xc9b6fc6a4fad18dad197ff7d0636f74bf066671d75656849a1c45122e00d54cf otokenAddress: OUSD_ADDRESS, + wotoken: { + address: WOUSD_ADDRESS, + from: 14566204, // https://etherscan.io/tx/0x5b16078d43861bf0e7a08aa3f061dbfce1c76bc5fc7cedaa96e2156d15651df1 + }, dripper: { address: OUSD_DRIPPER_ADDRESS, from: 14250273, diff --git a/src/utils/addresses.ts b/src/utils/addresses.ts index 8f22b2c2..bc2210ca 100644 --- a/src/utils/addresses.ts +++ b/src/utils/addresses.ts @@ -53,6 +53,7 @@ export const OUSD_HARVESTER_ADDRESS = '0x21fb5812d70b3396880d30e90d9e5c1202266c8 export const OUSD_DRIPPER_ADDRESS = '0x80c898ae5e56f888365e235ceb8cea3eb726cb58' export const OUSD_STABLE_OTOKENS = [OUSD_ADDRESS] export const OUSD_VAULT_ERC20_ADDRESSES = [DAI_ADDRESS, USDC_ADDRESS, USDT_ADDRESS] +export const WOUSD_ADDRESS = '0xd2af830e8cbdfed6cc11bab697bb25496ed6fa62' // OETH Related export const OETH_ADDRESS = '0x856c4efb76c1d1ae02e20ceb03a2a6a08b0b8dc3' From 4dda81fd65e45641c9af606130b835904cf22f11 Mon Sep 17 00:00:00 2001 From: toniocodo Date: Wed, 2 Oct 2024 20:19:47 +0200 Subject: [PATCH 7/9] feat: update yaml version --- squid.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/squid.yaml b/squid.yaml index d4772402..40f44077 100644 --- a/squid.yaml +++ b/squid.yaml @@ -1,6 +1,6 @@ manifestVersion: subsquid.io/v0.1 name: origin-squid -version: 999 +version: 53 description: 'Origin Protocol 🦑' build: deploy: From 36e5b78fb561fa2ec7d0ca7a80f6c442216aaa6a Mon Sep 17 00:00:00 2001 From: toniocodo Date: Thu, 3 Oct 2024 10:56:39 +0200 Subject: [PATCH 8/9] chore: add ci script for deploying on tag --- .github/workflows/release.yml | 41 +++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..59e7f641 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,41 @@ +name: Release squid + +on: + push: + tags: + - 'v*' + +jobs: + build_and_publish: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Install squid CLI + run: npm i -g @subsquid/cli + + - name: npm install + run: npm i + + - name: update squid.yml + run: | + # Get the tag from GitHub + TAG=$(echo ${{ github.ref }} | sed 's/refs\/tags\///') + + # Extract the numeric part of the tag + VERSION=$(echo $TAG | sed 's/v//') + + # Update the version in squid.yaml + sed -i "s/^version: .*/version: $VERSION/" squid.yaml + + # Optional: Print the updated version for verification + echo "Updated squid.yaml version to: $VERSION" + + - name: Build and deploy squid + run: squid build && squid deploy . From f150c3176fb52e38ad10375e0257ab5f50498652 Mon Sep 17 00:00:00 2001 From: toniocodo Date: Thu, 3 Oct 2024 10:57:21 +0200 Subject: [PATCH 9/9] chore: squid version to 999 --- squid.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/squid.yaml b/squid.yaml index 40f44077..d4772402 100644 --- a/squid.yaml +++ b/squid.yaml @@ -1,6 +1,6 @@ manifestVersion: subsquid.io/v0.1 name: origin-squid -version: 53 +version: 999 description: 'Origin Protocol 🦑' build: deploy: