repo_id
stringclasses
137 values
file_path
stringlengths
10
89
content
stringlengths
0
990k
__index_level_0__
int64
0
0
templates
/mono/helm/strat-market-maker/templates/_helpers.tpl
{{/* Expand the name of the chart. */}} {{- define "strat-market-maker.name" -}} {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} {{- end }} {{/* Create a default fully qualified app name. We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). If release name contains chart name it will be used as a full name. */}} {{- define "strat-market-maker.fullname" -}} {{- if .Values.fullnameOverride }} {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} {{- else }} {{- $name := default .Chart.Name .Values.nameOverride }} {{- if contains $name .Release.Name }} {{- .Release.Name | trunc 63 | trimSuffix "-" }} {{- else }} {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} {{- end }} {{- end }} {{- end }} {{/* Create chart name and version as used by the chart label. */}} {{- define "strat-market-maker.chart" -}} {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} {{- end }} {{/* Common labels */}} {{- define "strat-market-maker.labels" -}} helm.sh/chart: {{ include "strat-market-maker.chart" . }} {{ include "strat-market-maker.selectorLabels" . }} {{- if .Chart.AppVersion }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} app.kubernetes.io/managed-by: {{ .Release.Service }} {{- end }} {{/* Selector labels */}} {{- define "strat-market-maker.selectorLabels" -}} app.kubernetes.io/name: {{ include "strat-market-maker.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} {{/* Create the name of the service account to use */}} {{- define "strat-market-maker.serviceAccountName" -}} {{- if .Values.serviceAccount.create }} {{- default (include "strat-market-maker.fullname" .) .Values.serviceAccount.name }} {{- else }} {{- default "default" .Values.serviceAccount.name }} {{- end }} {{- end }}
0
templates
/mono/helm/strat-market-maker/templates/service.yaml
apiVersion: v1 kind: Service metadata: name: {{ include "strat-market-maker.fullname" . }} labels: {{- include "strat-market-maker.labels" . | nindent 4 }} spec: type: {{ .Values.service.type }} ports: - port: {{ .Values.service.port }} targetPort: http protocol: TCP name: http selector: {{- include "strat-market-maker.selectorLabels" . | nindent 4 }}
0
templates
/mono/helm/strat-market-maker/templates/deployment.yaml
{{- include "common.secrets" . -}} {{- include "common.config.configmap" . -}} apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "strat-market-maker.fullname" . }} labels: {{- include "strat-market-maker.labels" . | nindent 4 }} spec: {{- if not .Values.autoscaling.enabled }} replicas: {{ .Values.replicaCount }} {{- end }} selector: matchLabels: {{- include "strat-market-maker.selectorLabels" . | nindent 6 }} template: metadata: {{- with .Values.podAnnotations }} annotations: {{- toYaml . | nindent 8 }} {{- end }} labels: {{- include "strat-market-maker.selectorLabels" . | nindent 8 }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} serviceAccountName: {{ include "strat-market-maker.serviceAccountName" . }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} containers: - name: {{ .Chart.Name }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} env: - name: "RUST_LOG" value: {{ .Values.RUST_LOG }} - name: "SERVICE" value: {{ .Values.SERVICE }} ports: - name: http containerPort: 3000 protocol: TCP livenessProbe: initialDelaySeconds: 5 httpGet: path: /healthy port: 3000 readinessProbe: initialDelaySeconds: 5 httpGet: path: /ready port: 3000 resources: {{- toYaml .Values.resources | nindent 12 }} volumeMounts: {{- include "common.secrets.volumeMounts" . | nindent 12 }} {{- include "common.config.volumeMounts" . | nindent 12 }} volumes: {{- include "common.secrets.volumes" . | nindent 8 }} {{- include "common.config.volumes" . | nindent 8 }} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.affinity }} affinity: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.tolerations }} tolerations: {{- toYaml . | nindent 8 }} {{- end }}
0
templates
/mono/helm/strat-market-maker/templates/serviceaccount.yaml
{{- if .Values.serviceAccount.create -}} apiVersion: v1 kind: ServiceAccount metadata: name: {{ include "strat-market-maker.serviceAccountName" . }} labels: {{- include "strat-market-maker.labels" . | nindent 4 }} {{- with .Values.serviceAccount.annotations }} annotations: {{- toYaml . | nindent 4 }} {{- end }} {{- end }}
0
tests
/mono/helm/strat-market-maker/templates/tests/test-connection.yaml
apiVersion: v1 kind: Pod metadata: name: "{{ include "strat-market-maker.fullname" . }}-test-connection" labels: {{- include "strat-market-maker.labels" . | nindent 4 }} annotations: "helm.sh/hook": test spec: containers: - name: wget image: busybox command: ['wget'] args: ['{{ include "strat-market-maker.fullname" . }}:{{ .Values.service.port }}'] restartPolicy: Never
0
redpanda
/mono/helm/redpanda/values.yaml
metrics: enabled: true redpanda: service: internal: annotations: "prometheus.io/scrape": "true" "prometheus.io/path": "/public_metrics" "prometheus.io/port": "9644" # Do not allow access from outside of the K8s cluster external: enabled: false # Matches topics by name and applies a config. For details on available properties see # https://docs.redpanda.com/current/reference/topic-properties/#retentionbytes topicsConfig: - pattern: "^.*$" config: "retention.bytes": 33554432 # 32 MiB per topic (2 segments) "retention.ms": 600000 # 10 minutes "segment.bytes": 16777216 # 16 MiB per segment (smallest allowable) - pattern: "^.*_ticker" config: "retention.ms": 3600000 # 1 hour topics: # General topics - "market_volatility" # Mirror topics - "mirror_opportunities" # Kraken topics - "kraken_orders" - "kraken_ticker" - "kraken_balances" - "kraken_account_balances" - "kraken_open_orders" - "kraken_assets" - "kraken_pairs" - "kraken_order_book" - "kraken_trade_volume" - "kraken_trades" - "kraken_book_btc_usd" - "kraken_book_btc_usdt" - "kraken_book_btc_cad" - "kraken_book_btc_eur" - "kraken_book_dot_usd" - "kraken_book_eth_usd" - "kraken_book_eth_usdt" - "kraken_book_eth_btc" - "kraken_book_eth_eur" - "kraken_book_eth_cad" - "kraken_book_link_btc" - "kraken_book_link_usdt" - "kraken_book_link_usd" - "kraken_book_link_eth" - "kraken_book_link_eur" - "kraken_book_sol_btc" - "kraken_book_sol_usdt" - "kraken_book_mkr_btc" - "kraken_book_usd_cad" - "kraken_book_usdt_cad" - "kraken_book_usdt_eur" - "kraken_book_usdt_usd" - "kraken_book_ltc_eth" - "kraken_book_ltc_btc" - "kraken_book_ltc_usd" - "kraken_book_sol_eur" - "kraken_book_usdc_usd" - "kraken_strategy_updates" - "kraken_dot_usd_rsi" - "kraken_dot_usd_sma" - "kraken_dot_usd_ema" - "kraken_dot_usd_stddev" # Poloniex topics - "poloniex_orders" - "poloniex_ticker" - "poloniex_book_btc_usd" - "poloniex_book_btc_usdt" - "poloniex_book_eth_usd" - "poloniex_book_eth_usdt" - "poloniex_book_eth_btc" - "poloniex_book_link_btc" - "poloniex_book_link_usdt" - "poloniex_book_trx_btc" - "poloniex_book_trx_usdt" - "poloniex_book_eth_trx" - "poloniex_book_link_trx" - "poloniex_balances" - "poloniex_account_balances" - "poloniex_open_orders" - "poloniex_assets" - "poloniex_pairs" - "poloniex_order_book" - "poloniex_trade_volume" - "poloniex_trades" - "poloniex_strategy_updates"
0
redpanda
/mono/helm/redpanda/Chart.yaml
apiVersion: v2 name: fdr-redpanda description: Redpanda is the real-time engine for modern apps. type: application version: "0.1.0" appVersion: v23.2.8 kubeVersion: "^1.21.0-0" dependencies: - name: redpanda version: "5.4.9" repository: https://charts.redpanda.com sources: - https://github.com/redpanda-data/helm-charts
0
redpanda
/mono/helm/redpanda/Chart.lock
dependencies: - name: redpanda repository: https://charts.redpanda.com version: 5.4.9 digest: sha256:11d4c9051633cd27dd594706e048b7051e82c1b4c20a270eb821ba5a11c0c5cd generated: "2024-04-19T16:10:42.31316938+08:00"
0
redpanda
/mono/helm/redpanda/Chart.state
92e5d394a96e13d1723b61aa8211b202b50e3774bb5d2d49f712b8f0995defb8 ./Chart.lock 7e75b8ec1b78acbc4cbbbe5e5d3301dab7a21000119431c1a81f966d6799db2d ./Chart.yaml 80dcb05471e037792f4bc83520744a07c9e7f749389798785f136374d9f2a508 ./files/create-topics.sh 5a24fc3ac647d80fee00d2c09ca5e86117b90326ee6ffd4c286d9a76e712c0aa ./templates/job-create-topics.yaml 4c378fca201e9076cede454da830dbe9b032041026555b63e5e701d7c1c10710 ./templates/NOTES.txt 1e7f7903e9754e390a80213d62e1a01d7d3cd04ad18e593f0e9e58555ecbb684 ./values/dev.yaml 191736c1f66ef5afee1e721f920622a65dd124141570196b060718fc7e2ec293 ./values/local.yaml 76ad53b88e9b3a8ac70b8df931208aff03ae10cd4899693ae25ddadca8b9f2ab ./values.yaml
0
values
/mono/helm/redpanda/values/dev.yaml
redpanda: statefulset: replicas: 1 storage: persistentVolume: enabled: true storageClass: aws-ebs-gp3-xfs tls: enabled: false # Do not allow access from outside of the cluster external: enabled: false listeners: kafka: external: default: enabled: false affinity: podAffinity: requiredDuringSchedulingIgnoredDuringExecution: # Schedule in the same AZ as the PostgreSQL primary - topologyKey: topology.kubernetes.io/zone labelSelector: matchExpressions: - key: app.kubernetes.io/name operator: In values: [postgresql] - key: app.kubernetes.io/component operator: In values: [primary] config: # https://docs.redpanda.com/current/reference/cluster-properties/ cluster: auto_create_topics_enabled: false
0
values
/mono/helm/redpanda/values/local.yaml
redpanda: statefulset: replicas: 1 initCountainers: fsValidator: enabled: true tls: enabled: false storage: persistentVolume: enabled: true size: 5Gi resources: memory: container: max: 1.5Gi # Enable access from outside of the cluster, ie when connecting from your host machine external: enabled: true # Do not create a NodePort/LoadBalancer service service: enabled: false addresses: - localhost listeners: kafka: external: default: port: 9094 advertisedPorts: - 9094 tls: enabled: false schemaRegistry: enabled: false config: # https://docs.redpanda.com/current/reference/cluster-properties/ cluster: auto_create_topics_enabled: false
0
files
/mono/helm/redpanda/files/create-topics.sh
#!/bin/env bash # Ensure script is run with at least one argument if [ $# -eq 0 ] then echo "No arguments supplied. Please supply topic names." exit 1 fi echo "Environment:" env | grep RPK # Wait until the RedPanda cluster is ready while ! curl -s $RPK_ADMIN_HOSTS/public_metrics > /dev/null; do echo "Waiting for RedPanda to become available..." sleep 1 done echo "Redpanda is ready." # Loop over topic names and configurations supplied as arguments for topic_config in "$@" do # Split our <topic>:<key1=val1,key2=val2,...> string topic="${topic_config%%:*}" config_string="${topic_config#*:}" # Split the config string into parts IFS=',' read -ra config <<< "$config_string" # Create the topic rpk topic create "$topic" # TODO: We can make this more efficient by only trying to create the topic once # Format the config options config_args=() for opt in "${config[@]}"; do config_args+=("--set") config_args+=($opt) done # Update the topic config rpk topic alter-config "$topic" "${config_args[@]}" done exit 0
0
templates
/mono/helm/redpanda/templates/NOTES.txt
You can connect to RedPanda by running a pod with RPK via ```bash kubectl run rpk-tool \ --image="{{ .Values.redpanda.image.repository }}:{{ .Chart.AppVersion }}" \ --restart=Never --rm --attach --tty --stdin --command \ --env="RPK_ADMIN_HOSTS=redpanda.default.svc.cluster.local:9644" \ --env="RPK_BROKERS=redpanda-0.redpanda.default.svc.cluster.local:9094" \ -- /bin/sh ``` You should now have an interactive shell with RPK available running inside of the Kubernetes cluster. You can use this shell to test, debug and configure our RedPanda cluster.
0
templates
/mono/helm/redpanda/templates/job-create-topics.yaml
{{ $redpandaUserId := 101 }} {{ $scriptMountPath := "/redpanda/bin" }} apiVersion: batch/v1 kind: Job metadata: name: redpanda-topic-creator labels: helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" annotations: "helm.sh/hook": post-install,post-upgrade "helm.sh/hook-weight": "-5" "helm.sh/hook-delete-policy": before-hook-creation spec: parallelism: 1 completions: 1 backoffLimit: 0 activeDeadlineSeconds: 60 # Allow the job to run for 1 minute ttlSecondsAfterFinished: 3600 # Keep the job for 1 hour after completion # PodSpec template template: spec: restartPolicy: Never containers: - name: redpanda-topic-creator image: "{{ .Values.redpanda.image.repository }}:{{ .Chart.AppVersion }}" env: - name: RPK_BROKERS value: redpanda.default.svc.cluster.local:9093 - name: RPK_ADMIN_HOSTS value: redpanda.default.svc.cluster.local:9644 command: - {{ $scriptMountPath }}/create-topics.sh {{ range $topic := $.Values.topics -}} {{ range $i, $topicConfig := $.Values.topicsConfig -}} {{ if (regexMatch $topicConfig.pattern $topic) -}} - {{ $topic }}:{{ range $k, $v := $topicConfig.config }}{{ $k }}={{ $v | int }},{{ end }} {{ end -}} {{ end -}} {{ end }} volumeMounts: - name: redpanda-create-topics-sh mountPath: {{ $scriptMountPath }} readOnly: true volumes: - name: redpanda-create-topics-sh configMap: name: redpanda-create-topics-sh defaultMode: 0555 --- apiVersion: v1 kind: ConfigMap metadata: name: redpanda-create-topics-sh data: create-topics.sh: | {{ ($.Files.Get "files/create-topics.sh") | indent 4 }}
0
postgresql
/mono/helm/postgresql/.helmignore
# Patterns to ignore when building packages. .DS_Store # Local secrets secrets.yaml *.secrets.yaml # Common VCS dirs .git/ .gitignore .bzr/ .bzrignore .hg/ .hgignore .svn/ # Common backup files *.swp *.bak *.tmp *~ # Various IDEs .project .idea/ *.tmproj
0
postgresql
/mono/helm/postgresql/Chart.yaml
# Copyright VMware, Inc. # SPDX-License-Identifier: APACHE-2.0 apiVersion: v2 name: fdr-postgresql appVersion: 15.4.0 version: 0.1.0 annotations: category: database namespace: data dependencies: - name: postgresql repository: https://charts.bitnami.com/bitnami version: 15.x.x description: | PostgreSQL (Postgres) is an open source object-relational database known for reliability and data integrity. ACID-compliant, it supports foreign keys, joins, views, triggers and stored procedures.
0
postgresql
/mono/helm/postgresql/Chart.lock
dependencies: - name: postgresql repository: https://charts.bitnami.com/bitnami version: 15.2.9 digest: sha256:c7d18fedc2d83de3d7be99e7dd6cbc2aa8bed5187328046e23e7ba18043a185a generated: "2024-05-07T09:55:03.774864563-03:00"
0
postgresql
/mono/helm/postgresql/Chart.state
63580d2fdce9e83a7e629ea4840f3daf79d58e5eb40c4b82321d83cde270a85a ./Chart.lock 4b950fd85e6db9902b6350746853f7e68f78f31a8649cabceb27ee01c33baa7f ./Chart.yaml efc832fb818cc0324a82834f5c5388ce1ba64367b3b8bd05704965dd2f364b44 ./files/initdb.sh 4e0eb6a6ebbfde3f2c3b071f5890c460395bc8cbc1ffeea6f73f38c235fbba53 ./.helmignore 0a059bc77924dbffcebc75813dcf53e34fc689f5c90124385549dabbf3afa563 ./templates/cfgmap-initdb.tpl 9f28efcc6803e9e1a38fc846595043b7b1017325f9f5bb57e14de1a39def8eb5 ./templates/NOTES.txt 6c68c01b07c0583b944284fdc9aae081026f786ae71bcf90d807fe742786f024 ./templates/secret-admin-password.tpl 13b990e8264f979fc2d39f2c2561883dac35e353ec826490f0b56bbb50ebabe0 ./values/dev.yaml 4d7e22ad86ee4e47d15b10e9d3069b6c3e40da9be021f3fa63548a4363c3ceec ./values/local.yaml
0
values
/mono/helm/postgresql/values/dev.yaml
# https://github.com/bitnami/charts/tree/main/bitnami/postgresql#postgresql-common-parameters postgresql: architecture: standalone image: tag: 15.4.0-debian-11-r39 auth: enablePostgresUser: true username: admin existingSecret: postgres database: postgres postgresqlDataDir: /mnt/postgres/data metrics: enabled: true service: annotations: "prometheus.io/scrape": "true" "prometheus.io/path": "/metrics" "prometheus.io/port": "9187" "prometheus.io/service": "postgresql" primary: persistence: # Enable PostgreSQL Primary data persistence using PVC enabled: true volumeName: postrgresql-data mountPath: /mnt/postgres size: 20Gi persistentVolumeClaimRetentionPolicy: enabled: true # initdb: # scriptsConfigMap: postgres-initdb-scripts initContainers: - name: chown-data-volume image: busybox command: ['sh', '-c', 'chown -R 1001:1001 /mnt/postgres'] volumeMounts: - name: postrgresql-data mountPath: /mnt/postgres # Deprecated in favor of primary.persistence but still required because there is # a ref to this value in the templates persistence: {}
0
values
/mono/helm/postgresql/values/local.yaml
global: postgresql: auth: postgresPassword: "" username: "trading" # TODO: manage secrets password: "trading" # TODO: manage secrets database: "trading" # TODO: manage secrets additionalDatabases: - name: "archive" # TODO: manage secrets username: "archive" # TODO: manage secrets password: "archive" # TODO: manage secrets postgresql: primary: resources: limits: cpu: 1000m memory: 2048Mi # 2Gi requests: cpu: 500m memory: 1024Mi # 1Gi image: tag: 15.4.0-debian-11-r39 persistence: useHostPath: false hostPath: path: "" metrics: enabled: true service: annotations: "prometheus.io/scrape": "true" "prometheus.io/path": "/metrics" "prometheus.io/port": "9187" "prometheus.io/service": "postgresql"
0
files
/mono/helm/postgresql/files/initdb.sh
#!/bin/env bash echo "Hello, PostgreSQL!"
0
templates
/mono/helm/postgresql/templates/NOTES.txt
Thank you for installing {{ .Chart.Name }}. To view the notes from the Bitnami PostgreSQL chart, please run the following command: helm get notes {{ .Release.Name }} --namespace {{ .Release.Namespace }} {{- $postgresImage := "docker.io/bitnami/postgresql:15.4.0-debian-11-r39" }} {{- $postgresSvcPort := 5432 }} {{- $postgresSvcDNS := printf "postgresql.%s.svc.cluster.local" .Release.Namespace }} PostgreSQL can be accessed via port {{ $postgresSvcPort }} on the following DNS names from within your cluster: {{ $postgresSvcDNS }} - Read/Write connection To connect to your database run the following command: kubectl run postgres-client --rm --tty -i --restart='Never' --namespace {{ .Release.Namespace }} \ --image {{ $postgresImage }} \ --env="PGPASSWORD=$POSTGRES_PASSWORD" \ --command -- psql --host {{ $postgresSvcDNS }} -U postgres -d postgres -p {{ $postgresSvcPort }} **Note:** You will need to set the admin password from command line. Dawson can provide this value on request.
0
templates
/mono/helm/postgresql/templates/cfgmap-initdb.tpl
apiVersion: v1 kind: ConfigMap metadata: name: postgres-initdb-scripts data: initdb.sh: | {{ .Files.Get "files/initdb.sh" | indent 4 }}
0
templates
/mono/helm/postgresql/templates/secret-admin-password.tpl
{{ if .Values.postgresql.auth.existingSecret }} apiVersion: v1 kind: Secret metadata: name: {{ .Values.postgresql.auth.existingSecret }} type: Opaque data: {{ $.Values.postgresql.auth.secretKeys.adminPasswordKey }}: {{ .Values.secrets.auth.adminPassword | b64enc }} {{ $.Values.postgresql.auth.secretKeys.userPasswordKey }}: {{ .Values.secrets.auth.userPassword | b64enc }} {{ $.Values.postgresql.auth.secretKeys.replicationPasswordKey }}: {{ .Values.secrets.auth.replicationPassword | b64enc }} {{ end }}
0
archive-service
/mono/helm/archive-service/.helmignore
# Patterns to ignore when building packages. # This supports shell glob matching, relative path matching, and # negation (prefixed with !). Only one pattern per line. .DS_Store # Common VCS dirs .git/ .gitignore .bzr/ .bzrignore .hg/ .hgignore .svn/ # Common backup files *.swp *.bak *.tmp *.orig *~ # Various IDEs .project .idea/ *.tmproj .vscode/
0
archive-service
/mono/helm/archive-service/values.yaml
replicaCount: 1 name: archive-service image: name: archive-service repository: registry.gitlab.com/fdr-group/mono/rs/archive-service pullPolicy: IfNotPresent tag: "latest" imagePullSecrets: [ ] nameOverride: "" fullnameOverride: "archive-service" serviceAccount: create: true annotations: { } name: "archive-service" service: type: ClusterIP port: 3000 ingress: enabled: false autoscaling: enabled: false
0
archive-service
/mono/helm/archive-service/Chart.yaml
apiVersion: v2 name: archive-service description: Archive Service type: application version: 0.1.0 appVersion: "0.1.0"
0
values
/mono/helm/archive-service/values/dev.yaml
SERVICE: "archive-service" RUST_LOG: info imagePullSecrets: - name: gitlab-registry image: tag: "amd64-79b11d20" configTomlFile: config/dev.toml affinity: podAffinity: requiredDuringSchedulingIgnoredDuringExecution: # Schedule in the same AZ as the PostgreSQL primary - topologyKey: topology.kubernetes.io/zone labelSelector: matchExpressions: - key: app.kubernetes.io/name operator: In values: [postgresql] - key: app.kubernetes.io/component operator: In values: [primary]
0
values
/mono/helm/archive-service/values/local.yaml
SERVICE: "archive-service" RUST_LOG: debug image: tag: "local" createSecrets: true secrets: postgresql_username: file://sym-secrets/postgresql_username postgresql_password: file://sym-secrets/postgresql_password configTomlFile: config/local-k8s.toml
0
templates
/mono/helm/archive-service/templates/NOTES.txt
1. Get the application URL by running these commands: {{- if .Values.ingress.enabled }} {{- range $host := .Values.ingress.hosts }} {{- range .paths }} http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} {{- end }} {{- end }} {{- else if contains "NodePort" .Values.service.type }} export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "archive-service.fullname" . }}) export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") echo http://$NODE_IP:$NODE_PORT {{- else if contains "LoadBalancer" .Values.service.type }} NOTE: It may take a few minutes for the LoadBalancer IP to be available. You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "archive-service.fullname" . }}' export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "archive-service.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") echo http://$SERVICE_IP:{{ .Values.service.port }} {{- else if contains "ClusterIP" .Values.service.type }} export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "archive-service.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") echo "Visit http://127.0.0.1:8080 to use your application" kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT {{- end }}
0
templates
/mono/helm/archive-service/templates/ingress.yaml
{{- if .Values.ingress.enabled -}} {{- $fullName := include "archive-service.fullname" . -}} {{- $svcPort := .Values.service.port -}} {{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }} {{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }} {{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}} {{- end }} {{- end }} {{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}} apiVersion: networking.k8s.io/v1 {{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} apiVersion: networking.k8s.io/v1beta1 {{- else -}} apiVersion: extensions/v1beta1 {{- end }} kind: Ingress metadata: name: {{ $fullName }} labels: {{- include "archive-service.labels" . | nindent 4 }} {{- with .Values.ingress.annotations }} annotations: {{- toYaml . | nindent 4 }} {{- end }} spec: {{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }} ingressClassName: {{ .Values.ingress.className }} {{- end }} {{- if .Values.ingress.tls }} tls: {{- range .Values.ingress.tls }} - hosts: {{- range .hosts }} - {{ . | quote }} {{- end }} secretName: {{ .secretName }} {{- end }} {{- end }} rules: {{- range .Values.ingress.hosts }} - host: {{ .host | quote }} http: paths: {{- range .paths }} - path: {{ .path }} {{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }} pathType: {{ .pathType }} {{- end }} backend: {{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }} service: name: {{ $fullName }} port: number: {{ $svcPort }} {{- else }} serviceName: {{ $fullName }} servicePort: {{ $svcPort }} {{- end }} {{- end }} {{- end }} {{- end }}
0
templates
/mono/helm/archive-service/templates/_helpers.tpl
{{/* Expand the name of the chart. */}} {{- define "archive-service.name" -}} {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} {{- end }} {{/* Create a default fully qualified app name. We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). If release name contains chart name it will be used as a full name. */}} {{- define "archive-service.fullname" -}} {{- if .Values.fullnameOverride }} {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} {{- else }} {{- $name := default .Chart.Name .Values.nameOverride }} {{- if contains $name .Release.Name }} {{- .Release.Name | trunc 63 | trimSuffix "-" }} {{- else }} {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} {{- end }} {{- end }} {{- end }} {{/* Create chart name and version as used by the chart label. */}} {{- define "archive-service.chart" -}} {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} {{- end }} {{/* Common labels */}} {{- define "archive-service.labels" -}} helm.sh/chart: {{ include "archive-service.chart" . }} {{ include "archive-service.selectorLabels" . }} {{- if .Chart.AppVersion }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} app.kubernetes.io/managed-by: {{ .Release.Service }} {{- end }} {{/* Selector labels */}} {{- define "archive-service.selectorLabels" -}} app.kubernetes.io/name: {{ include "archive-service.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} {{/* Create the name of the service account to use */}} {{- define "archive-service.serviceAccountName" -}} {{- if .Values.serviceAccount.create }} {{- default (include "archive-service.fullname" .) .Values.serviceAccount.name }} {{- else }} {{- default "default" .Values.serviceAccount.name }} {{- end }} {{- end }}
0
templates
/mono/helm/archive-service/templates/hpa.yaml
{{- if .Values.autoscaling.enabled }} apiVersion: autoscaling/v2beta1 kind: HorizontalPodAutoscaler metadata: name: {{ include "archive-service.fullname" . }} labels: {{- include "archive-service.labels" . | nindent 4 }} spec: scaleTargetRef: apiVersion: apps/v1 kind: Deployment name: {{ include "archive-service.fullname" . }} minReplicas: {{ .Values.autoscaling.minReplicas }} maxReplicas: {{ .Values.autoscaling.maxReplicas }} metrics: {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} - type: Resource resource: name: cpu targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} {{- end }} {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} - type: Resource resource: name: memory targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} {{- end }} {{- end }}
0
templates
/mono/helm/archive-service/templates/service.yaml
apiVersion: v1 kind: Service metadata: name: {{ include "archive-service.fullname" . }} labels: {{- include "archive-service.labels" . | nindent 4 }} spec: type: {{ .Values.service.type }} ports: - port: {{ .Values.service.port }} targetPort: http protocol: TCP name: http selector: {{- include "archive-service.selectorLabels" . | nindent 4 }}
0
templates
/mono/helm/archive-service/templates/deployment.yaml
{{- if .Values.createSecrets }} {{- include "common.secrets-v2" . }} --- {{- end -}} {{- include "common.config.configmap" . -}} apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "archive-service.fullname" . }} labels: {{- include "archive-service.labels" . | nindent 4 }} spec: {{- if not .Values.autoscaling.enabled }} replicas: {{ .Values.replicaCount }} {{- end }} selector: matchLabels: {{- include "archive-service.selectorLabels" . | nindent 6 }} template: metadata: {{- with .Values.podAnnotations }} annotations: {{- toYaml . | nindent 8 }} {{- end }} labels: {{- include "archive-service.selectorLabels" . | nindent 8 }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} serviceAccountName: {{ include "archive-service.serviceAccountName" . }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} containers: - name: {{ .Chart.Name }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} {{- if (.Values.command) }} command: {{ .Values.command | toJson }} {{- end }} env: - name: "RUST_LOG" value: {{ .Values.RUST_LOG }} - name: "SERVICE" value: {{ .Values.SERVICE }} ports: - name: http containerPort: 3000 protocol: TCP livenessProbe: initialDelaySeconds: 5 httpGet: path: /healthy port: 3000 readinessProbe: initialDelaySeconds: 5 httpGet: path: /ready port: 3000 resources: {{- toYaml .Values.resources | nindent 12 }} volumeMounts: {{- include "common.secrets.volumeMounts" . | nindent 12 }} {{- include "common.config.volumeMounts" . | nindent 12 }} volumes: {{- include "common.secrets.volumes" . | nindent 8 }} {{- include "common.config.volumes" . | nindent 8 }} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.affinity }} affinity: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.tolerations }} tolerations: {{- toYaml . | nindent 8 }} {{- end }}
0
templates
/mono/helm/archive-service/templates/serviceaccount.yaml
{{- if .Values.serviceAccount.create -}} apiVersion: v1 kind: ServiceAccount metadata: name: {{ include "archive-service.serviceAccountName" . }} labels: {{- include "archive-service.labels" . | nindent 4 }} {{- with .Values.serviceAccount.annotations }} annotations: {{- toYaml . | nindent 4 }} {{- end }} {{- end }}
0
tests
/mono/helm/archive-service/templates/tests/test-connection.yaml
apiVersion: v1 kind: Pod metadata: name: "{{ include "archive-service.fullname" . }}-test-connection" labels: {{- include "archive-service.labels" . | nindent 4 }} annotations: "helm.sh/hook": test spec: containers: - name: wget image: busybox command: ['wget'] args: ['{{ include "archive-service.fullname" . }}:{{ .Values.service.port }}'] restartPolicy: Never
0
config
/mono/helm/archive-service/config/dev.toml
[kafka_consumer] group_id = "archive_service" bootstrap_servers = "redpanda.default.svc.cluster.local:9093" enable_partition_eof = "false" session_timeout_ms = "6000" auto_commit = "false" offset_reset = "latest" topics = ["kraken_ticker"] [postgres] hostname = "postgresql" port = 5432 database = "trading" max_connections = 10 username = "file:./.secrets/postgresql_username" password = "file:./.secrets/postgresql_password" [server] listen_address = "0.0.0.0" port = 3000 [metrics] prefix = "fdr" [tracing] level = "DEBUG" tempo_url = "http://tempo.default.svc.cluster.local" tempo_port = 4317 service_name = "archive_service"
0
config
/mono/helm/archive-service/config/local-k8s.toml
[kafka_consumer] group_id = "archive_service" bootstrap_servers = "redpanda:9093" enable_partition_eof = "false" session_timeout_ms = "6000" auto_commit = "false" offset_reset = "latest" topics = ["kraken_ticker"] [postgres] hostname = "postgresql" port = 5432 database = "trading" max_connections = 10 username = "file:./.secrets/postgresql_username" password = "file:./.secrets/postgresql_password" [server] listen_address = "0.0.0.0" port = 3000 [metrics] prefix = "fdr" [tracing] level = "DEBUG" tempo-url = "http://tempo" tempo-port = 4317 service-name = "archive_service"
0
config
/mono/helm/archive-service/config/local-host-ohlcv.toml
[postgres] hostname = "localhost" port = 5432 database = "trading-test" max_connections = 10 username = "file:./.secrets/postgresql_test_username" password = "file:./.secrets/postgresql_test_password" [ohlcv_params] exchange = "Kraken" pair = "DOT_USD" candle_interval_mins = 1 data_file = "DOTUSD_1.csv"
0
vault
/mono/helm/vault/values.yaml
global: namespace: vault vault: injector: enabled: false # TODO: Enable once K8s auth is configured server: enabled: true logLevel: info service: enabled: true type: ClusterIP active: enabled: true standby: enabled: true publishNotReadyAddresses: false dataStorage: enabled: true persistentVolumeClaimRetentionPolicy: whenDeleted: Retain whenScaled: Retain standalone: enabled: true ui: enabled: true publishNotReadyAddresses: false activeVaultPodOnly: true
0
vault
/mono/helm/vault/Chart.yaml
# Copyright VMware, Inc. # SPDX-License-Identifier: APACHE-2.0 apiVersion: v2 name: fdr-vault appVersion: 1.16.1 version: 0.1.0 annotations: category: secrets namespace: vault # TODO: Move to OpenBao when it becomes stable dependencies: - name: vault repository: https://helm.releases.hashicorp.com version: 0.28.x description: | Hashicorp Vault for dynamic secrets and service identity.
0
vault
/mono/helm/vault/Chart.lock
dependencies: - name: vault repository: https://helm.releases.hashicorp.com version: 0.28.0 digest: sha256:f4e39de88be0810aaa8275491ada495105a8afda9781277b08a3e3c4714568fe generated: "2024-05-29T12:16:36.385268534+08:00"
0
vault
/mono/helm/vault/Chart.state
087ac030e81dd070cdceeb3cf8d2706a63ea5d20d29c574f64a4ae18d80afec8 ./Chart.lock 2244f0fee792aa8fa7b27e7d8a7ddb87b4721cfbf9baa2361ef1c29659785c75 ./Chart.yaml 7e847654d750c983407f86db4ad9779021991c93cdaaed79e24521ea047750ea ./templates/namespace.yaml 1d9b8a1f57c4cf59c30d95ffe87a68b977d7ec678b8f75b5a56f15bb46364eea ./values.yaml
0
templates
/mono/helm/vault/templates/namespace.yaml
apiVersion: v1 kind: Namespace metadata: name: {{ .Values.global.namespace }}
0
promtail
/mono/helm/promtail/values.yaml
# Common values for Promtail
0
promtail
/mono/helm/promtail/values-local.yaml
# Local values for Grafana Loki config: clients: - url: http://loki-stack:3100/loki/api/v1/push
0
fdr-common
/mono/helm/fdr-common/Chart.yaml
apiVersion: v2 name: fdr-common description: A Helm library chart for shared templates version: 0.1.0 type: library
0
templates
/mono/helm/fdr-common/templates/_secrets.tpl
# helm/common/_secrets.tpl {{- define "common.secrets" -}} {{- if .Values.createSecrets -}} apiVersion: v1 kind: Secret metadata: name: {{ .Release.Name }}-secrets type: Opaque data: {{- range $secret := .Values.secrets }} {{- $fileContent := $.Files.Get (printf "sym-secrets/%s" $secret) }} {{- if $fileContent }} {{ $secret }}: {{ $fileContent | b64enc | quote }} {{- else }} {{ printf "Warning: No content found for secret file: %s" $secret | fail }} {{- end }} {{- end }} --- {{- end -}} {{- end -}} {{- define "common.secrets-v2" -}} {{/* Validation */}} {{- if (empty .Values.secrets) }} {{- fail ".Values.secrets missing. `secrets` must be defined in your values file." }} {{- end -}} {{- if (not (kindIs "map" .Values.secrets)) }} {{- fail ".Values.secrets must be defined as a map[string]string." }} {{- end -}} apiVersion: v1 kind: Secret metadata: name: {{ .Release.Name }}-secrets type: Opaque stringData: {{- range $secretKey, $secret := .Values.secrets }} {{- if (hasPrefix "file://" $secret) }} {{- $filePath := (trimPrefix "file://" $secret) }} {{- $fileContent := $.Files.Get ($filePath) }} {{ $secretKey }}: {{ $fileContent | trim | quote }} {{- else }} {{ $secretKey }}: {{ $secret | trim | quote }} {{- end }} {{- end }} {{- end -}} {{/*{{- define "common.secrets" -}}*/}} {{/*apiVersion: v1*/}} {{/*kind: Secret*/}} {{/*metadata:*/}} {{/* name: {{ .Values.name }}-secrets*/}} {{/*type: Opaque*/}} {{/*data:*/}} {{/* {{- $files := $.Files.Glob ".secrets/*" }}*/}} {{/* {{- range $file, $content := $files }}*/}} {{/* {{- $strContent := "" }}*/}} {{/* {{- range $content }}*/}} {{/* {{- $strContent = print $strContent (printf "%c" .) }}*/}} {{/* {{- end }}*/}} {{/* {{ base $file }}: {{ $strContent | b64enc | quote }}*/}} {{/* {{- end }}*/}} {{/*---*/}} {{/*{{- end -}}*/}} {{/* Define volumeMounts for secrets */}} {{- define "common.secrets.volumeMounts" }} - name: {{ .Release.Name }}-secrets-volume mountPath: /app/.secrets readOnly: true {{- end }} {{/* Define volumes for secrets */}} {{- define "common.secrets.volumes" }} - name: {{ .Release.Name }}-secrets-volume secret: secretName: {{ .Release.Name }}-secrets {{- end }}
0
templates
/mono/helm/fdr-common/templates/_config.tpl
{{/* Define config map for TOML config */}} {{- define "common.config.configmap" -}} apiVersion: v1 kind: ConfigMap metadata: name: {{ include "fdr.common.name.configmap.toml-config" . }} labels: app: {{ .Chart.Name }} data: config.toml: | {{ if .Values.configTomlFile }} {{- ($.Files.Get .Values.configTomlFile) | indent 6 }} {{ else }} {{ .Values.configToml | indent 6 }} {{ end }} --- {{- end -}} {{/* Generates a sha256 hash of the config */}} {{- define "fdr.common.config.configmap.sha256sum" }} {{- if .Values.configTomlFile }} {{- ($.Files.Get .Values.configTomlFile) | sha256sum }} {{- else }} {{- .Values.configToml | sha256sum }} {{- end }} {{- end }} {{- define "fdr.common.config.configmap.annotation" -}} "fdrgroup.xyz/config-hash": "{{ include "fdr.common.config.configmap.sha256sum" . }}" {{- end }} {{/* Define volumeMounts for secrets */}} {{- define "common.config.volumeMounts" }} - name: toml-config mountPath: /app/config.toml subPath: config.toml {{- end }} {{/* Define volumes for secrets */}} {{- define "common.config.volumes" }} - name: toml-config configMap: name: {{ include "fdr.common.name.configmap.toml-config" . }} {{- end }}
0
templates
/mono/helm/fdr-common/templates/_names.tpl
{{- define "fdr.common.name.deployment" -}} {{ .Release.Name }} {{- end }} {{- define "fdr.common.name.configmap.toml-config" -}} toml-{{ .Chart.Name }}-{{ .Release.Name }} {{- end }} {{- define "fdr.common.name.service" -}} {{ .Release.Name }} {{- end }}
0
indicator-service
/mono/helm/indicator-service/.helmignore
# Patterns to ignore when building packages. # This supports shell glob matching, relative path matching, and # negation (prefixed with !). Only one pattern per line. .DS_Store # Common VCS dirs .git/ .gitignore .bzr/ .bzrignore .hg/ .hgignore .svn/ # Common backup files *.swp *.bak *.tmp *.orig *~ # Various IDEs .project .idea/ *.tmproj .vscode/
0
indicator-service
/mono/helm/indicator-service/values.yaml
replicaCount: 1 name: indicator-service createSecrets: false secrets: { } image: name: indicator-service repository: registry.gitlab.com/fdr-group/mono/rs/indicator-service pullPolicy: IfNotPresent tag: "latest" imagePullSecrets: [ ] nameOverride: "" fullnameOverride: "indicator-service" serviceAccount: create: true annotations: { } name: "indicator-service" service: type: ClusterIP port: 3000 annotations: "prometheus.io/scrape": "true" "prometheus.io/path": "/metrics" "prometheus.io/port": "3000" ingress: enabled: false autoscaling: enabled: false
0
indicator-service
/mono/helm/indicator-service/Chart.yaml
apiVersion: v2 name: indicator-service description: Price Oracle type: application version: 0.1.0 appVersion: "0.1.0"
0
values
/mono/helm/indicator-service/values/dev.yaml
SERVICE: "indicator-service" RUST_LOG: info imagePullSecrets: - name: gitlab-registry image: tag: "amd64-79b11d20" configTomlFile: config/dev.toml affinity: podAffinity: requiredDuringSchedulingIgnoredDuringExecution: # Schedule in the same AZ as the PostgreSQL primary - topologyKey: topology.kubernetes.io/zone labelSelector: matchExpressions: - key: app.kubernetes.io/name operator: In values: [ postgresql ] - key: app.kubernetes.io/component operator: In values: [ primary ]
0
values
/mono/helm/indicator-service/values/local.yaml
SERVICE: "indicator-service" RUST_LOG: debug image: tag: "local" createSecrets: true secrets: postgresql_username: file://sym-secrets/postgresql_username postgresql_password: file://sym-secrets/postgresql_password configTomlFile: config/local-k8s.toml
0
templates
/mono/helm/indicator-service/templates/NOTES.txt
1. Get the application URL by running these commands: {{- if .Values.ingress.enabled }} {{- range $host := .Values.ingress.hosts }} {{- range .paths }} http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }} {{- end }} {{- end }} {{- else if contains "NodePort" .Values.service.type }} export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "indicator-service.fullname" . }}) export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}") echo http://$NODE_IP:$NODE_PORT {{- else if contains "LoadBalancer" .Values.service.type }} NOTE: It may take a few minutes for the LoadBalancer IP to be available. You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "indicator-service.fullname" . }}' export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "indicator-service.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}") echo http://$SERVICE_IP:{{ .Values.service.port }} {{- else if contains "ClusterIP" .Values.service.type }} export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "indicator-service.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}") export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}") echo "Visit http://127.0.0.1:8080 to use your application" kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT {{- end }}
0
templates
/mono/helm/indicator-service/templates/_helpers.tpl
{{/* Expand the name of the chart. */}} {{- define "indicator-service.name" -}} {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} {{- end }} {{/* Create a default fully qualified app name. We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). If release name contains chart name it will be used as a full name. */}} {{- define "indicator-service.fullname" -}} {{- if .Values.fullnameOverride }} {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} {{- else }} {{- $name := default .Chart.Name .Values.nameOverride }} {{- if contains $name .Release.Name }} {{- .Release.Name | trunc 63 | trimSuffix "-" }} {{- else }} {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} {{- end }} {{- end }} {{- end }} {{/* Create chart name and version as used by the chart label. */}} {{- define "indicator-service.chart" -}} {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} {{- end }} {{/* Common labels */}} {{- define "indicator-service.labels" -}} helm.sh/chart: {{ include "indicator-service.chart" . }} {{ include "indicator-service.selectorLabels" . }} {{- if .Chart.AppVersion }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} app.kubernetes.io/managed-by: {{ .Release.Service }} {{- end }} {{/* Selector labels */}} {{- define "indicator-service.selectorLabels" -}} app.kubernetes.io/name: {{ include "indicator-service.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} {{/* Create the name of the service account to use */}} {{- define "indicator-service.serviceAccountName" -}} {{- if .Values.serviceAccount.create }} {{- default (include "indicator-service.fullname" .) .Values.serviceAccount.name }} {{- else }} {{- default "default" .Values.serviceAccount.name }} {{- end }} {{- end }}
0
templates
/mono/helm/indicator-service/templates/service.yaml
apiVersion: v1 kind: Service metadata: name: {{ include "indicator-service.fullname" . }} labels: {{- include "indicator-service.labels" . | nindent 4 }} annotations: {{- $.Values.service.annotations | toYaml | nindent 4 }} spec: type: {{ .Values.service.type }} ports: - port: {{ .Values.service.port }} targetPort: http protocol: TCP name: http selector: {{- include "indicator-service.selectorLabels" . | nindent 4 }}
0
templates
/mono/helm/indicator-service/templates/deployment.yaml
{{- if .Values.createSecrets }} {{- include "common.secrets-v2" . }} --- {{- end -}} {{- include "common.config.configmap" . -}} apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "indicator-service.fullname" . }} labels: {{- include "indicator-service.labels" . | nindent 4 }} spec: {{- if not .Values.autoscaling.enabled }} replicas: {{ .Values.replicaCount }} {{- end }} selector: matchLabels: {{- include "indicator-service.selectorLabels" . | nindent 6 }} template: metadata: {{- with .Values.podAnnotations }} annotations: {{- toYaml . | nindent 8 }} {{- end }} labels: {{- include "indicator-service.selectorLabels" . | nindent 8 }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} serviceAccountName: {{ include "indicator-service.serviceAccountName" . }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} containers: - name: {{ .Chart.Name }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} {{- if (.Values.command) }} command: {{ .Values.command | toJson }} {{- end }} env: - name: "RUST_LOG" value: {{ .Values.RUST_LOG }} - name: "SERVICE" value: {{ .Values.SERVICE }} ports: - name: http containerPort: 3000 protocol: TCP livenessProbe: initialDelaySeconds: 5 httpGet: path: /healthy port: 3000 readinessProbe: initialDelaySeconds: 5 httpGet: path: /ready port: 3000 resources: {{- toYaml .Values.resources | nindent 12 }} volumeMounts: {{- include "common.secrets.volumeMounts" . | nindent 12 }} {{- include "common.config.volumeMounts" . | nindent 12 }} volumes: {{- include "common.secrets.volumes" . | nindent 8 }} {{- include "common.config.volumes" . | nindent 8 }} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.affinity }} affinity: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.tolerations }} tolerations: {{- toYaml . | nindent 8 }} {{- end }}
0
templates
/mono/helm/indicator-service/templates/serviceaccount.yaml
{{- if .Values.serviceAccount.create -}} apiVersion: v1 kind: ServiceAccount metadata: name: {{ include "indicator-service.serviceAccountName" . }} labels: {{- include "indicator-service.labels" . | nindent 4 }} {{- with .Values.serviceAccount.annotations }} annotations: {{- toYaml . | nindent 4 }} {{- end }} {{- end }}
0
tests
/mono/helm/indicator-service/templates/tests/test-connection.yaml
apiVersion: v1 kind: Pod metadata: name: "{{ include "indicator-service.fullname" . }}-test-connection" labels: {{- include "indicator-service.labels" . | nindent 4 }} annotations: "helm.sh/hook": test spec: containers: - name: wget image: busybox command: [ 'wget' ] args: [ '{{ include "indicator-service.fullname" . }}:{{ .Values.service.port }}' ] restartPolicy: Never
0
config
/mono/helm/indicator-service/config/dev.toml
[kafka_consumer] group_id = "price_oracle" bootstrap_servers = "redpanda.default.svc.cluster.local:9093" enable_partition_eof = "false" session_timeout_ms = "6000" auto_commit = "false" offset_reset = "latest" topics = ["kraken_ticker"] [postgres] hostname = "postgresql" port = 5432 database = "trading" max_connections = 10 username = "file:./.secrets/postgresql_username" password = "file:./.secrets/postgresql_password" [server] listen_address = "0.0.0.0" port = 3000 [metrics] prefix = "fdr" [tracing] level = "DEBUG" tempo_url = "http://tempo.default.svc.cluster.local" tempo_port = 4317 service_name = "price_oracle" [[markets]] pair = "DOT/USD" exchange = "Kraken"
0
config
/mono/helm/indicator-service/config/local-k8s.toml
[kafka_producer] bootstrap_servers = "redpanda:9093" max_in_flight_requests_per_connection = 1 batch_num_messages = 1 request_required_acks = "all" default_timeout_milliseconds = 50 max_retries = 3 retry_backoff_milliseconds = 10 [kafka_consumer] group_id = "price_oracle" bootstrap_servers = "redpanda:9093" enable_partition_eof = "false" session_timeout_ms = "6000" auto_commit = "false" offset_reset = "latest" topics = ["kraken_ticker"] [postgres] hostname = "postgresql" port = 5432 database = "trading" max_connections = 10 username = "file:./.secrets/postgresql_username" password = "file:./.secrets/postgresql_password" [server] listen_address = "0.0.0.0" port = 3000 [metrics] prefix = "fdr" [tracing] level = "DEBUG" tempo-url = "http://tempo" tempo-port = 4317 service-name = "price_oracle" [indicator] [[indicator.markets]] pair = "DOT/USD" exchange = "Kraken"
0
config
/mono/helm/indicator-service/config/local-host.toml
[kafka_producer] bootstrap_servers = "localhost:9094" max_in_flight_requests_per_connection = 1 batch_num_messages = 1 request_required_acks = "all" default_timeout_milliseconds = 50 max_retries = 3 retry_backoff_milliseconds = 10 [kafka_consumer] group_id = "indicator-service" bootstrap_servers = "localhost:9094" enable_partition_eof = "false" session_timeout_ms = "6000" auto_commit = "false" offset_reset = "latest" topics = ["kraken_ticker"] [server] listen_address = "0.0.0.0" port = 3010 [postgres] hostname = "localhost" port = 5432 database = "trading" max_connections = 10 username = "file:./.secrets/postgresql_username" password = "file:./.secrets/postgresql_password" [metrics] prefix = "fdr" [tracing] level = "DEBUG" tempo_url = "http://localhost" tempo_port = 4317 service_name = "kraken_proxy" [indicator] [[indicator.markets]] pair = "DOT/USD" exchange = "Kraken"
0
node-exporter
/mono/helm/node-exporter/values.yaml
node-exporter: namespaceOverride: monitoring rbac: create: false serviceAccount: create: false podAnnotations: "prometheus.io/scrape": "true" "prometheus.io/path": "/metrics" "prometheus.io/port": "9100"
0
node-exporter
/mono/helm/node-exporter/Chart.yaml
apiVersion: v2 name: fdr-node-exporter description: A Helm chart to deploy Node Exporter as a daemon set to all nodes in the cluster type: application version: 0.1.0 dependencies: - name: node-exporter repository: https://charts.bitnami.com/bitnami version: 4.2.1
0
node-exporter
/mono/helm/node-exporter/Chart.lock
dependencies: - name: node-exporter repository: https://charts.bitnami.com/bitnami version: 4.2.1 digest: sha256:127b10ab9abcce58b6b071582ae2aef165b96bc588bca9bb382914fdd3d58ce7 generated: "2024-05-14T11:54:06.339879706+08:00"
0
node-exporter
/mono/helm/node-exporter/Chart.state
7d0583b7cdd8f04a502b2ea71f86cc8a5dad872318f0500d30f207870f36fc43 ./Chart.lock 9a50ebcbfaea25eafe930f73c22368a44825abd45edf212077937766f35c9f3f ./Chart.yaml 995e61b77168ce69be1d2b990a2674d8d22b82dbca1ec4b12c530e46953d7817 ./values.yaml
0
strat-triangular-arbitrage
/mono/helm/strat-triangular-arbitrage/.helmignore
# Patterns to ignore when building packages. # This supports shell glob matching, relative path matching, and # negation (prefixed with !). Only one pattern per line. .DS_Store # Common VCS dirs .git/ .gitignore .bzr/ .bzrignore .hg/ .hgignore .svn/ # Common backup files *.swp *.bak *.tmp *.orig *~ # Various IDEs .project .idea/ *.tmproj .vscode/
0
strat-triangular-arbitrage
/mono/helm/strat-triangular-arbitrage/values.yaml
replicaCount: 1 image: name: strategy-manager repository: registry.gitlab.com/fdr-group/mono/rs/strategy-manager pullPolicy: IfNotPresent tag: "latest" imagePullSecrets: [] nameOverride: "" serviceAccount: create: true annotations: {} service: type: ClusterIP port: 3000 annotations: "prometheus.io/scrape": "true" "prometheus.io/path": "/metrics" "prometheus.io/port": "3000" ingress: enabled: false autoscaling: enabled: false
0
strat-triangular-arbitrage
/mono/helm/strat-triangular-arbitrage/Chart.yaml
apiVersion: v2 name: strat-triangular-arbitrage description: Triangular Arbitrage Strategy type: application version: 0.1.0 appVersion: "0.1.0"
0
values
/mono/helm/strat-triangular-arbitrage/values/dev.yaml
SERVICE: "strategy-manager" RUST_LOG: info imagePullSecrets: - name: gitlab-registry image: # https://gitlab.com/fdr-group/mono/-/jobs/6918202320 tag: "amd64-240523035831-749ff5f7" configTomlFile: config/dev.toml affinity: podAffinity: requiredDuringSchedulingIgnoredDuringExecution: # Schedule in the same AZ as the PostgreSQL primary - topologyKey: topology.kubernetes.io/zone labelSelector: matchExpressions: - key: app.kubernetes.io/name operator: In values: [postgresql] - key: app.kubernetes.io/component operator: In values: [primary]
0
values
/mono/helm/strat-triangular-arbitrage/values/dev-dry-run.yaml
SERVICE: "strategy-manager" RUST_LOG: debug imagePullSecrets: - name: gitlab-registry image: # https://gitlab.com/fdr-group/mono/-/jobs/6918202320 tag: "amd64-240523035831-749ff5f7" configTomlFile: config/dev-dry-run.toml affinity: podAffinity: requiredDuringSchedulingIgnoredDuringExecution: # Schedule in the same AZ as the PostgreSQL primary - topologyKey: topology.kubernetes.io/zone labelSelector: matchExpressions: - key: app.kubernetes.io/name operator: In values: [postgresql] - key: app.kubernetes.io/component operator: In values: [primary]
0
values
/mono/helm/strat-triangular-arbitrage/values/local.yaml
image: tag: "local" SERVICE: "strategy-manager" RUST_LOG: debug configTomlFile: "config/local-k8s.toml" createSecrets: true secrets: kraken_api_key: file://sym-secrets/kraken_api_key kraken_api_secret: file://sym-secrets/kraken_api_secret postgresql_username: file://sym-secrets/postgresql_username postgresql_password: file://sym-secrets/postgresql_password
0
templates
/mono/helm/strat-triangular-arbitrage/templates/_helpers.tpl
{{/* Expand the name of the chart. */}} {{- define "strat-triangular-arbitrage.name" -}} {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} {{- end }} {{/* Create a default fully qualified app name. We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). If release name contains chart name it will be used as a full name. */}} {{- define "strat-triangular-arbitrage.fullname" -}} {{- if .Values.fullnameOverride }} {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} {{- else }} {{- $name := default .Chart.Name .Values.nameOverride }} {{- if contains $name .Release.Name }} {{- .Release.Name | trunc 63 | trimSuffix "-" }} {{- else }} {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} {{- end }} {{- end }} {{- end }} {{/* Create chart name and version as used by the chart label. */}} {{- define "strat-triangular-arbitrage.chart" -}} {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} {{- end }} {{/* Common labels */}} {{- define "strat-triangular-arbitrage.labels" -}} helm.sh/chart: {{ include "strat-triangular-arbitrage.chart" . }} {{ include "strat-triangular-arbitrage.selectorLabels" . }} {{- if .Chart.AppVersion }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} app.kubernetes.io/managed-by: {{ .Release.Service }} {{- end }} {{/* Selector labels */}} {{- define "strat-triangular-arbitrage.selectorLabels" -}} app.kubernetes.io/name: {{ include "strat-triangular-arbitrage.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} {{/* Create the name of the service account to use */}} {{- define "strat-triangular-arbitrage.serviceAccountName" -}} {{- if .Values.serviceAccount.create }} {{- default (include "strat-triangular-arbitrage.fullname" .) .Values.serviceAccount.name }} {{- else }} {{- default "default" .Values.serviceAccount.name }} {{- end }} {{- end }}
0
templates
/mono/helm/strat-triangular-arbitrage/templates/service.yaml
apiVersion: v1 kind: Service metadata: name: {{ include "fdr.common.name.service" . }} labels: {{- include "strat-triangular-arbitrage.labels" . | nindent 4 }} annotations: {{- $.Values.service.annotations | toYaml | nindent 4 }} spec: type: {{ .Values.service.type }} ports: - port: {{ .Values.service.port }} targetPort: http protocol: TCP name: http selector: {{- include "strat-triangular-arbitrage.selectorLabels" . | nindent 4 }}
0
templates
/mono/helm/strat-triangular-arbitrage/templates/deployment.yaml
{{- if .Values.createSecrets }} {{- include "common.secrets-v2" . }} --- {{- end -}} {{- include "common.config.configmap" . -}} apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "fdr.common.name.deployment" . }} labels: {{- include "strat-triangular-arbitrage.labels" . | nindent 4 }} spec: {{- if not .Values.autoscaling.enabled }} replicas: {{ .Values.replicaCount }} {{- end }} strategy: type: Recreate # stops previous pods selector: matchLabels: {{- include "strat-triangular-arbitrage.selectorLabels" . | nindent 6 }} template: metadata: annotations: {{- with .Values.podAnnotations -}} {{- toYaml . | nindent 8 -}} {{- end -}} {{- include "fdr.common.config.configmap.annotation" . | nindent 8 }} labels: {{- include "strat-triangular-arbitrage.selectorLabels" . | nindent 8 }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} serviceAccountName: {{ include "strat-triangular-arbitrage.serviceAccountName" . }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} containers: - name: {{ .Chart.Name }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} {{- if (.Values.command) }} command: {{ .Values.command | toJson }} {{- end }} env: - name: "RUST_LOG" value: {{ .Values.RUST_LOG }} - name: "SERVICE" value: {{ .Values.SERVICE }} ports: - name: http containerPort: 3000 protocol: TCP livenessProbe: initialDelaySeconds: 5 httpGet: path: /healthy port: 3000 readinessProbe: initialDelaySeconds: 5 httpGet: path: /ready port: 3000 resources: {{- toYaml .Values.resources | nindent 12 }} volumeMounts: {{- include "common.secrets.volumeMounts" . | nindent 12 }} {{- include "common.config.volumeMounts" . | nindent 12 }} volumes: {{- include "common.secrets.volumes" . | nindent 8 }} {{- include "common.config.volumes" . | nindent 8 }} {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.affinity }} affinity: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.tolerations }} tolerations: {{- toYaml . | nindent 8 }} {{- end }}
0
templates
/mono/helm/strat-triangular-arbitrage/templates/serviceaccount.yaml
{{- if .Values.serviceAccount.create -}} apiVersion: v1 kind: ServiceAccount metadata: name: {{ include "strat-triangular-arbitrage.serviceAccountName" . }} labels: {{- include "strat-triangular-arbitrage.labels" . | nindent 4 }} {{- with .Values.serviceAccount.annotations }} annotations: {{- toYaml . | nindent 4 }} {{- end }} {{- end }}
0
tests
/mono/helm/strat-triangular-arbitrage/templates/tests/test-connection.yaml
apiVersion: v1 kind: Pod metadata: name: "{{ include "strat-triangular-arbitrage.fullname" . }}-test-connection" labels: {{- include "strat-triangular-arbitrage.labels" . | nindent 4 }} annotations: "helm.sh/hook": test spec: containers: - name: wget image: busybox command: ['wget'] args: ['{{ include "strat-triangular-arbitrage.fullname" . }}:{{ .Values.service.port }}'] restartPolicy: Never
0
config
/mono/helm/strat-triangular-arbitrage/config/dev.toml
run_id = "51d65638-03b7-44a6-b6f4-33cfe5baf08a" [kafka_consumer] group_id = "triangular_arbitrage" bootstrap_servers = "redpanda.default.svc.cluster.local:9093" topics = [ "kraken_ticker", "kraken_orders", "kraken_order_book", # Books "kraken_book_btc_usdc", "kraken_book_eth_usdc", "kraken_book_eth_btc", "kraken_book_link_usdc", "kraken_book_link_btc", "kraken_book_link_eth", "kraken_book_usdc_usd", ] [kafka_producer] bootstrap_servers = "redpanda.default.svc.cluster.local:9093" [[exchange_adapter]] url = "http://proxy-kraken.default.svc.cluster.local" port = 3000 exchange = "KRAKEN" strategy = "TRIANGULAR_ARBITRAGE" [postgres] hostname = "postgresql.default.svc.cluster.local" database = "trading" username = "file:./.secrets/postgresql_username" password = "file:./.secrets/postgresql_password" [metrics] prefix = "fdr_arb" [tracing] tempo_url = "http://tempo.default.svc.cluster.local" tempo_port = 4317 service_name = "TRIANGULAR_ARBITRAGE" level = "DEBUG" [server] listen_address = "0.0.0.0" port = 3000 [notify_subscribers] ticker = false book = true order_cancelled = false trade = false alert = true order_placed = false order_error = false [[strategies]] [strategies.TriangularArbitrage] strat_run_id = "51d65638-03b7-44a6-b6f4-33cfe5baf08a" max_volume_btc = 0.0007 min_order_price_difference = 0.05 [markets.Kraken.btc_usdc] ticker_delta = { decay_factor = 0.001, coefficient = { time_window = 60, increase_by = 0.05 } } volume_weights = { profit_weight_scalar = 3, balance_weight_scalar = 6 } [markets.Kraken.eth_usdc] ticker_delta = { decay_factor = 0.001, coefficient = { time_window = 60, increase_by = 0.05 } } volume_weights = { profit_weight_scalar = 3, balance_weight_scalar = 6 } [markets.Kraken.eth_btc] ticker_delta = { decay_factor = 0.001, coefficient = { time_window = 60, increase_by = 0.05 } } volume_weights = { profit_weight_scalar = 3, balance_weight_scalar = 6 } [markets.Kraken.link_btc] ticker_delta = { decay_factor = 0.001, coefficient = { time_window = 60, increase_by = 0.05 } } volume_weights = { profit_weight_scalar = 3, balance_weight_scalar = 6 } [markets.Kraken.link_usd] ticker_delta = { decay_factor = 0.001, coefficient = { time_window = 60, increase_by = 0.05 } } volume_weights = { profit_weight_scalar = 3, balance_weight_scalar = 6 } [markets.Kraken.link_eth] ticker_delta = { decay_factor = 0.001, coefficient = { time_window = 60, increase_by = 0.05 } } volume_weights = { profit_weight_scalar = 3, balance_weight_scalar = 6 } [markets.Kraken.usdc_usd] ticker_delta = { decay_factor = 0.001, coefficient = { time_window = 60, increase_by = 0.05 } } volume_weights = { profit_weight_scalar = 3, balance_weight_scalar = 6 }
0
config
/mono/helm/strat-triangular-arbitrage/config/local-k8s.toml
use_market_balance = false back_test = false run_id = "34dac011-cbb0-44e1-bca1-14c73091c7f7" [kafka_consumer] group_id = "triangular_arbitrage" bootstrap_servers = "redpanda.default.svc.cluster.local:9093" enable_partition_eof = "false" session_timeout_ms = "6000" auto_commit = "false" offset_reset = "latest" topics = [ "kraken_ticker", "kraken_orders", "kraken_order_book", # Books "kraken_book_btc_usdc", "kraken_book_eth_usdc", "kraken_book_eth_btc", "kraken_book_link_usdc", "kraken_book_link_btc", "kraken_book_link_eth", "kraken_book_usdc_usd", ] [kafka_producer] bootstrap_servers = "redpanda.default.svc.cluster.local:9093" max_in_flight_requests_per_connection = 1 batch_num_messages = 1 request_required_acks = "all" default_timeout_milliseconds = 50 max_retries = 3 retry_backoff_milliseconds = 10 [[exchange_adapter]] url = "http://proxy-kraken.default.svc.cluster.local" port = 3000 exchange = "KRAKEN" strategy = "TRIANGULAR_ARBITRAGE" [postgres] hostname = "postgresql.default.svc.cluster.local" port = 5432 database = "trading" max_connections = 10 username = "file:./.secrets/postgresql_username" password = "file:./.secrets/postgresql_password" [metrics] prefix = "fdr_tri_arb" [tracing] level = "DEBUG" tempo_url = "http://tempo.default.svc.cluster.local" tempo_port = 4317 service_name = "TRIANGULAR_ARBITRAGE" [server] listen_address = "0.0.0.0" port = 3000 [[strategies]] [strategies.TriangularArbitrage] strat_run_id = "34dac011-cbb0-44e1-bca1-14c73091c7f7" max_volume_btc = 0.0007 min_order_price_difference = 0.05 [markets.Kraken.btc_usdc] vwap_decay_factor = 0.0001 vwap_history = 10 base_balance = 0 quote_balance = 0 ticker_delta = { decay_factor = 0.001, coefficient = { time_window = 60, increase_by = 0.05 } } volume_weights = { profit_weight_scalar = 3, balance_weight_scalar = 6 } [markets.Kraken.eth_usdc] vwap_decay_factor = 0.0001 vwap_history = 10 base_balance = 0 quote_balance = 0 ticker_delta = { decay_factor = 0.001, coefficient = { time_window = 60, increase_by = 0.05 } } volume_weights = { profit_weight_scalar = 3, balance_weight_scalar = 6 } [markets.Kraken.eth_btc] vwap_decay_factor = 0.0001 vwap_history = 10 base_balance = 0 quote_balance = 0 ticker_delta = { decay_factor = 0.001, coefficient = { time_window = 60, increase_by = 0.05 } } volume_weights = { profit_weight_scalar = 3, balance_weight_scalar = 6 } [markets.Kraken.link_btc] vwap_decay_factor = 0.0001 vwap_history = 10 base_balance = 0 quote_balance = 0 ticker_delta = { decay_factor = 0.001, coefficient = { time_window = 60, increase_by = 0.05 } } volume_weights = { profit_weight_scalar = 3, balance_weight_scalar = 6 } [markets.Kraken.link_usd] vwap_decay_factor = 0.0001 vwap_history = 10 base_balance = 0 quote_balance = 0 ticker_delta = { decay_factor = 0.001, coefficient = { time_window = 60, increase_by = 0.05 } } volume_weights = { profit_weight_scalar = 3, balance_weight_scalar = 6 } [markets.Kraken.link_eth] vwap_decay_factor = 0.0001 vwap_history = 10 base_balance = 0 quote_balance = 0 ticker_delta = { decay_factor = 0.001, coefficient = { time_window = 60, increase_by = 0.05 } } volume_weights = { profit_weight_scalar = 3, balance_weight_scalar = 6 } [markets.Kraken.usdc_usd] vwap_decay_factor = 0.0001 vwap_history = 10 base_balance = 0 quote_balance = 0 ticker_delta = { decay_factor = 0.001, coefficient = { time_window = 60, increase_by = 0.05 } } volume_weights = { profit_weight_scalar = 3, balance_weight_scalar = 6 } [notify_subscribers] ticker = false book = true order_cancelled = false trade = false alert = true order_placed = false order_error = false
0
config
/mono/helm/strat-triangular-arbitrage/config/local-host.toml
use_market_balance = false back_test = false run_id = "34dac011-cbb0-44e1-bca1-14c73091c7f7" [kafka_consumer] group_id = "triangular_arbitrage" bootstrap_servers = "localhost:9094" enable_partition_eof = "false" session_timeout_ms = "6000" auto_commit = "false" offset_reset = "latest" topics = [ "poloniex_ticker", "poloniex_orders", "poloniex_order_book", "poloniex_book_btc_usdt", "poloniex_book_link_btc", "poloniex_book_link_usdt", "poloniex_book_eth_usdt", "poloniex_book_eth_btc", "poloniex_book_trx_btc", "poloniex_book_trx_usdt", "poloniex_book_eth_trx", "poloniex_book_link_trx", ] [kafka_producer] bootstrap_servers = "localhost:9094" max_in_flight_requests_per_connection = 1 batch_num_messages = 1 request_required_acks = "all" default_timeout_milliseconds = 50 max_retries = 3 retry_backoff_milliseconds = 10 [[exchange_adapter]] exchange = "POLONIEX" strategy = "TRIANGULAR_ARBITRAGE" url = "http://localhost" port = 3002 [postgres] hostname = "127.0.0.1" port = 5432 database = "trading" max_connections = 10 username = "file:./.secrets/postgresql_username" password = "file:./.secrets/postgresql_password" [metrics] prefix = "fdr_tri_arb" [tracing] level = "DEBUG" tempo_url = "http://localhost" tempo_port = 4317 service_name = "TRIANGULAR_ARBITRAGE" [server] listen_address = "127.0.0.1" port = 4001 [[strategies]] [strategies.TriangularArbitrage] max_volume_btc = 0.0007 min_order_price_difference = 0.05 strat_run_id = "34dac011-cbb0-44e1-bca1-14c73091c7f7" [markets.Poloniex.btc_usdt] vwap_decay_factor = 0.0001 vwap_history = 10 base_balance = 0 quote_balance = 0 ticker_delta = { decay_factor = 0.001, coefficient = { time_window = 60, increase_by = 0.05 } } volume_weights = { profit_weight_scalar = 3, balance_weight_scalar = 6 } [markets.Poloniex.eth_usdt] vwap_decay_factor = 0.0001 vwap_history = 10 base_balance = 0 quote_balance = 0 ticker_delta = { decay_factor = 0.001, coefficient = { time_window = 60, increase_by = 0.05 } } volume_weights = { profit_weight_scalar = 3, balance_weight_scalar = 6 } [markets.Poloniex.eth_btc] vwap_decay_factor = 0.0001 vwap_history = 10 base_balance = 0 quote_balance = 0 ticker_delta = { decay_factor = 0.001, coefficient = { time_window = 60, increase_by = 0.05 } } volume_weights = { profit_weight_scalar = 3, balance_weight_scalar = 6 } [markets.Poloniex.link_btc] vwap_decay_factor = 0.0001 vwap_history = 10 base_balance = 0 quote_balance = 0 ticker_delta = { decay_factor = 0.001, coefficient = { time_window = 60, increase_by = 0.05 } } volume_weights = { profit_weight_scalar = 3, balance_weight_scalar = 6 } [markets.Poloniex.link_usdt] vwap_decay_factor = 0.0001 vwap_history = 10 base_balance = 0 quote_balance = 0 ticker_delta = { decay_factor = 0.001, coefficient = { time_window = 60, increase_by = 0.05 } } volume_weights = { profit_weight_scalar = 3, balance_weight_scalar = 6 } [markets.Poloniex.trx_btc] vwap_decay_factor = 0.0001 vwap_history = 10 base_balance = 0 quote_balance = 0 ticker_delta = { decay_factor = 0.001, coefficient = { time_window = 60, increase_by = 0.05 } } volume_weights = { profit_weight_scalar = 3, balance_weight_scalar = 6 } [markets.Poloniex.trx_usdt] vwap_decay_factor = 0.0001 vwap_history = 10 base_balance = 0 quote_balance = 0 ticker_delta = { decay_factor = 0.001, coefficient = { time_window = 60, increase_by = 0.05 } } volume_weights = { profit_weight_scalar = 3, balance_weight_scalar = 6 } [markets.Poloniex.eth_trx] vwap_decay_factor = 0.0001 vwap_history = 10 base_balance = 0 quote_balance = 0 ticker_delta = { decay_factor = 0.001, coefficient = { time_window = 60, increase_by = 0.05 } } volume_weights = { profit_weight_scalar = 3, balance_weight_scalar = 6 } [markets.Poloniex.link_trx] vwap_decay_factor = 0.0001 vwap_history = 10 base_balance = 0 quote_balance = 0 ticker_delta = { decay_factor = 0.001, coefficient = { time_window = 60, increase_by = 0.05 } } volume_weights = { profit_weight_scalar = 3, balance_weight_scalar = 6 } [notify_subscribers] ticker = false book = true order_cancelled = false trade = false alert = true order_placed = false order_error = false
0
config
/mono/helm/strat-triangular-arbitrage/config/dev-dry-run.toml
run_id = "51d65638-03b7-44a6-b6f4-33cfe5baf08a" dry_run = true [kafka_consumer] group_id = "triangular_arbitrage_dry_run" bootstrap_servers = "redpanda.default.svc.cluster.local:9093" topics = [ "kraken_ticker", "kraken_orders", "kraken_order_book", # Books "kraken_book_btc_usdc", "kraken_book_eth_usdc", "kraken_book_eth_btc", "kraken_book_link_usdc", "kraken_book_link_btc", "kraken_book_link_eth", "kraken_book_usdc_usd", # TODO: Add more books ] [kafka_producer] bootstrap_servers = "redpanda.default.svc.cluster.local:9093" [[exchange_adapter]] url = "http://proxy-kraken.default.svc.cluster.local" port = 3000 exchange = "KRAKEN" strategy = "TRIANGULAR_ARBITRAGE" [postgres] hostname = "postgresql.default.svc.cluster.local" database = "trading" username = "file:./.secrets/postgresql_username" password = "file:./.secrets/postgresql_password" [metrics] prefix = "fdr_arb" [tracing] tempo_url = "http://tempo.default.svc.cluster.local" tempo_port = 4317 service_name = "TRIANGULAR_ARBITRAGE" level = "DEBUG" [server] listen_address = "0.0.0.0" port = 3000 [notify_subscribers] ticker = false book = true order_cancelled = false trade = false alert = true order_placed = false order_error = false [[strategies]] [strategies.TriangularArbitrage] strat_run_id = "51d65638-03b7-44a6-b6f4-33cfe5baf08a" max_volume_btc = 0.0007 min_order_price_difference = 0.05 [markets.Kraken.btc_usdc] ticker_delta = { decay_factor = 0.001, coefficient = { time_window = 60, increase_by = 0.05 } } volume_weights = { profit_weight_scalar = 3, balance_weight_scalar = 6 } [markets.Kraken.eth_usdc] ticker_delta = { decay_factor = 0.001, coefficient = { time_window = 60, increase_by = 0.05 } } volume_weights = { profit_weight_scalar = 3, balance_weight_scalar = 6 } [markets.Kraken.eth_btc] ticker_delta = { decay_factor = 0.001, coefficient = { time_window = 60, increase_by = 0.05 } } volume_weights = { profit_weight_scalar = 3, balance_weight_scalar = 6 } [markets.Kraken.link_btc] ticker_delta = { decay_factor = 0.001, coefficient = { time_window = 60, increase_by = 0.05 } } volume_weights = { profit_weight_scalar = 3, balance_weight_scalar = 6 } [markets.Kraken.link_usd] ticker_delta = { decay_factor = 0.001, coefficient = { time_window = 60, increase_by = 0.05 } } volume_weights = { profit_weight_scalar = 3, balance_weight_scalar = 6 } [markets.Kraken.link_eth] ticker_delta = { decay_factor = 0.001, coefficient = { time_window = 60, increase_by = 0.05 } } volume_weights = { profit_weight_scalar = 3, balance_weight_scalar = 6 } [markets.Kraken.usdc_usd] ticker_delta = { decay_factor = 0.001, coefficient = { time_window = 60, increase_by = 0.05 } } volume_weights = { profit_weight_scalar = 3, balance_weight_scalar = 6 } # TODO: Add more markets
0
grafana
/mono/helm/grafana/.helmignore
# Patterns to ignore when building packages. .DS_Store # Local secrets secrets.yaml *.secrets.yaml # Common VCS dirs .git/ .gitignore .bzr/ .bzrignore .hg/ .hgignore .svn/ # Common backup files *.swp *.bak *.tmp *~ # Various IDEs .project .idea/ *.tmproj
0
grafana
/mono/helm/grafana/values.yaml
grafana: auth: enableAnonymous: false persistence: enabled: true metrics: enabled: true service: annotations: "prometheus.io/scrape": "true" "prometheus.io/path": "/metrics" "prometheus.io/port": "3000" serviceAccount: create: false dashboardsProvider: enabled: true # Creates a single ConfigMap containing all of the dashboards dashboards: - example-service-dashboard.json - kraken-market-metrics.json - market-makers.json - market-maker-test.json - triangular-arbitrage.json - market-maker-leaderboard.json - proxy-market-metrics.json - strat-tri-arb-rates.json - market-volatility.json dashboardsInfra: - postgresql.json - service-status.json - node-exporter.json - csi-volume-metrics.json config: useGrafanaIniFile: true grafanaIniConfigMap: grafana-config-ini grafana: extraConfigmaps: - name: grafana-dashboards mountPath: /opt/bitnami/grafana/dashboards/ - name: grafana-dashboards-infra mountPath: /opt/bitnami/grafana/dashboards/infra/
0
grafana
/mono/helm/grafana/Chart.yaml
apiVersion: v2 name: fdr-grafana appVersion: 10.1.2 version: 0.1.0 annotations: category: analytics dependencies: - name: grafana repository: https://charts.bitnami.com/bitnami version: 10.0.x description: | Grafana is an open source metric analytics and visualization suite for visualizing time series data that supports various types of data sources.
0
grafana
/mono/helm/grafana/Chart.lock
dependencies: - name: grafana repository: https://charts.bitnami.com/bitnami version: 10.0.10 digest: sha256:11a1c76e75b7e4a4c5b51dfb7576691cdcd070f47a96ab2a2d88e11a61f4cd22 generated: "2024-05-08T12:35:10.929392424-03:00"
0
grafana
/mono/helm/grafana/Chart.state
cb31fe6afef71c10cf5e9adae162d4dabca53d9857f8eb164c653116088e41c8 ./Chart.lock 2847489bb7e63cb138aab27c5d62429e276c0a298db3d297b2dbd3313b3948e5 ./Chart.yaml fceaf1289937c2428d0282e9ddedf67fdeba59ff46c5188bac354310f84e6a46 ./dashboards/example-service-dashboard.json 7fb19ce829c931ef14a1ecc3304b9da05d23a405ea2df80badb7ba1d66c873af ./dashboards/infra/csi-volume-metrics.json 2735add89a06490c29b0c10bf9e781e599dc4b44221af4def2eb7f974e035f89 ./dashboards/infra/node-exporter.json 1624eeff9a65c231d599dd06552036f6b3e119d5bc2cc9480c3f5af7aafb203f ./dashboards/infra/postgresql.json e34cc6d13250462a8abdb824fcf33cb77b7214b6b1a46ef21cbc225725f6ee69 ./dashboards/infra/service-status.json 4c43209a7ebd1669e506b4f1b77e60d98deaceece9e434a1520bc29535a17257 ./dashboards/kraken-market-metrics.json 6bcda3d668e51e92eda57f6e040b756c6f24281ef89fce0428b4dc913f0a9c40 ./dashboards/market-maker-leaderboard.json 429e827370a891a9ddb570603737e94e0cc465d85d905f7dbafd2ab7bbfe04f2 ./dashboards/market-makers.json 979412a7fd0c6ff9375f9c322b1bdf031923b3fdd165a31353bf1a20605d6895 ./dashboards/market-maker-test.json e7a9e0a3914faa0ef551ea048952addfe3452c1bbd8d99055fde533c2d370131 ./dashboards/market-volatility.json 542dba31024462f5da533a5e6056345d765e454438bd3c75772ed3e656b34794 ./dashboards/proxy-market-metrics.json a2e327d36ed770ce9ec3e3b0348c7453e280fc49320fe2c2ce6c1b28cba08090 ./dashboards/redpanda-dashboard.json 48012de534e77bb22749b811d6355c070ea4825794cf405c4a2b096aa1c273f6 ./dashboards/simple_market_maker.json 08479a2511565e5eadd84e6c3b8998d8e05178c6225028e5e99526a8627c04f0 ./dashboards/strat-tri-arb-rates.json d7701966e21ef9f648f5a82ab0879a363e8fc50b3dd8395ee1cf8e1a5991c815 ./dashboards/triangular-arbitrage.json 4e0eb6a6ebbfde3f2c3b071f5890c460395bc8cbc1ffeea6f73f38c235fbba53 ./.helmignore 7b069f05a7d7e2ddff3e6486f3c2cba35deaeaf94b24b5e6eb1f7ca07b9689ca ./templates/cfgmap-config-ini.yaml a9f56d1f7c41dd4a5dec5735b3bd972571e557ec243f186f73b4bfa8b8d88c19 ./templates/cfgmap-dashboards.yaml 101b6d275bc734a97a59d8b1b9521dadc002b9293eba0d36b7c6c97e37be7e3a ./templates/secret-admin-password.yaml 31008ebc411f0b80c10988bf96dded3f86eef5db2beaa59fd6f5f0380b98e654 ./templates/secret-datasources.yaml 5c37530416187ef4a5fe13d92d83ef24870f9f2277c5d3874f8789ac8687a0d8 ./values/dev.yaml 4bf1285ab163456891963e2a663f2a04e6046134eff3e721c313337a4710b3b5 ./values/local.yaml 2cf468e6bffb59aa68f4e8ac495dfd8a3bf8c130026326cf5bd24afd4186af7b ./values.yaml
0
values
/mono/helm/grafana/values/dev.yaml
grafana: admin: user: admin existingSecret: "grafana-admin-password" datasources: secretName: "grafana-datasources"
0
values
/mono/helm/grafana/values/local.yaml
grafana: auth: enableAnonymous: true persistence: enabled: true size: 500Mi # Grafana deployment parameters need to be nested under a redundant Grafana key grafana: resources: limits: cpu: 1000m memory: 2048Mi # 2Gi requests: cpu: 500m memory: 1024Mi # 1Gi datasources: secretDefinition: apiVersion: 1 datasources: - name: Prometheus type: prometheus url: http://prometheus-server:9090 access: proxy isDefault: true uid: prometheus - name: Tempo type: tempo url: http://tempo:3100 access: proxy isDefault: false uid: tempo - name: Loki type: loki url: http://loki-stack:3100 access: proxy isDefault: false uid: loki - name: PostgreSQL type: postgres url: postgresql:5432 user: trading # TODO: MANAGE THIS VIA SECRETS secureJsonData: password: 'trading' # TODO: MANAGE THIS VIA SECRETS jsonData: database: trading # TODO: MANAGE THIS VIA SECRETS maxOpenConns: 100 maxIdleConns: 100 maxIdleConnsAuto: true connMaxLifetime: 14400 sslmode: "disable" postgresVersion: 15.4 timescaledb: false access: proxy orgId: 1 isDefault: false version: 1 editable: true uid: postgresql - name: PostgreSQL-test type: postgres url: postgresql-test:5432 user: trading-test # TODO: MANAGE THIS VIA SECRETS secureJsonData: password: 'trading-test' # TODO: MANAGE THIS VIA SECRETS jsonData: database: trading-test # TODO: MANAGE THIS VIA SECRETS maxOpenConns: 100 maxIdleConns: 100 maxIdleConnsAuto: true connMaxLifetime: 14400 sslmode: "disable" postgresVersion: 15.4 timescaledb: false access: proxy orgId: 1 isDefault: false version: 1 editable: true uid: postgresql-test
0
dashboards
/mono/helm/grafana/dashboards/simple_market_maker.json
{ "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": 6, "links": [], "liveNow": false, "panels": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "description": "Balances for assets being trades by SMM strategy in terms of BTC", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "decimals": 6, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "Total_in_BTC" }, "properties": [ { "id": "displayName", "value": "Total in base" } ] }, { "matcher": { "id": "byName", "options": "USD" }, "properties": [ { "id": "unit", "value": "currencyUSD" } ] }, { "matcher": { "id": "byName", "options": "Total_in_BTC" }, "properties": [ { "id": "unit", "value": "currencyUSD" } ] } ] }, "gridPos": { "h": 11, "w": 4, "x": 0, "y": 0 }, "id": 8, "options": { "colorMode": "background", "graphMode": "none", "justifyMode": "center", "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "text": {}, "textMode": "value_and_name" }, "pluginVersion": "9.3.2", "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "fdr_market_balance{asset=\"$quote\", exchange=\"kraken\", pair=\"$pair\"}", "hide": false, "legendFormat": "{{asset}}", "range": true, "refId": "BTC_balance" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "fdr_market_balance{asset=\"$base\", exchange=\"kraken\", pair=\"$pair\"}", "hide": false, "legendFormat": "{{asset}}", "range": true, "refId": "ETH_balance" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "fdr_ticker_last_price{pair=\"$pair\"}", "hide": true, "legendFormat": "__auto", "range": true, "refId": "ETH_price_in_BTC" }, { "datasource": { "name": "Expression", "type": "__expr__", "uid": "__expr__" }, "expression": "$ETH_balance * $ETH_price_in_BTC + $BTC_balance", "hide": false, "refId": "Total_in_BTC", "type": "math" } ], "title": "Balances ", "type": "stat" }, { "datasource": { "type": "postgres", "uid": "C8wqsYe4k" }, "fieldConfig": { "defaults": { "color": { "mode": "continuous-BlPu" }, "decimals": 7, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "USD Volume BUY" }, "properties": [ { "id": "unit", "value": "currencyUSD" } ] }, { "matcher": { "id": "byName", "options": "USD Volume SELL" }, "properties": [ { "id": "unit", "value": "currencyUSD" } ] } ] }, "gridPos": { "h": 14, "w": 4, "x": 4, "y": 0 }, "id": 16, "options": { "colorMode": "background", "graphMode": "area", "justifyMode": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "textMode": "auto" }, "pluginVersion": "9.3.2", "targets": [ { "datasource": { "type": "postgres", "uid": "jLvLCa9Vz" }, "editorMode": "code", "expr": "", "format": "table", "hide": true, "legendFormat": "__auto", "range": true, "rawQuery": true, "rawSql": "SELECT order_side, SUM(cost) / SUM(volume) FROM trades WHERE (base = '$base' AND quote = '$quote') GROUP BY order_side", "refId": "average_cost", "sql": { "columns": [ { "name": "SUM", "parameters": [ { "name": "price", "type": "functionParameter" } ], "type": "function" }, { "name": "SUM", "parameters": [ { "name": "volume", "type": "functionParameter" } ], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50, "whereJsonTree": { "children1": [ { "id": "a9b9899a-4567-489a-bcde-f1892437099a", "properties": { "field": "base", "operator": "equal", "value": [ "DOT" ], "valueSrc": [ "value" ], "valueType": [ "text" ] }, "type": "rule" }, { "id": "9abaaa8a-0123-4456-b89a-b18924372452", "properties": { "field": "quote", "operator": "equal", "value": [ "USD" ], "valueSrc": [ "value" ], "valueType": [ "text" ] }, "type": "rule" } ], "id": "b88b999b-89ab-4cde-b012-318922568302", "type": "group" }, "whereString": "(base = 'DOT' AND quote = 'USD')" }, "table": "trades" }, { "datasource": { "type": "postgres", "uid": "jLvLCa9Vz" }, "editorMode": "code", "expr": "SELECT order_side, SUM(volume) AS \"$base Volume\" FROM trades WHERE (base = '$base' AND quote = '$quote') GROUP BY order_side", "format": "table", "hide": false, "legendFormat": "__auto", "range": true, "rawQuery": true, "rawSql": "SELECT order_side, SUM(volume) AS \"DOT Volume\" FROM trades WHERE (base = '$base' AND quote = '$quote') GROUP BY order_side", "refId": "dot_volume", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "name": "Expression", "type": "__expr__", "uid": "__expr__" }, "expression": "$dot_volume * $average_cost", "hide": false, "refId": "USD Volume", "type": "math" } ], "title": "Volume", "type": "stat" }, { "datasource": { "type": "postgres", "uid": "C8wqsYe4k" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "decimals": 6, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] } }, "overrides": [] }, "gridPos": { "h": 14, "w": 4, "x": 8, "y": 0 }, "id": 35, "options": { "colorMode": "background", "graphMode": "none", "justifyMode": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "textMode": "auto" }, "pluginVersion": "9.3.2", "targets": [ { "datasource": { "name": "Expression", "type": "__expr__", "uid": "__expr__" }, "expression": "$net_proceeds - $cost_basis - $fees", "hide": false, "refId": "gain_or_loss", "type": "math" }, { "datasource": { "name": "Expression", "type": "__expr__", "uid": "__expr__" }, "expression": "$vwap_sell - $average_cost", "hide": false, "refId": "vwap_delta", "type": "math" }, { "datasource": { "type": "postgres", "uid": "C8wqsYe4k" }, "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT\r\n SUM(cost) / SUM(volume) AS average_cost\r\nFROM\r\n trades\r\nWHERE\r\n base = '$base' AND quote = '$quote' AND order_side = 'BUY' AND $__timeFilter(created_at)", "refId": "average_cost", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "type": "postgres", "uid": "C8wqsYe4k" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT\r\n SUM(cost) / SUM(volume) AS vwap_sell\r\nFROM\r\n trades\r\nWHERE\r\n base = '$base' AND quote = '$quote' AND order_side = 'SELL' AND $__timeFilter(created_at)", "refId": "vwap_sell", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "type": "postgres", "uid": "C8wqsYe4k" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT SUM(volume) AS volume_sold FROM trades WHERE order_side = 'SELL' AND base = '$base' AND quote = '$quote' AND $__timeFilter(created_at)", "refId": "volume_sold", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "type": "postgres", "uid": "C8wqsYe4k" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT SUM(volume) AS volume_bought FROM trades WHERE order_side = 'BUY' AND base = '$base' AND quote = '$quote' AND $__timeFilter(created_at)", "refId": "volume_bought", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "name": "Expression", "type": "__expr__", "uid": "__expr__" }, "expression": "$volume_sold * $average_cost", "hide": false, "refId": "cost_basis", "type": "math" }, { "datasource": { "type": "postgres", "uid": "C8wqsYe4k" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT SUM(cost) AS net_proceeds FROM trades WHERE order_side = 'SELL' AND base = '$base' AND quote = '$quote' AND $__timeFilter(created_at)", "refId": "net_proceeds", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "type": "postgres", "uid": "C8wqsYe4k" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT SUM(fee) AS FEE FROM trades WHERE base = '$base' AND quote = '$quote' AND $__timeFilter(time)", "refId": "fees", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Profit and Loss 2", "type": "stat" }, { "datasource": { "type": "postgres", "uid": "C8wqsYe4k" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "Sells" }, "properties": [ { "id": "color", "value": { "fixedColor": "red", "mode": "fixed" } } ] } ] }, "gridPos": { "h": 3, "w": 4, "x": 12, "y": 0 }, "id": 29, "options": { "displayMode": "gradient", "minVizHeight": 10, "minVizWidth": 0, "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": true }, "showUnfilled": true }, "pluginVersion": "9.3.2", "targets": [ { "datasource": { "type": "postgres", "uid": "jLvLCa9Vz" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT\r\n COUNT(*) AS \"Buys\"\r\nFROM\r\n orders\r\nWHERE\r\n quote = '$quote' AND base = '$base' AND order_side = 'BUY' AND $__timeFilter(created_at)\r\n", "refId": "Buys", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "type": "postgres", "uid": "jLvLCa9Vz" }, "editorMode": "code", "expr": "", "format": "table", "legendFormat": "__auto", "range": true, "rawQuery": true, "rawSql": "SELECT\r\n COUNT(*) AS \"Sells\"\r\nFROM\r\n orders\r\nWHERE\r\n quote = '$quote' AND base = '$base' AND order_side = 'SELL' AND $__timeFilter(created_at)\r\n", "refId": "Sells", "sql": { "columns": [ { "name": "COUNT", "parameters": [ { "name": "*", "type": "functionParameter" } ], "type": "function" } ], "groupBy": [ { "property": { "name": "order_side", "type": "string" }, "type": "groupBy" } ], "limit": 50, "whereJsonTree": { "children1": [ { "id": "ab9bba9a-cdef-4012-b456-71892428a8bd", "properties": { "field": "quote", "operator": "equal", "value": [ "$quote" ], "valueSrc": [ "value" ], "valueType": [ "text" ] }, "type": "rule" }, { "id": "89ba9b8a-89ab-4cde-b012-31892428cf41", "properties": { "field": "base", "operator": "equal", "value": [ "$base" ], "valueSrc": [ "value" ], "valueType": [ "text" ] }, "type": "rule" } ], "id": "b88b999b-89ab-4cde-b012-318922568302", "type": "group" }, "whereString": "(quote = '$quote' AND base = '$base')" }, "table": "trades" } ], "title": "Order Count by Side", "type": "bargauge" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "decimals": 6, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "Sell" }, "properties": [ { "id": "color", "value": { "fixedColor": "red", "mode": "fixed" } } ] } ] }, "gridPos": { "h": 4, "w": 4, "x": 16, "y": 0 }, "id": 10, "options": { "colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "textMode": "auto" }, "pluginVersion": "9.3.2", "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "avg(fdr_trade_price{pair=\"$pair\", side=\"Buy\", strategy=\"MARKET_MAKER_ON_TICKER\"})", "legendFormat": "Buy", "range": true, "refId": "A" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "avg(fdr_trade_price{pair=\"$pair\", side=\"Sell\", strategy=\"MARKET_MAKER_ON_TICKER\"})", "hide": false, "legendFormat": "Sell", "range": true, "refId": "B" } ], "title": "Trade Price Avg", "type": "stat" }, { "datasource": { "type": "postgres", "uid": "C8wqsYe4k" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "Sells" }, "properties": [ { "id": "color", "value": { "fixedColor": "red", "mode": "fixed" } } ] } ] }, "gridPos": { "h": 3, "w": 4, "x": 12, "y": 3 }, "id": 30, "options": { "displayMode": "gradient", "minVizHeight": 10, "minVizWidth": 0, "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": true }, "showUnfilled": true }, "pluginVersion": "9.3.2", "targets": [ { "datasource": { "type": "postgres", "uid": "jLvLCa9Vz" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT\r\n COUNT(*) AS \"Buys\"\r\nFROM\r\n orders\r\nWHERE\r\n quote = '$quote' AND base = '$base' AND order_side = 'BUY' AND status = 'CANCELLED' AND $__timeFilter(created_at)\r\n", "refId": "Buys", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "type": "postgres", "uid": "jLvLCa9Vz" }, "editorMode": "code", "expr": "", "format": "table", "legendFormat": "__auto", "range": true, "rawQuery": true, "rawSql": "SELECT\r\n COUNT(*) AS \"Sells\"\r\nFROM\r\n orders\r\nWHERE\r\n quote = '$quote' AND base = '$base' AND order_side = 'SELL' AND status = 'CANCELLED' AND $__timeFilter(created_at)\r\n", "refId": "Sells", "sql": { "columns": [ { "name": "COUNT", "parameters": [ { "name": "*", "type": "functionParameter" } ], "type": "function" } ], "groupBy": [ { "property": { "name": "order_side", "type": "string" }, "type": "groupBy" } ], "limit": 50, "whereJsonTree": { "children1": [ { "id": "ab9bba9a-cdef-4012-b456-71892428a8bd", "properties": { "field": "quote", "operator": "equal", "value": [ "$quote" ], "valueSrc": [ "value" ], "valueType": [ "text" ] }, "type": "rule" }, { "id": "89ba9b8a-89ab-4cde-b012-31892428cf41", "properties": { "field": "base", "operator": "equal", "value": [ "$base" ], "valueSrc": [ "value" ], "valueType": [ "text" ] }, "type": "rule" } ], "id": "b88b999b-89ab-4cde-b012-318922568302", "type": "group" }, "whereString": "(quote = '$quote' AND base = '$base')" }, "table": "trades" } ], "title": "Cancel Count by Side", "type": "bargauge" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "description": "Total volume times average cost", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "decimals": 6, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "Buy" }, "properties": [ { "id": "displayName", "value": "Buy" } ] }, { "matcher": { "id": "byName", "options": "Sell" }, "properties": [ { "id": "displayName", "value": "Sell" }, { "id": "color", "value": { "fixedColor": "red", "mode": "fixed" } } ] } ] }, "gridPos": { "h": 4, "w": 4, "x": 16, "y": 4 }, "id": 11, "options": { "colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "textMode": "auto" }, "pluginVersion": "9.3.2", "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "avg(fdr_trade_price{pair=\"$pair\", side=\"Buy\"})", "hide": true, "legendFormat": "__auto", "range": true, "refId": "avg_price_buy" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "avg(fdr_trade_price{pair=\"$pair\", side=\"Sell\"})", "hide": true, "legendFormat": "__auto", "range": true, "refId": "avg_price_sell" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "fdr_trade_volume{pair=\"$pair\", side=\"Buy\", strategy=\"MARKET_MAKER_ON_TICKER\"}", "hide": true, "legendFormat": "__auto", "range": true, "refId": "total_volume_buy" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "fdr_trade_volume{pair=\"$pair\", side=\"Sell\", strategy=\"MARKET_MAKER_ON_TICKER\"}", "hide": true, "legendFormat": "__auto", "range": true, "refId": "total_volume_sell" }, { "datasource": { "name": "Expression", "type": "__expr__", "uid": "__expr__" }, "expression": "$avg_price_buy * $total_volume_buy", "hide": false, "refId": "Buy", "type": "math" }, { "datasource": { "name": "Expression", "type": "__expr__", "uid": "__expr__" }, "expression": "$avg_price_sell * $total_volume_sell", "hide": false, "refId": "Sell", "type": "math" } ], "title": "Volume * Avg Price", "type": "stat" }, { "datasource": { "type": "postgres", "uid": "C8wqsYe4k" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "Sells" }, "properties": [ { "id": "color", "value": { "fixedColor": "red", "mode": "fixed" } } ] } ] }, "gridPos": { "h": 4, "w": 4, "x": 12, "y": 6 }, "id": 7, "options": { "displayMode": "gradient", "minVizHeight": 10, "minVizWidth": 0, "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": true }, "showUnfilled": true }, "pluginVersion": "9.3.2", "targets": [ { "datasource": { "type": "postgres", "uid": "jLvLCa9Vz" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT\r\n COUNT(*) AS \"Buys\"\r\nFROM\r\n trades\r\nWHERE\r\n quote = '$quote' AND base = '$base' AND order_side = 'BUY' AND $__timeFilter(time)\r\n", "refId": "Buys", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "type": "postgres", "uid": "jLvLCa9Vz" }, "editorMode": "code", "expr": "", "format": "table", "legendFormat": "__auto", "range": true, "rawQuery": true, "rawSql": "SELECT\r\n COUNT(*) AS \"Sells\"\r\nFROM\r\n trades\r\nWHERE\r\n quote = '$quote' AND base = '$base' AND order_side = 'SELL' AND $__timeFilter(time)\r\n", "refId": "Sells", "sql": { "columns": [ { "name": "COUNT", "parameters": [ { "name": "*", "type": "functionParameter" } ], "type": "function" } ], "groupBy": [ { "property": { "name": "order_side", "type": "string" }, "type": "groupBy" } ], "limit": 50, "whereJsonTree": { "children1": [ { "id": "ab9bba9a-cdef-4012-b456-71892428a8bd", "properties": { "field": "quote", "operator": "equal", "value": [ "$quote" ], "valueSrc": [ "value" ], "valueType": [ "text" ] }, "type": "rule" }, { "id": "89ba9b8a-89ab-4cde-b012-31892428cf41", "properties": { "field": "base", "operator": "equal", "value": [ "$base" ], "valueSrc": [ "value" ], "valueType": [ "text" ] }, "type": "rule" } ], "id": "b88b999b-89ab-4cde-b012-318922568302", "type": "group" }, "whereString": "(quote = '$quote' AND base = '$base')" }, "table": "trades" } ], "title": "Trade Count by Side", "type": "bargauge" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "Sell" }, "properties": [ { "id": "color", "value": { "fixedColor": "red", "mode": "fixed" } } ] } ] }, "gridPos": { "h": 4, "w": 4, "x": 12, "y": 10 }, "id": 20, "options": { "orientation": "vertical", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showThresholdLabels": false, "showThresholdMarkers": true }, "pluginVersion": "9.3.2", "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "increase(fdr_trade_count{pair=\"$pair\", strategy=\"MARKET_MAKER_ON_TICKER\"}[1h])", "legendFormat": "{{side}}", "range": true, "refId": "A" } ], "title": "Trade Count by Side per hour", "type": "gauge" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "fieldConfig": { "defaults": { "color": { "fixedColor": "dark-orange", "mode": "fixed" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] }, "unit": "currencyUSD" }, "overrides": [] }, "gridPos": { "h": 3, "w": 4, "x": 0, "y": 11 }, "id": 14, "options": { "colorMode": "background", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "reduceOptions": { "calcs": [ "diff" ], "fields": "", "values": false }, "textMode": "auto" }, "pluginVersion": "9.3.2", "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "fdr_market_balance{asset=\"$quote\", pair=\"$pair\"}", "hide": true, "legendFormat": "{{asset}}", "range": true, "refId": "BTC" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "fdr_market_balance{asset=\"$base\", pair=\"$pair\"}", "hide": true, "legendFormat": "{{asset}}", "range": true, "refId": "ETH" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "fdr_ticker_last_price{pair=\"$pair\"}", "hide": true, "legendFormat": "__auto", "range": true, "refId": "price" }, { "datasource": { "name": "Expression", "type": "__expr__", "uid": "__expr__" }, "expression": "($price * $ETH) + $BTC", "hide": false, "refId": "A", "type": "math" } ], "title": "Gain in Base", "type": "stat" }, { "datasource": { "type": "datasource", "uid": "-- Mixed --" }, "description": "Prices at time of buy and sell order execution", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "hue", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "stepAfter", "lineStyle": { "fill": "solid" }, "lineWidth": 0.5, "pointSize": 3, "scaleDistribution": { "type": "linear" }, "showPoints": "always", "spanNulls": true, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "decimals": 6, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "sell_price" }, "properties": [ { "id": "color", "value": { "fixedColor": "red", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Ticker" }, "properties": [ { "id": "custom.lineWidth", "value": 0 }, { "id": "custom.lineStyle", "value": { "dash": [ 10, 10 ], "fill": "dash" } }, { "id": "custom.drawStyle", "value": "line" }, { "id": "custom.showPoints", "value": "auto" }, { "id": "custom.fillOpacity", "value": 10 }, { "id": "color", "value": { "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "buy_price" }, "properties": [ { "id": "displayName", "value": "Buy Price" } ] }, { "matcher": { "id": "byName", "options": "sell_price" }, "properties": [ { "id": "displayName", "value": "Sell Price" } ] }, { "matcher": { "id": "byName", "options": "volume" }, "properties": [ { "id": "unit", "value": "none" }, { "id": "custom.axisPlacement", "value": "right" }, { "id": "custom.fillOpacity", "value": 6 }, { "id": "custom.showPoints", "value": "never" }, { "id": "custom.lineStyle", "value": { "dash": [ 0, 10 ], "fill": "dot" } }, { "id": "custom.lineWidth", "value": 0 } ] } ] }, "gridPos": { "h": 7, "w": 12, "x": 0, "y": 14 }, "id": 5, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true }, "timezone": [ "", "" ], "tooltip": { "mode": "multi", "sort": "none" } }, "targets": [ { "datasource": { "type": "postgres", "uid": "C8wqsYe4k" }, "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT time,\r\nMAX(CASE WHEN order_side = 'BUY' THEN price END) AS buy_price, \r\nMAX(CASE WHEN order_side = 'SELL' THEN price END) AS sell_price\r\nFROM trades WHERE $__timeFilter(time) AND base = '$base' AND quote = '$quote' AND (order_side = 'BUY' OR order_side = 'SELL') GROUP BY time", "refId": "trades", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "fdr_ticker_last_price{pair=\"$pair\", exchange=\"kraken\"}", "hide": false, "legendFormat": "Ticker", "range": true, "refId": "ticker" }, { "datasource": { "type": "postgres", "uid": "C8wqsYe4k" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT time,\r\nvolume AS Volume\r\nFROM trades WHERE $__timeFilter(time) AND base = '$base' AND quote = '$quote' AND (order_side = 'BUY' OR order_side = 'SELL') GROUP BY time, volume", "refId": "volume", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Trade Prices", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "description": "Balances for assets being trades by MM strategy in terms of the Quote asset", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "auto", "spanNulls": true, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "decimals": 6, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "ETH_balance_in_BTC" }, "properties": [ { "id": "color", "value": { "fixedColor": "#8a8a93", "mode": "fixed" } }, { "id": "displayName", "value": "Base in Quote" } ] }, { "matcher": { "id": "byName", "options": "Total in Quote" }, "properties": [ { "id": "displayName", "value": "Total in Quote" } ] } ] }, "gridPos": { "h": 7, "w": 12, "x": 12, "y": 14 }, "id": 2, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "single", "sort": "none" } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "fdr_market_balance{pair=\"$pair\", asset=\"$quote\"}", "hide": false, "legendFormat": "{{asset}}", "range": true, "refId": "quote_balance" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "fdr_market_balance{pair=\"$pair\", asset=\"$base\"}", "hide": true, "legendFormat": "{{asset}}", "range": true, "refId": "base_balance" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "exemplar": false, "expr": "fdr_ticker_last_price{pair=\"$pair\"}", "hide": true, "instant": false, "interval": "", "legendFormat": "{{pair}}", "range": true, "refId": "quote_price" }, { "datasource": { "name": "Expression", "type": "__expr__", "uid": "__expr__" }, "expression": "$base_balance * $quote_price", "hide": false, "refId": "base_balance_in_quote", "type": "math" }, { "datasource": { "name": "Expression", "type": "__expr__", "uid": "__expr__" }, "expression": "$base_balance_in_quote + $quote_balance", "hide": false, "refId": "Total in Quote", "type": "math" } ], "title": "Balances (Quote)", "type": "timeseries" }, { "datasource": { "type": "datasource", "uid": "-- Mixed --" }, "description": "Prices at time of buy and sell order execution", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "points", "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 4, "scaleDistribution": { "type": "linear" }, "showPoints": "auto", "spanNulls": true, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "decimals": 6, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "sell_price" }, "properties": [ { "id": "color", "value": { "fixedColor": "red", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Ticker" }, "properties": [ { "id": "custom.lineStyle", "value": { "fill": "solid" } }, { "id": "custom.fillOpacity", "value": 10 }, { "id": "custom.drawStyle", "value": "line" }, { "id": "color", "value": { "mode": "fixed" } }, { "id": "custom.lineWidth", "value": 0 } ] }, { "matcher": { "id": "byName", "options": "buy_price" }, "properties": [ { "id": "displayName", "value": "Buy Price" } ] }, { "matcher": { "id": "byName", "options": "sell_price" }, "properties": [ { "id": "displayName", "value": "Sell Price" } ] }, { "matcher": { "id": "byName", "options": "C" }, "properties": [ { "id": "custom.fillOpacity", "value": 0 }, { "id": "custom.drawStyle", "value": "line" } ] }, { "matcher": { "id": "byName", "options": "Fake Order: 1.8 Buy" }, "properties": [ { "id": "color", "value": { "fixedColor": "yellow", "mode": "fixed" } } ] }, { "__systemRef": "hideSeriesFrom", "matcher": { "id": "byNames", "options": { "mode": "exclude", "names": [ "Buy Price", "Sell Price", "buy_trade", "sell_trade", "Ticker" ], "prefix": "All except:", "readOnly": true } }, "properties": [ { "id": "custom.hideFrom", "value": { "legend": false, "tooltip": false, "viz": true } } ] } ] }, "gridPos": { "h": 7, "w": 12, "x": 0, "y": 21 }, "id": 32, "options": { "legend": { "calcs": [ "lastNotNull" ], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "single", "sort": "none" } }, "pluginVersion": "9.3.2", "targets": [ { "datasource": { "type": "postgres", "uid": "C8wqsYe4k" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT created_at,\r\nMAX(CASE WHEN order_side = 'BUY' THEN price END) AS buy_price, \r\nMAX(CASE WHEN order_side = 'SELL' THEN price END) AS sell_price\r\nFROM orders WHERE $__timeFilter(created_at) AND base = '$base' AND quote = '$quote' AND (order_side = 'BUY' OR order_side = 'SELL') GROUP BY created_at", "refId": "buys", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "fdr_ticker_last_price{pair=\"$pair\", exchange=\"kraken\"}", "hide": false, "legendFormat": "Ticker", "range": true, "refId": "A" }, { "datasource": { "type": "postgres", "uid": "C8wqsYe4k" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT time,\r\nMAX(CASE WHEN order_side = 'BUY' THEN price END) AS buy_trade, \r\nMAX(CASE WHEN order_side = 'SELL' THEN price END) AS sell_trade\r\nFROM trades WHERE $__timeFilter(time) AND base = '$base' AND quote = '$quote' AND (order_side = 'BUY' OR order_side = 'SELL') GROUP BY time", "refId": "B", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "exemplar": false, "expr": "fdr_fake_order_market_maker_on_ticker{exchange=\"kraken\", pair=\"$pair\", strategy=\"MARKET_MAKER_ON_TICKER\"}", "hide": false, "instant": false, "legendFormat": "{{side}}: {{coefficient}}", "range": true, "refId": "fake_orders" } ], "title": "Order Prices", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "description": "Total balance of assets traded by SMM, converted to BTC.", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "auto", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "decimals": 6, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "{__name__=\"fdr_s003_balance\", asset=\"BTC\", exchange=\"kraken\", instance=\"host.docker.internal:4001\", job=\"strat-stable-market-maker-local\"}" }, "properties": [ { "id": "color", "value": { "fixedColor": "orange", "mode": "fixed" } }, { "id": "displayName", "value": "BTC Balance" } ] }, { "matcher": { "id": "byName", "options": "ETH_balance_in_BTC" }, "properties": [ { "id": "color", "value": { "fixedColor": "#8a8a93", "mode": "fixed" } }, { "id": "displayName", "value": "ETH Balance (BTC)" } ] }, { "matcher": { "id": "byName", "options": "Total_in_BTC" }, "properties": [ { "id": "displayName", "value": "Quote + Base (Quote)" } ] } ] }, "gridPos": { "h": 7, "w": 12, "x": 12, "y": 21 }, "id": 12, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "single", "sort": "none" } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "fdr_market_balance{pair=\"$pair\", asset=\"$quote\"}", "hide": true, "legendFormat": "__auto", "range": true, "refId": "BTC_balance" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "fdr_market_balance{pair=\"$pair\", asset=\"$base\"}", "hide": true, "legendFormat": "__auto", "range": true, "refId": "ETH_balance" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "exemplar": false, "expr": "fdr_ticker_last_price{pair=\"$pair\"}", "hide": true, "instant": false, "interval": "", "legendFormat": "__auto", "range": true, "refId": "BTC_price" }, { "datasource": { "name": "Expression", "type": "__expr__", "uid": "__expr__" }, "expression": "$ETH_balance * $BTC_price", "hide": true, "refId": "ETH_balance_in_BTC", "type": "math" }, { "datasource": { "name": "Expression", "type": "__expr__", "uid": "__expr__" }, "expression": "$BTC_balance + $ETH_balance_in_BTC", "hide": false, "refId": "Total_in_BTC", "type": "math" } ], "title": "Total Balance (Quote)", "type": "timeseries" }, { "datasource": { "type": "datasource", "uid": "-- Mixed --" }, "description": "Prices at time of buy and sell order execution", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "auto", "spanNulls": true, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "decimals": 6, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "Ticker" }, "properties": [ { "id": "custom.lineStyle", "value": { "fill": "solid" } }, { "id": "custom.fillOpacity", "value": 10 }, { "id": "custom.drawStyle", "value": "line" }, { "id": "color", "value": { "mode": "fixed" } } ] } ] }, "gridPos": { "h": 7, "w": 12, "x": 0, "y": 28 }, "id": 33, "options": { "legend": { "calcs": [ "lastNotNull" ], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "single", "sort": "none" } }, "pluginVersion": "9.3.2", "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "fdr_ticker_last_price{pair=\"$pair\", exchange=\"kraken\"}", "hide": false, "legendFormat": "Ticker", "range": true, "refId": "A" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "exemplar": false, "expr": "fdr_fake_order_market_maker_on_ticker{exchange=\"kraken\", pair=\"$pair\", strategy=\"MARKET_MAKER_ON_TICKER\"}", "hide": false, "instant": false, "legendFormat": "{{side}}: {{coefficient}}", "range": true, "refId": "fake_orders" }, { "datasource": { "type": "postgres", "uid": "C8wqsYe4k" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT created_at,\r\nMAX(CASE WHEN order_side = 'BUY' THEN price END) AS buy_price, \r\nMAX(CASE WHEN order_side = 'SELL' THEN price END) AS sell_price\r\nFROM orders WHERE $__timeFilter(created_at) AND base = '$base' AND quote = '$quote' AND (order_side = 'BUY' OR order_side = 'SELL') GROUP BY created_at", "refId": "B", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Fake Orders", "type": "timeseries" }, { "datasource": { "type": "datasource", "uid": "-- Mixed --" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "stepAfter", "lineStyle": { "dash": [ 10, 10 ], "fill": "dash" }, "lineWidth": 0.5, "pointSize": 3, "scaleDistribution": { "type": "linear" }, "showPoints": "auto", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "decimals": 8, "mappings": [], "noValue": "-", "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] }, "unit": "none" }, "overrides": [ { "matcher": { "id": "byName", "options": "Ticker" }, "properties": [ { "id": "custom.fillOpacity", "value": 6 }, { "id": "custom.lineStyle", "value": { "dash": [ 10, 10 ], "fill": "dash" } }, { "id": "color", "value": { "mode": "fixed" } }, { "id": "custom.lineWidth", "value": 0 } ] }, { "matcher": { "id": "byName", "options": "sell_price" }, "properties": [ { "id": "custom.drawStyle", "value": "points" } ] }, { "matcher": { "id": "byName", "options": "buy_price" }, "properties": [ { "id": "color", "value": { "fixedColor": "green", "mode": "fixed" } }, { "id": "custom.drawStyle", "value": "points" }, { "id": "custom.lineInterpolation", "value": "stepAfter" } ] }, { "matcher": { "id": "byName", "options": "Average Sell" }, "properties": [ { "id": "custom.lineStyle", "value": { "fill": "solid" } }, { "id": "color", "value": { "fixedColor": "super-light-purple", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Average Cost" }, "properties": [ { "id": "color", "value": { "fixedColor": "super-light-yellow", "mode": "fixed" } }, { "id": "custom.lineStyle", "value": { "fill": "solid" } }, { "id": "custom.spanNulls", "value": false } ] }, { "matcher": { "id": "byName", "options": "volume" }, "properties": [ { "id": "unit", "value": "none" }, { "id": "custom.axisPlacement", "value": "right" }, { "id": "custom.fillOpacity", "value": 6 }, { "id": "custom.lineWidth", "value": 0 } ] } ] }, "gridPos": { "h": 8, "w": 12, "x": 12, "y": 28 }, "id": 38, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "fdr_tvwap_market_maker_on_ticker{exchange=\"kraken\", pair=\"$pair\", side=\"Buy\", kind=\"VwapBuckets\"} > 2", "hide": false, "legendFormat": "Average Cost", "range": true, "refId": "average_cost" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "fdr_tvwap_market_maker_on_ticker{exchange=\"kraken\", pair=\"$pair\", side=\"Sell\", kind=\"VwapBuckets\"} > 2", "hide": false, "legendFormat": "Average Sell", "range": true, "refId": "average_sell" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "exemplar": false, "expr": "fdr_ticker_last_price{pair=\"$pair\", exchange=\"kraken\"}", "hide": false, "instant": false, "interval": "", "legendFormat": "Ticker", "range": true, "refId": "ticker" }, { "datasource": { "type": "postgres", "uid": "C8wqsYe4k" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT time,\r\nMAX(CASE WHEN order_side = 'BUY' THEN price END) AS buy_price, \r\nMAX(CASE WHEN order_side = 'SELL' THEN price END) AS sell_price\r\nFROM trades WHERE $__timeFilter(time) AND base = '$base' AND quote = '$quote' AND (order_side = 'BUY' OR order_side = 'SELL') GROUP BY time", "refId": "A", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "type": "postgres", "uid": "C8wqsYe4k" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT time,\r\nvolume AS Volume\r\nFROM trades WHERE $__timeFilter(time) AND base = '$base' AND quote = '$quote' AND (order_side = 'BUY' OR order_side = 'SELL') GROUP BY time, volume", "refId": "B", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Volume Weighted Average Buy / Sell from prom", "type": "timeseries" }, { "datasource": { "type": "datasource", "uid": "-- Mixed --" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": 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": "Ticker" }, "properties": [ { "id": "custom.fillOpacity", "value": 6 }, { "id": "custom.lineStyle", "value": { "dash": [ 10, 10 ], "fill": "dash" } } ] }, { "matcher": { "id": "byName", "options": "sell_price" }, "properties": [ { "id": "custom.drawStyle", "value": "points" } ] }, { "matcher": { "id": "byName", "options": "buy_price" }, "properties": [ { "id": "color", "value": { "fixedColor": "green", "mode": "fixed" } }, { "id": "custom.drawStyle", "value": "points" } ] }, { "matcher": { "id": "byName", "options": "average_sell" }, "properties": [ { "id": "custom.lineStyle", "value": { "dash": [ 0, 10 ], "fill": "dot" } }, { "id": "color", "value": { "fixedColor": "super-light-purple", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "average_cost" }, "properties": [ { "id": "color", "value": { "fixedColor": "super-light-yellow", "mode": "fixed" } }, { "id": "custom.lineStyle", "value": { "dash": [ 0, 10 ], "fill": "dot" } } ] } ] }, "gridPos": { "h": 8, "w": 12, "x": 0, "y": 35 }, "id": 37, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "single", "sort": "none" } }, "targets": [ { "datasource": { "type": "postgres", "uid": "C8wqsYe4k" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT time,\r\n SUM(cost) / SUM(volume) AS average_cost\r\nFROM\r\n trades\r\nWHERE\r\n base = '$base' AND quote = '$quote' AND order_side = 'BUY' AND $__timeFilter(time) GROUP BY time", "refId": "average_cost", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "type": "postgres", "uid": "C8wqsYe4k" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT time,\r\n SUM(cost) / SUM(volume) AS average_sell\r\nFROM\r\n trades\r\nWHERE\r\n base = '$base' AND quote = '$quote' AND order_side = 'SELL' AND $__timeFilter(time) GROUP BY time", "refId": "average_sell", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "name": "Expression", "type": "__expr__", "uid": "__expr__" }, "expression": "$average_sell - $average_cost", "hide": true, "reducer": "mean", "refId": "A", "settings": { "mode": "dropNN" }, "type": "math" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "fdr_ticker_last_price{pair=\"$pair\", exchange=\"kraken\"}", "hide": false, "legendFormat": "Ticker", "range": true, "refId": "B" }, { "datasource": { "type": "postgres", "uid": "C8wqsYe4k" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT time,\r\nMAX(CASE WHEN order_side = 'BUY' THEN price END) AS buy_price, \r\nMAX(CASE WHEN order_side = 'SELL' THEN price END) AS sell_price\r\nFROM trades WHERE $__timeFilter(time) AND base = '$base' AND quote = '$quote' AND (order_side = 'BUY' OR order_side = 'SELL') GROUP BY time", "refId": "trades", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Volume Weighted Average Buy / Sell", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 1, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 2, "scaleDistribution": { "type": "linear" }, "showPoints": "auto", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "decimals": 8, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] }, "unit": "none" }, "overrides": [] }, "gridPos": { "h": 8, "w": 12, "x": 12, "y": 36 }, "id": 40, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "single", "sort": "none" } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "builder", "exemplar": false, "expr": "fdr_tvwap_market_maker_on_ticker{exchange=\"kraken\", pair=\"$pair\", side=\"Buy\"}", "instant": false, "legendFormat": "__auto", "range": true, "refId": "A" } ], "title": "Panel Title", "type": "timeseries" }, { "datasource": { "type": "postgres", "uid": "C8wqsYe4k" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "decimals": 7, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "gain_or_loss" }, "properties": [ { "id": "displayName", "value": "Gain or Loss" }, { "id": "unit", "value": "currencyUSD" } ] }, { "matcher": { "id": "byName", "options": "average_cost" }, "properties": [ { "id": "displayName", "value": "Average Cost" } ] }, { "matcher": { "id": "byName", "options": "vwap_delta" }, "properties": [ { "id": "displayName", "value": "Delta" } ] }, { "matcher": { "id": "byName", "options": "cost_basis" }, "properties": [ { "id": "displayName", "value": "Cost Basis" } ] }, { "matcher": { "id": "byName", "options": "vwap_sell" }, "properties": [ { "id": "displayName", "value": "Volume Weight Average Sell" } ] }, { "matcher": { "id": "byName", "options": "volume_sold" }, "properties": [ { "id": "displayName", "value": "Volume Sold" } ] }, { "matcher": { "id": "byName", "options": "net_proceeds" }, "properties": [ { "id": "displayName", "value": "Net Proceeds" } ] }, { "matcher": { "id": "byName", "options": "fee" }, "properties": [ { "id": "displayName", "value": "Fees" } ] } ] }, "gridPos": { "h": 14, "w": 4, "x": 0, "y": 43 }, "id": 26, "options": { "colorMode": "background", "graphMode": "none", "justifyMode": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "textMode": "auto" }, "pluginVersion": "9.3.2", "targets": [ { "datasource": { "name": "Expression", "type": "__expr__", "uid": "__expr__" }, "expression": "$net_proceeds - $cost_basis - $fees", "hide": false, "refId": "gain_or_loss", "type": "math" }, { "datasource": { "name": "Expression", "type": "__expr__", "uid": "__expr__" }, "expression": "$vwap_sell - $average_cost", "hide": false, "refId": "vwap_delta", "type": "math" }, { "datasource": { "type": "postgres", "uid": "jLvLCa9Vz" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT SUM(cost) / SUM(volume) AS average_cost\r\nFROM trades\r\nWHERE order_side = 'BUY' AND base = '$base' AND quote = '$quote'", "refId": "average_cost", "sql": { "columns": [ { "name": "COUNT", "parameters": [ { "name": "*", "type": "functionParameter" } ], "type": "function" } ], "groupBy": [], "limit": 50, "whereJsonTree": { "children1": [ { "id": "b89a88bb-cdef-4012-b456-718922f846e0", "properties": { "field": "base", "operator": "equal", "value": [ "DOT" ], "valueSrc": [ "value" ], "valueType": [ "text" ] }, "type": "rule" }, { "id": "98aaa88a-89ab-4cde-b012-318922f89aa2", "properties": { "field": "quote", "operator": "equal", "value": [ "USD" ], "valueSrc": [ "value" ], "valueType": [ "text" ] }, "type": "rule" } ], "id": "b88b999b-89ab-4cde-b012-318922568302", "type": "group" }, "whereString": "(base = 'DOT' AND quote = 'USD')" }, "table": "trades" }, { "datasource": { "type": "postgres", "uid": "jLvLCa9Vz" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT SUM(cost) / SUM(volume) AS VWAP_SELL FROM trades WHERE order_side = 'SELL' AND base = '$base' AND quote = '$quote'", "refId": "vwap_sell", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "type": "postgres", "uid": "jLvLCa9Vz" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT SUM(volume) AS volume_sold FROM trades WHERE order_side = 'SELL' AND base = '$base' AND quote = '$quote' AND $__timeFilter(time) ", "refId": "volume_sold", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "name": "Expression", "type": "__expr__", "uid": "__expr__" }, "expression": "$volume_sold * $average_cost", "hide": false, "refId": "cost_basis", "type": "math" }, { "datasource": { "type": "postgres", "uid": "jLvLCa9Vz" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT SUM(cost) AS net_proceeds\r\nFROM trades\r\nWHERE order_side = 'SELL' AND base = '$base' AND quote = '$quote' AND $__timeFilter(time) ", "refId": "net_proceeds", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "type": "postgres", "uid": "jLvLCa9Vz" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT SUM(fee) AS FEE FROM trades WHERE base = '$base' AND quote = '$quote'", "refId": "fees", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Average Cost Basis Profit", "type": "stat" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "description": "Balances for assets being trades by SMM strategy in terms of BTC", "fieldConfig": { "defaults": { "color": { "fixedColor": "green", "mode": "palette-classic" }, "custom": { "hideFrom": { "legend": false, "tooltip": false, "viz": false } }, "decimals": 6, "mappings": [] }, "overrides": [ { "matcher": { "id": "byName", "options": "{__name__=\"fdr_s003_balance\", asset=\"BTC\", exchange=\"kraken\", instance=\"host.docker.internal:4001\", job=\"strat-stable-market-maker-local\"}" }, "properties": [ { "id": "color", "value": { "fixedColor": "orange", "mode": "fixed" } }, { "id": "displayName", "value": "BTC Balance" } ] }, { "matcher": { "id": "byName", "options": "ETH_balance_in_BTC" }, "properties": [ { "id": "color", "value": { "fixedColor": "#8a8a93", "mode": "fixed" } }, { "id": "displayName", "value": "ETH Balance (BTC)" } ] } ] }, "gridPos": { "h": 9, "w": 4, "x": 6, "y": 43 }, "id": 3, "options": { "displayLabels": [ "value", "percent" ], "legend": { "displayMode": "list", "placement": "bottom", "showLegend": true, "values": [] }, "pieType": "pie", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "tooltip": { "mode": "single", "sort": "none" } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "builder", "expr": "fdr_balance{asset=\"$base\"}", "hide": false, "legendFormat": "{{asset}}", "range": true, "refId": "base" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "fdr_balance{asset=\"$quote\"}", "hide": false, "legendFormat": "{{asset}}", "range": true, "refId": "quote" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "exemplar": false, "expr": "fdr_ticker_last_price{pair=\"$pair\"}", "hide": false, "instant": false, "interval": "", "legendFormat": "__auto", "range": true, "refId": "price" }, { "datasource": { "name": "Expression", "type": "__expr__", "uid": "__expr__" }, "expression": "$base * $price", "hide": false, "refId": "base_in_quote_asset", "type": "math" } ], "title": "Balances (Quote)", "transparent": true, "type": "piechart" } ], "refresh": "5s", "schemaVersion": 37, "style": "dark", "tags": [], "templating": { "list": [ { "current": { "selected": false, "text": "ETH_USD", "value": "ETH_USD" }, "datasource": { "type": "prometheus", "uid": "prometheus" }, "definition": "label_values(pair)", "hide": 0, "includeAll": false, "label": "Pair", "multi": false, "name": "pair", "options": [], "query": { "query": "label_values(pair)", "refId": "StandardVariableQuery" }, "refresh": 1, "regex": "", "skipUrlSync": false, "sort": 0, "type": "query" }, { "current": { "selected": false, "text": "fdr_ticker_last_price{exchange=\"kraken\",instance=\"host.docker.internal:3001\",job=\"proxy-kraken\",pair=\"ETH_USD\"}", "value": "fdr_ticker_last_price{exchange=\"kraken\",instance=\"host.docker.internal:3001\",job=\"proxy-kraken\",pair=\"ETH_USD\"}" }, "datasource": { "type": "prometheus", "uid": "prometheus" }, "definition": "fdr_ticker_last_price{pair=\"$pair\"}", "hide": 2, "includeAll": false, "multi": false, "name": "ticker_price", "options": [], "query": { "query": "fdr_ticker_last_price{pair=\"$pair\"}", "refId": "StandardVariableQuery" }, "refresh": 1, "regex": "", "skipUrlSync": false, "sort": 0, "type": "query" }, { "current": { "selected": false, "text": "USD", "value": "USD" }, "datasource": { "type": "prometheus", "uid": "prometheus" }, "definition": "label_values(asset)", "hide": 0, "includeAll": false, "label": "Quote", "multi": false, "name": "quote", "options": [], "query": { "query": "label_values(asset)", "refId": "StandardVariableQuery" }, "refresh": 1, "regex": "", "skipUrlSync": false, "sort": 0, "type": "query" }, { "current": { "selected": false, "text": "ETH", "value": "ETH" }, "datasource": { "type": "prometheus", "uid": "prometheus" }, "definition": "label_values(asset)", "hide": 0, "includeAll": false, "label": "Base", "multi": false, "name": "base", "options": [], "query": { "query": "label_values(asset)", "refId": "StandardVariableQuery" }, "refresh": 1, "regex": "", "skipUrlSync": false, "sort": 0, "type": "query" } ] }, "time": { "from": "now-30d", "to": "now" }, "timepicker": {}, "timezone": "", "title": "Stable Market Maker: DOT/USD Copy Copy Copy", "uid": "WFzb7RRIz", "version": 83, "weekStart": "" }
0
dashboards
/mono/helm/grafana/dashboards/example-service-dashboard.json
{ "annotations": { "list": [ { "builtIn": 1, "datasource": "-- Grafana --", "enable": true, "hide": true, "iconColor": "rgba(0, 211, 255, 1)", "name": "Annotations & Alerts", "type": "dashboard" } ] }, "editable": true, "gnetId": null, "graphTooltip": 0, "id": 7, "links": [], "panels": [ { "aliasColors": {}, "bars": false, "dashLength": 10, "dashes": false, "datasource": null, "fieldConfig": { "defaults": { "custom": {}, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] } }, "overrides": [] }, "fill": 1, "fillGradient": 0, "gridPos": { "h": 11, "w": 8, "x": 0, "y": 0 }, "hiddenSeries": false, "id": 10, "legend": { "avg": false, "current": false, "max": false, "min": false, "show": true, "total": false, "values": false }, "lines": true, "linewidth": 1, "nullPointMode": "null", "options": { "dataLinks": [] }, "percentage": false, "pluginVersion": "7.0.0", "pointradius": 2, "points": false, "renderer": "flot", "seriesOverrides": [], "spaceLength": 10, "stack": false, "steppedLine": false, "targets": [ { "expr": "sum(increase(http_request_duration_seconds_count[1m]))", "interval": "", "legendFormat": "Requests per minute", "refId": "A" } ], "thresholds": [], "timeFrom": null, "timeRegions": [], "timeShift": null, "title": "Rate (R): Number of requests per minute", "tooltip": { "shared": true, "sort": 0, "value_type": "individual" }, "type": "graph", "xaxis": { "buckets": null, "mode": "time", "name": null, "show": true, "values": [] }, "yaxes": [ { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true }, { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true } ], "yaxis": { "align": false, "alignLevel": null } }, { "aliasColors": {}, "bars": false, "dashLength": 10, "dashes": false, "datasource": null, "fieldConfig": { "defaults": { "custom": {}, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] } }, "overrides": [] }, "fill": 1, "fillGradient": 0, "gridPos": { "h": 11, "w": 8, "x": 8, "y": 0 }, "hiddenSeries": false, "id": 12, "legend": { "avg": false, "current": false, "max": false, "min": false, "show": true, "total": false, "values": false }, "lines": true, "linewidth": 1, "nullPointMode": "null", "options": { "dataLinks": [] }, "percentage": false, "pluginVersion": "7.0.0", "pointradius": 2, "points": false, "renderer": "flot", "seriesOverrides": [], "spaceLength": 10, "stack": false, "steppedLine": false, "targets": [ { "expr": "sum(increase(http_request_duration_seconds_count{code=~\"5.*\"}[1m]))", "interval": "", "legendFormat": "", "refId": "A" } ], "thresholds": [], "timeFrom": null, "timeRegions": [], "timeShift": null, "title": "Errors (E): The number of failed requests", "tooltip": { "shared": true, "sort": 0, "value_type": "individual" }, "type": "graph", "xaxis": { "buckets": null, "mode": "time", "name": null, "show": true, "values": [] }, "yaxes": [ { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true }, { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true } ], "yaxis": { "align": false, "alignLevel": null } }, { "aliasColors": {}, "bars": false, "dashLength": 10, "dashes": false, "datasource": null, "description": "", "fieldConfig": { "defaults": { "custom": {} }, "overrides": [] }, "fill": 1, "fillGradient": 0, "gridPos": { "h": 11, "w": 8, "x": 16, "y": 0 }, "hiddenSeries": false, "id": 2, "legend": { "avg": false, "current": false, "max": false, "min": false, "show": true, "total": false, "values": false }, "lines": true, "linewidth": 1, "nullPointMode": "null", "options": { "dataLinks": [] }, "percentage": false, "pointradius": 2, "points": false, "renderer": "flot", "seriesOverrides": [], "spaceLength": 10, "stack": false, "steppedLine": false, "targets": [ { "expr": "histogram_quantile(0.9, sum(rate(http_request_duration_seconds_bucket[10m])) by (le, route))", "interval": "", "legendFormat": "p90 {{route}}", "refId": "A" }, { "expr": "histogram_quantile(0.5, sum(rate(http_request_duration_seconds_bucket[10m])) by (le, route))", "interval": "", "legendFormat": "Median {{route}}", "refId": "B" }, { "expr": "rate(http_request_duration_seconds_sum[5m]) / rate(http_request_duration_seconds_count[5m])", "interval": "", "legendFormat": "Average {{route}}", "refId": "C" } ], "thresholds": [], "timeFrom": null, "timeRegions": [], "timeShift": null, "title": "Duration (D): The amount of time to process a request", "tooltip": { "shared": true, "sort": 0, "value_type": "individual" }, "type": "graph", "xaxis": { "buckets": null, "mode": "time", "name": null, "show": true, "values": [] }, "yaxes": [ { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true }, { "format": "short", "label": null, "logBase": 1, "max": null, "min": null, "show": true } ], "yaxis": { "align": false, "alignLevel": null } } ], "refresh": false, "schemaVersion": 25, "style": "dark", "tags": [], "templating": { "list": [] }, "time": { "from": "now-15m", "to": "now" }, "timepicker": { "refresh_intervals": ["10s", "30s", "1m", "5m", "15m", "30m", "1h", "2h", "1d"] }, "timezone": "", "title": "Example Service Dashboard", "uid": "1DYaynomMk", "version": 2 }
0
dashboards
/mono/helm/grafana/dashboards/proxy-market-metrics.json
{ "annotations": { "list": [ { "builtIn": 1, "datasource": { "type": "grafana", "uid": "-- Grafana --" }, "enable": true, "hide": true, "iconColor": "rgba(0, 211, 255, 1)", "name": "Annotations & Alerts", "type": "dashboard" } ] }, "description": "High level exchange proxy metrics used to view the current status of an exchange proxy and rate of published markets.", "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, "id": 11, "links": [], "panels": [ { "collapsed": false, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 0 }, "id": 2, "panels": [], "repeat": "pair", "repeatDirection": "h", "title": "Market $pair", "type": "row" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "description": "The sampled ticker price, best bid and best ask. These metrics are sampled from Prometheus so this does not represent the full ticker and OB data set.", "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 } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "Best Ask" }, "properties": [ { "id": "color", "value": { "fixedColor": "red", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Best Bid" }, "properties": [ { "id": "color", "value": { "fixedColor": "green", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Last Price" }, "properties": [ { "id": "color", "value": { "fixedColor": "blue", "mode": "fixed" } } ] } ] }, "gridPos": { "h": 12, "w": 17, "x": 0, "y": 1 }, "id": 29, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "single", "sort": "none" } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "fdr_ticker_last_price{exchange=\"$exchange\", pair=\"$pair\"}", "instant": false, "legendFormat": "Last Price", "range": true, "refId": "A" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "fdr_ticker_best_bid_price{exchange=\"$exchange\", pair=\"$pair\"}", "hide": false, "instant": false, "legendFormat": "Best Bid", "range": true, "refId": "B" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "fdr_ticker_best_ask_price{exchange=\"$exchange\", pair=\"$pair\"}", "hide": false, "instant": false, "legendFormat": "Best Ask", "range": true, "refId": "C" } ], "title": "Market Prices", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "description": "The rate of tickers published per interval.", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] } }, "overrides": [] }, "gridPos": { "h": 6, "w": 7, "x": 17, "y": 1 }, "id": 1, "options": { "colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "reduceOptions": { "calcs": [ "mean" ], "fields": "", "values": false }, "showPercentChange": false, "textMode": "auto", "wideLayout": true }, "pluginVersion": "10.4.2", "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "rate(fdr_ticker_count{exchange=\"$exchange\", pair=\"$pair\"}[$__rate_interval])*60", "instant": false, "legendFormat": "__auto", "range": true, "refId": "A" } ], "title": "Tickers / Minute", "type": "stat" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "description": "The rate of book updates published per minute.", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] } }, "overrides": [] }, "gridPos": { "h": 6, "w": 7, "x": 17, "y": 7 }, "id": 13, "options": { "colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "reduceOptions": { "calcs": [ "mean" ], "fields": "", "values": false }, "showPercentChange": false, "textMode": "auto", "wideLayout": true }, "pluginVersion": "10.4.2", "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "rate(fdr_book_count{exchange=\"$exchange\", pair=\"$pair\"}[$__rate_interval])*60", "instant": false, "legendFormat": "__auto", "range": true, "refId": "A" } ], "title": "Book Updates / Minute", "type": "stat" } ], "schemaVersion": 39, "tags": [ "proxy", "markets" ], "templating": { "list": [ { "current": { "selected": false, "text": "kraken", "value": "kraken" }, "datasource": { "type": "prometheus", "uid": "prometheus" }, "definition": "label_values(fdr_ticker_count,exchange)", "description": "The Exchange to query", "hide": 0, "includeAll": false, "label": "Exchange", "multi": false, "name": "exchange", "options": [], "query": { "qryType": 1, "query": "label_values(fdr_ticker_count,exchange)", "refId": "PrometheusVariableQueryEditor-VariableQuery" }, "refresh": 1, "regex": "", "skipUrlSync": false, "sort": 0, "type": "query" }, { "allValue": "", "current": { "selected": true, "text": [ "ETH_BTC", "ETH_USDT", "LINK_BTC", "LINK_ETH", "LINK_USDT", "BTC_USDT" ], "value": [ "ETH_BTC", "ETH_USDT", "LINK_BTC", "LINK_ETH", "LINK_USDT", "BTC_USDT" ] }, "datasource": { "type": "prometheus", "uid": "prometheus" }, "definition": "label_values(fdr_ticker_count,pair)", "description": "A pair to repeat on.", "hide": 0, "includeAll": true, "label": "Pair", "multi": true, "name": "pair", "options": [], "query": { "qryType": 1, "query": "label_values(fdr_ticker_count,pair)", "refId": "PrometheusVariableQueryEditor-VariableQuery" }, "refresh": 1, "regex": "", "skipUrlSync": false, "sort": 0, "type": "query" } ] }, "time": { "from": "now-6h", "to": "now" }, "timepicker": {}, "timezone": "browser", "title": "Proxy Market Metrics", "uid": "edky60janssu8f", "version": 7, "weekStart": "" }
0
dashboards
/mono/helm/grafana/dashboards/kraken-market-metrics.json
{ "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, "links": [], "liveNow": false, "panels": [ { "gridPos": { "h": 1, "w": 24, "x": 0, "y": 0 }, "id": 4, "title": "Book", "type": "row" }, { "datasource": {}, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "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": 12, "w": 24, "x": 0, "y": 1 }, "id": 3, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "single", "sort": "none" } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "disableTextWrap": false, "editorMode": "builder", "expr": "fdr_book_ask_depth{exchange=\"kraken\"}", "fullMetaSearch": false, "includeNullMetadata": true, "instant": false, "legendFormat": "{{exchange}}_{{pair}}_ask_depth_at_{{bps}}", "range": true, "refId": "A", "useBackend": false }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "disableTextWrap": false, "editorMode": "builder", "expr": "fdr_book_bid_depth{exchange=\"kraken\"}", "fullMetaSearch": false, "hide": false, "includeNullMetadata": true, "instant": false, "legendFormat": "{{exchange}}_{{pair}}_bid_depth_at_{{bps}}", "range": true, "refId": "B", "useBackend": false } ], "title": "Books", "type": "timeseries" }, { "collapsed": false, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 13 }, "id": 2, "panels": [], "title": "Ticker", "type": "row" }, { "datasource": {}, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "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": [ { "matcher": { "id": "byFrameRefID", "options": "A" }, "properties": [ { "id": "custom.thresholdsStyle", "value": { "mode": "off" } } ] } ] }, "gridPos": { "h": 15, "w": 24, "x": 0, "y": 14 }, "id": 1, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "disableTextWrap": false, "editorMode": "builder", "exemplar": false, "expr": "fdr_ticker_best_ask_price{exchange=\"kraken\"}", "format": "time_series", "fullMetaSearch": false, "includeNullMetadata": true, "instant": false, "interval": "", "legendFormat": "{{exchange}}_{{pair}}_ask_price", "range": true, "refId": "A", "useBackend": false }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "disableTextWrap": false, "editorMode": "builder", "expr": "fdr_ticker_best_bid_price{exchange=\"kraken\"}", "fullMetaSearch": false, "hide": false, "includeNullMetadata": true, "legendFormat": "{{exchange}}_{{pair}}_bid_price", "range": true, "refId": "B", "useBackend": false } ], "title": "Tickers", "type": "timeseries" } ], "refresh": "", "schemaVersion": 38, "style": "dark", "tags": [], "templating": { "list": [] }, "time": { "from": "now-5m", "to": "now" }, "timepicker": {}, "timezone": "", "title": "Kraken Market Metrics", "uid": "f026e7c6-fe00-4fd0-8357-6eb49b5927e1", "version": 1, "weekStart": "" }
0
dashboards
/mono/helm/grafana/dashboards/market-makers.json
{ "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, "links": [], "liveNow": false, "panels": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "description": "Balances for assets being trades by SMM strategy in terms of BTC", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "decimals": 6, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "Total_in_BTC" }, "properties": [ { "id": "displayName", "value": "Total in base" } ] }, { "matcher": { "id": "byName", "options": "USD" }, "properties": [ { "id": "unit", "value": "currencyUSD" } ] }, { "matcher": { "id": "byName", "options": "Total_in_BTC" }, "properties": [ { "id": "unit", "value": "currencyUSD" } ] } ] }, "gridPos": { "h": 11, "w": 4, "x": 0, "y": 0 }, "id": 8, "options": { "colorMode": "background", "graphMode": "none", "justifyMode": "center", "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "text": {}, "textMode": "value_and_name" }, "pluginVersion": "10.1.2", "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "fdr_market_balance{asset=\"$quote\", exchange=\"kraken\", pair=\"$pair\"}", "hide": false, "legendFormat": "{{asset}}", "range": true, "refId": "BTC_balance" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "fdr_market_balance{asset=\"$base\", exchange=\"kraken\", pair=\"$pair\"}", "hide": false, "legendFormat": "{{asset}}", "range": true, "refId": "ETH_balance" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "fdr_ticker_last_price{pair=\"$pair\"}", "hide": true, "legendFormat": "__auto", "range": true, "refId": "ETH_price_in_BTC" }, { "datasource": { "name": "Expression", "type": "__expr__", "uid": "__expr__" }, "expression": "$ETH_balance * $ETH_price_in_BTC + $BTC_balance", "hide": false, "refId": "Total_in_BTC", "type": "math" } ], "title": "Balances ", "type": "stat" }, { "datasource": { "type": "postgres", "uid": "postgresql" }, "fieldConfig": { "defaults": { "color": { "mode": "continuous-BlPu" }, "decimals": 7, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "USD Volume BUY" }, "properties": [ { "id": "unit", "value": "currencyUSD" } ] }, { "matcher": { "id": "byName", "options": "USD Volume SELL" }, "properties": [ { "id": "unit", "value": "currencyUSD" } ] } ] }, "gridPos": { "h": 14, "w": 4, "x": 4, "y": 0 }, "id": 16, "options": { "colorMode": "background", "graphMode": "area", "justifyMode": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "textMode": "auto" }, "pluginVersion": "10.1.2", "targets": [ { "datasource": { "type": "postgres", "uid": "postgresql" }, "editorMode": "code", "expr": "", "format": "table", "hide": true, "legendFormat": "__auto", "range": true, "rawQuery": true, "rawSql": "SELECT order_side, SUM(cost) / SUM(volume) FROM trades WHERE (base = '$base' AND quote = '$quote') GROUP BY order_side", "refId": "average_cost", "sql": { "columns": [ { "name": "SUM", "parameters": [ { "name": "price", "type": "functionParameter" } ], "type": "function" }, { "name": "SUM", "parameters": [ { "name": "volume", "type": "functionParameter" } ], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50, "whereJsonTree": { "children1": [ { "id": "a9b9899a-4567-489a-bcde-f1892437099a", "properties": { "field": "base", "operator": "equal", "value": [ "DOT" ], "valueSrc": [ "value" ], "valueType": [ "text" ] }, "type": "rule" }, { "id": "9abaaa8a-0123-4456-b89a-b18924372452", "properties": { "field": "quote", "operator": "equal", "value": [ "USD" ], "valueSrc": [ "value" ], "valueType": [ "text" ] }, "type": "rule" } ], "id": "b88b999b-89ab-4cde-b012-318922568302", "type": "group" }, "whereString": "(base = 'DOT' AND quote = 'USD')" }, "table": "trades" }, { "datasource": { "type": "postgres", "uid": "postgresql" }, "editorMode": "code", "expr": "SELECT order_side, SUM(volume) AS \"$base Volume\" FROM trades WHERE (base = '$base' AND quote = '$quote') GROUP BY order_side", "format": "table", "hide": false, "legendFormat": "__auto", "range": true, "rawQuery": true, "rawSql": "SELECT order_side, SUM(volume) AS \"DOT Volume\" FROM trades WHERE (base = '$base' AND quote = '$quote') GROUP BY order_side", "refId": "dot_volume", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "name": "Expression", "type": "__expr__", "uid": "__expr__" }, "expression": "$dot_volume * $average_cost", "hide": false, "refId": "USD Volume", "type": "math" } ], "title": "Volume", "type": "stat" }, { "datasource": { "type": "postgres", "uid": "postgresql" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "decimals": 6, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] } }, "overrides": [] }, "gridPos": { "h": 14, "w": 4, "x": 8, "y": 0 }, "id": 35, "options": { "colorMode": "background", "graphMode": "none", "justifyMode": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "textMode": "auto" }, "pluginVersion": "10.1.2", "targets": [ { "datasource": { "name": "Expression", "type": "__expr__", "uid": "__expr__" }, "expression": "$net_proceeds - $cost_basis - $fees", "hide": false, "refId": "gain_or_loss", "type": "math" }, { "datasource": { "name": "Expression", "type": "__expr__", "uid": "__expr__" }, "expression": "$vwap_sell - $average_cost", "hide": false, "refId": "vwap_delta", "type": "math" }, { "datasource": { "type": "postgres", "uid": "postgresql" }, "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT\r\n SUM(cost) / SUM(volume) AS average_cost\r\nFROM\r\n trades\r\nWHERE\r\n base = '$base' AND quote = '$quote' AND order_side = 'BUY' AND $__timeFilter(created_at)", "refId": "average_cost", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "type": "postgres", "uid": "postgresql" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT\r\n SUM(cost) / SUM(volume) AS vwap_sell\r\nFROM\r\n trades\r\nWHERE\r\n base = '$base' AND quote = '$quote' AND order_side = 'SELL' AND $__timeFilter(created_at)", "refId": "vwap_sell", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "type": "postgres", "uid": "postgresql" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT SUM(volume) AS volume_sold FROM trades WHERE order_side = 'SELL' AND base = '$base' AND quote = '$quote' AND $__timeFilter(created_at)", "refId": "volume_sold", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "type": "postgres", "uid": "postgresql" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT SUM(volume) AS volume_bought FROM trades WHERE order_side = 'BUY' AND base = '$base' AND quote = '$quote' AND $__timeFilter(created_at)", "refId": "volume_bought", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "name": "Expression", "type": "__expr__", "uid": "__expr__" }, "expression": "$volume_sold * $average_cost", "hide": false, "refId": "cost_basis", "type": "math" }, { "datasource": { "type": "postgres", "uid": "postgresql" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT SUM(cost) AS net_proceeds FROM trades WHERE order_side = 'SELL' AND base = '$base' AND quote = '$quote' AND $__timeFilter(created_at)", "refId": "net_proceeds", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "type": "postgres", "uid": "postgresql" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT SUM(fee) AS FEE FROM trades WHERE base = '$base' AND quote = '$quote' AND $__timeFilter(time)", "refId": "fees", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Profit and Loss 2", "type": "stat" }, { "datasource": { "type": "postgres", "uid": "postgresql" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "Sells" }, "properties": [ { "id": "color", "value": { "fixedColor": "red", "mode": "fixed" } } ] } ] }, "gridPos": { "h": 3, "w": 4, "x": 12, "y": 0 }, "id": 29, "options": { "displayMode": "gradient", "minVizHeight": 10, "minVizWidth": 0, "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": true }, "showUnfilled": true, "valueMode": "color" }, "pluginVersion": "10.1.2", "targets": [ { "datasource": { "type": "postgres", "uid": "postgresql" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT\r\n COUNT(*) AS \"Buys\"\r\nFROM\r\n orders\r\nWHERE\r\n quote = '$quote' AND base = '$base' AND order_side = 'BUY' AND $__timeFilter(created_at)\r\n", "refId": "Buys", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "type": "postgres", "uid": "postgresql" }, "editorMode": "code", "expr": "", "format": "table", "legendFormat": "__auto", "range": true, "rawQuery": true, "rawSql": "SELECT\r\n COUNT(*) AS \"Sells\"\r\nFROM\r\n orders\r\nWHERE\r\n quote = '$quote' AND base = '$base' AND order_side = 'SELL' AND $__timeFilter(created_at)\r\n", "refId": "Sells", "sql": { "columns": [ { "name": "COUNT", "parameters": [ { "name": "*", "type": "functionParameter" } ], "type": "function" } ], "groupBy": [ { "property": { "name": "order_side", "type": "string" }, "type": "groupBy" } ], "limit": 50, "whereJsonTree": { "children1": [ { "id": "ab9bba9a-cdef-4012-b456-71892428a8bd", "properties": { "field": "quote", "operator": "equal", "value": [ "$quote" ], "valueSrc": [ "value" ], "valueType": [ "text" ] }, "type": "rule" }, { "id": "89ba9b8a-89ab-4cde-b012-31892428cf41", "properties": { "field": "base", "operator": "equal", "value": [ "$base" ], "valueSrc": [ "value" ], "valueType": [ "text" ] }, "type": "rule" } ], "id": "b88b999b-89ab-4cde-b012-318922568302", "type": "group" }, "whereString": "(quote = '$quote' AND base = '$base')" }, "table": "trades" } ], "title": "Order Count by Side", "type": "bargauge" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "decimals": 6, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "Sell" }, "properties": [ { "id": "color", "value": { "fixedColor": "red", "mode": "fixed" } } ] } ] }, "gridPos": { "h": 4, "w": 4, "x": 16, "y": 0 }, "id": 10, "options": { "colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "textMode": "auto" }, "pluginVersion": "10.1.2", "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "avg(fdr_trade_price{pair=\"$pair\", side=\"Buy\", strategy=\"MARKET_MAKER_ON_TICKER\"})", "legendFormat": "Buy", "range": true, "refId": "A" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "avg(fdr_trade_price{pair=\"$pair\", side=\"Sell\", strategy=\"MARKET_MAKER_ON_TICKER\"})", "hide": false, "legendFormat": "Sell", "range": true, "refId": "B" } ], "title": "Trade Price Avg", "type": "stat" }, { "datasource": { "type": "postgres", "uid": "postgresql" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "Sells" }, "properties": [ { "id": "color", "value": { "fixedColor": "red", "mode": "fixed" } } ] } ] }, "gridPos": { "h": 3, "w": 4, "x": 12, "y": 3 }, "id": 30, "options": { "displayMode": "gradient", "minVizHeight": 10, "minVizWidth": 0, "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": true }, "showUnfilled": true, "valueMode": "color" }, "pluginVersion": "10.1.2", "targets": [ { "datasource": { "type": "postgres", "uid": "postgresql" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT\r\n COUNT(*) AS \"Buys\"\r\nFROM\r\n orders\r\nWHERE\r\n quote = '$quote' AND base = '$base' AND order_side = 'BUY' AND order_status = 'CANCELLED' AND $__timeFilter(created_at)\r\n", "refId": "Buys", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "type": "postgres", "uid": "postgresql" }, "editorMode": "code", "expr": "", "format": "table", "legendFormat": "__auto", "range": true, "rawQuery": true, "rawSql": "SELECT\r\n COUNT(*) AS \"Sells\"\r\nFROM\r\n orders\r\nWHERE\r\n quote = '$quote' AND base = '$base' AND order_side = 'SELL' AND order_status = 'CANCELLED' AND $__timeFilter(created_at)\r\n", "refId": "Sells", "sql": { "columns": [ { "name": "COUNT", "parameters": [ { "name": "*", "type": "functionParameter" } ], "type": "function" } ], "groupBy": [ { "property": { "name": "order_side", "type": "string" }, "type": "groupBy" } ], "limit": 50, "whereJsonTree": { "children1": [ { "id": "ab9bba9a-cdef-4012-b456-71892428a8bd", "properties": { "field": "quote", "operator": "equal", "value": [ "$quote" ], "valueSrc": [ "value" ], "valueType": [ "text" ] }, "type": "rule" }, { "id": "89ba9b8a-89ab-4cde-b012-31892428cf41", "properties": { "field": "base", "operator": "equal", "value": [ "$base" ], "valueSrc": [ "value" ], "valueType": [ "text" ] }, "type": "rule" } ], "id": "b88b999b-89ab-4cde-b012-318922568302", "type": "group" }, "whereString": "(quote = '$quote' AND base = '$base')" }, "table": "trades" } ], "title": "Cancel Count by Side", "type": "bargauge" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "description": "Total volume times average cost", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "decimals": 6, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "Buy" }, "properties": [ { "id": "displayName", "value": "Buy" } ] }, { "matcher": { "id": "byName", "options": "Sell" }, "properties": [ { "id": "displayName", "value": "Sell" }, { "id": "color", "value": { "fixedColor": "red", "mode": "fixed" } } ] } ] }, "gridPos": { "h": 4, "w": 4, "x": 16, "y": 4 }, "id": 11, "options": { "colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "textMode": "auto" }, "pluginVersion": "10.1.2", "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "avg(fdr_trade_price{pair=\"$pair\", side=\"Buy\"})", "hide": true, "legendFormat": "__auto", "range": true, "refId": "avg_price_buy" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "avg(fdr_trade_price{pair=\"$pair\", side=\"Sell\"})", "hide": true, "legendFormat": "__auto", "range": true, "refId": "avg_price_sell" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "fdr_trade_volume{pair=\"$pair\", side=\"Buy\", strategy=\"MARKET_MAKER_ON_TICKER\"}", "hide": true, "legendFormat": "__auto", "range": true, "refId": "total_volume_buy" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "fdr_trade_volume{pair=\"$pair\", side=\"Sell\", strategy=\"MARKET_MAKER_ON_TICKER\"}", "hide": true, "legendFormat": "__auto", "range": true, "refId": "total_volume_sell" }, { "datasource": { "name": "Expression", "type": "__expr__", "uid": "__expr__" }, "expression": "$avg_price_buy * $total_volume_buy", "hide": false, "refId": "Buy", "type": "math" }, { "datasource": { "name": "Expression", "type": "__expr__", "uid": "__expr__" }, "expression": "$avg_price_sell * $total_volume_sell", "hide": false, "refId": "Sell", "type": "math" } ], "title": "Volume * Avg Price", "type": "stat" }, { "datasource": { "type": "postgres", "uid": "postgresql" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "Sells" }, "properties": [ { "id": "color", "value": { "fixedColor": "red", "mode": "fixed" } } ] } ] }, "gridPos": { "h": 4, "w": 4, "x": 12, "y": 6 }, "id": 7, "options": { "displayMode": "gradient", "minVizHeight": 10, "minVizWidth": 0, "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": true }, "showUnfilled": true, "valueMode": "color" }, "pluginVersion": "10.1.2", "targets": [ { "datasource": { "type": "postgres", "uid": "postgresql" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT\r\n COUNT(*) AS \"Buys\"\r\nFROM\r\n trades\r\nWHERE\r\n quote = '$quote' AND base = '$base' AND order_side = 'BUY' AND $__timeFilter(time)\r\n", "refId": "Buys", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "type": "postgres", "uid": "postgresql" }, "editorMode": "code", "expr": "", "format": "table", "legendFormat": "__auto", "range": true, "rawQuery": true, "rawSql": "SELECT\r\n COUNT(*) AS \"Sells\"\r\nFROM\r\n trades\r\nWHERE\r\n quote = '$quote' AND base = '$base' AND order_side = 'SELL' AND $__timeFilter(time)\r\n", "refId": "Sells", "sql": { "columns": [ { "name": "COUNT", "parameters": [ { "name": "*", "type": "functionParameter" } ], "type": "function" } ], "groupBy": [ { "property": { "name": "order_side", "type": "string" }, "type": "groupBy" } ], "limit": 50, "whereJsonTree": { "children1": [ { "id": "ab9bba9a-cdef-4012-b456-71892428a8bd", "properties": { "field": "quote", "operator": "equal", "value": [ "$quote" ], "valueSrc": [ "value" ], "valueType": [ "text" ] }, "type": "rule" }, { "id": "89ba9b8a-89ab-4cde-b012-31892428cf41", "properties": { "field": "base", "operator": "equal", "value": [ "$base" ], "valueSrc": [ "value" ], "valueType": [ "text" ] }, "type": "rule" } ], "id": "b88b999b-89ab-4cde-b012-318922568302", "type": "group" }, "whereString": "(quote = '$quote' AND base = '$base')" }, "table": "trades" } ], "title": "Trade Count by Side", "type": "bargauge" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "Sell" }, "properties": [ { "id": "color", "value": { "fixedColor": "red", "mode": "fixed" } } ] } ] }, "gridPos": { "h": 4, "w": 4, "x": 12, "y": 10 }, "id": 20, "options": { "orientation": "vertical", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showThresholdLabels": false, "showThresholdMarkers": true }, "pluginVersion": "10.1.2", "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "increase(fdr_trade_count{pair=\"$pair\", strategy=\"MARKET_MAKER_ON_TICKER\"}[1h])", "legendFormat": "{{side}}", "range": true, "refId": "A" } ], "title": "Trade Count by Side per hour", "type": "gauge" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "fieldConfig": { "defaults": { "color": { "fixedColor": "dark-orange", "mode": "fixed" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] }, "unit": "currencyUSD" }, "overrides": [] }, "gridPos": { "h": 3, "w": 4, "x": 0, "y": 11 }, "id": 14, "options": { "colorMode": "background", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "reduceOptions": { "calcs": [ "diff" ], "fields": "", "values": false }, "textMode": "auto" }, "pluginVersion": "10.1.2", "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "fdr_market_balance{asset=\"$quote\", pair=\"$pair\"}", "hide": true, "legendFormat": "{{asset}}", "range": true, "refId": "BTC" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "fdr_market_balance{asset=\"$base\", pair=\"$pair\"}", "hide": true, "legendFormat": "{{asset}}", "range": true, "refId": "ETH" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "fdr_ticker_last_price{pair=\"$pair\"}", "hide": true, "legendFormat": "__auto", "range": true, "refId": "price" }, { "datasource": { "name": "Expression", "type": "__expr__", "uid": "__expr__" }, "expression": "($price * $ETH) + $BTC", "hide": false, "refId": "A", "type": "math" } ], "title": "Gain in Base", "type": "stat" }, { "datasource": { "type": "datasource", "uid": "-- Mixed --" }, "description": "Prices at time of buy and sell order execution", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "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": 0.5, "pointSize": 3, "scaleDistribution": { "type": "linear" }, "showPoints": "always", "spanNulls": true, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "decimals": 6, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "sell_price" }, "properties": [ { "id": "color", "value": { "fixedColor": "red", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Ticker" }, "properties": [ { "id": "custom.lineWidth", "value": 0 }, { "id": "custom.lineStyle", "value": { "dash": [ 10, 10 ], "fill": "dash" } }, { "id": "custom.drawStyle", "value": "line" }, { "id": "custom.showPoints", "value": "auto" }, { "id": "custom.fillOpacity", "value": 10 }, { "id": "color", "value": { "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "buy_price" }, "properties": [ { "id": "displayName", "value": "Buy Price" } ] }, { "matcher": { "id": "byName", "options": "sell_price" }, "properties": [ { "id": "displayName", "value": "Sell Price" } ] }, { "matcher": { "id": "byName", "options": "volume" }, "properties": [ { "id": "unit", "value": "none" }, { "id": "custom.axisPlacement", "value": "right" }, { "id": "custom.fillOpacity", "value": 6 }, { "id": "custom.showPoints", "value": "never" }, { "id": "custom.lineStyle", "value": { "dash": [ 0, 10 ], "fill": "dot" } }, { "id": "custom.lineWidth", "value": 0 } ] } ] }, "gridPos": { "h": 7, "w": 12, "x": 0, "y": 14 }, "id": 5, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true }, "timezone": [ "", "" ], "tooltip": { "mode": "multi", "sort": "none" } }, "targets": [ { "datasource": { "type": "postgres", "uid": "postgresql" }, "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT time,\r\nMAX(CASE WHEN order_side = 'BUY' THEN price END) AS buy_price, \r\nMAX(CASE WHEN order_side = 'SELL' THEN price END) AS sell_price\r\nFROM trades WHERE $__timeFilter(time) AND base = '$base' AND quote = '$quote' AND (order_side = 'BUY' OR order_side = 'SELL') GROUP BY time", "refId": "trades", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "fdr_ticker_last_price{pair=\"$pair\", exchange=\"kraken\"}", "hide": false, "legendFormat": "Ticker", "range": true, "refId": "ticker" }, { "datasource": { "type": "postgres", "uid": "postgresql" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT time,\r\nvolume AS Volume\r\nFROM trades WHERE $__timeFilter(time) AND base = '$base' AND quote = '$quote' AND (order_side = 'BUY' OR order_side = 'SELL') GROUP BY time, volume", "refId": "volume", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Trade Prices", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "description": "Balances for assets being trades by MM strategy in terms of the Quote asset", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "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": 6, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "ETH_balance_in_BTC" }, "properties": [ { "id": "color", "value": { "fixedColor": "#8a8a93", "mode": "fixed" } }, { "id": "displayName", "value": "Base in Quote" } ] }, { "matcher": { "id": "byName", "options": "Total in Quote" }, "properties": [ { "id": "displayName", "value": "Total in Quote" } ] } ] }, "gridPos": { "h": 7, "w": 12, "x": 12, "y": 14 }, "id": 2, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "single", "sort": "none" } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "fdr_market_balance{pair=\"$pair\", asset=\"$quote\"}", "hide": false, "legendFormat": "{{asset}}", "range": true, "refId": "quote_balance" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "fdr_market_balance{pair=\"$pair\", asset=\"$base\"}", "hide": true, "legendFormat": "{{asset}}", "range": true, "refId": "base_balance" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "exemplar": false, "expr": "fdr_ticker_last_price{pair=\"$pair\"}", "hide": true, "instant": false, "interval": "", "legendFormat": "{{pair}}", "range": true, "refId": "quote_price" }, { "datasource": { "name": "Expression", "type": "__expr__", "uid": "__expr__" }, "expression": "$base_balance * $quote_price", "hide": false, "refId": "base_balance_in_quote", "type": "math" }, { "datasource": { "name": "Expression", "type": "__expr__", "uid": "__expr__" }, "expression": "$base_balance_in_quote + $quote_balance", "hide": false, "refId": "Total in Quote", "type": "math" } ], "title": "Balances (Quote)", "type": "timeseries" }, { "datasource": { "type": "datasource", "uid": "-- Mixed --" }, "description": "Prices at time of buy and sell order execution", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "points", "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 4, "scaleDistribution": { "type": "linear" }, "showPoints": "auto", "spanNulls": true, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "decimals": 6, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "sell_price" }, "properties": [ { "id": "color", "value": { "fixedColor": "red", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Ticker" }, "properties": [ { "id": "custom.lineStyle", "value": { "fill": "solid" } }, { "id": "custom.fillOpacity", "value": 10 }, { "id": "custom.drawStyle", "value": "line" }, { "id": "color", "value": { "mode": "fixed" } }, { "id": "custom.lineWidth", "value": 0 } ] }, { "matcher": { "id": "byName", "options": "buy_price" }, "properties": [ { "id": "displayName", "value": "Buy Price" } ] }, { "matcher": { "id": "byName", "options": "sell_price" }, "properties": [ { "id": "displayName", "value": "Sell Price" } ] }, { "matcher": { "id": "byName", "options": "C" }, "properties": [ { "id": "custom.fillOpacity", "value": 0 }, { "id": "custom.drawStyle", "value": "line" } ] }, { "matcher": { "id": "byName", "options": "Fake Order: 1.8 Buy" }, "properties": [ { "id": "color", "value": { "fixedColor": "yellow", "mode": "fixed" } } ] }, { "__systemRef": "hideSeriesFrom", "matcher": { "id": "byNames", "options": { "mode": "exclude", "names": [ "Buy Price", "Sell Price", "buy_trade", "sell_trade", "Ticker" ], "prefix": "All except:", "readOnly": true } }, "properties": [ { "id": "custom.hideFrom", "value": { "legend": false, "tooltip": false, "viz": true } } ] } ] }, "gridPos": { "h": 7, "w": 12, "x": 0, "y": 21 }, "id": 32, "options": { "legend": { "calcs": [ "lastNotNull" ], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "single", "sort": "none" } }, "pluginVersion": "9.3.2", "targets": [ { "datasource": { "type": "postgres", "uid": "postgresql" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT created_at,\r\nMAX(CASE WHEN order_side = 'BUY' THEN price END) AS buy_price, \r\nMAX(CASE WHEN order_side = 'SELL' THEN price END) AS sell_price\r\nFROM orders WHERE $__timeFilter(created_at) AND base = '$base' AND quote = '$quote' AND (order_side = 'BUY' OR order_side = 'SELL') GROUP BY created_at", "refId": "buys", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "fdr_ticker_last_price{pair=\"$pair\", exchange=\"kraken\"}", "hide": false, "legendFormat": "Ticker", "range": true, "refId": "A" }, { "datasource": { "type": "postgres", "uid": "postgresql" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT time,\r\nMAX(CASE WHEN order_side = 'BUY' THEN price END) AS buy_trade, \r\nMAX(CASE WHEN order_side = 'SELL' THEN price END) AS sell_trade\r\nFROM trades WHERE $__timeFilter(time) AND base = '$base' AND quote = '$quote' AND (order_side = 'BUY' OR order_side = 'SELL') GROUP BY time", "refId": "B", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "exemplar": false, "expr": "fdr_fake_order_market_maker_on_ticker{exchange=\"kraken\", pair=\"$pair\", strategy=\"MARKET_MAKER_ON_TICKER\"}", "hide": false, "instant": false, "legendFormat": "{{side}}: {{coefficient}}", "range": true, "refId": "fake_orders" } ], "title": "Order Prices", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "description": "Total balance of assets traded by SMM, converted to BTC.", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "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": 6, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "{__name__=\"fdr_s003_balance\", asset=\"BTC\", exchange=\"kraken\", instance=\"host.docker.internal:4001\", job=\"strat-stable-market-maker-local\"}" }, "properties": [ { "id": "color", "value": { "fixedColor": "orange", "mode": "fixed" } }, { "id": "displayName", "value": "BTC Balance" } ] }, { "matcher": { "id": "byName", "options": "ETH_balance_in_BTC" }, "properties": [ { "id": "color", "value": { "fixedColor": "#8a8a93", "mode": "fixed" } }, { "id": "displayName", "value": "ETH Balance (BTC)" } ] }, { "matcher": { "id": "byName", "options": "Total_in_BTC" }, "properties": [ { "id": "displayName", "value": "Quote + Base (Quote)" } ] } ] }, "gridPos": { "h": 7, "w": 12, "x": 12, "y": 21 }, "id": 12, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "single", "sort": "none" } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "fdr_market_balance{pair=\"$pair\", asset=\"$quote\"}", "hide": true, "legendFormat": "__auto", "range": true, "refId": "BTC_balance" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "fdr_market_balance{pair=\"$pair\", asset=\"$base\"}", "hide": true, "legendFormat": "__auto", "range": true, "refId": "ETH_balance" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "exemplar": false, "expr": "fdr_ticker_last_price{pair=\"$pair\"}", "hide": true, "instant": false, "interval": "", "legendFormat": "__auto", "range": true, "refId": "BTC_price" }, { "datasource": { "name": "Expression", "type": "__expr__", "uid": "__expr__" }, "expression": "$ETH_balance * $BTC_price", "hide": true, "refId": "ETH_balance_in_BTC", "type": "math" }, { "datasource": { "name": "Expression", "type": "__expr__", "uid": "__expr__" }, "expression": "$BTC_balance + $ETH_balance_in_BTC", "hide": false, "refId": "Total_in_BTC", "type": "math" } ], "title": "Total Balance (Quote)", "type": "timeseries" }, { "datasource": { "type": "datasource", "uid": "-- Mixed --" }, "description": "Prices at time of buy and sell order execution", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "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": 6, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "Ticker" }, "properties": [ { "id": "custom.lineStyle", "value": { "fill": "solid" } }, { "id": "custom.fillOpacity", "value": 10 }, { "id": "custom.drawStyle", "value": "line" }, { "id": "color", "value": { "mode": "fixed" } } ] } ] }, "gridPos": { "h": 7, "w": 12, "x": 0, "y": 28 }, "id": 33, "options": { "legend": { "calcs": [ "lastNotNull" ], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "single", "sort": "none" } }, "pluginVersion": "9.3.2", "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "fdr_ticker_last_price{pair=\"$pair\", exchange=\"kraken\"}", "hide": false, "legendFormat": "Ticker", "range": true, "refId": "A" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "exemplar": false, "expr": "fdr_fake_order_market_maker_on_ticker{exchange=\"kraken\", pair=\"$pair\", strategy=\"MARKET_MAKER_ON_TICKER\"}", "hide": false, "instant": false, "legendFormat": "{{side}}: {{coefficient}}", "range": true, "refId": "fake_orders" }, { "datasource": { "type": "postgres", "uid": "postgresql" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT created_at,\r\nMAX(CASE WHEN order_side = 'BUY' THEN price END) AS buy_price, \r\nMAX(CASE WHEN order_side = 'SELL' THEN price END) AS sell_price\r\nFROM orders WHERE $__timeFilter(created_at) AND base = '$base' AND quote = '$quote' AND (order_side = 'BUY' OR order_side = 'SELL') GROUP BY created_at", "refId": "B", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Fake Orders", "type": "timeseries" }, { "datasource": { "type": "datasource", "uid": "-- Mixed --" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "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": { "dash": [ 10, 10 ], "fill": "dash" }, "lineWidth": 0.5, "pointSize": 3, "scaleDistribution": { "type": "linear" }, "showPoints": "auto", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "decimals": 8, "mappings": [], "noValue": "-", "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] }, "unit": "none" }, "overrides": [ { "matcher": { "id": "byName", "options": "Ticker" }, "properties": [ { "id": "custom.fillOpacity", "value": 6 }, { "id": "custom.lineStyle", "value": { "dash": [ 10, 10 ], "fill": "dash" } }, { "id": "color", "value": { "mode": "fixed" } }, { "id": "custom.lineWidth", "value": 0 } ] }, { "matcher": { "id": "byName", "options": "sell_price" }, "properties": [ { "id": "custom.drawStyle", "value": "points" } ] }, { "matcher": { "id": "byName", "options": "buy_price" }, "properties": [ { "id": "color", "value": { "fixedColor": "green", "mode": "fixed" } }, { "id": "custom.drawStyle", "value": "points" }, { "id": "custom.lineInterpolation", "value": "stepAfter" } ] }, { "matcher": { "id": "byName", "options": "Average Sell" }, "properties": [ { "id": "custom.lineStyle", "value": { "fill": "solid" } }, { "id": "color", "value": { "fixedColor": "super-light-purple", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Average Cost" }, "properties": [ { "id": "color", "value": { "fixedColor": "super-light-yellow", "mode": "fixed" } }, { "id": "custom.lineStyle", "value": { "fill": "solid" } }, { "id": "custom.spanNulls", "value": false } ] }, { "matcher": { "id": "byName", "options": "volume" }, "properties": [ { "id": "unit", "value": "none" }, { "id": "custom.axisPlacement", "value": "right" }, { "id": "custom.fillOpacity", "value": 6 }, { "id": "custom.lineWidth", "value": 0 } ] } ] }, "gridPos": { "h": 8, "w": 12, "x": 12, "y": 28 }, "id": 38, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "fdr_tvwap_market_maker_on_ticker{exchange=\"kraken\", pair=\"$pair\", side=\"Buy\", kind=\"VwapBuckets\"} > 2", "hide": false, "legendFormat": "Average Cost", "range": true, "refId": "average_cost" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "fdr_tvwap_market_maker_on_ticker{exchange=\"kraken\", pair=\"$pair\", side=\"Sell\", kind=\"VwapBuckets\"} > 2", "hide": false, "legendFormat": "Average Sell", "range": true, "refId": "average_sell" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "exemplar": false, "expr": "fdr_ticker_last_price{pair=\"$pair\", exchange=\"kraken\"}", "hide": false, "instant": false, "interval": "", "legendFormat": "Ticker", "range": true, "refId": "ticker" }, { "datasource": { "type": "postgres", "uid": "postgresql" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT time,\r\nMAX(CASE WHEN order_side = 'BUY' THEN price END) AS buy_price, \r\nMAX(CASE WHEN order_side = 'SELL' THEN price END) AS sell_price\r\nFROM trades WHERE $__timeFilter(time) AND base = '$base' AND quote = '$quote' AND (order_side = 'BUY' OR order_side = 'SELL') GROUP BY time", "refId": "A", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "type": "postgres", "uid": "postgresql" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT time,\r\nvolume AS Volume\r\nFROM trades WHERE $__timeFilter(time) AND base = '$base' AND quote = '$quote' AND (order_side = 'BUY' OR order_side = 'SELL') GROUP BY time, volume", "refId": "B", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Volume Weighted Average Buy / Sell from prom", "type": "timeseries" }, { "datasource": { "type": "datasource", "uid": "-- Mixed --" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "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": "Ticker" }, "properties": [ { "id": "custom.fillOpacity", "value": 6 }, { "id": "custom.lineStyle", "value": { "dash": [ 10, 10 ], "fill": "dash" } } ] }, { "matcher": { "id": "byName", "options": "sell_price" }, "properties": [ { "id": "custom.drawStyle", "value": "points" } ] }, { "matcher": { "id": "byName", "options": "buy_price" }, "properties": [ { "id": "color", "value": { "fixedColor": "green", "mode": "fixed" } }, { "id": "custom.drawStyle", "value": "points" } ] }, { "matcher": { "id": "byName", "options": "average_sell" }, "properties": [ { "id": "custom.lineStyle", "value": { "dash": [ 0, 10 ], "fill": "dot" } }, { "id": "color", "value": { "fixedColor": "super-light-purple", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "average_cost" }, "properties": [ { "id": "color", "value": { "fixedColor": "super-light-yellow", "mode": "fixed" } }, { "id": "custom.lineStyle", "value": { "dash": [ 0, 10 ], "fill": "dot" } } ] } ] }, "gridPos": { "h": 8, "w": 12, "x": 0, "y": 35 }, "id": 37, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "single", "sort": "none" } }, "targets": [ { "datasource": { "type": "postgres", "uid": "postgresql" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT time,\r\n SUM(cost) / SUM(volume) AS average_cost\r\nFROM\r\n trades\r\nWHERE\r\n base = '$base' AND quote = '$quote' AND order_side = 'BUY' AND $__timeFilter(time) GROUP BY time", "refId": "average_cost", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "type": "postgres", "uid": "postgresql" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT time,\r\n SUM(cost) / SUM(volume) AS average_sell\r\nFROM\r\n trades\r\nWHERE\r\n base = '$base' AND quote = '$quote' AND order_side = 'SELL' AND $__timeFilter(time) GROUP BY time", "refId": "average_sell", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "name": "Expression", "type": "__expr__", "uid": "__expr__" }, "expression": "$average_sell - $average_cost", "hide": true, "reducer": "mean", "refId": "A", "settings": { "mode": "dropNN" }, "type": "math" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "fdr_ticker_last_price{pair=\"$pair\", exchange=\"kraken\"}", "hide": false, "legendFormat": "Ticker", "range": true, "refId": "B" }, { "datasource": { "type": "postgres", "uid": "postgresql" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT time,\r\nMAX(CASE WHEN order_side = 'BUY' THEN price END) AS buy_price, \r\nMAX(CASE WHEN order_side = 'SELL' THEN price END) AS sell_price\r\nFROM trades WHERE $__timeFilter(time) AND base = '$base' AND quote = '$quote' AND (order_side = 'BUY' OR order_side = 'SELL') GROUP BY time", "refId": "trades", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Volume Weighted Average Buy / Sell", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 1, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 2, "scaleDistribution": { "type": "linear" }, "showPoints": "auto", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "decimals": 8, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] }, "unit": "none" }, "overrides": [] }, "gridPos": { "h": 8, "w": 12, "x": 12, "y": 36 }, "id": 40, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "single", "sort": "none" } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "builder", "exemplar": false, "expr": "fdr_tvwap_market_maker_on_ticker{exchange=\"kraken\", pair=\"$pair\", side=\"Buy\"}", "instant": false, "legendFormat": "__auto", "range": true, "refId": "A" } ], "title": "Panel Title", "type": "timeseries" }, { "datasource": { "type": "postgres", "uid": "postgresql" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "decimals": 7, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "gain_or_loss" }, "properties": [ { "id": "displayName", "value": "Gain or Loss" }, { "id": "unit", "value": "currencyUSD" } ] }, { "matcher": { "id": "byName", "options": "average_cost" }, "properties": [ { "id": "displayName", "value": "Average Cost" } ] }, { "matcher": { "id": "byName", "options": "vwap_delta" }, "properties": [ { "id": "displayName", "value": "Delta" } ] }, { "matcher": { "id": "byName", "options": "cost_basis" }, "properties": [ { "id": "displayName", "value": "Cost Basis" } ] }, { "matcher": { "id": "byName", "options": "vwap_sell" }, "properties": [ { "id": "displayName", "value": "Volume Weight Average Sell" } ] }, { "matcher": { "id": "byName", "options": "volume_sold" }, "properties": [ { "id": "displayName", "value": "Volume Sold" } ] }, { "matcher": { "id": "byName", "options": "net_proceeds" }, "properties": [ { "id": "displayName", "value": "Net Proceeds" } ] }, { "matcher": { "id": "byName", "options": "fee" }, "properties": [ { "id": "displayName", "value": "Fees" } ] } ] }, "gridPos": { "h": 14, "w": 4, "x": 0, "y": 43 }, "id": 26, "options": { "colorMode": "background", "graphMode": "none", "justifyMode": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "textMode": "auto" }, "pluginVersion": "10.1.2", "targets": [ { "datasource": { "name": "Expression", "type": "__expr__", "uid": "__expr__" }, "expression": "$net_proceeds - $cost_basis - $fees", "hide": false, "refId": "gain_or_loss", "type": "math" }, { "datasource": { "name": "Expression", "type": "__expr__", "uid": "__expr__" }, "expression": "$vwap_sell - $average_cost", "hide": false, "refId": "vwap_delta", "type": "math" }, { "datasource": { "type": "postgres", "uid": "postgresql" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT SUM(cost) / SUM(volume) AS average_cost\r\nFROM trades\r\nWHERE order_side = 'BUY' AND base = '$base' AND quote = '$quote'", "refId": "average_cost", "sql": { "columns": [ { "name": "COUNT", "parameters": [ { "name": "*", "type": "functionParameter" } ], "type": "function" } ], "groupBy": [], "limit": 50, "whereJsonTree": { "children1": [ { "id": "b89a88bb-cdef-4012-b456-718922f846e0", "properties": { "field": "base", "operator": "equal", "value": [ "DOT" ], "valueSrc": [ "value" ], "valueType": [ "text" ] }, "type": "rule" }, { "id": "98aaa88a-89ab-4cde-b012-318922f89aa2", "properties": { "field": "quote", "operator": "equal", "value": [ "USD" ], "valueSrc": [ "value" ], "valueType": [ "text" ] }, "type": "rule" } ], "id": "b88b999b-89ab-4cde-b012-318922568302", "type": "group" }, "whereString": "(base = 'DOT' AND quote = 'USD')" }, "table": "trades" }, { "datasource": { "type": "postgres", "uid": "postgresql" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT SUM(cost) / SUM(volume) AS VWAP_SELL FROM trades WHERE order_side = 'SELL' AND base = '$base' AND quote = '$quote'", "refId": "vwap_sell", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "type": "postgres", "uid": "postgresql" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT SUM(volume) AS volume_sold FROM trades WHERE order_side = 'SELL' AND base = '$base' AND quote = '$quote' AND $__timeFilter(time) ", "refId": "volume_sold", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "name": "Expression", "type": "__expr__", "uid": "__expr__" }, "expression": "$volume_sold * $average_cost", "hide": false, "refId": "cost_basis", "type": "math" }, { "datasource": { "type": "postgres", "uid": "postgresql" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT SUM(cost) AS net_proceeds\r\nFROM trades\r\nWHERE order_side = 'SELL' AND base = '$base' AND quote = '$quote' AND $__timeFilter(time) ", "refId": "net_proceeds", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "type": "postgres", "uid": "postgresql" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT SUM(fee) AS FEE FROM trades WHERE base = '$base' AND quote = '$quote'", "refId": "fees", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Average Cost Basis Profit", "type": "stat" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "description": "Balances for assets being trades by SMM strategy in terms of BTC", "fieldConfig": { "defaults": { "color": { "fixedColor": "green", "mode": "palette-classic" }, "custom": { "hideFrom": { "legend": false, "tooltip": false, "viz": false } }, "decimals": 6, "mappings": [] }, "overrides": [ { "matcher": { "id": "byName", "options": "{__name__=\"fdr_s003_balance\", asset=\"BTC\", exchange=\"kraken\", instance=\"host.docker.internal:4001\", job=\"strat-stable-market-maker-local\"}" }, "properties": [ { "id": "color", "value": { "fixedColor": "orange", "mode": "fixed" } }, { "id": "displayName", "value": "BTC Balance" } ] }, { "matcher": { "id": "byName", "options": "ETH_balance_in_BTC" }, "properties": [ { "id": "color", "value": { "fixedColor": "#8a8a93", "mode": "fixed" } }, { "id": "displayName", "value": "ETH Balance (BTC)" } ] } ] }, "gridPos": { "h": 9, "w": 4, "x": 6, "y": 43 }, "id": 3, "options": { "displayLabels": [ "value", "percent" ], "legend": { "displayMode": "list", "placement": "bottom", "showLegend": true, "values": [] }, "pieType": "pie", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "tooltip": { "mode": "single", "sort": "none" } }, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "builder", "expr": "fdr_balance{asset=\"$base\"}", "hide": false, "legendFormat": "{{asset}}", "range": true, "refId": "base" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "fdr_balance{asset=\"$quote\"}", "hide": false, "legendFormat": "{{asset}}", "range": true, "refId": "quote" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "exemplar": false, "expr": "fdr_ticker_last_price{pair=\"$pair\"}", "hide": false, "instant": false, "interval": "", "legendFormat": "__auto", "range": true, "refId": "price" }, { "datasource": { "name": "Expression", "type": "__expr__", "uid": "__expr__" }, "expression": "$base * $price", "hide": false, "refId": "base_in_quote_asset", "type": "math" } ], "title": "Balances (Quote)", "transparent": true, "type": "piechart" } ], "refresh": "5s", "schemaVersion": 38, "style": "dark", "tags": [], "templating": { "list": [ { "current": { "selected": false, "text": "ETH_USD", "value": "ETH_USD" }, "datasource": { "type": "prometheus", "uid": "prometheus" }, "definition": "label_values(pair)", "hide": 0, "includeAll": false, "label": "Pair", "multi": false, "name": "pair", "options": [], "query": { "query": "label_values(pair)", "refId": "StandardVariableQuery" }, "refresh": 1, "regex": "", "skipUrlSync": false, "sort": 0, "type": "query" }, { "current": { "selected": false, "text": "fdr_ticker_last_price{exchange=\"kraken\",instance=\"proxy-kraken:3000\",job=\"proxy-kraken\",pair=\"ETH_USD\"}", "value": "fdr_ticker_last_price{exchange=\"kraken\",instance=\"proxy-kraken:3000\",job=\"proxy-kraken\",pair=\"ETH_USD\"}" }, "datasource": { "type": "prometheus", "uid": "prometheus" }, "definition": "fdr_ticker_last_price{pair=\"$pair\"}", "hide": 2, "includeAll": false, "multi": false, "name": "ticker_price", "options": [], "query": { "query": "fdr_ticker_last_price{pair=\"$pair\"}", "refId": "StandardVariableQuery" }, "refresh": 1, "regex": "", "skipUrlSync": false, "sort": 0, "type": "query" }, { "current": { "selected": false, "text": "USD", "value": "USD" }, "datasource": { "type": "prometheus", "uid": "prometheus" }, "definition": "label_values(asset)", "hide": 0, "includeAll": false, "label": "Quote", "multi": false, "name": "quote", "options": [], "query": { "query": "label_values(asset)", "refId": "StandardVariableQuery" }, "refresh": 1, "regex": "", "skipUrlSync": false, "sort": 0, "type": "query" }, { "current": { "selected": false, "text": "ETH", "value": "ETH" }, "datasource": { "type": "prometheus", "uid": "prometheus" }, "definition": "label_values(asset)", "hide": 0, "includeAll": false, "label": "Base", "multi": false, "name": "base", "options": [], "query": { "query": "label_values(asset)", "refId": "StandardVariableQuery" }, "refresh": 1, "regex": "", "skipUrlSync": false, "sort": 0, "type": "query" } ] }, "time": { "from": "now-1h", "to": "now" }, "timepicker": {}, "timezone": "", "title": "Market Maker", "uid": "WFzb7RRIz", "version": 1, "weekStart": "" }
0
dashboards
/mono/helm/grafana/dashboards/market-maker-test.json
{ "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, "links": [], "liveNow": false, "panels": [ { "datasource": { "type": "grafana-postgresql-datasource", "uid": "${postgres_source}" }, "description": "Balances", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "decimals": 6, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "base_balance" }, "properties": [ { "id": "displayName", "value": "$base" } ] }, { "matcher": { "id": "byName", "options": "quote_balance" }, "properties": [ { "id": "displayName", "value": "$quote" } ] } ] }, "gridPos": { "h": 14, "w": 4, "x": 0, "y": 0 }, "id": 8, "options": { "colorMode": "background", "graphMode": "none", "justifyMode": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showPercentChange": false, "text": {}, "textMode": "value_and_name", "wideLayout": true }, "pluginVersion": "10.4.2", "targets": [ { "datasource": { "type": "postgres", "uid": "${postgres_source}" }, "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT\r\n CASE WHEN vba.asset = '$base' THEN vba.amount END as base_balance,\r\n CASE WHEN vba.asset = '$quote' THEN vba.amount END as quote_balance,\r\n sba.strat_run_id\r\nFROM\r\n virtual_balance_accounts vba\r\nJOIN\r\n strat_balance_accounts sba ON vba.id = sba.vba_id\r\n", "refId": "base_balances", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Balances ", "type": "stat" }, { "datasource": { "type": "postgres", "uid": "${postgres_source}" }, "fieldConfig": { "defaults": { "color": { "mode": "continuous-BlPu" }, "decimals": 7, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "USD Volume BUY" }, "properties": [ { "id": "unit", "value": "currencyUSD" }, { "id": "displayName", "value": "$quote Volume Buy" } ] }, { "matcher": { "id": "byName", "options": "USD Volume SELL" }, "properties": [ { "id": "unit", "value": "currencyUSD" }, { "id": "displayName", "value": "$quote Volume Sell" } ] }, { "matcher": { "id": "byName", "options": "DOT Volume SELL" }, "properties": [ { "id": "displayName", "value": "$base Volume Sell" } ] }, { "matcher": { "id": "byName", "options": "DOT Volume BUY" }, "properties": [ { "id": "displayName", "value": "$base Volume Buy" } ] } ] }, "gridPos": { "h": 14, "w": 4, "x": 4, "y": 0 }, "id": 16, "options": { "colorMode": "background", "graphMode": "area", "justifyMode": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showPercentChange": false, "textMode": "auto", "wideLayout": true }, "pluginVersion": "10.4.2", "targets": [ { "datasource": { "type": "postgres", "uid": "${postgres_source}" }, "editorMode": "code", "expr": "", "format": "table", "hide": true, "legendFormat": "__auto", "range": true, "rawQuery": true, "rawSql": "SELECT\r\n order_side,\r\n SUM(cost) / SUM(volume)\r\nFROM\r\n trades\r\nWHERE\r\n (\r\n base = '$base'\r\n AND quote = '$quote'\r\n AND strat_run_id = '$run_id'\r\n )\r\nGROUP BY\r\n order_side", "refId": "average_cost", "sql": { "columns": [ { "name": "SUM", "parameters": [ { "name": "price", "type": "functionParameter" } ], "type": "function" }, { "name": "SUM", "parameters": [ { "name": "volume", "type": "functionParameter" } ], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50, "whereJsonTree": { "children1": [ { "id": "a9b9899a-4567-489a-bcde-f1892437099a", "properties": { "field": "base", "operator": "equal", "value": [ "DOT" ], "valueSrc": [ "value" ], "valueType": [ "text" ] }, "type": "rule" }, { "id": "9abaaa8a-0123-4456-b89a-b18924372452", "properties": { "field": "quote", "operator": "equal", "value": [ "USD" ], "valueSrc": [ "value" ], "valueType": [ "text" ] }, "type": "rule" } ], "id": "b88b999b-89ab-4cde-b012-318922568302", "type": "group" }, "whereString": "(base = 'DOT' AND quote = 'USD')" }, "table": "trades" }, { "datasource": { "type": "postgres", "uid": "${postgres_source}" }, "editorMode": "code", "expr": "SELECT order_side, SUM(volume) AS \"$base Volume\" FROM trades WHERE (base = '$base' AND quote = '$quote') GROUP BY order_side", "format": "table", "hide": false, "legendFormat": "__auto", "range": true, "rawQuery": true, "rawSql": "SELECT\r\n order_side,\r\n SUM(volume) AS \"DOT Volume\"\r\nFROM\r\n trades\r\nWHERE\r\n (\r\n base = '$base'\r\n AND quote = '$quote'\r\n AND strat_run_id = '$run_id'\r\n )\r\nGROUP BY\r\n order_side", "refId": "dot_volume", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "name": "Expression", "type": "__expr__", "uid": "__expr__" }, "expression": "$dot_volume * $average_cost", "hide": false, "refId": "USD Volume", "type": "math" } ], "title": "Volume", "type": "stat" }, { "datasource": { "type": "postgres", "uid": "${postgres_source}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "decimals": 6, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] } }, "overrides": [] }, "gridPos": { "h": 14, "w": 4, "x": 8, "y": 0 }, "id": 35, "options": { "colorMode": "background", "graphMode": "none", "justifyMode": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showPercentChange": false, "textMode": "auto", "wideLayout": true }, "pluginVersion": "10.4.2", "targets": [ { "datasource": { "name": "Expression", "type": "__expr__", "uid": "__expr__" }, "expression": "$net_proceeds - $cost_basis - $fees", "hide": false, "refId": "gain_or_loss", "type": "math" }, { "datasource": { "name": "Expression", "type": "__expr__", "uid": "__expr__" }, "expression": "$vwap_sell - $average_cost", "hide": false, "refId": "vwap_delta", "type": "math" }, { "datasource": { "type": "postgres", "uid": "${postgres_source}" }, "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT\r\n SUM(cost) / SUM(volume) AS average_cost\r\nFROM\r\n trades\r\nWHERE\r\n base = '$base'\r\n AND quote = '$quote'\r\n AND strat_run_id = '$run_id'\r\n AND order_side = 'BUY'\r\n AND $__timeFilter(created_at)", "refId": "average_cost", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "type": "postgres", "uid": "${postgres_source}" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT\r\n SUM(cost) / SUM(volume) AS vwap_sell\r\nFROM\r\n trades\r\nWHERE\r\n base = '$base'\r\n AND quote = '$quote'\r\n AND strat_run_id = '$run_id'\r\n AND order_side = 'SELL'\r\n AND $__timeFilter(created_at)", "refId": "vwap_sell", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "type": "postgres", "uid": "${postgres_source}" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT\r\n SUM(volume) AS volume_sold\r\nFROM\r\n trades\r\nWHERE\r\n order_side = 'SELL'\r\n AND base = '$base'\r\n AND quote = '$quote'\r\n AND strat_run_id = '$run_id'\r\n AND $__timeFilter(created_at)", "refId": "volume_sold", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "type": "postgres", "uid": "${postgres_source}" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT\r\n SUM(volume) AS volume_bought\r\nFROM\r\n trades\r\nWHERE\r\n order_side = 'BUY'\r\n AND base = '$base'\r\n AND quote = '$quote'\r\n AND strat_run_id = '$run_id'\r\n AND $__timeFilter(created_at)", "refId": "volume_bought", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "name": "Expression", "type": "__expr__", "uid": "__expr__" }, "expression": "$volume_sold * $average_cost", "hide": false, "refId": "cost_basis", "type": "math" }, { "datasource": { "type": "postgres", "uid": "${postgres_source}" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT\r\n SUM(cost) AS net_proceeds\r\nFROM\r\n trades\r\nWHERE\r\n order_side = 'SELL'\r\n AND base = '$base'\r\n AND quote = '$quote'\r\n AND strat_run_id = '$run_id'\r\n AND $__timeFilter(created_at)", "refId": "net_proceeds", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "type": "postgres", "uid": "${postgres_source}" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT\r\n SUM(fee) AS FEE\r\nFROM\r\n trades\r\nWHERE\r\n base = '$base'\r\n AND quote = '$quote'\r\n AND strat_run_id = '$run_id'\r\n AND $__timeFilter(time)", "refId": "fees", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Profit and Loss 2", "type": "stat" }, { "datasource": { "type": "grafana-postgresql-datasource", "uid": "${postgres_source}" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] }, "unit": "percent" }, "overrides": [ { "matcher": { "id": "byName", "options": "average_fill_ratio" }, "properties": [ { "id": "displayName", "value": "Fill Rate" } ] }, { "matcher": { "id": "byName", "options": "fill_percentage" }, "properties": [ { "id": "displayName", "value": "Full Fill" } ] }, { "matcher": { "id": "byName", "options": "average_fill_ratio_sell" }, "properties": [ { "id": "displayName", "value": "Fill Sell" } ] }, { "matcher": { "id": "byName", "options": "average_fill_ratio_buy" }, "properties": [ { "id": "displayName", "value": "Fill Buy" } ] }, { "matcher": { "id": "byName", "options": "fill_percentage_sell" }, "properties": [ { "id": "displayName", "value": "Full Fill Sell" } ] }, { "matcher": { "id": "byName", "options": "fill_percentage_buy" }, "properties": [ { "id": "displayName", "value": "Full Fill Buy" } ] }, { "matcher": { "id": "byName", "options": "average_amount_filled_sell" }, "properties": [ { "id": "unit", "value": "none" }, { "id": "displayName", "value": "Avg $base Fill Sell" } ] }, { "matcher": { "id": "byName", "options": "average_amount_filled_buy" }, "properties": [ { "id": "unit", "value": "none" }, { "id": "displayName", "value": "Avg $base Fill Buy" } ] }, { "matcher": { "id": "byName", "options": "average_volume_ask_sell" }, "properties": [ { "id": "unit", "value": "none" }, { "id": "displayName", "value": "Avg Volume Sell" } ] }, { "matcher": { "id": "byName", "options": "average_volume_ask_buy" }, "properties": [ { "id": "unit", "value": "none" }, { "id": "displayName", "value": "Avg Volume Buy" } ] } ] }, "gridPos": { "h": 14, "w": 4, "x": 12, "y": 0 }, "id": 43, "options": { "colorMode": "background", "graphMode": "area", "justifyMode": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showPercentChange": false, "textMode": "auto", "wideLayout": true }, "pluginVersion": "10.4.2", "targets": [ { "datasource": { "type": "postgres", "uid": "${postgres_source}" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT\r\n AVG(volume_filled / volume) * 100 AS average_fill_ratio,\r\n CASE WHEN order_side = 'SELL' THEN AVG(volume_filled / volume) * 100 END AS average_fill_ratio_sell,\r\n CASE WHEN order_side = 'BUY' THEN AVG(volume_filled / volume) * 100 END AS average_fill_ratio_buy,\r\n CASE WHEN order_side = 'SELL' THEN AVG(volume_filled) END AS average_amount_filled_sell,\r\n CASE WHEN order_side = 'BUY' THEN AVG(volume_filled) END AS average_amount_filled_buy,\r\n CASE WHEN order_side = 'SELL' THEN AVG(volume) END AS average_volume_ask_sell,\r\n CASE WHEN order_side = 'BUY' THEN AVG(volume) END AS average_volume_ask_buy\r\nFROM\r\n orders\r\nWHERE\r\n volume > 0\r\n AND base = '$base'\r\n AND quote = '$quote'\r\n AND strat_run_id = '$run_id'\r\nGROUP BY order_side", "refId": "% fill", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "type": "postgres", "uid": "${postgres_source}" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT\r\n (\r\n COUNT(*) FILTER (\r\n WHERE\r\n volume_filled = volume\r\n AND volume_filled > 0\r\n AND base = '$base'\r\n AND quote = '$quote'\r\n AND strat_run_id = '$run_id'\r\n ) * 100.0\r\n ) / NULLIF(\r\n COUNT(*) FILTER (\r\n WHERE\r\n volume_filled > 0\r\n ),\r\n 0\r\n ) AS fill_percentage\r\nFROM\r\n orders;", "refId": "% full fill", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "type": "postgres", "uid": "${postgres_source}" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT\r\n (\r\n COUNT(*) FILTER (\r\n WHERE\r\n volume_filled = volume\r\n AND volume_filled > 0\r\n AND base = '$base'\r\n AND quote = '$quote'\r\n AND order_side = 'SELL'\r\n AND strat_run_id = '$run_id'\r\n ) * 100.0\r\n ) / NULLIF(\r\n COUNT(*) FILTER (\r\n WHERE\r\n volume_filled > 0\r\n ),\r\n 0\r\n ) AS fill_percentage_sell\r\nFROM\r\n orders;", "refId": "%full fill sell", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "type": "postgres", "uid": "${postgres_source}" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT\r\n (\r\n COUNT(*) FILTER (\r\n WHERE\r\n volume_filled = volume\r\n AND volume_filled > 0\r\n AND base = '$base'\r\n AND quote = '$quote'\r\n AND order_side = 'SELL'\r\n AND strat_run_id = '$run_id'\r\n ) * 100.0\r\n ) / NULLIF(\r\n COUNT(*) FILTER (\r\n WHERE\r\n volume_filled > 0\r\n ),\r\n 0\r\n ) AS fill_percentage_buy\r\nFROM\r\n orders;", "refId": "%full fill buy", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Order Fill Stats", "type": "stat" }, { "datasource": { "type": "grafana-postgresql-datasource", "uid": "${postgres_source}" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "Max" }, "properties": [ { "id": "color", "value": { "fixedColor": "red", "mode": "palette-classic" } } ] } ] }, "gridPos": { "h": 5, "w": 4, "x": 16, "y": 0 }, "id": 29, "options": { "displayMode": "gradient", "maxVizHeight": 300, "minVizHeight": 10, "minVizWidth": 0, "namePlacement": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": true }, "showUnfilled": true, "sizing": "auto", "valueMode": "color" }, "pluginVersion": "10.4.2", "targets": [ { "datasource": { "type": "postgres", "uid": "${postgres_source}" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT\r\n CASE\r\n WHEN order_side = 'BUY' THEN COUNT(*)\r\n END AS buys,\r\n CASE\r\n WHEN order_side = 'SELL' THEN COUNT(*)\r\n END AS sells\r\nFROM\r\n orders\r\nWHERE\r\n strat_run_id = '$run_id'\r\n AND $__timeFilter(created_at)\r\nGROUP BY\r\n order_side", "refId": "order_count", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Order Count by Side", "transformations": [ { "id": "reduce", "options": {} } ], "type": "bargauge" }, { "datasource": { "type": "postgres", "uid": "${postgres_source}" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "Sells" }, "properties": [ { "id": "color", "value": { "fixedColor": "red", "mode": "fixed" } } ] } ] }, "gridPos": { "h": 5, "w": 4, "x": 16, "y": 5 }, "id": 30, "options": { "displayMode": "gradient", "maxVizHeight": 300, "minVizHeight": 10, "minVizWidth": 0, "namePlacement": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": true }, "showUnfilled": true, "sizing": "auto", "valueMode": "color" }, "pluginVersion": "10.4.2", "targets": [ { "datasource": { "type": "postgres", "uid": "${postgres_source}" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT\r\n COUNT(*) AS \"Buys\"\r\nFROM\r\n orders\r\nWHERE\r\n quote = '$quote'\r\n AND base = '$base'\r\n AND order_side = 'BUY'\r\n AND order_status = 'CANCELLED'\r\n AND $__timeFilter(created_at)", "refId": "Buys", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "type": "postgres", "uid": "${postgres_source}" }, "editorMode": "code", "expr": "", "format": "table", "legendFormat": "__auto", "range": true, "rawQuery": true, "rawSql": "SELECT\r\n COUNT(*) AS \"Sells\"\r\nFROM\r\n orders\r\nWHERE\r\n quote = '$quote'\r\n AND base = '$base'\r\n AND order_side = 'SELL'\r\n AND order_status = 'CANCELLED'\r\n AND $__timeFilter(created_at)", "refId": "Sells", "sql": { "columns": [ { "name": "COUNT", "parameters": [ { "name": "*", "type": "functionParameter" } ], "type": "function" } ], "groupBy": [ { "property": { "name": "order_side", "type": "string" }, "type": "groupBy" } ], "limit": 50, "whereJsonTree": { "children1": [ { "id": "ab9bba9a-cdef-4012-b456-71892428a8bd", "properties": { "field": "quote", "operator": "equal", "value": [ "$quote" ], "valueSrc": [ "value" ], "valueType": [ "text" ] }, "type": "rule" }, { "id": "89ba9b8a-89ab-4cde-b012-31892428cf41", "properties": { "field": "base", "operator": "equal", "value": [ "$base" ], "valueSrc": [ "value" ], "valueType": [ "text" ] }, "type": "rule" } ], "id": "b88b999b-89ab-4cde-b012-318922568302", "type": "group" }, "whereString": "(quote = '$quote' AND base = '$base')" }, "table": "trades" } ], "title": "Cancel Count by Side", "type": "bargauge" }, { "datasource": { "type": "postgres", "uid": "${postgres_source}" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "Sells" }, "properties": [ { "id": "color", "value": { "fixedColor": "red", "mode": "fixed" } } ] } ] }, "gridPos": { "h": 4, "w": 4, "x": 16, "y": 10 }, "id": 7, "options": { "displayMode": "gradient", "maxVizHeight": 300, "minVizHeight": 10, "minVizWidth": 0, "namePlacement": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": true }, "showUnfilled": true, "sizing": "auto", "valueMode": "color" }, "pluginVersion": "10.4.2", "targets": [ { "datasource": { "type": "postgres", "uid": "${postgres_source}" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT\r\n COUNT(*) AS \"Buys\"\r\nFROM\r\n trades\r\nWHERE\r\n quote = '$quote'\r\n AND base = '$base'\r\n AND strat_run_id = '$run_id'\r\n AND order_side = 'BUY'\r\n AND $__timeFilter(time)", "refId": "Buys", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "type": "postgres", "uid": "${postgres_source}" }, "editorMode": "code", "expr": "", "format": "table", "legendFormat": "__auto", "range": true, "rawQuery": true, "rawSql": "SELECT\r\n COUNT(*) AS \"Sells\"\r\nFROM\r\n trades\r\nWHERE\r\n quote = '$quote'\r\n AND base = '$base'\r\n AND strat_run_id = '$run_id'\r\n AND order_side = 'SELL'\r\n AND $__timeFilter(time)", "refId": "Sells", "sql": { "columns": [ { "name": "COUNT", "parameters": [ { "name": "*", "type": "functionParameter" } ], "type": "function" } ], "groupBy": [ { "property": { "name": "order_side", "type": "string" }, "type": "groupBy" } ], "limit": 50, "whereJsonTree": { "children1": [ { "id": "ab9bba9a-cdef-4012-b456-71892428a8bd", "properties": { "field": "quote", "operator": "equal", "value": [ "$quote" ], "valueSrc": [ "value" ], "valueType": [ "text" ] }, "type": "rule" }, { "id": "89ba9b8a-89ab-4cde-b012-31892428cf41", "properties": { "field": "base", "operator": "equal", "value": [ "$base" ], "valueSrc": [ "value" ], "valueType": [ "text" ] }, "type": "rule" } ], "id": "b88b999b-89ab-4cde-b012-318922568302", "type": "group" }, "whereString": "(quote = '$quote' AND base = '$base')" }, "table": "trades" } ], "title": "Trade Count by Side", "type": "bargauge" }, { "datasource": { "type": "datasource", "uid": "-- Mixed --" }, "description": "Prices at time of buy and sell order execution", "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": 0.5, "pointSize": 3, "scaleDistribution": { "type": "linear" }, "showPoints": "always", "spanNulls": true, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "decimals": 6, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "sell_price" }, "properties": [ { "id": "color", "value": { "fixedColor": "red", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "ticker" }, "properties": [ { "id": "custom.lineWidth", "value": 0 }, { "id": "custom.lineStyle", "value": { "dash": [ 10, 10 ], "fill": "dash" } }, { "id": "custom.drawStyle", "value": "line" }, { "id": "custom.showPoints", "value": "auto" }, { "id": "custom.fillOpacity", "value": 10 }, { "id": "color", "value": { "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "buy_price" }, "properties": [ { "id": "displayName", "value": "Buy Price" } ] }, { "matcher": { "id": "byName", "options": "sell_price" }, "properties": [ { "id": "displayName", "value": "Sell Price" } ] }, { "matcher": { "id": "byName", "options": "volume" }, "properties": [ { "id": "unit", "value": "none" }, { "id": "custom.axisPlacement", "value": "right" }, { "id": "custom.fillOpacity", "value": 6 }, { "id": "custom.showPoints", "value": "never" }, { "id": "custom.lineStyle", "value": { "dash": [ 0, 10 ], "fill": "dot" } }, { "id": "custom.lineWidth", "value": 0 } ] } ] }, "gridPos": { "h": 7, "w": 12, "x": 0, "y": 14 }, "id": 5, "options": { "legend": { "calcs": [ "lastNotNull" ], "displayMode": "list", "placement": "bottom", "showLegend": true }, "timezone": [ "", "" ], "tooltip": { "mode": "multi", "sort": "none" } }, "targets": [ { "datasource": { "type": "postgres", "uid": "${postgres_source}" }, "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT\r\n time,\r\n volume as Volume,\r\n MAX(\r\n CASE\r\n WHEN order_side = 'BUY' THEN price\r\n END\r\n ) AS buy_price,\r\n MAX(\r\n CASE\r\n WHEN order_side = 'SELL' THEN price\r\n END\r\n ) AS sell_price\r\nFROM\r\n trades\r\nWHERE\r\n $__timeFilter(time)\r\n AND base = '$base'\r\n AND quote = '$quote'\r\n AND strat_run_id = '$run_id'\r\nGROUP BY\r\n time, volume\r\nORDER BY time", "refId": "trades", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "type": "postgres", "uid": "${postgres_source}" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT\r\n timestamp,\r\n last_price AS ticker\r\nFROM\r\n archive\r\nWHERE\r\n $__timeFilter(timestamp)\r\n AND base = '$base'\r\n AND quote = '$quote'\r\nORDER BY\r\n timestamp;", "refId": "ticker", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Trade Prices", "type": "timeseries" }, { "datasource": { "type": "datasource", "uid": "-- Mixed --" }, "description": "Prices at time of buy and sell order execution", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisBorderShow": false, "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "points", "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 4, "scaleDistribution": { "type": "linear" }, "showPoints": "auto", "spanNulls": true, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "decimals": 6, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "sell_trade" }, "properties": [ { "id": "color", "value": { "fixedColor": "purple", "mode": "fixed" } }, { "id": "custom.pointSize", "value": 3 } ] }, { "matcher": { "id": "byName", "options": "ticker" }, "properties": [ { "id": "custom.lineStyle", "value": { "fill": "solid" } }, { "id": "custom.fillOpacity", "value": 10 }, { "id": "custom.drawStyle", "value": "line" }, { "id": "color", "value": { "mode": "fixed" } }, { "id": "custom.lineWidth", "value": 0 } ] }, { "matcher": { "id": "byName", "options": "buy_price" }, "properties": [ { "id": "displayName", "value": "Buy Price" }, { "id": "custom.pointSize", "value": 3 } ] }, { "matcher": { "id": "byName", "options": "sell_price" }, "properties": [ { "id": "displayName", "value": "Sell Price" }, { "id": "custom.pointSize", "value": 3 }, { "id": "color", "value": { "fixedColor": "red", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "C" }, "properties": [ { "id": "custom.fillOpacity", "value": 0 }, { "id": "custom.drawStyle", "value": "line" } ] }, { "matcher": { "id": "byName", "options": "Fake Order: 1.8 Buy" }, "properties": [ { "id": "color", "value": { "fixedColor": "yellow", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "open_sell_price" }, "properties": [ { "id": "custom.pointSize", "value": 7 }, { "id": "color", "value": { "fixedColor": "super-light-red", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "open_buy_price" }, "properties": [ { "id": "custom.pointSize", "value": 9 }, { "id": "color", "value": { "fixedColor": "super-light-green", "mode": "fixed" } } ] } ] }, "gridPos": { "h": 7, "w": 12, "x": 12, "y": 14 }, "id": 32, "options": { "legend": { "calcs": [ "lastNotNull" ], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "9.3.2", "targets": [ { "datasource": { "type": "postgres", "uid": "${postgres_source}" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT\r\n created_at,\r\n CASE\r\n WHEN order_side = 'BUY'\r\n AND order_status != 'OPEN' THEN price\r\n END AS buy_price,\r\n CASE\r\n WHEN order_side = 'SELL'\r\n AND order_status != 'OPEN' THEN price\r\n END AS sell_price,\r\n CASE\r\n WHEN order_side = 'BUY'\r\n AND order_status = 'OPEN' THEN price\r\n END AS open_buy_price,\r\n CASE\r\n WHEN order_side = 'SELL'\r\n AND order_status = 'OPEN' THEN price\r\n END AS open_sell_price\r\nFROM\r\n orders\r\nWHERE\r\n $__timeFilter(created_at)\r\n AND pair = '$pair'\r\n AND strat_run_id = '$run_id'\r\nGROUP BY\r\n created_at,\r\n sell_price,\r\n buy_price,\r\n order_side,\r\n order_status,\r\n open_buy_price,\r\n open_sell_price\r\nORDER BY\r\n created_at", "refId": "buys", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "type": "postgres", "uid": "${postgres_source}" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT\r\n timestamp,\r\n last_price AS ticker\r\nFROM\r\n archive\r\nWHERE\r\n $__timeFilter(timestamp)\r\n AND base = '$base'\r\n AND quote = '$quote'\r\nORDER BY\r\n timestamp;", "refId": "ticker", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "type": "postgres", "uid": "${postgres_source}" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT\r\n time,\r\n CASE\r\n WHEN order_side = 'BUY' THEN price\r\n END AS buy_trade,\r\n CASE\r\n WHEN order_side = 'SELL' THEN price\r\n END AS sell_trade\r\nFROM\r\n trades\r\nWHERE\r\n $__timeFilter(time)\r\n AND pair = '$pair'\r\n AND strat_run_id = '$run_id'\r\nGROUP BY\r\n time,\r\n order_side,\r\n price\r\nORDER BY\r\n time", "refId": "trades", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Order Prices", "type": "timeseries" }, { "datasource": { "type": "grafana-postgresql-datasource", "uid": "${postgres_source}" }, "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": 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": 7, "w": 12, "x": 0, "y": 21 }, "id": 48, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "single", "sort": "none" } }, "pluginVersion": "10.4.2", "targets": [ { "datasource": { "type": "grafana-postgresql-datasource", "uid": "${postgres_source}" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "WITH params AS (\r\n SELECT INTERVAL '$volatility_range' AS period -- Replace '1 MINUTE' with your desired period\r\n),\r\nfiltered_data AS (\r\n SELECT\r\n timestamp,\r\n last_price,\r\n timestamp - (SELECT period FROM params) AS window_start\r\n FROM\r\n archive\r\n WHERE\r\n $__timeFilter(timestamp)\r\n AND base = '$base'\r\n AND quote = '$quote'\r\n)\r\nSELECT\r\n fd.timestamp,\r\n fd.last_price,\r\n AVG(fd.last_price) OVER w AS moving_avg,\r\n -- STDDEV_SAMP(fd.last_price) OVER w AS rolling_stddev,\r\n AVG(fd.last_price) OVER w + 2 * STDDEV_SAMP(fd.last_price) OVER w AS upper_band,\r\n AVG(fd.last_price) OVER w - 2 * STDDEV_SAMP(fd.last_price) OVER w AS lower_band\r\nFROM\r\n filtered_data fd\r\nWINDOW w AS (\r\n PARTITION BY 1\r\n ORDER BY fd.timestamp\r\n RANGE BETWEEN '$volatility_range' PRECEDING AND CURRENT ROW\r\n)\r\nORDER BY\r\n fd.timestamp;\r\n", "refId": "bollinger_bands", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Bollinger Bands", "type": "timeseries" }, { "datasource": { "type": "grafana-postgresql-datasource", "uid": "${postgres_source}" }, "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": 7, "w": 12, "x": 12, "y": 21 }, "id": 46, "options": { "legend": { "calcs": [ "lastNotNull" ], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "single", "sort": "none" } }, "targets": [ { "datasource": { "type": "postgres", "uid": "${postgres_source}" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT\r\n time,\r\n net_proceeds - (average_cost * volume_sold) as total_profit\r\nFROM (\r\n SELECT\r\n time,\r\n SUM(CASE WHEN order_side = 'BUY' THEN cost END) OVER (ORDER BY time) / SUM(CASE WHEN order_side = 'BUY' THEN volume END) OVER (ORDER BY time) AS average_cost,\r\n SUM(CASE WHEN order_side = 'SELL' THEN cost END) OVER (ORDER BY time) / SUM(CASE WHEN order_side = 'SELL' THEN volume END) OVER (ORDER BY time) AS vwap_sell,\r\n SUM(CASE WHEN order_side = 'SELL' THEN cost END) OVER (ORDER BY time) AS net_proceeds,\r\n SUM(CASE WHEN order_side = 'SELL' THEN volume END) OVER (ORDER BY time) AS volume_sold\r\n FROM\r\n trades\r\n WHERE\r\n base = '$base'\r\n AND quote = '$quote'\r\n AND strat_run_id = '$run_id'\r\n AND $__timeFilter(time) \r\n GROUP BY\r\n time, order_side, cost, volume\r\n) AS subquery\r\nWHERE\r\n average_cost > 0\r\nGROUP BY\r\n time, average_cost, vwap_sell, net_proceeds, volume_sold\r\nORDER BY\r\n time;\r\n", "refId": "average_cost", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Profit (Time Windowed)", "type": "timeseries" }, { "datasource": { "type": "grafana-postgresql-datasource", "uid": "${postgres_source}" }, "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": 7, "w": 12, "x": 0, "y": 28 }, "id": 41, "options": { "legend": { "calcs": [ "lastNotNull" ], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "single", "sort": "none" } }, "targets": [ { "datasource": { "type": "postgres", "uid": "${postgres_source}" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT\r\n time,\r\n average_cost,\r\n vwap_sell,\r\n net_proceeds,\r\n volume_sold\r\nFROM\r\n pnl_mv\r\nWHERE\r\n pair = '$pair'\r\n AND strat_run_id = '$run_id' \r\nGROUP BY time, average_cost, volume_sold, vwap_sell, net_proceeds\r\nORDER BY time;\r\n", "refId": "average_cost", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Profit (All Time)", "transformations": [ { "id": "calculateField", "options": { "alias": "cost_basis", "binary": { "left": "volume_sold", "operator": "*", "reducer": "sum", "right": "average_cost" }, "mode": "binary", "reduce": { "reducer": "sum" } } }, { "id": "calculateField", "options": { "alias": "Profit", "binary": { "left": "net_proceeds", "operator": "-", "reducer": "sum", "right": "cost_basis" }, "mode": "binary", "reduce": { "reducer": "sum" }, "replaceFields": true } } ], "type": "timeseries" }, { "datasource": { "type": "datasource", "uid": "-- Mixed --" }, "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": "Ticker" }, "properties": [ { "id": "custom.fillOpacity", "value": 6 }, { "id": "custom.lineStyle", "value": { "dash": [ 10, 10 ], "fill": "dash" } } ] }, { "matcher": { "id": "byName", "options": "sell_price" }, "properties": [ { "id": "custom.drawStyle", "value": "points" }, { "id": "custom.pointSize", "value": 3 } ] }, { "matcher": { "id": "byName", "options": "buy_price" }, "properties": [ { "id": "color", "value": { "fixedColor": "green", "mode": "fixed" } }, { "id": "custom.drawStyle", "value": "points" }, { "id": "custom.pointSize", "value": 3 } ] }, { "matcher": { "id": "byName", "options": "average_sell" }, "properties": [ { "id": "custom.lineStyle", "value": { "fill": "solid" } }, { "id": "color", "value": { "fixedColor": "super-light-purple", "mode": "fixed" } }, { "id": "custom.lineWidth", "value": 1 } ] }, { "matcher": { "id": "byName", "options": "average_cost" }, "properties": [ { "id": "color", "value": { "fixedColor": "super-light-yellow", "mode": "fixed" } }, { "id": "custom.lineStyle", "value": { "fill": "solid" } } ] }, { "matcher": { "id": "byName", "options": "ticker" }, "properties": [ { "id": "custom.lineWidth", "value": 0 }, { "id": "custom.fillOpacity", "value": 10 }, { "id": "color", "value": { "mode": "fixed" } }, { "id": "custom.showPoints", "value": "never" } ] } ] }, "gridPos": { "h": 7, "w": 12, "x": 12, "y": 28 }, "id": 37, "options": { "legend": { "calcs": [ "lastNotNull" ], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "single", "sort": "none" } }, "targets": [ { "datasource": { "type": "postgres", "uid": "${postgres_source}" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT\r\n time,\r\n average_cost,\r\n vwap_sell\r\nFROM\r\n pnl_mv\r\nWHERE\r\n pair = '$pair'\r\n AND strat_run_id = '$run_id'\r\n AND $__timeFilter(time) \r\nGROUP BY time, average_cost, vwap_sell\r\nORDER BY time;\r\n", "refId": "average_cost", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "type": "postgres", "uid": "${postgres_source}" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT\r\n timestamp,\r\n last_price AS ticker\r\nFROM\r\n archive\r\nWHERE\r\n $__timeFilter(timestamp)\r\n AND base = '$base'\r\n AND quote = '$quote'\r\nORDER BY\r\n timestamp;", "refId": "ticker", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "type": "postgres", "uid": "${postgres_source}" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT\r\n time,\r\n MAX(\r\n CASE\r\n WHEN order_side = 'BUY' THEN price\r\n END\r\n ) AS buy_price,\r\n MAX(\r\n CASE\r\n WHEN order_side = 'SELL' THEN price\r\n END\r\n ) AS sell_price\r\nFROM\r\n trades\r\nWHERE\r\n $__timeFilter(time)\r\n AND base = '$base'\r\n AND quote = '$quote'\r\n AND strat_run_id = '$run_id'\r\n AND (\r\n order_side = 'BUY'\r\n OR order_side = 'SELL'\r\n )\r\nGROUP BY\r\n time", "refId": "trades", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Volume Weighted Average Buy / Sell (Windowed)", "type": "timeseries" }, { "datasource": { "type": "datasource", "uid": "-- Mixed --" }, "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": "Ticker" }, "properties": [ { "id": "custom.fillOpacity", "value": 6 }, { "id": "custom.lineStyle", "value": { "dash": [ 10, 10 ], "fill": "dash" } } ] }, { "matcher": { "id": "byName", "options": "sell_price" }, "properties": [ { "id": "custom.drawStyle", "value": "points" }, { "id": "custom.pointSize", "value": 3 } ] }, { "matcher": { "id": "byName", "options": "buy_price" }, "properties": [ { "id": "color", "value": { "fixedColor": "green", "mode": "fixed" } }, { "id": "custom.drawStyle", "value": "points" }, { "id": "custom.pointSize", "value": 3 } ] }, { "matcher": { "id": "byName", "options": "average_sell" }, "properties": [ { "id": "custom.lineStyle", "value": { "fill": "solid" } }, { "id": "color", "value": { "fixedColor": "super-light-purple", "mode": "fixed" } }, { "id": "custom.lineWidth", "value": 1 } ] }, { "matcher": { "id": "byName", "options": "average_cost" }, "properties": [ { "id": "color", "value": { "fixedColor": "super-light-yellow", "mode": "fixed" } }, { "id": "custom.lineStyle", "value": { "fill": "solid" } } ] }, { "matcher": { "id": "byName", "options": "ticker" }, "properties": [ { "id": "custom.lineWidth", "value": 0 }, { "id": "custom.fillOpacity", "value": 10 }, { "id": "color", "value": { "mode": "fixed" } }, { "id": "custom.showPoints", "value": "never" } ] } ] }, "gridPos": { "h": 7, "w": 12, "x": 0, "y": 35 }, "id": 47, "options": { "legend": { "calcs": [ "lastNotNull" ], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "single", "sort": "none" } }, "targets": [ { "datasource": { "type": "postgres", "uid": "${postgres_source}" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT\r\n time,\r\n average_cost,\r\n vwap_sell\r\nFROM\r\n pnl_mv\r\nWHERE\r\n pair = '$pair'\r\n AND strat_run_id = '$run_id'\r\nGROUP BY\r\n time,\r\n average_cost,\r\n vwap_sell\r\nORDER BY\r\n time;", "refId": "average_cost", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "type": "postgres", "uid": "${postgres_source}" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT\r\n timestamp,\r\n last_price AS ticker\r\nFROM\r\n archive\r\nWHERE\r\n $__timeFilter(timestamp)\r\n AND base = '$base'\r\n AND quote = '$quote'\r\nORDER BY\r\n timestamp;", "refId": "ticker", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "type": "postgres", "uid": "${postgres_source}" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT\r\n time,\r\n CASE\r\n WHEN order_side = 'BUY' THEN price\r\n END AS buy_price,\r\n CASE\r\n WHEN order_side = 'SELL' THEN price\r\n END AS sell_price\r\nFROM\r\n trades\r\nWHERE\r\n $__timeFilter(time)\r\n AND base = '$base'\r\n AND quote = '$quote'\r\n AND strat_run_id = '$run_id'\r\nGROUP BY\r\n time,\r\n order_side,\r\n price\r\nORDER BY\r\n time", "refId": "trades", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Volume Weighted Average Buy / Sell (All Time)", "type": "timeseries" }, { "datasource": { "type": "grafana-postgresql-datasource", "uid": "${postgres_source}" }, "description": "Balances for assets being trades by MM strategy in terms of the Quote asset", "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": 6, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "ETH_balance_in_BTC" }, "properties": [ { "id": "color", "value": { "fixedColor": "#8a8a93", "mode": "fixed" } }, { "id": "displayName", "value": "Base in Quote" } ] }, { "matcher": { "id": "byName", "options": "Total in Quote" }, "properties": [ { "id": "displayName", "value": "Total in Quote" } ] } ] }, "gridPos": { "h": 7, "w": 12, "x": 12, "y": 35 }, "id": 2, "options": { "legend": { "calcs": [ "lastNotNull" ], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "single", "sort": "none" } }, "targets": [ { "datasource": { "type": "postgres", "uid": "${postgres_source}" }, "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT balance, $__time(\"time\") FROM balance_metrics WHERE run_id = '$run_id' AND asset = '$quote' ORDER BY time", "refId": "quote_balance", "sql": { "columns": [ { "parameters": [ { "name": "balance", "type": "functionParameter" } ], "type": "function" }, { "parameters": [ { "name": "\"time\"", "type": "functionParameter" } ], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50, "whereJsonTree": { "children1": [ { "id": "bb8aab8b-4567-489a-bcde-f18e80600a13", "properties": { "field": "run_id", "operator": "equal", "value": [ "$run_id" ], "valueSrc": [ "value" ], "valueType": [ "text" ] }, "type": "rule" } ], "id": "889bb888-89ab-4cde-b012-318e805bd041", "type": "group" }, "whereString": "run_id = '$run_id'" }, "table": "balance_metrics" }, { "datasource": { "type": "postgres", "uid": "${postgres_source}" }, "editorMode": "code", "format": "table", "hide": true, "rawQuery": true, "rawSql": "SELECT balance, $__time(\"time\") FROM balance_metrics WHERE run_id = '$run_id' AND asset = '$base' ORDER BY time", "refId": "base_balance", "sql": { "columns": [ { "parameters": [ { "name": "balance", "type": "functionParameter" } ], "type": "function" }, { "parameters": [ { "name": "\"time\"", "type": "functionParameter" } ], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50, "whereJsonTree": { "children1": [ { "id": "bb8aab8b-4567-489a-bcde-f18e80600a13", "properties": { "field": "run_id", "operator": "equal", "value": [ "$run_id" ], "valueSrc": [ "value" ], "valueType": [ "text" ] }, "type": "rule" } ], "id": "889bb888-89ab-4cde-b012-318e805bd041", "type": "group" }, "whereString": "run_id = '$run_id'" }, "table": "balance_metrics" }, { "datasource": { "type": "postgres", "uid": "${postgres_source}" }, "editorMode": "code", "format": "table", "hide": true, "rawQuery": true, "rawSql": "SELECT\r\n timestamp,\r\n last_price AS ticker\r\nFROM\r\n archive\r\nWHERE\r\n $__timeFilter(timestamp)\r\n AND base = '$base'\r\n AND quote = '$quote'\r\nORDER BY\r\n timestamp;\r\n", "refId": "ticker", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 }, "table": "archive" }, { "datasource": { "name": "Expression", "type": "__expr__", "uid": "__expr__" }, "expression": "$base_balance * $ticker", "hide": false, "refId": "base_in_quote", "type": "math" } ], "title": "Balances (Quote)", "type": "timeseries" }, { "datasource": { "type": "grafana-postgresql-datasource", "uid": "${postgres_source}" }, "description": "Balances for assets being trades by MM strategy in terms of the Quote asset", "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": 6, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] } }, "overrides": [ { "matcher": { "id": "byName", "options": "ETH_balance_in_BTC" }, "properties": [ { "id": "color", "value": { "fixedColor": "#8a8a93", "mode": "fixed" } }, { "id": "displayName", "value": "Base in Quote" } ] }, { "matcher": { "id": "byName", "options": "Total in Quote" }, "properties": [ { "id": "displayName", "value": "Total in Quote" } ] } ] }, "gridPos": { "h": 7, "w": 12, "x": 0, "y": 42 }, "id": 42, "options": { "legend": { "calcs": [ "lastNotNull" ], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "single", "sort": "none" } }, "targets": [ { "datasource": { "type": "postgres", "uid": "${postgres_source}" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT\r\n time,\r\n (base_in_quote + quote_total) as total_balance\r\nFROM\r\n (\r\n SELECT\r\n bm.time,\r\n CASE\r\n WHEN bm.asset = '$base' THEN bm.balance * arc.last_price\r\n END AS base_in_quote,\r\n CASE\r\n WHEN bm.asset = '$quote' THEN bm.balance\r\n END AS quote_total\r\n FROM\r\n balance_metrics bm\r\n JOIN archive arc ON bm.time = arc.timestamp\r\n WHERE\r\n bm.run_id = '$run_id'\r\n AND $__timeFilter(bm.time)\r\n GROUP BY\r\n bm.time, bm.asset, bm.balance, arc.last_price\r\n ) AS subquery\r\nGROUP BY\r\n time,\r\n base_in_quote,\r\n quote_total\r\nORDER BY\r\n time;", "refId": "balances", "sql": { "columns": [ { "parameters": [ { "name": "balance", "type": "functionParameter" } ], "type": "function" }, { "parameters": [ { "name": "\"time\"", "type": "functionParameter" } ], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50, "whereJsonTree": { "children1": [ { "id": "bb8aab8b-4567-489a-bcde-f18e80600a13", "properties": { "field": "run_id", "operator": "equal", "value": [ "$run_id" ], "valueSrc": [ "value" ], "valueType": [ "text" ] }, "type": "rule" } ], "id": "889bb888-89ab-4cde-b012-318e805bd041", "type": "group" }, "whereString": "run_id = '$run_id'" }, "table": "balance_metrics" } ], "title": "Total Balance (Quote)", "type": "timeseries" }, { "datasource": { "type": "datasource", "uid": "-- Mixed --" }, "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": "Ticker" }, "properties": [ { "id": "custom.fillOpacity", "value": 6 }, { "id": "custom.lineStyle", "value": { "dash": [ 10, 10 ], "fill": "dash" } } ] }, { "matcher": { "id": "byName", "options": "sell_price" }, "properties": [ { "id": "custom.drawStyle", "value": "points" }, { "id": "custom.pointSize", "value": 3 } ] }, { "matcher": { "id": "byName", "options": "buy_price" }, "properties": [ { "id": "color", "value": { "fixedColor": "green", "mode": "fixed" } }, { "id": "custom.drawStyle", "value": "points" }, { "id": "custom.pointSize", "value": 3 } ] }, { "matcher": { "id": "byName", "options": "average_sell" }, "properties": [ { "id": "custom.lineStyle", "value": { "fill": "solid" } }, { "id": "color", "value": { "fixedColor": "super-light-purple", "mode": "fixed" } }, { "id": "custom.lineWidth", "value": 1 } ] }, { "matcher": { "id": "byName", "options": "average_cost" }, "properties": [ { "id": "color", "value": { "fixedColor": "super-light-yellow", "mode": "fixed" } }, { "id": "custom.lineStyle", "value": { "fill": "solid" } } ] }, { "matcher": { "id": "byName", "options": "ticker" }, "properties": [ { "id": "custom.lineWidth", "value": 0 }, { "id": "custom.fillOpacity", "value": 10 }, { "id": "color", "value": { "mode": "fixed" } }, { "id": "custom.showPoints", "value": "never" } ] } ] }, "gridPos": { "h": 7, "w": 12, "x": 12, "y": 42 }, "id": 45, "options": { "legend": { "calcs": [ "lastNotNull" ], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "single", "sort": "none" } }, "targets": [ { "datasource": { "type": "postgres", "uid": "${postgres_source}" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT\r\n timestamp,\r\n last_price AS ticker\r\nFROM\r\n archive\r\nWHERE\r\n $__timeFilter(timestamp)\r\n AND base = '$base'\r\n AND quote = '$quote'\r\nORDER BY\r\n timestamp;", "refId": "ticker", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "type": "postgres", "uid": "${postgres_source}" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT\r\n time,\r\n CASE\r\n WHEN order_side = 'BUY' THEN price\r\n END AS buy_price,\r\n CASE\r\n WHEN order_side = 'SELL' THEN price\r\n END AS sell_price\r\nFROM\r\n trades\r\nWHERE\r\n $__timeFilter(time)\r\n AND base = '$base'\r\n AND quote = '$quote'\r\n AND strat_run_id = '$run_id'\r\nGROUP BY\r\n time, order_side, price\r\nORDER BY\r\n time", "refId": "trades", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "type": "postgres", "uid": "${postgres_source}" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT\r\n time,\r\n time_volume_weighted_average_cost\r\nFROM\r\n trade_metrics\r\nWHERE\r\n base = '$base'\r\n AND quote = '$quote'\r\n AND $__timeFilter(time) \r\n AND time_volume_weighted_average_cost > 0\r\n AND run_id = '$run_id'\r\nORDER BY time", "refId": "tvwap_average_cost", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "type": "postgres", "uid": "${postgres_source}" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT\r\n time\r\n time_volume_weighted_average_sell\r\nFROM\r\n trade_metrics\r\nWHERE\r\n base = '$base'\r\n AND $__timeFilter(time) \r\n AND quote = '$quote'\r\n AND time_volume_weighted_average_sell > 0\r\n AND run_id = '$run_id'\r\nORDER BY time", "refId": "tvwap_average_sell", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Time Volume Weighted Average Buy / Sell", "type": "timeseries" } ], "refresh": "", "schemaVersion": 39, "tags": [], "templating": { "list": [ { "current": { "selected": false, "text": "DOT_USD", "value": "DOT_USD" }, "datasource": { "type": "postgres", "uid": "${postgres_source}" }, "definition": "SELECT DISTINCT pair FROM orders;\n", "hide": 0, "includeAll": false, "label": "Pair", "multi": false, "name": "pair", "options": [], "query": "SELECT DISTINCT pair FROM orders;\n", "refresh": 1, "regex": "", "skipUrlSync": false, "sort": 0, "type": "query" }, { "current": { "selected": false, "text": "fdr_ticker_last_price{exchange=\"kraken\",instance=\"proxy-kraken:3000\",job=\"proxy-kraken\",pair=\"ETH_USD\"}", "value": "fdr_ticker_last_price{exchange=\"kraken\",instance=\"proxy-kraken:3000\",job=\"proxy-kraken\",pair=\"ETH_USD\"}" }, "datasource": { "type": "prometheus", "uid": "prometheus" }, "definition": "fdr_ticker_last_price{pair=\"$pair\"}", "hide": 2, "includeAll": false, "multi": false, "name": "ticker_price", "options": [], "query": { "query": "fdr_ticker_last_price{pair=\"$pair\"}", "refId": "StandardVariableQuery" }, "refresh": 1, "regex": "", "skipUrlSync": false, "sort": 0, "type": "query" }, { "current": { "selected": false, "text": "DOT", "value": "DOT" }, "datasource": { "type": "postgres", "uid": "${postgres_source}" }, "definition": "SELECT DISTINCT base FROM orders;\n", "hide": 0, "includeAll": false, "label": "Base", "multi": false, "name": "base", "options": [], "query": "SELECT DISTINCT base FROM orders;\n", "refresh": 1, "regex": "", "skipUrlSync": false, "sort": 0, "type": "query" }, { "current": { "selected": false, "text": "90d99ddf-ba11-480e-9a31-792670745053", "value": "90d99ddf-ba11-480e-9a31-792670745053" }, "datasource": { "type": "postgres", "uid": "${postgres_source}" }, "definition": "SELECT DISTINCT strat_run_id FROM trades;\n", "hide": 0, "includeAll": false, "label": "RunID", "multi": false, "name": "run_id", "options": [], "query": "SELECT DISTINCT strat_run_id FROM trades;\n", "refresh": 1, "regex": "", "skipUrlSync": false, "sort": 0, "type": "query" }, { "current": { "selected": false, "text": "USD", "value": "USD" }, "datasource": { "type": "postgres", "uid": "${postgres_source}" }, "definition": "SELECT DISTINCT quote FROM orders", "hide": 0, "includeAll": false, "label": "Quote", "multi": false, "name": "quote", "options": [], "query": "SELECT DISTINCT quote FROM orders", "refresh": 1, "regex": "", "skipUrlSync": false, "sort": 0, "type": "query" }, { "current": { "selected": false, "text": "PostgreSQL-test", "value": "postgresql-test" }, "hide": 0, "includeAll": false, "multi": false, "name": "postgres_source", "options": [], "query": "postgres", "queryValue": "", "refresh": 1, "regex": "", "skipUrlSync": false, "type": "datasource" }, { "current": { "selected": true, "text": "24 HOURS", "value": "24 HOURS" }, "hide": 0, "includeAll": false, "multi": false, "name": "volatility_range", "options": [ { "selected": false, "text": "15 SECONDS", "value": "15 SECONDS" }, { "selected": false, "text": "30 SECONDS", "value": "30 SECONDS" }, { "selected": false, "text": "1 MINUTE", "value": "1 MINUTE" }, { "selected": false, "text": "2 MINUTES", "value": "2 MINUTES" }, { "selected": false, "text": "5 MINUTES", "value": "5 MINUTES" }, { "selected": false, "text": "15 MINUTES", "value": "15 MINUTES" }, { "selected": false, "text": "30 MINUTES", "value": "30 MINUTES" }, { "selected": false, "text": "1 HOUR", "value": "1 HOUR" }, { "selected": false, "text": "2 HOURS", "value": "2 HOURS" }, { "selected": false, "text": "3 HOURS", "value": "3 HOURS" }, { "selected": false, "text": "6 HOURS", "value": "6 HOURS" }, { "selected": false, "text": "12 HOURS", "value": "12 HOURS" }, { "selected": true, "text": "24 HOURS", "value": "24 HOURS" } ], "query": "15 SECONDS, 30 SECONDS, 1 MINUTE, 2 MINUTES, 5 MINUTES, 15 MINUTES, 30 MINUTES, 1 HOUR, 2 HOURS, 3 HOURS, 6 HOURS, 12 HOURS, 24 HOURS", "queryValue": "", "skipUrlSync": false, "type": "custom" } ] }, "time": { "from": "2024-04-01T05:44:44.292Z", "to": "2024-04-01T05:56:12.340Z" }, "timepicker": {}, "timezone": "", "title": "Market Maker Test 2", "uid": "WFzb7RRId", "version": 1, "weekStart": "" }
0
dashboards
/mono/helm/grafana/dashboards/redpanda-dashboard.json
{ "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": 1, "id": 6, "links": [], "liveNow": false, "panels": [ { "collapsed": false, "datasource": { "type": "datasource", "uid": "grafana" }, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 0 }, "id": 146, "panels": [], "type": "row" }, { "datasource": { "type": "datasource", "uid": "grafana" }, "editable": true, "error": false, "gridPos": { "h": 2, "w": 24, "x": 0, "y": 1 }, "id": 1, "options": { "code": { "language": "plaintext", "showLineNumbers": false, "showMiniMap": false }, "content": "<h1 style=\"color:#87CEEB; border-bottom: 3px solid #87CEEB;\">Redpanda Summary</h1>", "mode": "html" }, "pluginVersion": "10.1.2", "span": 1, "transparent": true, "type": "text" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [ { "options": { "match": "null", "result": { "text": "N/A" } }, "type": "special" } ], "min": 0, "thresholds": { "mode": "percentage", "steps": [ { "color": "red", "value": null }, { "color": "green", "value": 100 } ] }, "unit": "none" }, "overrides": [] }, "gridPos": { "h": 8, "w": 4, "x": 0, "y": 3 }, "id": 2, "links": [], "maxDataPoints": 100, "options": { "colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "text": {}, "textMode": "auto" }, "pluginVersion": "10.1.2", "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "exemplar": true, "expr": "count by (app) (redpanda_application_uptime_seconds_total{redpanda_cloud_data_cluster_name=~\"[[data_cluster]]\"}) OR on() vector(0)", "hide": false, "interval": "", "intervalFactor": 1, "legendFormat": "Nodes Up", "refId": "A", "step": 40 }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "exemplar": false, "expr": "max_over_time(count by (app) (redpanda_application_uptime_seconds_total{redpanda_cloud_data_cluster_name=~\"[[data_cluster]]\"} )[1w:])", "hide": false, "instant": true, "interval": "", "intervalFactor": 1, "legendFormat": "Nodes Up", "range": false, "refId": "config", "step": 40 } ], "title": "Nodes Up", "transformations": [ { "id": "configFromData", "options": { "configRefId": "config", "mappings": [ { "fieldName": "Nodes Up", "handlerKey": "max", "reducerId": "max" } ] } } ], "transparent": true, "type": "stat" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "dark-red", "value": null }, { "color": "#EAB839", "value": 600 }, { "color": "dark-green", "value": 3600 } ] }, "unit": "s" }, "overrides": [] }, "gridPos": { "h": 8, "w": 4, "x": 4, "y": 3 }, "id": 23763572006, "options": { "colorMode": "background", "graphMode": "area", "justifyMode": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "textMode": "auto" }, "pluginVersion": "10.1.2", "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "exemplar": false, "expr": "sum by (exported_instance, instance) (redpanda_application_uptime_seconds_total{instance=~\"[[node]]\", exported_instance=~\"[[exported_node]]\",redpanda_cloud_data_cluster_name=~\"[[data_cluster]]\"})", "format": "time_series", "hide": false, "instant": true, "interval": "", "legendFormat": "{{instance}} {{exported_instance}}", "range": false, "refId": "A" } ], "title": "Node Uptime", "type": "stat" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [ { "options": { "match": "null", "result": { "text": "N/A" } }, "type": "special" } ], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] }, "unit": "none" }, "overrides": [] }, "gridPos": { "h": 4, "w": 4, "x": 8, "y": 3 }, "id": 23763572028, "links": [], "maxDataPoints": 100, "options": { "colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "text": {}, "textMode": "auto" }, "pluginVersion": "10.1.2", "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "exemplar": true, "expr": "sum(redpanda_cluster_topics) by ([[aggr_criteria]])", "interval": "", "legendFormat": "Partition count", "refId": "A" } ], "title": "Topics", "transparent": true, "type": "stat" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [ { "options": { "match": "null", "result": { "text": "N/A" } }, "type": "special" } ], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] }, "unit": "Bps" }, "overrides": [] }, "gridPos": { "h": 8, "w": 4, "x": 12, "y": 3 }, "id": 23763572037, "links": [], "maxDataPoints": 100, "options": { "colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "text": {}, "textMode": "auto" }, "pluginVersion": "10.1.2", "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "exemplar": true, "expr": "sum by([[aggr_criteria]])(rate(redpanda_kafka_request_bytes_total[1m]))", "interval": "", "legendFormat": "Partition count", "range": true, "refId": "A" } ], "title": "Throughput", "transparent": true, "type": "stat" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "#EAB839", "value": 1 }, { "color": "red", "value": 10 } ] }, "unit": "short" }, "overrides": [] }, "gridPos": { "h": 4, "w": 4, "x": 16, "y": 3 }, "id": 23763572019, "options": { "colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "textMode": "auto" }, "pluginVersion": "10.1.2", "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "exemplar": true, "expr": "sum(rate(redpanda_raft_leadership_changes{redpanda_cloud_data_cluster_name=\"[[data_cluster]]\"}[5m])) ", "hide": false, "interval": "", "intervalFactor": 1, "legendFormat": "Pod: {{pod}}, Node: {{instance}}", "range": true, "refId": "B" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "exemplar": true, "expr": "sum(rate(redpanda_raft_leadership_changes{redpanda_cloud_data_cluster_name=\"[[data_cluster]]\"}[5m] offset 1d)) by (cluster)", "hide": true, "interval": "", "intervalFactor": 10, "legendFormat": "Yesterday cluster avg", "refId": "A" } ], "title": "Leadership Transfers / 5min", "type": "stat" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] }, "unit": "none" }, "overrides": [] }, "gridPos": { "h": 4, "w": 4, "x": 20, "y": 3 }, "id": 23763572020, "options": { "colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "textMode": "auto" }, "pluginVersion": "10.1.2", "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "exemplar": true, "expr": "sum (redpanda_kafka_under_replicated_replicas{redpanda_cloud_data_cluster_name=~\"[[data_cluster]]\"}) > 0 OR on() vector(0) ", "hide": false, "interval": "", "intervalFactor": 5, "legendFormat": "{{topic}}/{{namespace}}/{{redpanda_cloud_data_cluster_name}}", "refId": "A" } ], "title": "Under replicated partitions by topic", "type": "stat" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [ { "options": { "match": "null", "result": { "text": "N/A" } }, "type": "special" } ], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null } ] }, "unit": "none" }, "overrides": [] }, "gridPos": { "h": 4, "w": 4, "x": 8, "y": 7 }, "id": 3, "links": [], "maxDataPoints": 100, "options": { "colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "text": {}, "textMode": "auto" }, "pluginVersion": "10.1.2", "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "exemplar": true, "expr": "sum(min by(redpanda_topic) (redpanda_kafka_partitions{redpanda_cloud_data_cluster_name=~\"\"}))", "interval": "", "legendFormat": "Partition count", "range": true, "refId": "A" } ], "title": "Partitions", "transparent": true, "type": "stat" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "max": 100, "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "red", "value": null }, { "color": "#EAB839", "value": 90 }, { "color": "green", "value": 95 } ] }, "unit": "percent" }, "overrides": [] }, "gridPos": { "h": 4, "w": 4, "x": 16, "y": 7 }, "id": 23763572032, "options": { "colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "textMode": "auto" }, "pluginVersion": "10.1.2", "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "exemplar": true, "expr": "100 * abs(1-(sum(stddev by (redpanda_topic) (sum(redpanda_kafka_max_offset{redpanda_namespace=\"kafka\",redpanda_cloud_data_cluster_name=~\"\"}) by (redpanda_topic,redpanda_partition))) / sum(avg by (redpanda_topic) ((sum(redpanda_kafka_max_offset{redpanda_namespace=\"kafka\",redpanda_cloud_data_cluster_name=~\"\"}) by (redpanda_topic,redpanda_partition))))))", "format": "time_series", "hide": false, "interval": "", "intervalFactor": 2, "legendFormat": "__auto", "range": true, "refId": "A", "step": 10 } ], "title": "Partition Balance", "type": "stat" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "description": "", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "dark-red", "value": 1 } ] }, "unit": "none" }, "overrides": [ { "matcher": { "id": "byName", "options": "partition" }, "properties": [ { "id": "unit" } ] } ] }, "gridPos": { "h": 4, "w": 4, "x": 20, "y": 7 }, "id": 23763572021, "options": { "colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "textMode": "auto" }, "pluginVersion": "10.1.2", "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "exemplar": false, "expr": "sum (redpanda_cluster_unavailable_partitions{redpanda_cloud_data_cluster_name=~\"[[data_cluster]]\"} == -1) OR on() vector(0) + sum(max by(redpanda_namespace, redpanda_topic) (redpanda_kafka_partitions ) - count by(redpanda_namespace, redpanda_topic) (count by (redpanda_namespace, redpanda_topic, redpanda_partition) (redpanda_kafka_under_replicated_replicas)))", "format": "table", "instant": false, "interval": "", "legendFormat": "__auto", "queryType": "randomWalk", "range": true, "refId": "A" } ], "title": "Leaderless Partitions", "transformations": [ { "id": "organize", "options": { "excludeByName": { "Time": false, "Value": false, "__name__": true, "byoc": true, "container": true, "data_cluster_uuid": true, "endpoint": true, "exported_namespace": true, "instance": true, "job": true, "namespace": true, "pod": true, "provider": true, "redpanda_cloud_data_cluster_name": true, "region": true, "shard": true, "topic": false }, "indexByName": { "Time": 0, "Value": 17, "__name__": 1, "byoc": 2, "container": 3, "data_cluster_uuid": 4, "endpoint": 5, "exported_namespace": 6, "instance": 7, "job": 8, "namespace": 9, "partition": 11, "pod": 12, "provider": 13, "redpanda_cloud_data_cluster_name": 16, "region": 14, "shard": 15, "topic": 10 }, "renameByName": { "Value": "Node ID", "instance": "Node IP", "namespace": "Namespace", "pod": "POD", "redpanda_cloud_data_cluster_name": "Cluster", "shard": "", "topic": "" } } } ], "type": "stat" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "max": 100, "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "#EAB839", "value": 75 }, { "color": "red", "value": 90 } ] }, "unit": "percent" }, "overrides": [] }, "gridPos": { "h": 5, "w": 4, "x": 0, "y": 11 }, "id": 23763572033, "options": { "orientation": "auto", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showThresholdLabels": false, "showThresholdMarkers": true }, "pluginVersion": "10.1.2", "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "exemplar": true, "expr": "(1 - (\n sum(redpanda_storage_disk_free_bytes{instance=~\".*\",shard=~\".*\",redpanda_cloud_data_cluster_name=~\"\"}) \n/\nsum(redpanda_storage_disk_total_bytes{instance=~\".*\",shard=~\".*\",redpanda_cloud_data_cluster_name=~\"\"}) \n))\n*\n100 ", "format": "time_series", "interval": "", "intervalFactor": 2, "legendFormat": "Pod: {{pod}}, Node: {{instance}}, Shard: {{shard}}", "range": true, "refId": "A", "step": 10 } ], "title": "Storage Used", "type": "gauge" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "max": 1, "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "#EAB839", "value": 0.75 }, { "color": "red", "value": 0.9 } ] }, "unit": "percentunit" }, "overrides": [] }, "gridPos": { "h": 8, "w": 4, "x": 4, "y": 11 }, "id": 23763572023, "options": { "orientation": "auto", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showThresholdLabels": false, "showThresholdMarkers": true }, "pluginVersion": "10.1.2", "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "exemplar": true, "expr": "sum(redpanda_memory_allocated_memory) / (sum(redpanda_memory_free_memory) + sum(redpanda_memory_allocated_memory))", "format": "time_series", "interval": "", "intervalFactor": 2, "legendFormat": "Pod: {{pod}}, Node: {{instance}}, Shard: {{shard}}", "range": true, "refId": "A", "step": 10 } ], "title": "Allocated memory", "type": "gauge" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "max": 1, "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "#EAB839", "value": 0.75 }, { "color": "red", "value": 0.9 } ] }, "unit": "percentunit" }, "overrides": [] }, "gridPos": { "h": 8, "w": 4, "x": 8, "y": 11 }, "id": 23763572036, "options": { "orientation": "auto", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showThresholdLabels": false, "showThresholdMarkers": true }, "pluginVersion": "10.1.2", "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "exemplar": true, "expr": "avg(rate(redpanda_cpu_busy_seconds_total[$__rate_interval]))", "format": "time_series", "interval": "", "intervalFactor": 2, "legendFormat": "Pod: {{pod}}, Node: {{instance}}, Shard: {{shard}}", "refId": "A", "step": 10 } ], "title": "CPU Utilization", "type": "gauge" }, { "aliasColors": {}, "bars": false, "dashLength": 10, "dashes": false, "datasource": { "type": "prometheus", "uid": "prometheus" }, "description": "Shows the number of clients actively connected. A sudden, extreme change in this metric may indicate problems with connection.", "editable": true, "error": false, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "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": [ { "matcher": { "id": "byName", "options": "Yesterday cluster avg" }, "properties": [ { "id": "custom.lineStyle", "value": { "dash": [ 10, 10 ], "fill": "dash" } } ] } ] }, "fill": 1, "fillGradient": 0, "gridPos": { "h": 8, "w": 4, "x": 12, "y": 11 }, "hiddenSeries": false, "id": 23763572017, "interval": "1m", "legend": { "avg": false, "current": false, "max": false, "min": false, "show": true, "total": false, "values": false }, "lines": true, "linewidth": 2, "nullPointMode": "null", "options": { "alertThreshold": true, "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "single", "sort": "none" } }, "percentage": false, "pluginVersion": "8.4.3-54429", "pointradius": 2, "points": false, "renderer": "flot", "seriesOverrides": [], "spaceLength": 10, "span": 4, "stack": false, "steppedLine": true, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "exemplar": false, "expr": "sum(redpanda_rpc_active_connections{instance=~\"[[node]]\",exported_instance=~\"[[exported_node]]\",shard=~\"[[node_shard]]\",redpanda_cloud_data_cluster_name=~\"[[data_cluster]]\"}) by ([[aggr_criteria]])", "format": "time_series", "instant": false, "intervalFactor": 1, "legendFormat": "Pod: {{pod}}, Node: {{instance}}, Shard: {{shard}}", "range": true, "refId": "A", "step": 10 }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "sum(redpanda_rpc_active_connections{instance=~\"[[node]]\",exported_instance=~\"[[exported_node]]\",shard=~\"[[node_shard]]\",redpanda_cloud_data_cluster_name=~\"[[data_cluster]]\"} offset 1d) by (redpanda_cloud_data_cluster_name)", "hide": true, "legendFormat": "Yesterday cluster avg", "range": true, "refId": "B" } ], "thresholds": [], "timeRegions": [], "title": "Kafka RPC: Currently active connections", "tooltip": { "msResolution": true, "shared": true, "sort": 0, "value_type": "cumulative" }, "type": "timeseries", "xaxis": { "format": "", "logBase": 0, "mode": "time", "show": true, "values": [] }, "yaxes": [ { "format": "short", "logBase": 1, "min": 0, "show": true }, { "format": "short", "logBase": 1, "min": 0, "show": true } ], "yaxis": { "align": false } }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "custom": { "align": "auto", "cellOptions": { "type": "auto" }, "filterable": false, "inspect": false }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] }, "unit": "s" }, "overrides": [ { "matcher": { "id": "byName", "options": "POD" }, "properties": [ { "id": "custom.width", "value": 474 } ] }, { "matcher": { "id": "byName", "options": "byoc" }, "properties": [ { "id": "custom.width", "value": 66 } ] }, { "matcher": { "id": "byName", "options": "provider" }, "properties": [ { "id": "custom.width", "value": 90 } ] }, { "matcher": { "id": "byName", "options": "region" }, "properties": [ { "id": "custom.width", "value": 145 } ] }, { "matcher": { "id": "byName", "options": "Uptime" }, "properties": [ { "id": "custom.width", "value": 90 } ] }, { "matcher": { "id": "byName", "options": "Node IP" }, "properties": [ { "id": "custom.width", "value": 250 } ] }, { "matcher": { "id": "byName", "options": "revision" }, "properties": [ { "id": "custom.width", "value": 316 } ] }, { "matcher": { "id": "byName", "options": "exported_instance" }, "properties": [ { "id": "custom.width", "value": 159 } ] } ] }, "gridPos": { "h": 8, "w": 8, "x": 16, "y": 11 }, "id": 154, "options": { "cellHeight": "sm", "footer": { "countRows": false, "fields": "", "reducer": [ "sum" ], "show": false }, "frameIndex": 0, "showHeader": true, "sortBy": [] }, "pluginVersion": "10.1.2", "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "exemplar": false, "expr": "redpanda_application_build{redpanda_cloud_data_cluster_name=~\"[[data_cluster]]\"} * on (instance, exported_instance) group_left redpanda_application_uptime_seconds_total{instance=~\"[[node]]\",exported_instance=~\"[[exported_node]]\",shard=~\"[[node_shard]]\",redpanda_cloud_data_cluster_name=~\"[[data_cluster]]\"}", "format": "table", "instant": true, "interval": "", "legendFormat": "{{instance}}", "queryType": "randomWalk", "refId": "A" } ], "title": "Cluster Info", "transformations": [ { "id": "organize", "options": { "excludeByName": { "Time": true, "Value": false, "__name__": true, "container": true, "endpoint": true, "instance": false, "job": true, "namespace": true, "redpanda_cloud_data_cluster_name": true, "shard": true }, "indexByName": { "Time": 6, "Value": 4, "__name__": 7, "byoc": 12, "container": 8, "data_cluster_uuid": 13, "endpoint": 9, "instance": 1, "job": 14, "namespace": 10, "pod": 0, "provider": 2, "redpanda_cloud_data_cluster_name": 5, "region": 3, "shard": 11 }, "renameByName": { "Value": "Uptime", "instance": "Node IP", "namespace": "Namespace", "pod": "POD", "redpanda_cloud_data_cluster_name": "Data Cluster", "shard": "" } } } ], "type": "table" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [ { "options": { "0": { "index": 0, "text": "OK" }, "1": { "color": "orange", "index": 1, "text": "Low" }, "2": { "color": "red", "index": 2, "text": "Degraded" } }, "type": "value" } ], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] } }, "overrides": [] }, "gridPos": { "h": 3, "w": 4, "x": 0, "y": 16 }, "id": 23763572035, "options": { "colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "textMode": "auto" }, "pluginVersion": "10.1.2", "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "max(redpanda_storage_disk_free_space_alert)", "legendFormat": "__auto", "range": true, "refId": "A" } ], "title": "Storage Health", "type": "stat" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "description": "Measured within Redpanda", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 50, "gradientMode": "opacity", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "stepAfter", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] }, "unit": "s" }, "overrides": [ { "matcher": { "id": "byName", "options": "Yesterday cluster average" }, "properties": [ { "id": "custom.lineStyle", "value": { "dash": [ 10, 10 ], "fill": "dash" } } ] } ] }, "gridPos": { "h": 9, "w": 8, "x": 0, "y": 19 }, "id": 23763572024, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "8.4.3-54429", "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "exemplar": true, "expr": "histogram_quantile(0.99, sum(rate(redpanda_kafka_request_latency_seconds_bucket{exported_instance=~\"[[exported_node]]\",instance=~\"[[node]]\",shard=~\"[[node_shard]]\",redpanda_request=\"produce\",redpanda_cloud_data_cluster_name=~\"[[data_cluster]]\"}[5m])) by (le, [[aggr_criteria]]))", "format": "time_series", "interval": "", "intervalFactor": 2, "legendFormat": "P99 Pod: {{pod}}, Node: {{instance}}, Shard: {{shard}}", "range": true, "refId": "A", "step": 10 }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "exemplar": true, "expr": "histogram_quantile(0.99, sum(rate(redpanda_kafka_request_latency_seconds_bucket{exported_instance=~\"[[exported_node]]\",instance=~\"[[node]]\",shard=~\"[[node_shard]]\",redpanda_request=\"produce\",redpanda_cloud_data_cluster_name=~\"[[data_cluster]]\"}[5m] offset 1d)) by (le, cluster))", "hide": false, "interval": "", "intervalFactor": 10, "legendFormat": "Yesterday cluster average", "refId": "B" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "exemplar": true, "expr": "histogram_quantile(0.95 , sum(rate(redpanda_kafka_request_latency_seconds_bucket{exported_instance=~\"[[exported_node]]\",instance=~\"[[node]]\",shard=~\"[[node_shard]]\",redpanda_request=\"produce\",redpanda_cloud_data_cluster_name=~\"[[data_cluster]]\"}[5m])) by (le, [[aggr_criteria]]))", "format": "time_series", "hide": false, "interval": "", "intervalFactor": 2, "legendFormat": "P95 Pod: {{pod}}, Node: {{instance}}, Shard: {{shard}}", "range": true, "refId": "C", "step": 10 }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "exemplar": true, "expr": "histogram_quantile(0.95, sum(rate(redpanda_kafka_request_latency_seconds_bucket{exported_instance=~\"[[exported_node]]\",instance=~\"[[node]]\",shard=~\"[[node_shard]]\",redpanda_request=\"produce\",redpanda_cloud_data_cluster_name=~\"[[data_cluster]]\"}[5m] offset 1d)) by (le, cluster))", "hide": false, "interval": "", "intervalFactor": 10, "legendFormat": "Yesterday cluster average", "refId": "D" } ], "title": "Produce Latency (p99)", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "description": "", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 50, "gradientMode": "opacity", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] }, "unit": "ops" }, "overrides": [ { "matcher": { "id": "byName", "options": "Yesterday cluster average" }, "properties": [ { "id": "custom.lineStyle", "value": { "dash": [ 10, 10 ], "fill": "dash" } } ] } ] }, "gridPos": { "h": 9, "w": 8, "x": 8, "y": 19 }, "id": 23763572026, "options": { "legend": { "calcs": [ "mean", "max" ], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "single", "sort": "none" } }, "pluginVersion": "8.4.3-54429", "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "exemplar": true, "expr": "sum(rate(redpanda_io_queue_total_write_ops{instance=~\"[[node]]\", exported_instance=~\"[[exported_node]]\",shard=~\"[[node_shard]]\",redpanda_cloud_data_cluster_name=\"[[data_cluster]]\"}[5m])) by ([[aggr_criteria]])", "format": "time_series", "hide": false, "interval": "", "intervalFactor": 1, "legendFormat": "Pod: {{ pod }}", "refId": "A", "step": 10 }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "exemplar": true, "expr": "sum(rate(redpanda_io_queue_total_write_ops{instance=~\"[[node]]\", exported_instance=~\"[[exported_node]]\",shard=~\"[[node_shard]]\",redpanda_cloud_data_cluster_name=\"[[data_cluster]]\"}[5m] offset 1d)) by (cluster)", "hide": false, "interval": "", "intervalFactor": 10, "legendFormat": "Yesterday cluster average", "refId": "B" } ], "title": "IO Queue Write Operations", "type": "timeseries" }, { "aliasColors": {}, "bars": false, "dashLength": 10, "dashes": false, "datasource": { "type": "prometheus", "uid": "prometheus" }, "editable": true, "error": false, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 50, "gradientMode": "opacity", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] }, "unit": "binBps" }, "overrides": [] }, "fill": 1, "fillGradient": 0, "gridPos": { "h": 9, "w": 8, "x": 16, "y": 19 }, "hiddenSeries": false, "id": 23763572029, "legend": { "avg": false, "current": false, "max": false, "min": false, "show": true, "total": false, "values": false }, "lines": true, "linewidth": 2, "nullPointMode": "null", "options": { "alertThreshold": true, "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "single", "sort": "none" } }, "percentage": false, "pluginVersion": "8.4.3-54429", "pointradius": 2, "points": false, "renderer": "flot", "seriesOverrides": [], "spaceLength": 10, "span": 4, "stack": false, "steppedLine": false, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "exemplar": true, "expr": "sum(rate(redpanda_kafka_request_bytes_total{instance=~\"[[node]]\",exported_instance=~\"[[exported_node]]\",shard=~\"[[node_shard]]\",redpanda_request=\"produce\",redpanda_cloud_data_cluster_name=~\"[[data_cluster]]\"}[5m])) by ([[aggr_criteria]])", "format": "time_series", "interval": "", "intervalFactor": 2, "legendFormat": "Pod: {{pod}}, Node: {{instance}}, Shard: {{shard}}", "refId": "A", "step": 10 } ], "thresholds": [], "timeRegions": [], "title": "Bytes Received via Kafka RPC", "tooltip": { "msResolution": true, "shared": true, "sort": 0, "value_type": "cumulative" }, "type": "timeseries", "xaxis": { "format": "", "logBase": 0, "mode": "time", "show": true, "values": [] }, "yaxes": [ { "format": "Bps", "logBase": 1, "min": 0, "show": true }, { "format": "short", "logBase": 1, "min": 0, "show": true } ], "yaxis": { "align": false } }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "description": "Measured within Redpanda", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 50, "gradientMode": "opacity", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "stepAfter", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] }, "unit": "s" }, "overrides": [ { "matcher": { "id": "byName", "options": "Yesterday cluster average" }, "properties": [ { "id": "custom.lineStyle", "value": { "dash": [ 10, 10 ], "fill": "dash" } } ] } ] }, "gridPos": { "h": 9, "w": 8, "x": 0, "y": 28 }, "id": 23763572025, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "8.4.3-54429", "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "exemplar": true, "expr": "histogram_quantile(0.99, sum(rate(redpanda_kafka_request_latency_seconds_bucket{instance=~\"[[node]]\",exported_instance=~\"[[exported_node]]\",shard=~\"[[node_shard]]\",redpanda_request=\"consume\",redpanda_cloud_data_cluster_name=~\"[[data_cluster]]\"}[5m])) by (le, [[aggr_criteria]]))", "format": "time_series", "interval": "", "intervalFactor": 2, "legendFormat": "P99 Pod: {{pod}}, Node: {{instance}}, Shard: {{shard}}", "range": true, "refId": "A", "step": 10 }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "exemplar": true, "expr": "histogram_quantile(0.99, sum(rate(redpanda_kafka_request_latency_seconds_bucket{instance=~\"[[node]]\",exported_instance=~\"[[exported_node]]\",shard=~\"[[node_shard]]\",redpanda_request=\"consume\",redpanda_cloud_data_cluster_name=~\"[[data_cluster]]\"}[5m] offset 1d)) by (le, cluster))", "hide": false, "interval": "", "intervalFactor": 10, "legendFormat": "Yesterday cluster average", "refId": "B" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "exemplar": true, "expr": "histogram_quantile(0.95 , sum(rate(redpanda_kafka_request_latency_seconds_bucket{instance=~\"[[node]]\",exported_instance=~\"[[exported_node]]\",shard=~\"[[node_shard]]\",redpanda_request=\"consume\",redpanda_cloud_data_cluster_name=~\"[[data_cluster]]\"}[5m])) by (le, [[aggr_criteria]]))", "format": "time_series", "hide": false, "interval": "", "intervalFactor": 2, "legendFormat": "P95 Pod: {{pod}}, Node: {{instance}}, Shard: {{shard}}", "range": true, "refId": "C", "step": 10 }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "exemplar": true, "expr": "histogram_quantile(0.95, sum(rate(redpanda_kafka_request_latency_seconds_bucket{instance=~\"[[node]]\",exported_instance=~\"[[exported_node]]\",shard=~\"[[node_shard]]\",redpanda_request=\"consume\",redpanda_cloud_data_cluster_name=~\"[[data_cluster]]\"}[5m] offset 1d)) by (le, cluster))", "hide": false, "interval": "", "intervalFactor": 10, "legendFormat": "Yesterday cluster average", "refId": "D" } ], "title": "Fetch Latency ", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "description": "", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 50, "gradientMode": "opacity", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] }, "unit": "ops" }, "overrides": [ { "matcher": { "id": "byName", "options": "Yesterday cluster average" }, "properties": [ { "id": "custom.lineStyle", "value": { "dash": [ 10, 10 ], "fill": "dash" } } ] } ] }, "gridPos": { "h": 9, "w": 8, "x": 8, "y": 28 }, "id": 23763572027, "options": { "legend": { "calcs": [ "mean", "max" ], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "single", "sort": "none" } }, "pluginVersion": "8.4.3-54429", "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "exemplar": true, "expr": "sum(rate(redpanda_io_queue_total_read_ops{instance=~\"[[node]]\", exported_instance=~\"[[exported_node]]\",shard=~\"[[node_shard]]\",redpanda_cloud_data_cluster_name=\"[[data_cluster]]\"}[5m])) by ([[aggr_criteria]])", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "Pod: {{pod}} Node: {{instance}} Partition: {{partition}} Shard: {{shard}}", "range": true, "refId": "A", "step": 10 }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "exemplar": true, "expr": "sum(rate(redpanda_io_queue_total_read_ops{instance=~\"[[node]]\", exported_instance=~\"[[exported_node]]\",shard=~\"[[node_shard]]\",redpanda_cloud_data_cluster_name=\"[[data_cluster]]\"}[5m] offset 1d)) by (cluster)", "hide": false, "interval": "", "intervalFactor": 10, "legendFormat": "Yesterday cluster average", "refId": "B" } ], "title": "IO Queue Read Operations", "type": "timeseries" }, { "aliasColors": {}, "bars": false, "dashLength": 10, "dashes": false, "datasource": { "type": "prometheus", "uid": "prometheus" }, "editable": true, "error": false, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisCenteredZero": false, "axisColorMode": "text", "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 50, "gradientMode": "opacity", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "insertNulls": false, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] }, "unit": "bytes" }, "overrides": [] }, "fill": 1, "fillGradient": 0, "gridPos": { "h": 9, "w": 8, "x": 16, "y": 28 }, "hiddenSeries": false, "id": 23763572030, "legend": { "avg": false, "current": false, "max": false, "min": false, "show": true, "total": false, "values": false }, "lines": true, "linewidth": 2, "nullPointMode": "null", "options": { "alertThreshold": true, "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "single", "sort": "none" } }, "percentage": false, "pluginVersion": "8.4.3-54429", "pointradius": 2, "points": false, "renderer": "flot", "seriesOverrides": [], "spaceLength": 10, "span": 4, "stack": false, "steppedLine": false, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "exemplar": true, "expr": "sum(rate(redpanda_kafka_request_bytes_total{instance=~\"[[node]]\",exported_instance=~\"[[exported_node]]\",shard=~\"[[node_shard]]\",redpanda_request=\"consume\",redpanda_cloud_data_cluster_name=~\"[[data_cluster]]\"}[30s])) by ([[aggr_criteria]])", "format": "time_series", "interval": "", "intervalFactor": 2, "legendFormat": "Pod: {{pod}}, Node: {{instance}}, Shard: {{shard}}", "refId": "A", "step": 10 } ], "thresholds": [], "timeRegions": [], "title": "Bytes Sent via Kafka RPC", "tooltip": { "msResolution": true, "shared": true, "sort": 0, "value_type": "cumulative" }, "type": "timeseries", "xaxis": { "format": "", "logBase": 0, "mode": "time", "show": true, "values": [] }, "yaxes": [ { "format": "Bps", "logBase": 1, "min": 0, "show": true }, { "format": "short", "logBase": 1, "min": 0, "show": true } ], "yaxis": { "align": false } }, { "datasource": { "type": "prometheus", "uid": "grafana" }, "gridPos": { "h": 2, "w": 24, "x": 0, "y": 37 }, "id": 23763572039, "options": { "code": { "language": "plaintext", "showLineNumbers": false, "showMiniMap": false }, "content": "<h1 style=\"color:#87CEEB; border-bottom: 3px solid #87CEEB;\">Redpanda Memory</h1>", "mode": "html" }, "pluginVersion": "9.3.6", "span": 1, "transparent": true, "type": "text" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "description": "Total allocated memory", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "max": 1, "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "#EAB839", "value": 0.75 }, { "color": "red", "value": 0.9 } ] }, "unit": "percentunit" }, "overrides": [] }, "gridPos": { "h": 8, "w": 8, "x": 0, "y": 39 }, "id": 23763572040, "options": { "orientation": "auto", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showThresholdLabels": false, "showThresholdMarkers": true }, "pluginVersion": "9.3.6", "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "exemplar": true, "expr": "max by (exported_instance, instance) (redpanda_memory_allocated_memory{instance=~\"[[node]]\", exported_instance=~\"[[exported_node]]\",redpanda_cloud_data_cluster_name=~\"[[data_cluster]]\"} / (redpanda_memory_free_memory{instance=~\"[[node]]\", exported_instance=~\"[[exported_node]]\",redpanda_cloud_data_cluster_name=~\"[[data_cluster]]\"} + redpanda_memory_allocated_memory{instance=~\"[[node]]\", exported_instance=~\"[[exported_node]]\",redpanda_cloud_data_cluster_name=~\"[[data_cluster]]\"}))", "format": "time_series", "interval": "", "intervalFactor": 2, "legendFormat": "{{instance}}", "range": true, "refId": "A", "step": 10 } ], "title": "Allocated memory", "type": "gauge" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "description": "Free memory plus the memory occupied by the batch cache. This is how much memory Redpanda can allocate if needed after reclaim.", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "max": 1, "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "red" }, { "color": "orange", "value": 0.1 }, { "color": "yellow", "value": 0.2 }, { "color": "green", "value": 0.3 } ] }, "unit": "bytes" }, "overrides": [] }, "gridPos": { "h": 8, "w": 8, "x": 8, "y": 39 }, "id": 23763572041, "options": { "orientation": "auto", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showThresholdLabels": false, "showThresholdMarkers": true }, "pluginVersion": "9.3.6", "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "exemplar": true, "expr": "max by (exported_instance, instance) (redpanda_memory_available_memory{instance=~\"[[node]]\", exported_instance=~\"[[exported_node]]\",redpanda_cloud_data_cluster_name=~\"[[data_cluster]]\"})", "format": "time_series", "interval": "", "intervalFactor": 2, "legendFormat": "{{instance}}", "range": true, "refId": "A", "step": 10 } ], "title": "Available memory", "type": "gauge" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "description": "The lowest available memory over the lifetime of the node (the closest the node has been to out-of-memory).", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "max": 1, "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "red" }, { "color": "orange", "value": 0.1 }, { "color": "yellow", "value": 0.2 }, { "color": "green", "value": 0.3 } ] }, "unit": "bytes" }, "overrides": [] }, "gridPos": { "h": 8, "w": 8, "x": 16, "y": 39 }, "id": 23763572042, "options": { "orientation": "auto", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showThresholdLabels": false, "showThresholdMarkers": true }, "pluginVersion": "9.3.6", "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "exemplar": true, "expr": "max by (exported_instance, instance) (redpanda_memory_available_memory_low_water_mark{instance=~\"[[node]]\", exported_instance=~\"[[exported_node]]\",redpanda_cloud_data_cluster_name=~\"[[data_cluster]]\"})", "format": "time_series", "interval": "", "intervalFactor": 2, "legendFormat": "{{instance}}", "range": true, "refId": "A", "step": 10 } ], "title": "Available memory low watermark", "type": "gauge" }, { "datasource": { "type": "datasource", "uid": "grafana" }, "editable": true, "error": false, "gridPos": { "h": 2, "w": 24, "x": 0, "y": 47 }, "id": 23763572004, "options": { "code": { "language": "plaintext", "showLineNumbers": false, "showMiniMap": false }, "content": "<h1 style=\"color:#87CEEB; border-bottom: 3px solid #87CEEB;\">Latency</h1>", "mode": "html" }, "pluginVersion": "", "span": 1, "transparent": true, "type": "text" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "description": "Measured within Redpanda", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 50, "gradientMode": "opacity", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "stepAfter", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "s" }, "overrides": [ { "matcher": { "id": "byName", "options": "Yesterday cluster avg" }, "properties": [ { "id": "custom.lineStyle", "value": { "dash": [ 10, 10 ], "fill": "dash" } } ] } ] }, "gridPos": { "h": 15, "w": 6, "x": 0, "y": 49 }, "id": 23763571998, "options": { "legend": { "calcs": [ "mean", "max" ], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "8.4.3-54429", "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "exemplar": true, "expr": "histogram_quantile(0.95, sum(rate(redpanda_kafka_request_latency_seconds_bucket{redpanda_request=\"produce\", instance=~\"[[node]]\",exported_instance=~\"[[exported_node]]\",shard=~\"[[node_shard]]\",redpanda_cloud_data_cluster_name=~\"[[data_cluster]]\"}[5m])) by (le, [[aggr_criteria]]))", "format": "time_series", "interval": "", "intervalFactor": 2, "legendFormat": "Pod: {{pod}}, Node: {{instance}}, Shard: {{shard}}", "refId": "A", "step": 10 }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "exemplar": true, "expr": "histogram_quantile(0.95, sum(rate(redpanda_kafka_request_latency_seconds_bucket{redpanda_request=\"produce\", instance=~\"[[node]]\",exported_instance=~\"[[exported_node]]\",shard=~\"[[node_shard]]\",redpanda_cloud_data_cluster_name=~\"[[data_cluster]]\"}[5m] offset 1d)) by (le, cluster))", "hide": false, "interval": "", "intervalFactor": 10, "legendFormat": "Yesterday cluster avg", "refId": "B" } ], "title": "Produce Latency (p95)", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "description": "Measured within Redpanda", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 50, "gradientMode": "opacity", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "stepAfter", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "s" }, "overrides": [ { "matcher": { "id": "byName", "options": "Yesterday cluster average" }, "properties": [ { "id": "custom.lineStyle", "value": { "dash": [ 10, 10 ], "fill": "dash" } } ] } ] }, "gridPos": { "h": 15, "w": 6, "x": 6, "y": 49 }, "id": 23763572000, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "8.4.3-54429", "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "exemplar": true, "expr": "histogram_quantile(0.99, sum(rate(redpanda_kafka_request_latency_seconds_bucket{redpanda_request=\"produce\", instance=~\"[[node]]\",exported_instance=~\"[[exported_node]]\",shard=~\"[[node_shard]]\",redpanda_cloud_data_cluster_name=~\"[[data_cluster]]\"}[5m])) by (le, [[aggr_criteria]]))", "format": "time_series", "interval": "", "intervalFactor": 2, "legendFormat": "Pod: {{pod}}, Node: {{instance}}, Shard: {{shard}}", "refId": "A", "step": 10 }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "exemplar": true, "expr": "histogram_quantile(0.99, sum(rate(redpanda_kafka_request_latency_seconds_bucket{redpanda_request=\"produce\", instance=~\"[[node]]\",exported_instance=~\"[[exported_node]]\",shard=~\"[[node_shard]]\",redpanda_cloud_data_cluster_name=~\"[[data_cluster]]\"}[5m] offset 1d)) by (le, cluster))", "hide": false, "interval": "", "intervalFactor": 10, "legendFormat": "Yesterday cluster average", "refId": "B" } ], "title": "Produce Latency (p99)", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "description": "Measured within Redpanda", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 50, "gradientMode": "opacity", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "stepAfter", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "s" }, "overrides": [ { "matcher": { "id": "byName", "options": "Yesterday cluster avg" }, "properties": [ { "id": "custom.lineStyle", "value": { "dash": [ 10, 10 ], "fill": "dash" } } ] } ] }, "gridPos": { "h": 15, "w": 6, "x": 12, "y": 49 }, "id": 23763571999, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "8.4.3-54429", "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "exemplar": true, "expr": "histogram_quantile(0.95, sum(rate(redpanda_kafka_request_latency_seconds_bucket{redpanda_request=\"consume\", instance=~\"[[node]]\",exported_instance=~\"[[exported_node]]\",shard=~\"[[node_shard]]\",redpanda_cloud_data_cluster_name=~\"[[data_cluster]]\"}[5m])) by (le, [[aggr_criteria]]))", "format": "time_series", "interval": "", "intervalFactor": 2, "legendFormat": "Pod: {{pod}}, Node: {{instance}}, Shard: {{shard}}", "refId": "A", "step": 10 }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "exemplar": true, "expr": "histogram_quantile(0.95, sum(rate(redpanda_kafka_request_latency_seconds_bucket{redpanda_request=\"consume\", instance=~\"[[node]]\",exported_instance=~\"[[exported_node]]\",shard=~\"[[node_shard]]\",redpanda_cloud_data_cluster_name=~\"[[data_cluster]]\"}[5m] offset 1d)) by (le, cluster))", "hide": false, "interval": "", "intervalFactor": 10, "legendFormat": "Yesterday cluster avg", "refId": "B" } ], "title": "Fetch Latency (p95)", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "description": "Measured within Redpanda", "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 50, "gradientMode": "opacity", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "stepAfter", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "s" }, "overrides": [ { "matcher": { "id": "byName", "options": "Yesterday cluster avg" }, "properties": [ { "id": "custom.lineStyle", "value": { "dash": [ 10, 10 ], "fill": "dash" } } ] } ] }, "gridPos": { "h": 15, "w": 6, "x": 18, "y": 49 }, "id": 23763572001, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "8.4.3-54429", "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "exemplar": true, "expr": "histogram_quantile(0.99, sum(rate(redpanda_kafka_request_latency_seconds_bucket{instance=~\"$node\", instance=~\"[[node]]\",exported_instance=~\"[[exported_node]]\",shard=~\"[[node_shard]]\",redpanda_cloud_data_cluster_name=~\"[[data_cluster]]\"}[5m])) by (le, [[aggr_criteria]]))", "format": "time_series", "interval": "", "intervalFactor": 2, "legendFormat": "Pod: {{pod}}, Node: {{instance}}, Shard: {{shard}}", "refId": "A", "step": 10 }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "exemplar": true, "expr": "histogram_quantile(0.99, sum(rate(redpanda_kafka_request_latency_seconds_bucket{instance=~\"$node\", instance=~\"[[node]]\",exported_instance=~\"[[exported_node]]\",shard=~\"[[node_shard]]\",redpanda_cloud_data_cluster_name=~\"[[data_cluster]]\"}[5m] offset 1d)) by (le, cluster))", "hide": false, "interval": "", "intervalFactor": 10, "legendFormat": "Yesterday cluster avg", "refId": "B" } ], "title": "Fetch Latency (p99)", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 30, "gradientMode": "opacity", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "stepAfter", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "s" }, "overrides": [ { "matcher": { "id": "byName", "options": "Yesterday cluster avg" }, "properties": [ { "id": "custom.lineStyle", "value": { "dash": [ 10, 10 ], "fill": "dash" } } ] } ] }, "gridPos": { "h": 6, "w": 12, "x": 0, "y": 64 }, "id": 4, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "8.4.3-54429", "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "exemplar": true, "expr": "histogram_quantile(0.95, sum(rate(redpanda_kafka_request_latency_seconds_bucket{instance=~\"[[node]]\",exported_instance=~\"[[exported_node]]\",shard=~\"[[node_shard]]\",redpanda_cloud_data_cluster_name=~\"[[data_cluster]]\"}[5m])) by (le, [[aggr_criteria]]))", "format": "time_series", "interval": "", "intervalFactor": 2, "legendFormat": "Pod: {{pod}}, Node: {{instance}}, Shard: {{shard}}", "refId": "A", "step": 10 }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "exemplar": true, "expr": "histogram_quantile(0.95, sum(rate(redpanda_kafka_request_latency_seconds_bucket{instance=~\"[[node]]\",exported_instance=~\"[[exported_node]]\",shard=~\"[[node_shard]]\",redpanda_cloud_data_cluster_name=~\"[[data_cluster]]\"}[5m] offset 1d)) by (le, cluster))", "hide": false, "interval": "", "intervalFactor": 10, "legendFormat": "Yesterday cluster avg", "refId": "B" } ], "title": "Kafka RPC: Latency (p95)", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 30, "gradientMode": "opacity", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "stepAfter", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "s" }, "overrides": [ { "matcher": { "id": "byName", "options": "Yesterday cluster avg" }, "properties": [ { "id": "custom.lineStyle", "value": { "dash": [ 10, 10 ], "fill": "dash" } } ] } ] }, "gridPos": { "h": 6, "w": 12, "x": 12, "y": 64 }, "id": 5, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "8.4.3-54429", "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "exemplar": true, "expr": "histogram_quantile(0.99, sum(rate(redpanda_kafka_request_latency_seconds_bucket{instance=~\"[[node]]\",exported_instance=~\"[[exported_node]]\",shard=~\"[[node_shard]]\",redpanda_cloud_data_cluster_name=~\"[[data_cluster]]\"}[5m])) by (le, [[aggr_criteria]]))", "format": "time_series", "interval": "", "intervalFactor": 2, "legendFormat": "Pod: {{pod}}, Node: {{instance}}, Shard: {{shard}}", "refId": "A", "step": 10 }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "exemplar": true, "expr": "histogram_quantile(0.99, sum(rate(redpanda_kafka_request_latency_seconds_bucket{instance=~\"[[node]]\",exported_instance=~\"[[exported_node]]\",shard=~\"[[node_shard]]\",redpanda_cloud_data_cluster_name=~\"[[data_cluster]]\"}[5m] offset 1d)) by (le, cluster))", "hide": false, "interval": "", "intervalFactor": 10, "legendFormat": "Yesterday cluster avg", "refId": "B" } ], "title": "Kafka RPC: Latency (p99)", "type": "timeseries" }, { "datasource": { "type": "datasource", "uid": "grafana" }, "editable": true, "error": false, "gridPos": { "h": 2, "w": 12, "x": 0, "y": 70 }, "id": 6, "options": { "code": { "language": "plaintext", "showLineNumbers": false, "showMiniMap": false }, "content": "<h1 style=\"color:#87CEEB; border-bottom: 3px solid #87CEEB;\">Internal RPC Latency</h1>", "mode": "html" }, "pluginVersion": "", "span": 1, "transparent": true, "type": "text" }, { "datasource": { "type": "datasource", "uid": "grafana" }, "editable": true, "error": false, "gridPos": { "h": 2, "w": 12, "x": 12, "y": 70 }, "id": 9, "options": { "code": { "language": "plaintext", "showLineNumbers": false, "showMiniMap": false }, "content": "<h1 style=\"color:#87CEEB; border-bottom: 3px solid #87CEEB;\">Throughput</h1>", "mode": "html" }, "pluginVersion": "", "span": 1, "transparent": true, "type": "text" }, { "aliasColors": {}, "bars": false, "dashLength": 10, "dashes": false, "datasource": { "type": "prometheus", "uid": "prometheus" }, "editable": true, "error": false, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 1, "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 } ] }, "unit": "s" }, "overrides": [] }, "fill": 1, "fillGradient": 0, "gridPos": { "h": 6, "w": 6, "x": 0, "y": 72 }, "hiddenSeries": false, "id": 7, "legend": { "avg": false, "current": false, "max": false, "min": false, "show": true, "total": false, "values": false }, "lines": true, "linewidth": 2, "nullPointMode": "null as zero", "options": { "alertThreshold": true, "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "single", "sort": "none" } }, "percentage": false, "pluginVersion": "8.4.3-54429", "pointradius": 2, "points": false, "renderer": "flot", "seriesOverrides": [], "spaceLength": 10, "span": 4, "stack": false, "steppedLine": true, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "exemplar": true, "expr": "histogram_quantile(0.95, sum(rate(redpanda_rpc_request_latency_seconds_bucket{instance=~\"[[node]]\",exported_instance=~\"[[exported_node]]\",shard=~\"[[node_shard]]\",redpanda_cloud_data_cluster_name=~\"[[data_cluster]]\"}[5m])) by (le, [[aggr_criteria]]))", "format": "time_series", "interval": "", "intervalFactor": 2, "legendFormat": "Pod: {{pod}}, Node: {{instance}}, Shard: {{shard}}", "refId": "A", "step": 10 } ], "thresholds": [], "timeRegions": [], "title": "internal_rpc: Latency (p95)", "tooltip": { "msResolution": true, "shared": true, "sort": 0, "value_type": "individual" }, "type": "timeseries", "xaxis": { "format": "", "logBase": 0, "mode": "time", "show": true, "values": [] }, "yaxes": [ { "$$hashKey": "object:411", "format": "µs", "logBase": 1, "min": 0, "show": true }, { "$$hashKey": "object:412", "format": "short", "logBase": 1, "min": 0, "show": true } ], "yaxis": { "align": false } }, { "aliasColors": {}, "bars": false, "dashLength": 10, "dashes": false, "datasource": { "type": "prometheus", "uid": "prometheus" }, "editable": true, "error": false, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "s" }, "overrides": [] }, "fill": 1, "fillGradient": 0, "gridPos": { "h": 6, "w": 6, "x": 6, "y": 72 }, "hiddenSeries": false, "id": 8, "legend": { "avg": false, "current": false, "max": false, "min": false, "show": true, "total": false, "values": false }, "lines": true, "linewidth": 2, "nullPointMode": "null as zero", "options": { "alertThreshold": true, "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "single", "sort": "none" } }, "percentage": false, "pluginVersion": "8.4.3-54429", "pointradius": 2, "points": false, "renderer": "flot", "seriesOverrides": [], "spaceLength": 10, "span": 4, "stack": false, "steppedLine": true, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "exemplar": true, "expr": "histogram_quantile(0.99, sum(rate(redpanda_rpc_request_latency_seconds_bucket{instance=~\"[[node]]\",exported_instance=~\"[[exported_node]]\",shard=~\"[[node_shard]]\",redpanda_cloud_data_cluster_name=~\"[[data_cluster]]\"}[5m])) by (le, [[aggr_criteria]]))", "format": "time_series", "interval": "", "intervalFactor": 2, "legendFormat": "Pod: {{pod}}, Node: {{instance}}, Shard: {{shard}}", "refId": "A", "step": 10 } ], "thresholds": [], "timeRegions": [], "title": "internal_rpc: Latency (p99)", "tooltip": { "msResolution": true, "shared": true, "sort": 0, "value_type": "individual" }, "type": "timeseries", "xaxis": { "format": "", "logBase": 0, "mode": "time", "show": true, "values": [] }, "yaxes": [ { "$$hashKey": "object:500", "format": "µs", "logBase": 1, "min": 0, "show": true }, { "$$hashKey": "object:501", "format": "short", "logBase": 1, "min": 0, "show": true } ], "yaxis": { "align": false } }, { "aliasColors": {}, "bars": false, "dashLength": 10, "dashes": false, "datasource": { "type": "prometheus", "uid": "prometheus" }, "editable": true, "error": false, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "Bps" }, "overrides": [] }, "fill": 1, "fillGradient": 0, "gridPos": { "h": 6, "w": 6, "x": 12, "y": 72 }, "hiddenSeries": false, "id": 10, "legend": { "avg": false, "current": false, "max": false, "min": false, "show": true, "total": false, "values": false }, "lines": true, "linewidth": 2, "nullPointMode": "null", "options": { "alertThreshold": true, "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "single", "sort": "none" } }, "percentage": false, "pluginVersion": "8.4.3-54429", "pointradius": 2, "points": false, "renderer": "flot", "seriesOverrides": [], "spaceLength": 10, "span": 4, "stack": false, "steppedLine": false, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "exemplar": true, "expr": "sum(rate(redpanda_kafka_request_bytes_total{redpanda_request=\"consume\", instance=~\"[[node]]\",exported_instance=~\"[[exported_node]]\",exported_instance=~\"[[exported_node]]\",shard=~\"[[node_shard]]\",redpanda_cloud_data_cluster_name=~\"[[data_cluster]]\"}[5m])) by ([[aggr_criteria]])", "format": "time_series", "interval": "", "intervalFactor": 2, "legendFormat": "pod: {{pod}}, node: {{instance}}, namespace: {{namespace}}, partition: {{partition}}, shard: {{shard}}, topic: {{topic}}", "refId": "A", "step": 10 } ], "thresholds": [], "timeRegions": [], "title": "Rate - Total number of bytes read", "tooltip": { "msResolution": true, "shared": true, "sort": 0, "value_type": "cumulative" }, "type": "timeseries", "xaxis": { "format": "", "logBase": 0, "mode": "time", "show": true, "values": [] }, "yaxes": [ { "format": "Bps", "logBase": 1, "min": 0, "show": true }, { "format": "short", "logBase": 1, "min": 0, "show": true } ], "yaxis": { "align": false } }, { "aliasColors": {}, "bars": false, "dashLength": 10, "dashes": false, "datasource": { "type": "prometheus", "uid": "prometheus" }, "editable": true, "error": false, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "Bps" }, "overrides": [] }, "fill": 1, "fillGradient": 0, "gridPos": { "h": 6, "w": 6, "x": 18, "y": 72 }, "hiddenSeries": false, "id": 11, "legend": { "avg": false, "current": false, "max": false, "min": false, "show": true, "total": false, "values": false }, "lines": true, "linewidth": 2, "nullPointMode": "null", "options": { "alertThreshold": true, "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "single", "sort": "none" } }, "percentage": false, "pluginVersion": "8.4.3-54429", "pointradius": 2, "points": false, "renderer": "flot", "seriesOverrides": [], "spaceLength": 10, "span": 4, "stack": false, "steppedLine": false, "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "exemplar": true, "expr": "sum(rate(redpanda_kafka_request_bytes_total{instance=~\"[[node]]\",exported_instance=~\"[[exported_node]]\",shard=~\"[[node_shard]]\",redpanda_request=\"produce\",redpanda_cloud_data_cluster_name=~\"[[data_cluster]]\"}[30s])) by ([[aggr_criteria]])", "format": "time_series", "interval": "", "intervalFactor": 2, "legendFormat": "pod: {{pod}}, node: {{instance}}, namespace: {{namespace}}, partition: {{partition}}, shard: {{shard}}, topic: {{topic}}", "refId": "A", "step": 10 } ], "thresholds": [], "timeRegions": [], "title": "Rate - Total number of bytes written", "tooltip": { "msResolution": true, "shared": true, "sort": 0, "value_type": "cumulative" }, "type": "timeseries", "xaxis": { "format": "", "logBase": 0, "mode": "time", "show": true, "values": [] }, "yaxes": [ { "format": "Bps", "logBase": 1, "min": 0, "show": true }, { "format": "short", "logBase": 1, "min": 0, "show": true } ], "yaxis": { "align": false } }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 0, "gradientMode": "none", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "stepAfter", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": true, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] }, "unit": "none" }, "overrides": [] }, "gridPos": { "h": 9, "w": 12, "x": 0, "y": 78 }, "id": 156, "options": { "legend": { "calcs": [ "lastNotNull", "max" ], "displayMode": "table", "placement": "right", "showLegend": true, "sortBy": "Last *", "sortDesc": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "8.4.3-54429", "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "exemplar": true, "expr": "topk by(redpanda_topic) (15, sum by(redpanda_topic, redpanda_namespace, redpanda_cloud_data_cluster_name) (redpanda_kafka_under_replicated_replicas{redpanda_cloud_data_cluster_name=~\"[[data_cluster]]\"}!=0))", "hide": false, "interval": "", "intervalFactor": 5, "legendFormat": "{{redpanda_topic}}/{{redpanda_namespace}}/{{redpanda_cloud_data_cluster_name}}", "range": true, "refId": "A" } ], "title": "Under replicated partitions by topic", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "description": "\n", "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "custom": { "align": "auto", "cellOptions": { "type": "auto" }, "inspect": false }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green" } ] }, "unit": "none" }, "overrides": [] }, "gridPos": { "h": 9, "w": 12, "x": 12, "y": 78 }, "id": 155, "options": { "footer": { "fields": "", "reducer": [ "sum" ], "show": false }, "showHeader": true, "sortBy": [ { "desc": true, "displayName": "Under Replicated Partition Count" } ] }, "pluginVersion": "", "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "exemplar": false, "expr": "max by(redpanda_namespace, redpanda_topic) (redpanda_kafka_partitions) - count by(redpanda_namespace, redpanda_topic) (count by (redpanda_namespace, redpanda_topic, redpanda_partition) (redpanda_kafka_under_replicated_replicas)!=0)!=0", "format": "table", "instant": true, "interval": "", "legendFormat": "__auto", "queryType": "randomWalk", "range": false, "refId": "A" } ], "title": "Leaderless Partitions", "transformations": [ { "id": "organize", "options": { "excludeByName": { "Time": true, "Value": false, "__name__": true, "byoc": true, "container": true, "data_cluster_uuid": true, "endpoint": true, "exported_namespace": true, "instance": true, "job": true, "namespace": true, "pod": true, "provider": true, "redpanda_cloud_data_cluster_name": true, "region": true, "shard": true, "topic": false }, "indexByName": { "Time": 0, "Value": 3, "redpanda_namespace": 1, "redpanda_topic": 2 }, "renameByName": { "Value": "Leaderless Partition Count", "instance": "Node IP", "namespace": "Namespace", "pod": "POD", "redpanda_cloud_data_cluster_name": "Cluster", "redpanda_namespace": "Namespace", "redpanda_topic": "Topic", "shard": "", "topic": "" } } } ], "type": "table" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "fieldConfig": { "defaults": { "color": { "mode": "palette-classic" }, "custom": { "axisLabel": "", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 2, "gradientMode": "hue", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "linear", "lineStyle": { "fill": "solid" }, "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": false, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "green" } ] }, "unit": "percentunit" }, "overrides": [ { "matcher": { "id": "byName", "options": "Yesterday cluster average" }, "properties": [ { "id": "custom.lineStyle", "value": { "dash": [ 10, 10 ], "fill": "dash" } } ] } ] }, "gridPos": { "h": 8, "w": 12, "x": 0, "y": 87 }, "id": 23763572003, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "single", "sort": "none" } }, "pluginVersion": "8.4.3-54429", "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "exemplar": true, "expr": "avg by([[aggr_criteria]]) (rate(redpanda_cpu_busy_seconds_total{instance=~\"[[node]]\", exported_instance=~\"[[exported_node]]\",shard=~\"[[node_shard]]\", redpanda_cloud_data_cluster_name=~\"[[data_cluster]]\"}[$__rate_interval]))", "format": "time_series", "interval": "", "intervalFactor": 1, "legendFormat": "Pod: {{pod}}, Node: {{instance}}, Shard: {{shard}}", "range": true, "refId": "A", "step": 10 }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "exemplar": true, "expr": "avg by([[aggr_criteria]]) (rate(redpanda_cpu_busy_seconds_total{instance=~\"[[node]]\", exported_instance=~\"[[exported_node]]\",shard=~\"[[node_shard]]\", redpanda_cloud_data_cluster_name=~\"[[data_cluster]]\"}[$__rate_interval] offset 1d))", "hide": false, "interval": "", "intervalFactor": 10, "legendFormat": "Yesterday cluster average", "refId": "B" } ], "title": "CPU utilization (Reactor)", "type": "timeseries" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "custom": { "axisLabel": "Leadership changes / 5 mins", "axisPlacement": "auto", "barAlignment": 0, "drawStyle": "line", "fillOpacity": 50, "gradientMode": "opacity", "hideFrom": { "legend": false, "tooltip": false, "viz": false }, "lineInterpolation": "stepAfter", "lineWidth": 1, "pointSize": 5, "scaleDistribution": { "type": "linear" }, "showPoints": "never", "spanNulls": true, "stacking": { "group": "A", "mode": "none" }, "thresholdsStyle": { "mode": "off" } }, "mappings": [], "min": 0, "thresholds": { "mode": "absolute", "steps": [ { "color": "light-blue" }, { "color": "red", "value": 80 } ] }, "unit": "short" }, "overrides": [ { "matcher": { "id": "byName", "options": "Yesterday cluster avg" }, "properties": [ { "id": "custom.lineStyle", "value": { "dash": [ 10, 10 ], "fill": "dash" } } ] }, { "matcher": { "id": "byName", "options": "Pod: , Node: 192.168.1.120:9644" }, "properties": [ { "id": "color", "value": { "fixedColor": "green", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Pod: , Node: 192.168.19.112:9644" }, "properties": [ { "id": "color", "value": { "fixedColor": "yellow", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Pod: , Node: 192.168.56.67:9644" }, "properties": [ { "id": "color", "value": { "fixedColor": "orange", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Pod: , Node: 192.168.65.78:9644" }, "properties": [ { "id": "color", "value": { "fixedColor": "red", "mode": "fixed" } } ] }, { "matcher": { "id": "byName", "options": "Pod: , Node: 192.168.80.139:9644" }, "properties": [ { "id": "color", "value": { "fixedColor": "blue", "mode": "fixed" } } ] } ] }, "gridPos": { "h": 8, "w": 12, "x": 12, "y": 87 }, "id": 23763572009, "options": { "legend": { "calcs": [], "displayMode": "list", "placement": "bottom", "showLegend": true }, "tooltip": { "mode": "multi", "sort": "none" } }, "pluginVersion": "8.4.3-54429", "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "exemplar": true, "expr": "sum(rate(redpanda_raft_leadership_changes{redpanda_cloud_data_cluster_name=\"[[data_cluster]]\"}[5m])) by ([[aggr_criteria]])", "hide": false, "interval": "", "intervalFactor": 1, "legendFormat": "Pod: {{pod}}, Node: {{instance}}", "range": true, "refId": "B" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "exemplar": true, "expr": "sum(rate(redpanda_raft_leadership_changes{redpanda_cloud_data_cluster_name=\"[[data_cluster]]\"}[5m] offset 1d)) by (cluster)", "hide": false, "interval": "", "intervalFactor": 10, "legendFormat": "Yesterday cluster avg", "refId": "A" } ], "title": "Leadership Transfers", "type": "timeseries" } ], "refresh": "5s", "schemaVersion": 38, "style": "dark", "tags": [], "templating": { "list": [ { "current": { "selected": false, "text": "Prometheus", "value": "prometheus" }, "hide": 0, "includeAll": false, "label": "Data Source", "multi": false, "name": "DS_PROMETHEUS", "options": [], "query": "prometheus", "refresh": 1, "regex": "", "skipUrlSync": false, "type": "datasource" }, { "allFormat": "", "allValue": ".*", "current": { "selected": false, "text": "All", "value": "$__all" }, "datasource": { "type": "prometheus", "uid": "prometheus" }, "definition": "", "hide": 0, "includeAll": true, "label": "Node", "multi": true, "multiFormat": "", "name": "node", "options": [], "query": { "query": "label_values(instance)", "refId": "grafanacloud-redpandaio-prom-node-Variable-Query" }, "refresh": 1, "regex": "", "skipUrlSync": false, "sort": 1, "tagValuesQuery": "", "tagsQuery": "", "type": "query", "useTags": false }, { "allFormat": "", "allValue": ".*", "current": { "selected": false, "text": "All", "value": "$__all" }, "datasource": { "type": "prometheus", "uid": "prometheus" }, "definition": "label_values(exported_instance)", "hide": 0, "includeAll": true, "label": "Exported Node", "multi": true, "multiFormat": "", "name": "exported_node", "options": [], "query": { "query": "label_values(exported_instance)", "refId": "StandardVariableQuery" }, "refresh": 1, "regex": "", "skipUrlSync": false, "sort": 1, "tagValuesQuery": "", "tagsQuery": "", "type": "query", "useTags": false }, { "allFormat": "", "allValue": ".*", "current": { "selected": false, "text": "All", "value": "$__all" }, "datasource": { "type": "prometheus", "uid": "prometheus" }, "definition": "", "hide": 0, "includeAll": true, "label": "Shard", "multi": true, "multiFormat": "", "name": "node_shard", "options": [], "query": { "query": "label_values(shard)", "refId": "grafanacloud-redpandaio-prom-node_shard-Variable-Query" }, "refresh": 1, "regex": "", "skipUrlSync": false, "sort": 1, "tagValuesQuery": "", "tagsQuery": "", "type": "query", "useTags": false }, { "current": { "selected": true, "text": "cluster", "value": "cluster" }, "hide": 0, "includeAll": false, "label": "Aggregate by", "multi": false, "name": "aggr_criteria", "options": [ { "selected": true, "text": "cluster", "value": "cluster" }, { "selected": false, "text": "pod", "value": "pod" }, { "selected": false, "text": "instance", "value": "instance" }, { "selected": false, "text": "shard", "value": "shard" }, { "selected": false, "text": "instance,shard", "value": "instance,shard" }, { "selected": false, "text": "pod,shard", "value": "pod,shard" } ], "query": "cluster, pod, instance, shard, instance\\,shard, pod\\,shard", "queryValue": "", "skipUrlSync": false, "type": "custom" }, { "current": { "isNone": true, "selected": false, "text": "None", "value": "" }, "datasource": { "type": "prometheus", "uid": "prometheus" }, "definition": "label_values(redpanda_cloud_data_cluster_name)", "hide": 0, "includeAll": false, "label": "Data cluster", "multi": true, "name": "data_cluster", "options": [], "query": { "query": "label_values(redpanda_cloud_data_cluster_name)", "refId": "StandardVariableQuery" }, "refresh": 1, "regex": "", "skipUrlSync": false, "sort": 1, "tagValuesQuery": "", "tagsQuery": "", "type": "query", "useTags": false }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "filters": [], "hide": 0, "name": "Filters", "skipUrlSync": false, "type": "adhoc" } ] }, "time": { "from": "now-15m", "to": "now" }, "timepicker": { "refresh_intervals": [ "5s", "10s", "30s", "1m", "5m", "15m", "30m", "1h", "2h", "1d" ], "time_options": [ "5m", "15m", "1h", "6h", "12h", "24h", "2d", "7d", "30d" ] }, "timezone": "", "title": "Redpanda Ops Dashboard", "uid": "FejE4c6nz", "version": 2, "weekStart": "" }
0
dashboards
/mono/helm/grafana/dashboards/triangular-arbitrage.json
{ "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" } ] }, "description": "", "editable": true, "fiscalYearStartMonth": 0, "graphTooltip": 0, "links": [], "liveNow": false, "panels": [ { "datasource": { "type": "grafana-postgresql-datasource", "uid": "postgresql" }, "fieldConfig": { "defaults": { "color": { "mode": "fixed" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "#EAB839", "value": 80 } ] } }, "overrides": [ { "matcher": { "id": "byRegexp", "options": ".*\\bSell\\b.*" }, "properties": [ { "id": "color", "value": { "fixedColor": "red", "mode": "fixed" } } ] }, { "matcher": { "id": "byRegexp", "options": ".*\\bBuy\\b.*" }, "properties": [ { "id": "color", "value": { "fixedColor": "green", "mode": "fixed" } } ] } ] }, "gridPos": { "h": 9, "w": 5, "x": 0, "y": 0 }, "id": 2, "options": { "colorMode": "background", "graphMode": "area", "justifyMode": "auto", "orientation": "horizontal", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showPercentChange": false, "textMode": "value_and_name", "wideLayout": true }, "pluginVersion": "10.4.2", "targets": [ { "datasource": { "type": "postgres", "uid": "postgresql" }, "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT COUNT(order_side) AS \"Buy Open\" FROM orders WHERE order_side = 'BUY' AND exchange = '$exchange' AND order_status = 'OPEN'", "refId": "Open Buy Orders", "sql": { "columns": [ { "alias": "\"Open Buy Orders\"", "name": "COUNT", "parameters": [ { "name": "order_side", "type": "functionParameter" } ], "type": "function" } ], "groupBy": [], "limit": 50, "whereJsonTree": { "children1": [ { "id": "9bb9b9a9-0123-4456-b89a-b18a09265da3", "properties": { "field": "order_side", "operator": "equal", "value": [ "BUY" ], "valueSrc": [ "value" ], "valueType": [ "text" ] }, "type": "rule" } ], "id": "9baa9b9a-89ab-4cde-b012-318a0616d6bd", "properties": { "conjunction": "AND" }, "type": "group" }, "whereString": "order_side = 'BUY'" }, "table": "orders" }, { "datasource": { "type": "postgres", "uid": "postgresql" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT COUNT(order_side) AS \"Buy Filled\" FROM orders WHERE order_side = 'BUY' AND exchange = '$exchange' AND order_status = 'FILLED' AND $__timeFilter(created_at)", "refId": "Filled Buy Orders", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 }, "table": "orders" }, { "datasource": { "type": "postgres", "uid": "postgresql" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT COUNT(order_side) AS \"Buy Closed\" FROM orders WHERE order_side = 'BUY' AND exchange = '$exchange' AND order_status = 'CANCELLED' AND $__timeFilter(created_at)", "refId": "Closed Buy Orders", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "type": "postgres", "uid": "postgresql" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT COUNT(order_side) AS \"Sell Open\" FROM orders WHERE order_side = 'SELL' AND exchange = '$exchange' AND order_status = 'OPEN'", "refId": "Open Sell Orders", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "type": "postgres", "uid": "postgresql" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT COUNT(order_side) AS \"Sell Filled\" FROM orders WHERE order_side = 'SELL' AND exchange = '$exchange' AND order_status = 'FILLED' AND $__timeFilter(created_at)", "refId": "Filled Sell Orders", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } }, { "datasource": { "type": "postgres", "uid": "postgresql" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT COUNT(order_side) AS \"Sell Closed\" FROM orders WHERE order_side = 'SELL' AND exchange = '$exchange' AND order_status = 'CANCELLED' AND $__timeFilter(created_at)", "refId": "Closed Sell Orders", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Orders", "type": "stat" }, { "datasource": { "type": "grafana-postgresql-datasource", "uid": "postgresql" }, "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": 9, "w": 14, "x": 5, "y": 0 }, "id": 4, "options": { "cellHeight": "sm", "footer": { "countRows": false, "fields": "", "reducer": [ "sum" ], "show": false }, "showHeader": true }, "pluginVersion": "10.4.2", "targets": [ { "datasource": { "type": "grafana-postgresql-datasource", "uid": "postgresql" }, "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT vba.asset, vba.amount, ad.venue\r\nFROM virtual_balance_accounts AS vba\r\nJOIN strat_balance_accounts AS sra ON vba.id = sra.vba_id\r\nJOIN account_details AS ad ON vba.account_id = ad.account_id\r\nWHERE sra.strat_run_id = '$strat_run_id';", "refId": "A", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Balances", "type": "table" }, { "datasource": { "type": "postgres", "uid": "postgresql" }, "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": 9, "w": 5, "x": 0, "y": 9 }, "id": 8, "options": { "cellHeight": "sm", "footer": { "countRows": false, "fields": "", "reducer": [ "sum" ], "show": false }, "frameIndex": 0, "showHeader": true }, "pluginVersion": "10.4.2", "targets": [ { "datasource": { "type": "postgres", "uid": "postgresql" }, "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT asset, sum(value) as total\r\nFROM (\r\n SELECT base AS asset, SUM(volume) AS value FROM trades WHERE order_side = 'BUY' AND exchange = '${exchange}' AND $__timeFilter(created_at) GROUP BY base\r\n UNION ALL\r\n SELECT quote AS asset, SUM(cost) AS value FROM trades WHERE order_side = 'SELL' AND exchange = '${exchange}' AND $__timeFilter(created_at) GROUP BY quote\r\n) AS totals\r\nGROUP BY asset\r\nORDER BY asset", "refId": "Bought", "sql": { "columns": [ { "parameters": [ { "name": "base", "type": "functionParameter" } ], "type": "function" }, { "name": "SUM", "parameters": [ { "name": "volume", "type": "functionParameter" } ], "type": "function" } ], "groupBy": [ { "property": { "name": "base", "type": "string" }, "type": "groupBy" } ], "limit": 50, "orderBy": { "property": { "type": "string" }, "type": "property" }, "whereJsonTree": { "children1": [ { "id": "8b9baaab-89ab-4cde-b012-318a09adebb7", "properties": { "field": "order_side", "operator": "equal", "value": [ "BUY" ], "valueSrc": [ "value" ], "valueType": [ "text" ] }, "type": "rule" } ], "id": "9baa9b9a-89ab-4cde-b012-318a0616d6bd", "type": "group" }, "whereString": "order_side = 'BUY'" }, "table": "trades" } ], "title": "Bought Assets", "type": "table" }, { "datasource": { "type": "postgres", "uid": "postgresql" }, "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": 9, "w": 14, "x": 5, "y": 9 }, "id": 13, "options": { "cellHeight": "sm", "footer": { "countRows": false, "fields": "", "reducer": [ "sum" ], "show": false }, "showHeader": true }, "pluginVersion": "10.4.2", "targets": [ { "datasource": { "type": "postgres", "uid": "postgresql" }, "editorMode": "code", "format": "table", "hide": false, "rawQuery": true, "rawSql": "SELECT order_side, volume, volume_filled AS \"volume filled\", order_status AS status, base || '_' || quote AS pair\r\nFROM orders\r\nWHERE order_status IN ( 'PENDING', 'NEW', 'OPEN' ) AND $__timeFilter(created_at)\r\nORDER BY status ASC ", "refId": "A", "sql": { "columns": [ { "parameters": [], "type": "function" } ], "groupBy": [ { "property": { "type": "string" }, "type": "groupBy" } ], "limit": 50 } } ], "title": "Open Orders", "type": "table" }, { "datasource": { "type": "postgres", "uid": "postgresql" }, "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": 9, "w": 5, "x": 0, "y": 18 }, "id": 14, "options": { "cellHeight": "sm", "footer": { "countRows": false, "fields": "", "reducer": [ "sum" ], "show": false }, "frameIndex": 0, "showHeader": true }, "pluginVersion": "10.4.2", "targets": [ { "datasource": { "type": "postgres", "uid": "postgresql" }, "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT asset, sum(value) as total\r\nFROM (\r\n SELECT base AS asset, SUM(volume) - SUM(volume_filled) AS value FROM orders WHERE order_side = 'BUY' AND exchange = '${exchange}' AND order_status IN('OPEN', 'PENDING', 'NEW') AND $__timeFilter(created_at) GROUP BY base\r\n UNION ALL\r\n SELECT quote AS asset, SUM(volume * price) - SUM(volume_filled * price) AS value FROM orders WHERE order_side = 'SELL' AND exchange = '${exchange}' AND order_status IN('OPEN', 'PENDING', 'NEW') AND $__timeFilter(created_at) GROUP BY quote\r\n) AS totals\r\nGROUP BY asset\r\nORDER BY asset", "refId": "Bought", "sql": { "columns": [ { "parameters": [ { "name": "base", "type": "functionParameter" } ], "type": "function" }, { "name": "SUM", "parameters": [ { "name": "volume", "type": "functionParameter" } ], "type": "function" } ], "groupBy": [ { "property": { "name": "base", "type": "string" }, "type": "groupBy" } ], "limit": 50, "orderBy": { "property": { "type": "string" }, "type": "property" }, "whereJsonTree": { "children1": [ { "id": "8b9baaab-89ab-4cde-b012-318a09adebb7", "properties": { "field": "order_side", "operator": "equal", "value": [ "BUY" ], "valueSrc": [ "value" ], "valueType": [ "text" ] }, "type": "rule" } ], "id": "9baa9b9a-89ab-4cde-b012-318a0616d6bd", "type": "group" }, "whereString": "order_side = 'BUY'" }, "table": "trades" } ], "title": "To Be Bought Assets", "type": "table" }, { "datasource": { "type": "postgres", "uid": "postgresql" }, "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": 9, "w": 5, "x": 5, "y": 18 }, "id": 9, "options": { "cellHeight": "sm", "footer": { "countRows": false, "fields": "", "reducer": [ "sum" ], "show": false }, "frameIndex": 0, "showHeader": true }, "pluginVersion": "10.4.2", "targets": [ { "datasource": { "type": "postgres", "uid": "postgresql" }, "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT asset, sum(value) as total\r\nFROM (\r\n SELECT base AS asset, SUM(volume) AS value FROM trades WHERE order_side = 'SELL' AND exchange = '${exchange}' AND $__timeFilter(created_at) GROUP BY base\r\n UNION ALL\r\n SELECT quote AS asset, SUM(cost) AS value FROM trades WHERE order_side = 'BUY' AND exchange = '${exchange}' AND $__timeFilter(created_at) GROUP BY quote\r\n) AS totals\r\nGROUP BY asset\r\n", "refId": "Sold", "sql": { "columns": [ { "parameters": [ { "name": "base", "type": "functionParameter" } ], "type": "function" }, { "name": "SUM", "parameters": [ { "name": "volume", "type": "functionParameter" } ], "type": "function" } ], "groupBy": [ { "property": { "name": "base", "type": "string" }, "type": "groupBy" } ], "limit": 50, "orderBy": { "property": { "name": [ "base" ], "type": "string" }, "type": "property" }, "whereJsonTree": { "children1": [ { "id": "8b9baaab-89ab-4cde-b012-318a09adebb7", "properties": { "field": "order_side", "operator": "equal", "value": [ "BUY" ], "valueSrc": [ "value" ], "valueType": [ "text" ] }, "type": "rule" } ], "id": "9baa9b9a-89ab-4cde-b012-318a0616d6bd", "type": "group" }, "whereString": "order_side = 'BUY'" }, "table": "trades" } ], "title": "Sold Assets", "type": "table" }, { "datasource": { "type": "postgres", "uid": "postgresql" }, "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": 9, "w": 5, "x": 10, "y": 18 }, "id": 12, "options": { "cellHeight": "sm", "footer": { "countRows": false, "fields": "", "reducer": [ "sum" ], "show": false }, "frameIndex": 0, "showHeader": true }, "pluginVersion": "10.4.2", "targets": [ { "datasource": { "type": "postgres", "uid": "postgresql" }, "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT asset, sum(value) as total\r\nFROM (\r\n SELECT base AS asset, SUM(volume) * -1 AS value FROM trades WHERE order_side = 'SELL' AND exchange = '${exchange}' AND $__timeFilter(created_at) GROUP BY base\r\n UNION ALL\r\n SELECT quote AS asset, SUM(cost) * -1 AS value FROM trades WHERE order_side = 'BUY' AND exchange = '${exchange}' AND $__timeFilter(created_at) GROUP BY quote\r\n UNION ALL\r\n SELECT base AS asset, SUM(volume) AS value FROM trades WHERE order_side = 'BUY' AND exchange = '${exchange}' AND $__timeFilter(created_at) GROUP BY base\r\n UNION ALL\r\n SELECT quote AS asset, SUM(cost) AS value FROM trades WHERE order_side = 'SELL' AND exchange = '${exchange}' AND $__timeFilter(created_at) GROUP BY quote\r\n) AS totals\r\nGROUP BY asset\r\n", "refId": "Bought Minus Sold", "sql": { "columns": [ { "parameters": [ { "name": "base", "type": "functionParameter" } ], "type": "function" }, { "name": "SUM", "parameters": [ { "name": "volume", "type": "functionParameter" } ], "type": "function" } ], "groupBy": [ { "property": { "name": "base", "type": "string" }, "type": "groupBy" } ], "limit": 50, "orderBy": { "property": { "name": [ "base" ], "type": "string" }, "type": "property" }, "whereJsonTree": { "children1": [ { "id": "8b9baaab-89ab-4cde-b012-318a09adebb7", "properties": { "field": "order_side", "operator": "equal", "value": [ "BUY" ], "valueSrc": [ "value" ], "valueType": [ "text" ] }, "type": "rule" } ], "id": "9baa9b9a-89ab-4cde-b012-318a0616d6bd", "type": "group" }, "whereString": "order_side = 'BUY'" }, "table": "trades" } ], "title": "Delta", "type": "table" }, { "datasource": { "type": "postgres", "uid": "postgresql" }, "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": 9, "w": 5, "x": 15, "y": 18 }, "id": 11, "options": { "cellHeight": "sm", "footer": { "countRows": false, "fields": "", "reducer": [ "sum" ], "show": false }, "showHeader": true }, "pluginVersion": "10.4.2", "targets": [ { "datasource": { "type": "postgres", "uid": "postgresql" }, "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT quote, SUM(fee) FROM trades WHERE exchange = '${exchange}' AND $__timeFilter(created_at) GROUP BY quote LIMIT 50 ", "refId": "A", "sql": { "columns": [ { "parameters": [ { "name": "quote", "type": "functionParameter" } ], "type": "function" }, { "name": "SUM", "parameters": [ { "name": "fee", "type": "functionParameter" } ], "type": "function" } ], "groupBy": [ { "property": { "name": "quote", "type": "string" }, "type": "groupBy" } ], "limit": 50 }, "table": "trades" } ], "title": "Fees", "type": "table" }, { "datasource": { "type": "postgres", "uid": "postgresql" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "custom": { "align": "auto", "cellOptions": { "type": "auto" }, "inspect": false }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] } }, "overrides": [] }, "gridPos": { "h": 9, "w": 5, "x": 5, "y": 27 }, "id": 15, "options": { "cellHeight": "sm", "footer": { "countRows": false, "fields": "", "reducer": [ "sum" ], "show": false }, "frameIndex": 0, "showHeader": true }, "pluginVersion": "10.4.2", "targets": [ { "datasource": { "type": "postgres", "uid": "postgresql" }, "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT asset, sum(value) as total\r\nFROM (\r\n SELECT base AS asset, SUM(volume - volume_filled) AS value FROM orders WHERE order_side = 'SELL' AND order_status IN('OPEN', 'NEW', 'PENDING') AND exchange = '${exchange}' AND $__timeFilter(created_at) GROUP BY base\r\n UNION ALL\r\n SELECT quote AS asset, SUM(price * volume) - SUM(price * volume_filled) AS value FROM orders WHERE order_side = 'BUY' AND order_status IN('OPEN', 'NEW', 'PENDING') AND exchange = '${exchange}' AND $__timeFilter(created_at) GROUP BY quote\r\n) AS totals\r\nGROUP BY asset\r\n", "refId": "Sold", "sql": { "columns": [ { "parameters": [ { "name": "base", "type": "functionParameter" } ], "type": "function" }, { "name": "SUM", "parameters": [ { "name": "volume", "type": "functionParameter" } ], "type": "function" } ], "groupBy": [ { "property": { "name": "base", "type": "string" }, "type": "groupBy" } ], "limit": 50, "orderBy": { "property": { "name": [ "base" ], "type": "string" }, "type": "property" }, "whereJsonTree": { "children1": [ { "id": "8b9baaab-89ab-4cde-b012-318a09adebb7", "properties": { "field": "order_side", "operator": "equal", "value": [ "BUY" ], "valueSrc": [ "value" ], "valueType": [ "text" ] }, "type": "rule" } ], "id": "9baa9b9a-89ab-4cde-b012-318a0616d6bd", "type": "group" }, "whereString": "order_side = 'BUY'" }, "table": "trades" } ], "title": "To Be Sold Assets", "type": "table" }, { "datasource": { "type": "postgres", "uid": "postgresql" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "custom": { "align": "auto", "cellOptions": { "type": "auto" }, "inspect": false }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] } }, "overrides": [] }, "gridPos": { "h": 9, "w": 5, "x": 10, "y": 27 }, "id": 16, "options": { "cellHeight": "sm", "footer": { "countRows": false, "fields": "", "reducer": [ "sum" ], "show": false }, "frameIndex": 0, "showHeader": true }, "pluginVersion": "10.4.2", "targets": [ { "datasource": { "type": "postgres", "uid": "postgresql" }, "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT asset, sum(value) as total\r\nFROM (\r\n SELECT base AS asset, SUM(volume - volume_filled) AS value FROM orders WHERE order_side = 'SELL' AND order_status IN('OPEN', 'NEW', 'PENDING') AND exchange = '${exchange}' AND $__timeFilter(created_at) GROUP BY base\r\n UNION ALL\r\n SELECT quote AS asset, SUM(price * volume) - SUM(price * volume_filled) AS value FROM orders WHERE order_side = 'BUY' AND order_status IN('OPEN', 'NEW', 'PENDING') AND exchange = '${exchange}' AND $__timeFilter(created_at) GROUP BY quote\r\n UNION ALL\r\n SELECT base AS asset, (SUM(volume) - SUM(volume_filled)) * -1 AS value FROM orders WHERE order_side = 'BUY' AND exchange = '${exchange}' AND order_status IN('OPEN', 'PENDING', 'NEW') AND $__timeFilter(created_at) GROUP BY base\r\n UNION ALL\r\n SELECT quote AS asset, (SUM(volume * price) - SUM(volume_filled * price)) * -1 AS value FROM orders WHERE order_side = 'SELL' AND exchange = '${exchange}' AND order_status IN('OPEN', 'PENDING', 'NEW') AND $__timeFilter(created_at) GROUP BY quote\r\n) AS totals\r\nGROUP BY asset\r\n", "refId": "Sold", "sql": { "columns": [ { "parameters": [ { "name": "base", "type": "functionParameter" } ], "type": "function" }, { "name": "SUM", "parameters": [ { "name": "volume", "type": "functionParameter" } ], "type": "function" } ], "groupBy": [ { "property": { "name": "base", "type": "string" }, "type": "groupBy" } ], "limit": 50, "orderBy": { "property": { "name": [ "base" ], "type": "string" }, "type": "property" }, "whereJsonTree": { "children1": [ { "id": "8b9baaab-89ab-4cde-b012-318a09adebb7", "properties": { "field": "order_side", "operator": "equal", "value": [ "BUY" ], "valueSrc": [ "value" ], "valueType": [ "text" ] }, "type": "rule" } ], "id": "9baa9b9a-89ab-4cde-b012-318a0616d6bd", "type": "group" }, "whereString": "order_side = 'BUY'" }, "table": "trades" } ], "title": "To Be Delta", "type": "table" }, { "datasource": { "type": "postgres", "uid": "postgresql" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "custom": { "align": "auto", "cellOptions": { "type": "auto" }, "inspect": false }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green" }, { "color": "red", "value": 80 } ] } }, "overrides": [] }, "gridPos": { "h": 9, "w": 5, "x": 15, "y": 27 }, "id": 17, "options": { "cellHeight": "sm", "footer": { "countRows": false, "fields": "", "reducer": [ "sum" ], "show": false }, "frameIndex": 0, "showHeader": true }, "pluginVersion": "10.4.2", "targets": [ { "datasource": { "type": "postgres", "uid": "postgresql" }, "editorMode": "code", "format": "table", "rawQuery": true, "rawSql": "SELECT asset, sum(value) as total\r\nFROM (\r\n SELECT base AS asset, SUM(volume - volume_filled) AS value FROM orders WHERE order_side = 'SELL' AND order_status IN('OPEN', 'NEW', 'PENDING') AND exchange = '${exchange}' AND $__timeFilter(created_at) GROUP BY base\r\n UNION ALL\r\n SELECT quote AS asset, SUM(price * volume) - SUM(price * volume_filled) AS value FROM orders WHERE order_side = 'BUY' AND order_status IN('OPEN', 'NEW', 'PENDING') AND exchange = '${exchange}' AND $__timeFilter(created_at) GROUP BY quote\r\n UNION ALL\r\n SELECT base AS asset, (SUM(volume) - SUM(volume_filled)) * -1 AS value FROM orders WHERE order_side = 'BUY' AND exchange = '${exchange}' AND order_status IN('OPEN', 'PENDING', 'NEW') AND $__timeFilter(created_at) GROUP BY base\r\n UNION ALL\r\n SELECT quote AS asset, (SUM(volume * price) - SUM(volume_filled * price)) * -1 AS value FROM orders WHERE order_side = 'SELL' AND exchange = '${exchange}' AND order_status IN('OPEN', 'PENDING', 'NEW') AND $__timeFilter(created_at) GROUP BY quote\r\n UNION ALL\r\n SELECT base AS asset, SUM(volume) * -1 AS value FROM trades WHERE order_side = 'SELL' AND exchange = '${exchange}' AND $__timeFilter(created_at) GROUP BY base\r\n UNION ALL\r\n SELECT quote AS asset, SUM(cost) * -1 AS value FROM trades WHERE order_side = 'BUY' AND exchange = '${exchange}' AND $__timeFilter(created_at) GROUP BY quote\r\n UNION ALL\r\n SELECT base AS asset, SUM(volume) AS value FROM trades WHERE order_side = 'BUY' AND exchange = '${exchange}' AND $__timeFilter(created_at) GROUP BY base\r\n UNION ALL\r\n SELECT quote AS asset, SUM(cost) AS value FROM trades WHERE order_side = 'SELL' AND exchange = '${exchange}' AND $__timeFilter(created_at) GROUP BY quote\r\n) AS totals\r\nGROUP BY asset\r\n", "refId": "Sold", "sql": { "columns": [ { "parameters": [ { "name": "base", "type": "functionParameter" } ], "type": "function" }, { "name": "SUM", "parameters": [ { "name": "volume", "type": "functionParameter" } ], "type": "function" } ], "groupBy": [ { "property": { "name": "base", "type": "string" }, "type": "groupBy" } ], "limit": 50, "orderBy": { "property": { "name": [ "base" ], "type": "string" }, "type": "property" }, "whereJsonTree": { "children1": [ { "id": "8b9baaab-89ab-4cde-b012-318a09adebb7", "properties": { "field": "order_side", "operator": "equal", "value": [ "BUY" ], "valueSrc": [ "value" ], "valueType": [ "text" ] }, "type": "rule" } ], "id": "9baa9b9a-89ab-4cde-b012-318a0616d6bd", "type": "group" }, "whereString": "order_side = 'BUY'" }, "table": "trades" } ], "title": "Super Delta", "type": "table" } ], "refresh": "", "schemaVersion": 39, "tags": [], "templating": { "list": [ { "current": { "selected": false, "text": "POLONIEX", "value": "POLONIEX" }, "datasource": { "type": "postgres", "uid": "postgresql" }, "definition": "SELECT enumlabel\nFROM pg_enum\nJOIN pg_type ON pg_enum.enumtypid = pg_type.oid\nWHERE pg_type.typname = 'exchange'\n", "hide": 0, "includeAll": false, "label": "Exchange", "multi": false, "name": "exchange", "options": [], "query": "SELECT enumlabel\nFROM pg_enum\nJOIN pg_type ON pg_enum.enumtypid = pg_type.oid\nWHERE pg_type.typname = 'exchange'\n", "refresh": 1, "regex": "", "skipUrlSync": false, "sort": 1, "type": "query" }, { "current": { "selected": false, "text": "Theo's Trust Fund", "value": "34dac011-cbb0-44e1-bca1-14c73091c7f7" }, "datasource": { "type": "grafana-postgresql-datasource", "uid": "postgresql" }, "definition": "SELECT strat_id AS __value, runs.name AS __text\nFROM strat_runs AS runs\nJOIN strategies AS strats ON runs.strat_id = strats.id\nWHERE strats.name = 'TRIANGULAR_ARBITRAGE';", "hide": 0, "includeAll": false, "label": "Strategy Run ID", "multi": false, "name": "strat_run_id", "options": [], "query": "SELECT strat_id AS __value, runs.name AS __text\nFROM strat_runs AS runs\nJOIN strategies AS strats ON runs.strat_id = strats.id\nWHERE strats.name = 'TRIANGULAR_ARBITRAGE';", "refresh": 1, "regex": "", "skipUrlSync": false, "sort": 0, "type": "query" } ] }, "time": { "from": "now-24h", "to": "now" }, "timepicker": {}, "timezone": "", "title": "Triangular Arbitrage", "uid": "8ZcFPSRSz", "version": 17, "weekStart": "" }
0
dashboards
/mono/helm/grafana/dashboards/strat-tri-arb-rates.json
{ "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": 12, "links": [], "panels": [ { "collapsed": false, "gridPos": { "h": 1, "w": 24, "x": 0, "y": 0 }, "id": 2, "panels": [], "repeat": "pair", "repeatDirection": "h", "title": "$pair rates", "type": "row" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] }, "unit": "none" }, "overrides": [] }, "gridPos": { "h": 7, "w": 6, "x": 0, "y": 1 }, "id": 1, "options": { "colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showPercentChange": false, "textMode": "auto", "wideLayout": true }, "pluginVersion": "10.4.2", "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "fdr_arb_opportunity_pre_fee_total{pair=\"$pair\"}", "instant": false, "legendFormat": "__auto", "range": true, "refId": "A" } ], "title": "Total Opps Pre Fee", "type": "stat" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] }, "unit": "none" }, "overrides": [] }, "gridPos": { "h": 7, "w": 6, "x": 6, "y": 1 }, "id": 38, "options": { "colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showPercentChange": false, "textMode": "auto", "wideLayout": true }, "pluginVersion": "10.4.2", "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "rate(fdr_arb_opportunity_pre_fee_total{pair=\"$pair\"}[$__rate_interval]) * 60", "instant": false, "legendFormat": "__auto", "range": true, "refId": "A" } ], "title": "Rate of Opps Pre Fee per Minute", "type": "stat" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] }, "unit": "none" }, "overrides": [] }, "gridPos": { "h": 7, "w": 6, "x": 12, "y": 1 }, "id": 19, "options": { "colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showPercentChange": false, "textMode": "auto", "wideLayout": true }, "pluginVersion": "10.4.2", "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "fdr_arb_opportunity_post_fee_total{pair=\"$pair\"}", "instant": false, "legendFormat": "__auto", "range": true, "refId": "A" } ], "title": "Total Opps Checked Post Fee", "type": "stat" }, { "datasource": { "type": "prometheus", "uid": "prometheus" }, "fieldConfig": { "defaults": { "color": { "mode": "thresholds" }, "mappings": [], "thresholds": { "mode": "absolute", "steps": [ { "color": "green", "value": null }, { "color": "red", "value": 80 } ] }, "unit": "none" }, "overrides": [] }, "gridPos": { "h": 7, "w": 6, "x": 18, "y": 1 }, "id": 55, "options": { "colorMode": "value", "graphMode": "area", "justifyMode": "auto", "orientation": "auto", "reduceOptions": { "calcs": [ "lastNotNull" ], "fields": "", "values": false }, "showPercentChange": false, "textMode": "auto", "wideLayout": true }, "pluginVersion": "10.4.2", "targets": [ { "datasource": { "type": "prometheus", "uid": "prometheus" }, "editorMode": "code", "expr": "rate(fdr_arb_opportunity_post_fee_total{pair=\"$pair\"}[$__rate_interval]) * 60", "instant": false, "legendFormat": "__auto", "range": true, "refId": "A" } ], "title": "Rate of Opps Pre Fee per Minute", "type": "stat" } ], "schemaVersion": 39, "tags": [], "templating": { "list": [ { "current": { "selected": true, "text": [ "BTC_USDC", "ETH_BTC", "ETH_USDC", "LINK_BTC", "USDC_USD", "LINK_ETH" ], "value": [ "BTC_USDC", "ETH_BTC", "ETH_USDC", "LINK_BTC", "USDC_USD", "LINK_ETH" ] }, "datasource": { "type": "prometheus", "uid": "prometheus" }, "definition": "label_values(pair)", "hide": 0, "includeAll": true, "label": "Pairs", "multi": true, "name": "pair", "options": [], "query": { "qryType": 1, "query": "label_values(pair)", "refId": "PrometheusVariableQueryEditor-VariableQuery" }, "refresh": 1, "regex": "", "skipUrlSync": false, "sort": 0, "type": "query" } ] }, "time": { "from": "now-12h", "to": "now-6h" }, "timepicker": {}, "timezone": "browser", "title": "Strat Tri Arb Rates", "uid": "cdlrbn437ynswc", "version": 2, "weekStart": "" }
0