diff --git a/deploy/analytics/provisioning/dashboards/folders/Analysis/Recently Popular Vaults.json b/deploy/analytics/provisioning/dashboards/folders/Analysis/Recently Popular Vaults.json new file mode 100644 index 00000000..a15e42c7 --- /dev/null +++ b/deploy/analytics/provisioning/dashboards/folders/Analysis/Recently Popular Vaults.json @@ -0,0 +1,580 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "grafana", + "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": 34, + "links": [], + "liveNow": false, + "panels": [ + { + "datasource": { + "type": "postgres", + "uid": "P1A7A05C63CAD1F73" + }, + "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": [ + { + "matcher": { + "id": "byRegexp", + "options": "diff_.+_tvl" + }, + "properties": [ + { + "id": "thresholds", + "value": { + "mode": "absolute", + "steps": [ + { + "color": "red", + "value": null + }, + { + "color": "yellow", + "value": -0.01 + }, + { + "color": "green", + "value": 0.01 + } + ] + } + }, + { + "id": "custom.cellOptions", + "value": { + "mode": "gradient", + "type": "color-background" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": ".+_tvl" + }, + "properties": [ + { + "id": "unit", + "value": "currencyUSD" + } + ] + } + ] + }, + "gridPos": { + "h": 8, + "w": 20, + "x": 0, + "y": 0 + }, + "id": 40, + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true, + "sortBy": [ + { + "desc": true, + "displayName": "diff_tvl" + } + ] + }, + "pluginVersion": "10.1.4", + "targets": [ + { + "datasource": { + "type": "postgres", + "uid": "P1A7A05C63CAD1F73" + }, + "editorMode": "code", + "format": "table", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "with \nproduct_scope as (\n select product_id\n from product \n where chain in ($chain)\n and coalesce(product_data->'boost', product_data->'vault')->>'eol' = 'false'\n),\nvault_staked_underlying_ts as (\n SELECT\n time_bucket('1d', datetime) AS datetime,\n product_id,\n max(staked_underlying) as max_staked_underlying\n FROM beefy_vault_stats_ts\n WHERE\n $__timeFilter(datetime)\n and product_id in (select product_id from product_scope)\n group by 1, 2\n),\nvault_tvl_ts as (\n select \n tvl.datetime,\n tvl.product_id,\n tvl.max_staked_underlying * p.price_avg as tvl\n FROM vault_staked_underlying_ts tvl\n JOIN product pr on pr.product_id = tvl.product_id\n JOIN price_ts_cagg_1d p \n on p.price_feed_id = pr.price_feed_2_id -- we need the underlying price\n and p.datetime = tvl.datetime\n and $__timeFilter(p.datetime) -- tell pg which scope we are interested in\n),\nvault_stats_ts_recent as (\n SELECT\n s.product_id,\n last(s.datetime, s.datetime) AS \"datetime\",\n last(s.tvl, s.datetime) as tvl\n FROM vault_tvl_ts s\n group by 1\n),\nvault_stats_ts_compare_to as (\n SELECT\n s.product_id,\n first(s.datetime, s.datetime) AS \"datetime\",\n first(s.tvl, s.datetime) as tvl\n FROM vault_tvl_ts s\n group by 1\n),\nvault_stats_ts_compared as (\n select recent.product_id,\n compare_to.datetime as compare_to_datetime,\n recent.datetime as recent_datetime,\n recent.datetime - compare_to.datetime as datetime_diff,\n compare_to.tvl as compare_to_tvl,\n recent.tvl as recent_tvl,\n coalesce(recent.tvl, 0) - coalesce(compare_to.tvl, 0) as diff_tvl\n from vault_stats_ts_recent recent\n left join vault_stats_ts_compare_to compare_to using (product_id)\n)\nselect \n p.chain,\n sum(compare_to_tvl) as compare_to_tvl,\n sum(sum(compare_to_tvl)) over() as total_compare_to_tvl,\n sum(recent_tvl) as recent_tvl,\n sum(sum(recent_tvl)) over() as total_recent_tvl,\n sum(ts.diff_tvl) as chain_diff_tvl,\n sum(sum(ts.diff_tvl)) over() as total_diff_tvl\nfrom vault_stats_ts_compared ts\njoin product p using (product_id)\ngroup by p.chain\norder by sum(sum(ts.diff_tvl)) over() desc", + "refId": "A", + "select": [ + [ + { + "params": [ + "balance" + ], + "type": "column" + } + ] + ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, + "table": "beefy_investor_timeline_cache_ts", + "timeColumn": "datetime", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "title": "tvl progress ${__from:date:iso} -> ${__to:date:iso}", + "type": "table" + }, + { + "datasource": { + "type": "postgres", + "uid": "P1A7A05C63CAD1F73" + }, + "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": [ + { + "matcher": { + "id": "byRegexp", + "options": "diff_.+_tvl" + }, + "properties": [ + { + "id": "thresholds", + "value": { + "mode": "absolute", + "steps": [ + { + "color": "red", + "value": null + }, + { + "color": "yellow", + "value": -0.01 + }, + { + "color": "green", + "value": 0.01 + } + ] + } + }, + { + "id": "custom.cellOptions", + "value": { + "mode": "gradient", + "type": "color-background" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": ".+_tvl" + }, + "properties": [ + { + "id": "unit", + "value": "currencyUSD" + } + ] + } + ] + }, + "gridPos": { + "h": 12, + "w": 24, + "x": 0, + "y": 8 + }, + "id": 75, + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true, + "sortBy": [ + { + "desc": true, + "displayName": "diff_tvl" + } + ] + }, + "pluginVersion": "10.1.4", + "targets": [ + { + "datasource": { + "type": "postgres", + "uid": "P1A7A05C63CAD1F73" + }, + "editorMode": "code", + "format": "table", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "with \nproduct_scope as (\n select product_id\n from product \n where chain in ($chain)\n and coalesce(product_data->'boost', product_data->'vault')->>'eol' = 'false'\n),\nvault_staked_underlying_ts as (\n SELECT\n time_bucket('1d', datetime) AS datetime,\n product_id,\n max(staked_underlying) as max_staked_underlying\n FROM beefy_vault_stats_ts\n WHERE\n $__timeFilter(datetime)\n and product_id in (select product_id from product_scope)\n group by 1, 2\n),\nvault_tvl_ts as (\n select \n tvl.datetime,\n tvl.product_id,\n tvl.max_staked_underlying * p.price_avg as tvl\n FROM vault_staked_underlying_ts tvl\n JOIN product pr on pr.product_id = tvl.product_id\n JOIN price_ts_cagg_1d p \n on p.price_feed_id = pr.price_feed_2_id -- we need the underlying price\n and p.datetime = tvl.datetime\n and $__timeFilter(p.datetime) -- tell pg which scope we are interested in\n),\nvault_stats_ts_recent as (\n SELECT\n s.product_id,\n last(s.datetime, s.datetime) AS \"datetime\",\n last(s.tvl, s.datetime) as tvl\n FROM vault_tvl_ts s\n group by 1\n),\nvault_stats_ts_compare_to as (\n SELECT\n s.product_id,\n first(s.datetime, s.datetime) AS \"datetime\",\n first(s.tvl, s.datetime) as tvl\n FROM vault_tvl_ts s\n group by 1\n),\nvault_stats_ts_compared as (\n select recent.product_id,\n compare_to.datetime as compare_to_datetime,\n recent.datetime as recent_datetime,\n recent.datetime - compare_to.datetime as datetime_diff,\n compare_to.tvl as compare_to_tvl,\n recent.tvl as recent_tvl,\n coalesce(recent.tvl, 0) - coalesce(compare_to.tvl, 0) as diff_tvl\n from vault_stats_ts_recent recent\n left join vault_stats_ts_compare_to compare_to using (product_id)\n)\nselect p.product_key,\n coalesce(p.product_data->'vault'->>'id', p.product_data->'boost'->>'id') as beefy_id,\n ts.*\nfrom vault_stats_ts_compared ts\njoin product p using (product_id)\norder by ts.diff_tvl desc", + "refId": "A", + "select": [ + [ + { + "params": [ + "balance" + ], + "type": "column" + } + ] + ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, + "table": "beefy_investor_timeline_cache_ts", + "timeColumn": "datetime", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "title": "tvl progress ${__from:date:iso} -> ${__to:date:iso}", + "type": "table" + }, + { + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 20 + }, + "id": 5, + "panels": [], + "repeat": "chain", + "repeatDirection": "h", + "title": "$chain", + "type": "row" + }, + { + "datasource": { + "type": "postgres", + "uid": "P1A7A05C63CAD1F73" + }, + "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": [ + { + "matcher": { + "id": "byRegexp", + "options": "diff_.+_tvl" + }, + "properties": [ + { + "id": "thresholds", + "value": { + "mode": "absolute", + "steps": [ + { + "color": "red", + "value": null + }, + { + "color": "yellow", + "value": -0.01 + }, + { + "color": "green", + "value": 0.01 + } + ] + } + }, + { + "id": "custom.cellOptions", + "value": { + "mode": "gradient", + "type": "color-background" + } + } + ] + }, + { + "matcher": { + "id": "byRegexp", + "options": ".+_tvl" + }, + "properties": [ + { + "id": "unit", + "value": "currencyUSD" + } + ] + } + ] + }, + "gridPos": { + "h": 12, + "w": 24, + "x": 0, + "y": 21 + }, + "id": 4, + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true, + "sortBy": [ + { + "desc": true, + "displayName": "diff_tvl" + } + ] + }, + "pluginVersion": "10.1.4", + "targets": [ + { + "datasource": { + "type": "postgres", + "uid": "P1A7A05C63CAD1F73" + }, + "editorMode": "code", + "format": "table", + "group": [], + "metricColumn": "none", + "rawQuery": true, + "rawSql": "with \nproduct_scope as (\n select product_id\n from product \n where chain in ($chain)\n and coalesce(product_data->'boost', product_data->'vault')->>'eol' = 'false'\n),\nvault_staked_underlying_ts as (\n SELECT\n time_bucket('1d', datetime) AS datetime,\n product_id,\n max(staked_underlying) as max_staked_underlying\n FROM beefy_vault_stats_ts\n WHERE\n $__timeFilter(datetime)\n and product_id in (select product_id from product_scope)\n group by 1, 2\n),\nvault_tvl_ts as (\n select \n tvl.datetime,\n tvl.product_id,\n tvl.max_staked_underlying * p.price_avg as tvl\n FROM vault_staked_underlying_ts tvl\n JOIN product pr on pr.product_id = tvl.product_id\n JOIN price_ts_cagg_1d p \n on p.price_feed_id = pr.price_feed_2_id -- we need the underlying price\n and p.datetime = tvl.datetime\n and $__timeFilter(p.datetime) -- tell pg which scope we are interested in\n),\nvault_stats_ts_recent as (\n SELECT\n s.product_id,\n last(s.datetime, s.datetime) AS \"datetime\",\n last(s.tvl, s.datetime) as tvl\n FROM vault_tvl_ts s\n group by 1\n),\nvault_stats_ts_compare_to as (\n SELECT\n s.product_id,\n first(s.datetime, s.datetime) AS \"datetime\",\n first(s.tvl, s.datetime) as tvl\n FROM vault_tvl_ts s\n group by 1\n),\nvault_stats_ts_compared as (\n select recent.product_id,\n compare_to.datetime as compare_to_datetime,\n recent.datetime as recent_datetime,\n recent.datetime - compare_to.datetime as datetime_diff,\n compare_to.tvl as compare_to_tvl,\n recent.tvl as recent_tvl,\n coalesce(recent.tvl, 0) - coalesce(compare_to.tvl, 0) as diff_tvl\n from vault_stats_ts_recent recent\n left join vault_stats_ts_compare_to compare_to using (product_id)\n)\nselect p.product_key,\n coalesce(p.product_data->'vault'->>'id', p.product_data->'boost'->>'id') as beefy_id,\n ts.*\nfrom vault_stats_ts_compared ts\njoin product p using (product_id)\norder by ts.diff_tvl desc", + "refId": "A", + "select": [ + [ + { + "params": [ + "balance" + ], + "type": "column" + } + ] + ], + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, + "table": "beefy_investor_timeline_cache_ts", + "timeColumn": "datetime", + "timeColumnType": "timestamp", + "where": [ + { + "name": "$__timeFilter", + "params": [], + "type": "macro" + } + ] + } + ], + "title": "$chain tvl progress ${__from:date:iso} -> ${__to:date:iso}", + "type": "table" + } + ], + "refresh": "", + "schemaVersion": 38, + "style": "dark", + "tags": [], + "templating": { + "list": [ + { + "current": { + "selected": true, + "text": [ + "All" + ], + "value": [ + "$__all" + ] + }, + "datasource": { + "type": "postgres", + "uid": "P1A7A05C63CAD1F73" + }, + "definition": "select distinct chain from product where chain not in ('harmony', 'heco', 'aurora', 'celo', 'emerald')", + "hide": 0, + "includeAll": true, + "multi": true, + "name": "chain", + "options": [], + "query": "select distinct chain from product where chain not in ('harmony', 'heco', 'aurora', 'celo', 'emerald')", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 5, + "type": "query" + } + ] + }, + "time": { + "from": "now-1w/w-1d", + "to": "now-1w/w" + }, + "timepicker": {}, + "timezone": "", + "title": "Recently Popular Vaults", + "uid": "jQ2acqfWz", + "version": 10, + "weekStart": "" +} \ No newline at end of file