repo_id
stringclasses 137
values | file_path
stringlengths 10
89
| content
stringlengths 0
990k
| __index_level_0__
int64 0
0
|
---|---|---|---|
dashboards | /mono/infra/services/grafana/provisioning/dashboards/simple_market_maker_dot_usd.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": 9,
"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"
}
]
}
]
},
"gridPos": {
"h": 5,
"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_balance{asset=\"USD\", strategy=\"STABLE_MARKET_MAKER\"}",
"hide": false,
"legendFormat": "{{asset}}",
"range": true,
"refId": "BTC_balance"
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"editorMode": "code",
"expr": "fdr_balance{asset=\"DOT\", strategy=\"STABLE_MARKET_MAKER\"}",
"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": "prometheus",
"uid": "prometheus"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "#6ED0E0",
"value": ""
},
{
"color": "#EAB839",
"value": 0
}
]
},
"unit": "none"
},
"overrides": []
},
"gridPos": {
"h": 5,
"w": 4,
"x": 4,
"y": 0
},
"id": 14,
"options": {
"colorMode": "value",
"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_balance{strategy=\"STABLE_MARKET_MAKER\", asset=\"USD\"}",
"hide": true,
"legendFormat": "{{asset}}",
"range": true,
"refId": "BTC"
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"editorMode": "code",
"expr": "fdr_balance{strategy=\"STABLE_MARKET_MAKER\", asset=\"DOT\"}",
"hide": true,
"legendFormat": "{{asset}}",
"range": true,
"refId": "ETH"
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"editorMode": "code",
"expr": "fdr_ticker_last_price{pair=\"DOT_USD\"}",
"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": "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": 8,
"y": 0
},
"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": "code",
"expr": "fdr_balance{asset=\"DOT\", strategy=\"STABLE_MARKET_MAKER\"}",
"hide": true,
"legendFormat": "{{asset}}",
"range": true,
"refId": "base"
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"editorMode": "code",
"expr": "fdr_balance{asset=\"USD\", strategy=\"STABLE_MARKET_MAKER\"}",
"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": true,
"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"
},
{
"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": "USD + DOT (USD)"
}
]
}
]
},
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
"y": 0
},
"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_balance{asset=\"USD\", strategy=\"STABLE_MARKET_MAKER\"}",
"hide": true,
"legendFormat": "__auto",
"range": true,
"refId": "BTC_balance"
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"editorMode": "code",
"expr": "fdr_balance{asset=\"DOT\", strategy=\"STABLE_MARKET_MAKER\"}",
"hide": true,
"legendFormat": "__auto",
"range": true,
"refId": "ETH_balance"
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"editorMode": "code",
"exemplar": false,
"expr": "fdr_ticker_last_price{pair=\"DOT_USD\"}",
"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 (USD)",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"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": 0,
"y": 5
},
"id": 7,
"options": {
"displayMode": "gradient",
"minVizHeight": 10,
"minVizWidth": 0,
"orientation": "horizontal",
"reduceOptions": {
"calcs": [],
"fields": "",
"values": false
},
"showUnfilled": true
},
"pluginVersion": "9.3.2",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"editorMode": "code",
"expr": "fdr_trade_count{pair=\"$pair\", strategy=\"STABLE_MARKET_MAKER\"}",
"legendFormat": "{{side}}s",
"range": true,
"refId": "A"
}
],
"title": "Trade 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": 4,
"y": 5
},
"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\"})",
"legendFormat": "Buy",
"range": true,
"refId": "A"
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"editorMode": "code",
"expr": "avg(fdr_trade_price{pair=\"$pair\", side=\"Sell\"})",
"hide": false,
"legendFormat": "Sell",
"range": true,
"refId": "B"
}
],
"title": "Trade Price Avg",
"type": "stat"
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"description": "Balances for assets being trades by SMM strategy in terms of 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": 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": "{__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": "USD Balance"
}
]
},
{
"matcher": {
"id": "byName",
"options": "ETH_balance_in_BTC"
},
"properties": [
{
"id": "color",
"value": {
"fixedColor": "#8a8a93",
"mode": "fixed"
}
},
{
"id": "displayName",
"value": "DOT Balance (USD)"
}
]
}
]
},
"gridPos": {
"h": 9,
"w": 8,
"x": 12,
"y": 8
},
"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_balance{asset=\"USD\", strategy=\"STABLE_MARKET_MAKER\"}",
"hide": false,
"legendFormat": "{{asset}}",
"range": true,
"refId": "BTC_balance"
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"editorMode": "code",
"expr": "fdr_balance{asset=\"DOT\", strategy=\"STABLE_MARKET_MAKER\"}",
"hide": true,
"legendFormat": "{{asset}}",
"range": true,
"refId": "ETH_balance"
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"editorMode": "code",
"exemplar": false,
"expr": "fdr_ticker_last_price{pair=\"DOT_USD\"}",
"hide": true,
"instant": false,
"interval": "",
"legendFormat": "{{pair}}",
"range": true,
"refId": "BTC_price"
},
{
"datasource": {
"name": "Expression",
"type": "__expr__",
"uid": "__expr__"
},
"expression": "$ETH_balance * $BTC_price",
"hide": false,
"refId": "ETH_balance_in_BTC",
"type": "math"
}
],
"title": "Balances (USD)",
"type": "timeseries"
},
{
"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"
}
}
]
},
{
"matcher": {
"id": "byName",
"options": "{__name__=\"fdr_s003_trade_count\", exchange=\"kraken\", instance=\"host.docker.internal:4001\", job=\"strat-stable-market-maker-local\", pair=\"ETH_BTC\", side=\"Sell\"}"
},
"properties": [
{
"id": "displayName",
"value": "Sells"
},
{
"id": "color",
"value": {
"fixedColor": "red",
"mode": "fixed"
}
}
]
}
]
},
"gridPos": {
"h": 4,
"w": 4,
"x": 0,
"y": 9
},
"id": 19,
"options": {
"displayMode": "gradient",
"minVizHeight": 10,
"minVizWidth": 0,
"orientation": "horizontal",
"reduceOptions": {
"calcs": [
"lastNotNull"
],
"fields": "",
"values": false
},
"showUnfilled": true
},
"pluginVersion": "9.3.2",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"editorMode": "code",
"expr": "increase(fdr_trade_count{pair=\"$pair\", strategy=\"STABLE_MARKET_MAKER\"}[$__range])",
"legendFormat": "{{side}}",
"range": true,
"refId": "A"
}
],
"title": "Trade Count by Side per range",
"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": 4,
"y": 9
},
"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=\"STABLE_MARKET_MAKER\"}",
"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=\"STABLE_MARKET_MAKER\"}",
"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": "prometheus",
"uid": "prometheus"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 4,
"x": 8,
"y": 9
},
"id": 16,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [],
"fields": "",
"values": false
},
"textMode": "auto"
},
"pluginVersion": "9.3.2",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"editorMode": "code",
"expr": "sum(fdr_trade_volume{strategy=\"STABLE_MARKET_MAKER\", pair=\"$pair\"})",
"hide": true,
"legendFormat": "__auto",
"range": true,
"refId": "A"
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"editorMode": "code",
"expr": "fdr_ticker_last_price{pair=\"$pair\"}",
"hide": true,
"legendFormat": "__auto",
"range": true,
"refId": "B"
},
{
"datasource": {
"name": "Expression",
"type": "__expr__",
"uid": "__expr__"
},
"expression": "$A * $B",
"hide": false,
"refId": "C",
"type": "math"
}
],
"title": "Total volume (USD)",
"type": "stat"
},
{
"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": 0,
"y": 13
},
"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=\"STABLE_MARKET_MAKER\"}[1h])",
"legendFormat": "{{side}}",
"range": true,
"refId": "A"
}
],
"title": "Trade Count by Side per hour",
"type": "gauge"
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
},
"unit": "none"
},
"overrides": []
},
"gridPos": {
"h": 4,
"w": 4,
"x": 4,
"y": 13
},
"id": 17,
"options": {
"colorMode": "value",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [],
"fields": "",
"values": false
},
"textMode": "auto"
},
"pluginVersion": "9.3.2",
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"editorMode": "code",
"expr": "sum(fdr_trade_fee{pair=\"$pair\"})",
"legendFormat": "__auto",
"range": true,
"refId": "A"
}
],
"title": "Total fees",
"type": "stat"
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"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": "{__name__=\"fdr_s003_trade_price\", exchange=\"kraken\", instance=\"host.docker.internal:4001\", job=\"strat-stable-market-maker-local\", pair=\"ETH_BTC\", side=\"Sell\"}"
},
"properties": [
{
"id": "color",
"value": {
"fixedColor": "red",
"mode": "fixed"
}
},
{
"id": "displayName",
"value": "Sell"
}
]
},
{
"matcher": {
"id": "byName",
"options": "{__name__=\"fdr_s003_trade_price\", exchange=\"kraken\", instance=\"host.docker.internal:4001\", job=\"strat-stable-market-maker-local\", pair=\"ETH_BTC\", side=\"Buy\"}"
},
"properties": [
{
"id": "color",
"value": {
"fixedColor": "semi-dark-green",
"mode": "fixed"
}
},
{
"id": "displayName",
"value": "Buy"
}
]
},
{
"matcher": {
"id": "byName",
"options": "Sell"
},
"properties": [
{
"id": "color",
"value": {
"fixedColor": "red",
"mode": "fixed"
}
}
]
}
]
},
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 17
},
"id": 5,
"options": {
"legend": {
"calcs": [],
"displayMode": "list",
"placement": "bottom",
"showLegend": true
},
"tooltip": {
"mode": "single",
"sort": "none"
}
},
"targets": [
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"editorMode": "code",
"expr": "fdr_trade_price{pair=\"$pair\", strategy=\"STABLE_MARKET_MAKER\"}",
"legendFormat": "{{side}}",
"range": true,
"refId": "A"
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"editorMode": "code",
"expr": "fdr_ticker_last_price{pair=\"$pair\"}",
"hide": true,
"legendFormat": "price",
"range": true,
"refId": "B"
}
],
"title": "Trade Prices",
"type": "timeseries"
},
{
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"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"
}
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
},
{
"color": "red",
"value": 80
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
"y": 17
},
"id": 22,
"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{pair=\"$pair\"}",
"legendFormat": "__auto",
"range": true,
"refId": "A"
}
],
"title": "Panel Title",
"type": "timeseries"
}
],
"refresh": "30s",
"schemaVersion": 37,
"style": "dark",
"tags": [],
"templating": {
"list": [
{
"current": {
"selected": false,
"text": [
"All"
],
"value": [
"$__all"
]
},
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"definition": "label_values(asset)\n\n\n",
"hide": 0,
"includeAll": true,
"multi": true,
"name": "asset",
"options": [],
"query": {
"query": "label_values(asset)\n\n\n",
"refId": "StandardVariableQuery"
},
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 0,
"type": "query"
},
{
"current": {
"selected": false,
"text": "DOT_USD",
"value": "DOT_USD"
},
"datasource": {
"type": "prometheus",
"uid": "prometheus"
},
"definition": "label_value(pair)",
"hide": 0,
"includeAll": false,
"label": "Pair",
"multi": false,
"name": "pair",
"options": [],
"query": {
"query": "label_value(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=\"DOT_USD\"}",
"value": "fdr_ticker_last_price{exchange=\"kraken\",instance=\"host.docker.internal:3001\",job=\"proxy-kraken\",pair=\"DOT_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"
}
]
},
"time": {
"from": "now-24h",
"to": "now"
},
"timepicker": {},
"timezone": "",
"title": "Stable Market Maker: DOT/USD",
"uid": "3Zbo1yuVzw",
"version": 1,
"weekStart": ""
} | 0 |
datasources | /mono/infra/services/grafana/provisioning/datasources/datasources.yml | apiVersion: 1
datasources:
- name: Prometheus
type: prometheus
access: proxy
orgId: 1
url: http://prometheus:9090
basicAuth: false
isDefault: true
editable: true
uid: prometheus
version: 1
jsonData:
httpMethod: GET
- name: Tempo
type: tempo
access: proxy
orgId: 1
url: http://tempo:3200
basicAuth: false
isDefault: false
version: 1
editable: false
apiVersion: 1
uid: tempo
jsonData:
httpMethod: GET
serviceMap:
datasourceUid: prometheus
| 0 |
prometheus | /mono/infra/services/prometheus/prometheus.yml | global:
scrape_interval: 5s
scrape_configs:
- job_name: "proxy-kraken-docker"
static_configs:
- targets: ["proxy-kraken:3001"]
- job_name: "proxy-kraken"
static_configs:
- targets: ["host.docker.internal:3001"]
- job_name: "proxy-poloniex"
static_configs:
- targets: ["proxy-poloniex:3002"]
- job_name: "strat-market-makers-local"
static_configs:
- targets: ["host.docker.internal:4001"]
- job_name: "strat-market-makers-docker"
static_configs:
- targets: ["strat-market-makers:4001"]
| 0 |
prometheus | /mono/infra/services/prometheus/prometheus.dev.yml | global:
scrape_interval: 30s
scrape_configs:
- job_name: node
scrape_interval: 60s
metrics_path: /metrics
static_configs:
- targets:
- host.docker.internal:9100
- job_name: redpanda
metrics_path: /public_metrics
static_configs:
- targets:
- redpanda:9644
- job_name: kraken-proxy
metrics_path: /metrics
static_configs:
- targets:
- proxy-kraken:3001
- job_name: poloniex-proxy
metrics_path: /metrics
static_configs:
- targets:
- proxy-poloniex:3002
- job_name: strat-market-makers
metrics_path: /metrics
static_configs:
- targets:
- strat-market-makers:4001
remote_write:
- url: https://prometheus-prod-13-prod-us-east-0.grafana.net/api/prom/push
basic_auth:
username: 999795
# Mounted via Docker Compose secrets
# https://docs.docker.com/compose/use-secrets/
password_file: /run/secrets/grafana_cloud_prometheus_api_key
| 0 |
prometheus | /mono/infra/services/prometheus/README.md | # Prometheus
Prometheus is used to scrape metrics from our services and expose them to tools like Grafana for visualization. This doc
will eventually give an overview of our Prometheus architecture and useful commands for managing Prom.
[[__TOC__]]
## Management
### Live reloading config
You can live reload Prometheus' config by sending `SIGHUP` via
```bash
docker kill --signal=SIGHUP fdr-prometheus-1
``` | 0 |
scripts | /mono/scripts/create-gitlab-registry-secret.sh | #!/usr/bin/env bash
# This script uses Gitlab's SSH API to automatically generate image pull credentials for Kubernetes
# https://docs.gitlab.com/ee/development/gitlab_shell/features.html
gl_welcome_msg=$(ssh [email protected])
# Welcome to GitLab, @ddaws!
gl_pat_token_name="k8s-$(kubectl config current-context)-read-reg"
gl_pat_msg=$(ssh [email protected] personal_access_token $gl_pat_token_name read_registry 364)
# Token: glpat-xxxxxxxxxxxxxx
# Scopes: read_registry
# Expires: 2024-05-15
# Extract the Gitlab registry credentials
DOCKER_USERNAME=$(echo $gl_welcome_msg | grep -oP '(?<=Welcome to GitLab, @)\w+(?=\!)')
DOCKER_PASSWORD=$(echo $gl_pat_msg | grep -oP '^Token:\s+\K\S+')
# Configure K8s to use the credentials to pull images
kubectl delete secret gitlab-registry --ignore-not-found=true
kubectl create secret docker-registry gitlab-registry --docker-server=registry.gitlab.com --docker-username=$DOCKER_USERNAME --docker-password=$DOCKER_PASSWORD
kubectl patch serviceaccount default -p '{"imagePullSecrets": [{"name": "gitlab-registry"}]}'
| 0 |
scripts | /mono/scripts/wsl-kernel.sh | #!/bin/bash
docker build -f docker/wsl/Dockerfile -t fdr-wsl-kernel-builder:latest ./docker/wsl
mkdir -p .kernel && docker run -it -v $PWD/.kernel:/kernel/src fdr-wsl-kernel-builder /kernel/build.sh
cp .kernel/WSL2-Linux-Kernel/arch/x86/boot/vmlinux.bin /mnt/c/Users/All\ Users | 0 |
scripts | /mono/scripts/helm-dep-build.sh | #!/bin/bash
GIT_ROOT="$(git rev-parse --show-toplevel)"
for dir in $GIT_ROOT/helm/*; do
if [[ ! -f "${dir}"/Chart.yaml ]] || [[ ! -f "${dir}"/Chart.lock ]]; then
continue
fi
echo "========================================"
echo "Updating: ${dir}"
echo "========================================"
cd $dir
# Check the files hashes of the current directory
state=$(find . -name "Chart.state" -prune -o -name "charts" -prune -o -type f -print0 | sort -z | xargs -0 sha256sum)
prev_state=$(cat "${dir}/Chart.state")
if [[ "$state" == "$prev_state" ]]; then
echo "Skipping update because nothing has changed"
continue
fi
helm dependency build "${dir}" --skip-refresh && echo "$state" > "${dir}/Chart.state"
done | 0 |
scripts | /mono/scripts/docker-build-for-k8s.sh | #!/bin/bash
# This script is used to build the docker image for the k8s cluster
# by detecting the OS and kubernetes context (e.g: minikube vs docker-desktop)
# and building the image accordingly
# Usage: ./scripts/docker-build-for-k8s.sh -o
# Usage: ./scripts/docker-build-for-k8s.sh -p -b <binary_name>
# This is necessary because images built locally will not be available within minikube by default
omnibus_image_tags=(
"registry.gitlab.com/fdr-group/mono/rs/arbitrage:local"
"registry.gitlab.com/fdr-group/mono/rs/proxy-kraken:local"
"registry.gitlab.com/fdr-group/mono/rs/proxy-poloniex:local"
"registry.gitlab.com/fdr-group/mono/rs/market-makers:local"
"registry.gitlab.com/fdr-group/mono/rs/archive-service:local"
"registry.gitlab.com/fdr-group/mono/rs/back-testing-service:local"
"registry.gitlab.com/fdr-group/mono/rs/strategy-manager:local"
"registry.gitlab.com/fdr-group/mono/rs/indicator-service:local"
)
current_context=$(kubectl config view | grep current-context)
main() {
perform_k8s_pre_checks
build_image
load_images
}
build_image() {
case $BUILD_TYPE in
OMNIBUS)
echo "Building Omnibus image"
build_omnibus_image
;;
SINGLE)
echo "Building Single-binary image"
build_single_binary_image
;;
*)
echo "Building Docker image"
;;
esac
}
build_single_binary_image() {
if [ -z "$BINARY_NAME" ]; then
echo "BINARY_NAME is not set"
exit 1
fi
DOCKER_BUILDKIT=1 docker buildx build \
-f docker/rust/local.Dockerfile \
--target release \
--build-arg BINARY_NAME=$BINARY_NAME \
--tag registry.gitlab.com/fdr-group/mono/rs/$BINARY_NAME:latest \
.
}
build_omnibus_image() {
DOCKER_BUILDKIT=1 docker buildx build \
--file docker/rust/local.Dockerfile \
--target omnibus \
--tag registry.gitlab.com/fdr-group/mono/omnibus:local \
.
for tag in "${omnibus_image_tags[@]}"; do
docker tag registry.gitlab.com/fdr-group/mono/omnibus:local "$tag"
done
}
perform_k8s_pre_checks() {
if [ "$current_context" = "current-context: docker-desktop" ]; then
echo "Docker Desktop Detected..."
elif [ "$current_context" = "current-context: minikube" ]; then
echo "Minikube Detected..."
minikube_status=$(minikube status | grep "host:" | awk '{print $2}')
if [[ "$minikube_status" == "Running" ]]; then
echo "Minikube is running!"
else
echo "Minikube is not running!"
exit 1
fi
# NOTE: It may actually be faster to build images on the host and then just
# load them into Minikube to avoid the perf hit building in a VM
eval $(minikube docker-env)
elif (echo "$current_context" | grep -q "kind"); then
echo "Kind Detected..."
else
echo "Unknown Kubernetes context. Make sure you know what you're doing!"
fi
}
load_images() {
if (echo "$current_context" | grep -q "kind"); then
echo "Loading images into Kind..."
for tag in "${omnibus_image_tags[@]}"; do
kind load docker-image "$tag"
done
fi
}
while getopts "osb:" opt; do
case $opt in
o)
BUILD_TYPE=OMNIBUS
;;
s)
BUILD_TYPE=SINGLE
;;
b)
BINARY_NAME=$OPTARG
;;
\?)
echo "Invalid option: -$OPTARG" >&2
exit 1
;;
esac
done
main "$@"
| 0 |
scripts | /mono/scripts/helm-clean.sh | #/usr/bin/env bash
# Remove all of the old fdr-common chart bundles
find helm/ -type f -name "fdr-common-*.tgz" -exec rm {} \;
| 0 |
scripts | /mono/scripts/tilt-clean-up.sh | #!/bin/env bash
# This script cleans up resources that are left behind by Tilt after running
# `tilt down`. This can occur when the Tiltfile is updated from using
# `k8s_yaml(helm(...))` to using `helm_resource(...)` because the resources
# created are tracked differently.
if curl -s http://localhost:10350 > /dev/null
then
echo "Tilt is currently running. Please stop Tilt before running this script."
exit 1
fi
if ! command -v jq &> /dev/null
then
echo "jq is not installed. Please install jq before running this script."
echo "https://jqlang.github.io/jq/download/"
exit 2
fi
allowed_contexts=("minikube" "kind-rootful" "docker-desktop")
current_context=$(kubectl config current-context)
if [[ ! " ${allowed_contexts[@]} " =~ " ${current_context} " ]]; then
echo "The current kube context '${current_context}' is not allowed. Please switch to one of the following contexts before running this script: ${allowed_contexts[@]}"
exit 3
fi
resources=$( \
kubectl get service,statefulset,deployment,serviceaccount,secret,netpol,configmap,clusterrole,clusterrolebinding -o json \
| jq '[.items[] | {kind: (.kind | ascii_downcase), name: .metadata.name, managedBy: .metadata.labels["app.kubernetes.io/managed-by"]}]'
)
resources_managed_by_tilt=$(echo $resources | jq '[.[] | select(.managedBy == "tilt")]')
if [ $(echo "$resources_managed_by_tilt" | jq -r 'length') -eq 0 ]; then
echo "No resources need to be cleaned up. Good to go 🚀"
exit 0
fi
while IFS= read -r resource; do
resource_id=$(echo $resource | jq -r '"\(.kind)/\(.name)"')
echo "Deleting $resource_id..."
kubectl delete $resource_id
done <<< "$(echo $resources_managed_by_tilt | jq -c '.[]')"
| 0 |
sql | /mono/scripts/sql/create-role-archive-service.sql | -- See README.md in this directory for instructions on how to use this scripts
DO $$
DECLARE
v_username VARCHAR := current_setting('myvars.username');
v_password VARCHAR := current_setting('myvars.password');
BEGIN
-- TODO: Add a check that the user doesn't already exist
EXECUTE format('CREATE ROLE %I LOGIN PASSWORD %L', v_username, v_password);
GRANT INSERT ON TABLE archive TO v_username;
END $$;
| 0 |
sql | /mono/scripts/sql/create-role-vault.sql | -- See README.md in this directory for instructions on how to use this scripts
DO $$
DECLARE
v_username VARCHAR := current_setting('myvars.username');
v_password VARCHAR := current_setting('myvars.password');
BEGIN
-- TODO: Add a check that the user doesn't already exist
EXECUTE format('CREATE ROLE %I LOGIN PASSWORD %L', v_username, v_password);
-- Grant the new user permissions to create users
EXECUTE format('ALTER ROLE %I CREATEROLE;', v_username);
-- Grant all permissions on all tables to the new user
EXECUTE format('GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO %I WITH GRANT OPTION', v_username);
END $$;
| 0 |
sql | /mono/scripts/sql/create-role-strat-tri-arb.sql | -- See README.md in this directory for instructions on how to use this scripts
DO $$
DECLARE
v_username VARCHAR := current_setting('myvars.username');
v_password VARCHAR := current_setting('myvars.password');
BEGIN
-- TODO: Add a check that the user doesn't already exist
EXECUTE format('CREATE ROLE %I LOGIN PASSWORD %L', v_username, v_password);
GRANT SELECT, INSERT ON TABLE orders TO :v_username;
GRANT INSERT ON TABLE opportunities TO :v_username;
GRANT SELECT ON TABLE trades TO :v_username;
GRANT SELECT ON TABLE virtual_balance_accounts TO :v_username;
GRANT SELECT ON TABLE strat_balance_accounts TO :v_username;
GRANT SELECT ON TABLE account_details TO :v_username;
GRANT USAGE, SELECT ON SEQUENCE orders_user_ref_seq TO v_username;
END $$; | 0 |
sql | /mono/scripts/sql/README.md | # SQL Scripts
These scripts are used to manage our database. As much as possible we try to automate database management, but in some
cases we are not ready for automation and need to do things manually. When we need to do things manually we try to
version control the things we need to do.
## Creating users (aka roles in Postgres)
To create a role you can use one of the `create-role-*.sql` scripts. First connect to the database as an admin, then
set the users username and password as session veriables.
```sql
# SET SESSION myvars.username = 'foo';
# SET SESSION myvars.password = 'bar';
```
The run the script. For example, to create the Grafana role
```sql
# \i scripts/sql/create-role-grafana.sql
```
The `\i` command includes and evals the script into the local session.
| 0 |
sql | /mono/scripts/sql/dump.sql | --
-- PostgreSQL database dump
--
-- Dumped from database version 15.4
-- Dumped by pg_dump version 16.1
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;
SET default_tablespace = '';
SET default_table_access_method = heap;
--
-- Name: account_details; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.account_details (
id uuid NOT NULL,
name text NOT NULL,
account_id uuid NOT NULL,
venue public.venue NOT NULL
);
ALTER TABLE public.account_details OWNER TO postgres;
--
-- Name: balance_accounts; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.balance_accounts (
id uuid NOT NULL,
asset public.asset NOT NULL,
amount numeric NOT NULL
);
ALTER TABLE public.balance_accounts OWNER TO postgres;
--
-- Name: strat_balance_accounts; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.strat_balance_accounts (
strat_run_id uuid NOT NULL,
vba_id uuid NOT NULL
);
ALTER TABLE public.strat_balance_accounts OWNER TO postgres;
--
-- Name: strat_runs; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.strat_runs (
id uuid NOT NULL,
strat_id uuid NOT NULL,
name text NOT NULL,
meta jsonb
);
ALTER TABLE public.strat_runs OWNER TO postgres;
--
-- Name: strategies; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.strategies (
id uuid NOT NULL,
name public.trading_strategy NOT NULL
);
ALTER TABLE public.strategies OWNER TO postgres;
--
-- Name: virtual_balance_accounts; Type: TABLE; Schema: public; Owner: postgres
--
CREATE TABLE public.virtual_balance_accounts (
id uuid NOT NULL,
account_id uuid NOT NULL,
account_status public.account_status NOT NULL,
asset public.asset NOT NULL,
amount numeric NOT NULL,
created_at timestamp with time zone DEFAULT now() NOT NULL
);
ALTER TABLE public.virtual_balance_accounts OWNER TO postgres;
--
-- Data for Name: account_details; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.account_details (id, name, account_id, venue) FROM stdin;
daa218f7-d7c3-4adb-8bcf-4b83f9901237 ETH f3e93a0c-aefc-4e5c-83bb-209cc3c16e20 KRAKEN
25a9b981-49d9-44a2-9cba-6553a39418db USDT 3d52d1ac-1ab8-4fc2-981d-dcc79c82ce29 KRAKEN
64c96e6c-28fd-4241-84c5-23b7e4f78bd3 BTC 045a82e4-c1d4-463f-82e6-9c301320fb62 KRAKEN
60f5f062-1378-424e-b4cc-21671455dee7 LINK 37f74795-6517-4288-9f87-6c7fea01ec70 KRAKEN
2d050a5c-9ae3-4086-b3c5-db0facd41e14 USDC 586ba2fe-ccb8-48c5-91cc-3cf6b4c3fa0c KRAKEN
\.
--
-- Data for Name: balance_accounts; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.balance_accounts (id, asset, amount) FROM stdin;
f3e93a0c-aefc-4e5c-83bb-209cc3c16e20 ETH 0
3d52d1ac-1ab8-4fc2-981d-dcc79c82ce29 USDT 0
045a82e4-c1d4-463f-82e6-9c301320fb62 BTC 0
37f74795-6517-4288-9f87-6c7fea01ec70 LINK 0
586ba2fe-ccb8-48c5-91cc-3cf6b4c3fa0c USDC 0
\.
--
-- Data for Name: strat_balance_accounts; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.strat_balance_accounts (strat_run_id, vba_id) FROM stdin;
51d65638-03b7-44a6-b6f4-33cfe5baf08a e3fe6936-d3d5-427f-9991-4c657cdbba12
51d65638-03b7-44a6-b6f4-33cfe5baf08a 8202dd82-99e7-48f8-a103-c3b3254975cc
51d65638-03b7-44a6-b6f4-33cfe5baf08a 6e562eb4-15a9-470c-b5e1-08019f564698
51d65638-03b7-44a6-b6f4-33cfe5baf08a 0987205f-b81c-4880-99dc-8f6d394ce3d2
51d65638-03b7-44a6-b6f4-33cfe5baf08a bacec9c7-5749-4e0d-b228-2048469353c2
\.
--
-- Data for Name: strat_runs; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.strat_runs (id, strat_id, name, meta) FROM stdin;
51d65638-03b7-44a6-b6f4-33cfe5baf08a 3a7918ff-07c4-47a8-8123-ed6889e033e9 main \N
\.
--
-- Data for Name: strategies; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.strategies (id, name) FROM stdin;
3a7918ff-07c4-47a8-8123-ed6889e033e9 TRIANGULAR_ARBITRAGE
12c50183-c0be-496f-8876-f3809a173fd5 MIRROR
1dc49a22-0141-40b2-b97d-b6f8745476c4 MARKET_MAKER_ON_TICKER
\.
--
-- Data for Name: virtual_balance_accounts; Type: TABLE DATA; Schema: public; Owner: postgres
--
COPY public.virtual_balance_accounts (id, account_id, account_status, asset, amount, created_at) FROM stdin;
e3fe6936-d3d5-427f-9991-4c657cdbba12 f3e93a0c-aefc-4e5c-83bb-209cc3c16e20 ACTIVE ETH 0.1622 2024-05-07 07:39:22.041769+00
0987205f-b81c-4880-99dc-8f6d394ce3d2 37f74795-6517-4288-9f87-6c7fea01ec70 ACTIVE LINK 35 2024-05-07 08:08:12.304913+00
6e562eb4-15a9-470c-b5e1-08019f564698 045a82e4-c1d4-463f-82e6-9c301320fb62 ACTIVE BTC 0.0076 2024-05-07 08:05:39.82114+00
8202dd82-99e7-48f8-a103-c3b3254975cc 3d52d1ac-1ab8-4fc2-981d-dcc79c82ce29 ACTIVE USDT 0 2024-05-07 08:01:43.138901+00
bacec9c7-5749-4e0d-b228-2048469353c2 586ba2fe-ccb8-48c5-91cc-3cf6b4c3fa0c ACTIVE USDC 500 2024-05-07 08:27:52.532337+00
\.
--
-- Name: account_details account_details_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.account_details
ADD CONSTRAINT account_details_pkey PRIMARY KEY (id);
--
-- Name: balance_accounts balance_accounts_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.balance_accounts
ADD CONSTRAINT balance_accounts_pkey PRIMARY KEY (id);
--
-- Name: strat_runs strat_runs_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.strat_runs
ADD CONSTRAINT strat_runs_pkey PRIMARY KEY (id);
--
-- Name: strategies strategies_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.strategies
ADD CONSTRAINT strategies_pkey PRIMARY KEY (id);
--
-- Name: strat_runs unique_name; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.strat_runs
ADD CONSTRAINT unique_name UNIQUE (name);
--
-- Name: strat_runs unique_strat_run_name; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.strat_runs
ADD CONSTRAINT unique_strat_run_name UNIQUE (name);
--
-- Name: strategies unique_strategies_name; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.strategies
ADD CONSTRAINT unique_strategies_name UNIQUE (name);
--
-- Name: virtual_balance_accounts virtual_balance_accounts_pkey; Type: CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.virtual_balance_accounts
ADD CONSTRAINT virtual_balance_accounts_pkey PRIMARY KEY (id);
--
-- Name: account_details account_details_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.account_details
ADD CONSTRAINT account_details_account_id_fkey FOREIGN KEY (account_id) REFERENCES public.balance_accounts(id);
--
-- Name: strat_balance_accounts strat_balance_accounts_strat_run_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.strat_balance_accounts
ADD CONSTRAINT strat_balance_accounts_strat_run_id_fkey FOREIGN KEY (strat_run_id) REFERENCES public.strat_runs(id);
--
-- Name: strat_balance_accounts strat_balance_accounts_vba_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.strat_balance_accounts
ADD CONSTRAINT strat_balance_accounts_vba_id_fkey FOREIGN KEY (vba_id) REFERENCES public.virtual_balance_accounts(id);
--
-- Name: strat_runs strat_runs_strat_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.strat_runs
ADD CONSTRAINT strat_runs_strat_id_fkey FOREIGN KEY (strat_id) REFERENCES public.strategies(id);
--
-- Name: virtual_balance_accounts virtual_balance_accounts_account_id_fkey; Type: FK CONSTRAINT; Schema: public; Owner: postgres
--
ALTER TABLE ONLY public.virtual_balance_accounts
ADD CONSTRAINT virtual_balance_accounts_account_id_fkey FOREIGN KEY (account_id) REFERENCES public.balance_accounts(id);
--
-- Name: TABLE account_details; Type: ACL; Schema: public; Owner: postgres
--
GRANT ALL ON TABLE public.account_details TO "strat-tri-arb";
--
-- Name: TABLE balance_accounts; Type: ACL; Schema: public; Owner: postgres
--
GRANT ALL ON TABLE public.balance_accounts TO "strat-tri-arb";
--
-- Name: TABLE strat_balance_accounts; Type: ACL; Schema: public; Owner: postgres
--
GRANT ALL ON TABLE public.strat_balance_accounts TO "strat-tri-arb";
--
-- Name: TABLE strat_runs; Type: ACL; Schema: public; Owner: postgres
--
GRANT ALL ON TABLE public.strat_runs TO "strat-tri-arb";
--
-- Name: TABLE strategies; Type: ACL; Schema: public; Owner: postgres
--
GRANT ALL ON TABLE public.strategies TO "strat-tri-arb";
--
-- Name: TABLE virtual_balance_accounts; Type: ACL; Schema: public; Owner: postgres
--
GRANT ALL ON TABLE public.virtual_balance_accounts TO "strat-tri-arb";
--
-- PostgreSQL database dump complete
--
| 0 |
sql | /mono/scripts/sql/create-role-grafana.sql | -- See README.md in this directory for instructions on how to use this scripts
DO $$
DECLARE
v_username VARCHAR := current_setting('myvars.username');
v_password VARCHAR := current_setting('myvars.password');
rec record;
BEGIN
-- TODO: Add a check that the user doesn't already exist
EXECUTE format('CREATE ROLE %I LOGIN PASSWORD %L', v_username, v_password);
-- Grant select permissions on all tables in the database
FOR rec IN
SELECT tablename FROM pg_tables WHERE schemaname = 'public'
LOOP
RAISE NOTICE 'Granting select on table: %', rec.tablename;
EXECUTE format('GRANT SELECT ON TABLE public.%I TO %I;', rec.tablename, v_username);
END LOOP;
END $$;
| 0 |
tilt | /mono/scripts/tilt/docker_build.py |
def fdr_docker_build(
name,
context,
dockerfile,
build_args={},
extra_tags=[],
target=None,
):
cmd = 'docker buildx build {context} -f {dockerfile} {build_args} {extra_tags}'.format(
context=context,
dockerfile=dockerfile,
build_args=' '.join(['--build-arg {}={}'.format(k, v) for k, v in build_args]),
extra_tags=' '.join(['--tag {}'.format(tag) for tag in extra_tags]),
)
docker_build_resource = 'docker_build::{}'.format(name)
local_resource(
docker_build_resource,
cmd,
trigger_mode=TRIGGER_MODE_MANUAL,
deps=[dockerfile],
auto_init=False,
allow_parallel=True,
env={'DOCKER_BUILDKIT': '1'},
labels=['Build']
)
cluster_type = _local_k8s_cluster_type()
if cluster_type == 'kind':
for tag in extra_tags:
local_resource(
'kind_load::{}'.format(name),
'kind load docker-image {}'.format(tag),
resource_deps=[docker_build_resource],
allow_parallel=True,
labels=['Kind']
)
def _local_k8s_cluster_type():
local_ctx = str(local('kubectl config current-context', quiet=True))
if 'k3d' in local_ctx:
return 'k3d'
elif 'kind' in local_ctx:
return 'kind'
elif 'minikube' in local_ctx:
return 'minikube'
elif 'microk8s' in local_ctx:
return 'microk8s'
elif 'docker-desktop' in local_ctx:
return 'docker-desktop'
else:
return 'unknown'
| 0 |
tilt | /mono/scripts/tilt/port_forward.sh | #!/usr/bin/env bash
count=0
limit=6
sleep=10
until [ "$count" -ge "$limit" ]; do
count=$((count+1))
kubectl port-forward $1 $2:$3 &
if [ $? -eq 0 ]; then
echo "Forwarding $1 $2:$3"
wait
fi
[ "$count" -ge "$limit" ] && break
echo "Failed to create port forward. The service may not be ready yet. Sleeping..."
sleep "$sleep"
done
echo "Failed to create port forward after $limit attempts. Exiting."
exit 1
| 0 |
tilt | /mono/scripts/tilt/port_forward.py |
def fdr_port_forward(resource, local_port, container_port, name=None, labels=[]):
'''
A more reliable port forward, using Kubernetes native port forwarding.
'''
name = name or 'pf:{}'.format(resource.split("/")[1])
cmd = '{}/scripts/tilt/port_forward.sh {} {} {}'.format(
os.getcwd(),
resource,
local_port,
container_port,
)
local_resource(name, cmd='', serve_cmd=cmd, labels=labels, allow_parallel=True)
| 0 |
.sqlx | /mono/.sqlx/query-0b73f42af6d7adc427fd195e3ec72c05c309c2d9ffec95d85d25a577ca515584.json | {
"db_name": "PostgreSQL",
"query": "\n SELECT\n vba.id AS \"id: _\",\n vba.account_id AS \"account_id: _\",\n vba.account_status AS \"account_status: _\",\n vba.asset AS \"asset: _\",\n vba.amount AS \"amount: _\",\n vba.created_at AS \"created_at: _\",\n ad.venue AS \"venue: _\"\n FROM virtual_balance_accounts AS vba\n JOIN strat_balance_accounts AS sra ON vba.id = sra.vba_id\n JOIN account_details AS ad ON vba.account_id = ad.account_id\n WHERE sra.strat_run_id = $1\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id: _",
"type_info": "Uuid"
},
{
"ordinal": 1,
"name": "account_id: _",
"type_info": "Uuid"
},
{
"ordinal": 2,
"name": "account_status: _",
"type_info": {
"Custom": {
"name": "account_status",
"kind": {
"Enum": [
"ACTIVE",
"INACTIVE"
]
}
}
}
},
{
"ordinal": 3,
"name": "asset: _",
"type_info": {
"Custom": {
"name": "asset",
"kind": {
"Enum": [
"CAD",
"USD",
"BTC",
"ETH",
"DAI",
"USDT",
"EUR",
"LINK",
"SOL",
"GALA",
"WAXL",
"CHR",
"ALICE",
"ETC",
"POND",
"API3",
"BTT",
"EUL",
"SNX",
"ORCA",
"REQ",
"SXP",
"COMP",
"BAL",
"ANKR",
"BADGER",
"CQT",
"ONEINCH",
"QNT",
"AUD",
"ATOM",
"SAMO",
"POLS",
"USDC",
"PLA",
"RAY",
"PARA",
"ROOK",
"FIS",
"UNI",
"AGLD",
"KSM",
"OMG",
"BAT",
"TBTC",
"BIT",
"OXT",
"PERP",
"RAD",
"SGB",
"NMR",
"RNDR",
"APT",
"MINA",
"SRM",
"BNC",
"JPY",
"STG",
"FTM",
"KAR",
"FLOWH",
"MV",
"SHIB",
"KP3R",
"KNC",
"ALPHA",
"FIDA",
"ENS",
"GNO",
"CHF",
"FLOW",
"STEP",
"MASK",
"TRIBE",
"FLR",
"FIL",
"ASTR",
"GAL",
"NYM",
"TRU",
"OCEAN",
"CELR",
"ANT",
"TRX",
"WAVES",
"ICX",
"STX",
"RBC",
"OGN",
"GBP",
"SDN",
"GMT",
"GLMR",
"JASMY",
"CRV",
"ARPA",
"ZRX",
"CVX",
"XTZ",
"ACH",
"ETHW",
"EGLD",
"ENJ",
"DASH",
"KAVA",
"GRT",
"CFG",
"FXS",
"MIR",
"BOBA",
"LSK",
"LDO",
"KINT",
"MSOL",
"SAND",
"RUNE",
"XRT",
"OXY",
"SYN",
"ACA",
"HDX",
"WBTC",
"STORJ",
"TLM",
"BAND",
"UNFI",
"LPT",
"MC",
"UST",
"T",
"POWR",
"SCRT",
"IMX",
"DYDX",
"RLC",
"ADX",
"FARM",
"XMR",
"SPELL",
"IDEX",
"XZEC",
"RARI",
"MXC",
"BNT",
"XRP",
"CHZ",
"PAXG",
"BLUR",
"MANA",
"REP",
"DOGE",
"ALCX",
"C98",
"FET",
"ADA",
"AUDIO",
"FORTH",
"TOKE",
"YFI",
"REN",
"CTSI",
"TVK",
"NODL",
"GARI",
"EWT",
"BCH",
"EOS",
"SC",
"MKR",
"SUSHI",
"KEEP",
"SBR",
"MATIC",
"GST",
"GMX",
"KIN",
"AKT",
"DOT",
"RPL",
"COTI",
"AXS",
"AAVE",
"ETH2",
"ALGO",
"CSM",
"XLM",
"MNGO",
"LRC",
"BICO",
"DENT",
"KFEE",
"MLN",
"BSX",
"HFT",
"ATLAS",
"LUNA",
"KEY",
"JUNO",
"WOO",
"POLIS",
"AIR",
"INTR",
"NANO",
"LCX",
"AVAX",
"LTC",
"MULTI",
"LUNA2",
"TEER",
"KILT",
"QTUM",
"PHA",
"INJ",
"PSTAKE",
"BOND",
"CVC",
"WETH",
"NEAR",
"GHST",
"YGG",
"RARE",
"BLZ",
"MOVR",
"AED",
"GTC",
"XCN",
"SUPER",
"ICP",
"APE",
"REPV2",
"UMA",
"DOTPARACHAIN",
"KSMPARACHAIN",
"EURHOLD",
"AUDHOLD",
"CADHOLD",
"CHFHOLD",
"USDHOLD",
"AEDHOLD",
"GBPHOLD",
"ADASTAKING",
"MINASTAKING",
"KAVASTAKING",
"KSM07STAKING",
"DOT28STAKING",
"ALGOSTAKING",
"XTZSTAKING",
"LUNASTAKING",
"FLOWSTAKING",
"MATIC04STAKING",
"SOLSTAKING",
"GRT28STAKING",
"SCRT21STAKING",
"XBTSTAKING",
"FLOWHSTAKING",
"TRXSTAKING",
"SOL03STAKING",
"KAVA21STAKING",
"ETH2STAKING",
"USDSTAKING",
"MATICSTAKING",
"DOTSTAKING",
"EURSTAKING",
"USDTSTAKING",
"ATOM21STAKING",
"FLRSTAKING",
"KSMSTAKING",
"SCRTSTAKING",
"FLOW14STAKING",
"ATOMSTAKING",
"USDCSTAKING",
"GRTSTAKING"
]
}
}
}
},
{
"ordinal": 4,
"name": "amount: _",
"type_info": "Numeric"
},
{
"ordinal": 5,
"name": "created_at: _",
"type_info": "Timestamptz"
},
{
"ordinal": 6,
"name": "venue: _",
"type_info": {
"Custom": {
"name": "venue",
"kind": {
"Enum": [
"KRAKEN",
"POLONIEX",
"COINBASE",
"BACKTEST"
]
}
}
}
}
],
"parameters": {
"Left": [
"Uuid"
]
},
"nullable": [
false,
false,
false,
false,
false,
false,
false
]
},
"hash": "0b73f42af6d7adc427fd195e3ec72c05c309c2d9ffec95d85d25a577ca515584"
}
| 0 |
.sqlx | /mono/.sqlx/query-3b1362459dfd1917387a2d30f517fc47b869bca502e4c461f9f9754357c597a2.json | {
"db_name": "PostgreSQL",
"query": "\n INSERT INTO virtual_balance_accounts (id, account_id, account_status, asset, amount, created_at)\n VALUES ($1, $2, $3, $4, $5, $6)\n ON CONFLICT (id) DO NOTHING\n ",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Uuid",
"Uuid",
{
"Custom": {
"name": "account_status",
"kind": {
"Enum": [
"ACTIVE",
"INACTIVE"
]
}
}
},
{
"Custom": {
"name": "asset",
"kind": {
"Enum": [
"CAD",
"USD",
"BTC",
"ETH",
"DAI",
"USDT",
"EUR",
"LINK",
"SOL",
"GALA",
"WAXL",
"CHR",
"ALICE",
"ETC",
"POND",
"API3",
"BTT",
"EUL",
"SNX",
"ORCA",
"REQ",
"SXP",
"COMP",
"BAL",
"ANKR",
"BADGER",
"CQT",
"ONEINCH",
"QNT",
"AUD",
"ATOM",
"SAMO",
"POLS",
"USDC",
"PLA",
"RAY",
"PARA",
"ROOK",
"FIS",
"UNI",
"AGLD",
"KSM",
"OMG",
"BAT",
"TBTC",
"BIT",
"OXT",
"PERP",
"RAD",
"SGB",
"NMR",
"RNDR",
"APT",
"MINA",
"SRM",
"BNC",
"JPY",
"STG",
"FTM",
"KAR",
"FLOWH",
"MV",
"SHIB",
"KP3R",
"KNC",
"ALPHA",
"FIDA",
"ENS",
"GNO",
"CHF",
"FLOW",
"STEP",
"MASK",
"TRIBE",
"FLR",
"FIL",
"ASTR",
"GAL",
"NYM",
"TRU",
"OCEAN",
"CELR",
"ANT",
"TRX",
"WAVES",
"ICX",
"STX",
"RBC",
"OGN",
"GBP",
"SDN",
"GMT",
"GLMR",
"JASMY",
"CRV",
"ARPA",
"ZRX",
"CVX",
"XTZ",
"ACH",
"ETHW",
"EGLD",
"ENJ",
"DASH",
"KAVA",
"GRT",
"CFG",
"FXS",
"MIR",
"BOBA",
"LSK",
"LDO",
"KINT",
"MSOL",
"SAND",
"RUNE",
"XRT",
"OXY",
"SYN",
"ACA",
"HDX",
"WBTC",
"STORJ",
"TLM",
"BAND",
"UNFI",
"LPT",
"MC",
"UST",
"T",
"POWR",
"SCRT",
"IMX",
"DYDX",
"RLC",
"ADX",
"FARM",
"XMR",
"SPELL",
"IDEX",
"XZEC",
"RARI",
"MXC",
"BNT",
"XRP",
"CHZ",
"PAXG",
"BLUR",
"MANA",
"REP",
"DOGE",
"ALCX",
"C98",
"FET",
"ADA",
"AUDIO",
"FORTH",
"TOKE",
"YFI",
"REN",
"CTSI",
"TVK",
"NODL",
"GARI",
"EWT",
"BCH",
"EOS",
"SC",
"MKR",
"SUSHI",
"KEEP",
"SBR",
"MATIC",
"GST",
"GMX",
"KIN",
"AKT",
"DOT",
"RPL",
"COTI",
"AXS",
"AAVE",
"ETH2",
"ALGO",
"CSM",
"XLM",
"MNGO",
"LRC",
"BICO",
"DENT",
"KFEE",
"MLN",
"BSX",
"HFT",
"ATLAS",
"LUNA",
"KEY",
"JUNO",
"WOO",
"POLIS",
"AIR",
"INTR",
"NANO",
"LCX",
"AVAX",
"LTC",
"MULTI",
"LUNA2",
"TEER",
"KILT",
"QTUM",
"PHA",
"INJ",
"PSTAKE",
"BOND",
"CVC",
"WETH",
"NEAR",
"GHST",
"YGG",
"RARE",
"BLZ",
"MOVR",
"AED",
"GTC",
"XCN",
"SUPER",
"ICP",
"APE",
"REPV2",
"UMA",
"DOTPARACHAIN",
"KSMPARACHAIN",
"EURHOLD",
"AUDHOLD",
"CADHOLD",
"CHFHOLD",
"USDHOLD",
"AEDHOLD",
"GBPHOLD",
"ADASTAKING",
"MINASTAKING",
"KAVASTAKING",
"KSM07STAKING",
"DOT28STAKING",
"ALGOSTAKING",
"XTZSTAKING",
"LUNASTAKING",
"FLOWSTAKING",
"MATIC04STAKING",
"SOLSTAKING",
"GRT28STAKING",
"SCRT21STAKING",
"XBTSTAKING",
"FLOWHSTAKING",
"TRXSTAKING",
"SOL03STAKING",
"KAVA21STAKING",
"ETH2STAKING",
"USDSTAKING",
"MATICSTAKING",
"DOTSTAKING",
"EURSTAKING",
"USDTSTAKING",
"ATOM21STAKING",
"FLRSTAKING",
"KSMSTAKING",
"SCRTSTAKING",
"FLOW14STAKING",
"ATOMSTAKING",
"USDCSTAKING",
"GRTSTAKING"
]
}
}
},
"Numeric",
"Timestamptz"
]
},
"nullable": []
},
"hash": "3b1362459dfd1917387a2d30f517fc47b869bca502e4c461f9f9754357c597a2"
}
| 0 |
.sqlx | /mono/.sqlx/query-fecf3a43a6e6ccc148e0272a36fddfea720c1ddbf8a3202264b596521015b9bb.json | {
"db_name": "PostgreSQL",
"query": "\n INSERT INTO orders (id, strategy, exchange, order_type, base, quote, order_side, price, volume, expire_time, strat_run_id, created_at)\n VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12)\n ON CONFLICT (id) DO NOTHING\n ",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Uuid",
{
"Custom": {
"name": "trading_strategy",
"kind": {
"Enum": [
"MARKET_MAKER_ON_TICKER",
"MIRROR",
"TRIANGULAR_ARBITRAGE",
"UNKNOWN"
]
}
}
},
{
"Custom": {
"name": "exchange",
"kind": {
"Enum": [
"KRAKEN",
"POLONIEX",
"COINBASE",
"BACKTEST"
]
}
}
},
{
"Custom": {
"name": "order_type",
"kind": {
"Enum": [
"MARKET",
"LIMIT",
"LIMIT_MAKER_ONLY"
]
}
}
},
{
"Custom": {
"name": "asset",
"kind": {
"Enum": [
"CAD",
"USD",
"BTC",
"ETH",
"DAI",
"USDT",
"EUR",
"LINK",
"SOL",
"GALA",
"WAXL",
"CHR",
"ALICE",
"ETC",
"POND",
"API3",
"BTT",
"EUL",
"SNX",
"ORCA",
"REQ",
"SXP",
"COMP",
"BAL",
"ANKR",
"BADGER",
"CQT",
"ONEINCH",
"QNT",
"AUD",
"ATOM",
"SAMO",
"POLS",
"USDC",
"PLA",
"RAY",
"PARA",
"ROOK",
"FIS",
"UNI",
"AGLD",
"KSM",
"OMG",
"BAT",
"TBTC",
"BIT",
"OXT",
"PERP",
"RAD",
"SGB",
"NMR",
"RNDR",
"APT",
"MINA",
"SRM",
"BNC",
"JPY",
"STG",
"FTM",
"KAR",
"FLOWH",
"MV",
"SHIB",
"KP3R",
"KNC",
"ALPHA",
"FIDA",
"ENS",
"GNO",
"CHF",
"FLOW",
"STEP",
"MASK",
"TRIBE",
"FLR",
"FIL",
"ASTR",
"GAL",
"NYM",
"TRU",
"OCEAN",
"CELR",
"ANT",
"TRX",
"WAVES",
"ICX",
"STX",
"RBC",
"OGN",
"GBP",
"SDN",
"GMT",
"GLMR",
"JASMY",
"CRV",
"ARPA",
"ZRX",
"CVX",
"XTZ",
"ACH",
"ETHW",
"EGLD",
"ENJ",
"DASH",
"KAVA",
"GRT",
"CFG",
"FXS",
"MIR",
"BOBA",
"LSK",
"LDO",
"KINT",
"MSOL",
"SAND",
"RUNE",
"XRT",
"OXY",
"SYN",
"ACA",
"HDX",
"WBTC",
"STORJ",
"TLM",
"BAND",
"UNFI",
"LPT",
"MC",
"UST",
"T",
"POWR",
"SCRT",
"IMX",
"DYDX",
"RLC",
"ADX",
"FARM",
"XMR",
"SPELL",
"IDEX",
"XZEC",
"RARI",
"MXC",
"BNT",
"XRP",
"CHZ",
"PAXG",
"BLUR",
"MANA",
"REP",
"DOGE",
"ALCX",
"C98",
"FET",
"ADA",
"AUDIO",
"FORTH",
"TOKE",
"YFI",
"REN",
"CTSI",
"TVK",
"NODL",
"GARI",
"EWT",
"BCH",
"EOS",
"SC",
"MKR",
"SUSHI",
"KEEP",
"SBR",
"MATIC",
"GST",
"GMX",
"KIN",
"AKT",
"DOT",
"RPL",
"COTI",
"AXS",
"AAVE",
"ETH2",
"ALGO",
"CSM",
"XLM",
"MNGO",
"LRC",
"BICO",
"DENT",
"KFEE",
"MLN",
"BSX",
"HFT",
"ATLAS",
"LUNA",
"KEY",
"JUNO",
"WOO",
"POLIS",
"AIR",
"INTR",
"NANO",
"LCX",
"AVAX",
"LTC",
"MULTI",
"LUNA2",
"TEER",
"KILT",
"QTUM",
"PHA",
"INJ",
"PSTAKE",
"BOND",
"CVC",
"WETH",
"NEAR",
"GHST",
"YGG",
"RARE",
"BLZ",
"MOVR",
"AED",
"GTC",
"XCN",
"SUPER",
"ICP",
"APE",
"REPV2",
"UMA",
"DOTPARACHAIN",
"KSMPARACHAIN",
"EURHOLD",
"AUDHOLD",
"CADHOLD",
"CHFHOLD",
"USDHOLD",
"AEDHOLD",
"GBPHOLD",
"ADASTAKING",
"MINASTAKING",
"KAVASTAKING",
"KSM07STAKING",
"DOT28STAKING",
"ALGOSTAKING",
"XTZSTAKING",
"LUNASTAKING",
"FLOWSTAKING",
"MATIC04STAKING",
"SOLSTAKING",
"GRT28STAKING",
"SCRT21STAKING",
"XBTSTAKING",
"FLOWHSTAKING",
"TRXSTAKING",
"SOL03STAKING",
"KAVA21STAKING",
"ETH2STAKING",
"USDSTAKING",
"MATICSTAKING",
"DOTSTAKING",
"EURSTAKING",
"USDTSTAKING",
"ATOM21STAKING",
"FLRSTAKING",
"KSMSTAKING",
"SCRTSTAKING",
"FLOW14STAKING",
"ATOMSTAKING",
"USDCSTAKING",
"GRTSTAKING"
]
}
}
},
{
"Custom": {
"name": "asset",
"kind": {
"Enum": [
"CAD",
"USD",
"BTC",
"ETH",
"DAI",
"USDT",
"EUR",
"LINK",
"SOL",
"GALA",
"WAXL",
"CHR",
"ALICE",
"ETC",
"POND",
"API3",
"BTT",
"EUL",
"SNX",
"ORCA",
"REQ",
"SXP",
"COMP",
"BAL",
"ANKR",
"BADGER",
"CQT",
"ONEINCH",
"QNT",
"AUD",
"ATOM",
"SAMO",
"POLS",
"USDC",
"PLA",
"RAY",
"PARA",
"ROOK",
"FIS",
"UNI",
"AGLD",
"KSM",
"OMG",
"BAT",
"TBTC",
"BIT",
"OXT",
"PERP",
"RAD",
"SGB",
"NMR",
"RNDR",
"APT",
"MINA",
"SRM",
"BNC",
"JPY",
"STG",
"FTM",
"KAR",
"FLOWH",
"MV",
"SHIB",
"KP3R",
"KNC",
"ALPHA",
"FIDA",
"ENS",
"GNO",
"CHF",
"FLOW",
"STEP",
"MASK",
"TRIBE",
"FLR",
"FIL",
"ASTR",
"GAL",
"NYM",
"TRU",
"OCEAN",
"CELR",
"ANT",
"TRX",
"WAVES",
"ICX",
"STX",
"RBC",
"OGN",
"GBP",
"SDN",
"GMT",
"GLMR",
"JASMY",
"CRV",
"ARPA",
"ZRX",
"CVX",
"XTZ",
"ACH",
"ETHW",
"EGLD",
"ENJ",
"DASH",
"KAVA",
"GRT",
"CFG",
"FXS",
"MIR",
"BOBA",
"LSK",
"LDO",
"KINT",
"MSOL",
"SAND",
"RUNE",
"XRT",
"OXY",
"SYN",
"ACA",
"HDX",
"WBTC",
"STORJ",
"TLM",
"BAND",
"UNFI",
"LPT",
"MC",
"UST",
"T",
"POWR",
"SCRT",
"IMX",
"DYDX",
"RLC",
"ADX",
"FARM",
"XMR",
"SPELL",
"IDEX",
"XZEC",
"RARI",
"MXC",
"BNT",
"XRP",
"CHZ",
"PAXG",
"BLUR",
"MANA",
"REP",
"DOGE",
"ALCX",
"C98",
"FET",
"ADA",
"AUDIO",
"FORTH",
"TOKE",
"YFI",
"REN",
"CTSI",
"TVK",
"NODL",
"GARI",
"EWT",
"BCH",
"EOS",
"SC",
"MKR",
"SUSHI",
"KEEP",
"SBR",
"MATIC",
"GST",
"GMX",
"KIN",
"AKT",
"DOT",
"RPL",
"COTI",
"AXS",
"AAVE",
"ETH2",
"ALGO",
"CSM",
"XLM",
"MNGO",
"LRC",
"BICO",
"DENT",
"KFEE",
"MLN",
"BSX",
"HFT",
"ATLAS",
"LUNA",
"KEY",
"JUNO",
"WOO",
"POLIS",
"AIR",
"INTR",
"NANO",
"LCX",
"AVAX",
"LTC",
"MULTI",
"LUNA2",
"TEER",
"KILT",
"QTUM",
"PHA",
"INJ",
"PSTAKE",
"BOND",
"CVC",
"WETH",
"NEAR",
"GHST",
"YGG",
"RARE",
"BLZ",
"MOVR",
"AED",
"GTC",
"XCN",
"SUPER",
"ICP",
"APE",
"REPV2",
"UMA",
"DOTPARACHAIN",
"KSMPARACHAIN",
"EURHOLD",
"AUDHOLD",
"CADHOLD",
"CHFHOLD",
"USDHOLD",
"AEDHOLD",
"GBPHOLD",
"ADASTAKING",
"MINASTAKING",
"KAVASTAKING",
"KSM07STAKING",
"DOT28STAKING",
"ALGOSTAKING",
"XTZSTAKING",
"LUNASTAKING",
"FLOWSTAKING",
"MATIC04STAKING",
"SOLSTAKING",
"GRT28STAKING",
"SCRT21STAKING",
"XBTSTAKING",
"FLOWHSTAKING",
"TRXSTAKING",
"SOL03STAKING",
"KAVA21STAKING",
"ETH2STAKING",
"USDSTAKING",
"MATICSTAKING",
"DOTSTAKING",
"EURSTAKING",
"USDTSTAKING",
"ATOM21STAKING",
"FLRSTAKING",
"KSMSTAKING",
"SCRTSTAKING",
"FLOW14STAKING",
"ATOMSTAKING",
"USDCSTAKING",
"GRTSTAKING"
]
}
}
},
{
"Custom": {
"name": "order_side",
"kind": {
"Enum": [
"SELL",
"BUY"
]
}
}
},
"Numeric",
"Numeric",
"Timestamptz",
"Uuid",
"Timestamptz"
]
},
"nullable": []
},
"hash": "fecf3a43a6e6ccc148e0272a36fddfea720c1ddbf8a3202264b596521015b9bb"
}
| 0 |
.sqlx | /mono/.sqlx/query-40d1d766a3f7840d21aa8855eeae4327b09f2582732489bc08dccfebc95aed6a.json | {
"db_name": "PostgreSQL",
"query": "DELETE FROM balance_metrics WHERE run_id = $1",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Uuid"
]
},
"nullable": []
},
"hash": "40d1d766a3f7840d21aa8855eeae4327b09f2582732489bc08dccfebc95aed6a"
}
| 0 |
.sqlx | /mono/.sqlx/query-be3c52c57c3d1c4c8954cb8fd4451e16fb6ae4a027ef9a036323bc98c4177b79.json | {
"db_name": "PostgreSQL",
"query": "\n INSERT INTO opportunities_orders (opportunity_id, order_id)\n VALUES ($1, $2)\n ON CONFLICT (opportunity_id, order_id) DO NOTHING\n ",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Uuid",
"Uuid"
]
},
"nullable": []
},
"hash": "be3c52c57c3d1c4c8954cb8fd4451e16fb6ae4a027ef9a036323bc98c4177b79"
}
| 0 |
.sqlx | /mono/.sqlx/query-4f52e417fd5a1dc9954ca653c15199a85b1f7d3886b35c650b12853f40117384.json | {
"db_name": "PostgreSQL",
"query": "\n INSERT INTO strategies (id, name)\n VALUES ($1, $2)\n ON CONFLICT (id) DO NOTHING\n ",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Uuid",
{
"Custom": {
"name": "trading_strategy",
"kind": {
"Enum": [
"MARKET_MAKER_ON_TICKER",
"MIRROR",
"TRIANGULAR_ARBITRAGE",
"UNKNOWN"
]
}
}
}
]
},
"nullable": []
},
"hash": "4f52e417fd5a1dc9954ca653c15199a85b1f7d3886b35c650b12853f40117384"
}
| 0 |
.sqlx | /mono/.sqlx/query-3239b942a855174275329017c27008231bd055a5a7708fec97326d30a0f061c1.json | {
"db_name": "PostgreSQL",
"query": "\n INSERT INTO strat_runs (id, strat_id, name)\n VALUES ($1, $2, $3)\n ON CONFLICT (id) DO NOTHING\n ",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Uuid",
"Uuid",
"Text"
]
},
"nullable": []
},
"hash": "3239b942a855174275329017c27008231bd055a5a7708fec97326d30a0f061c1"
}
| 0 |
.sqlx | /mono/.sqlx/query-8561a660ec592e77fa0f7fedb85237b67c7f5ec2625b503d39a5578202580c99.json | {
"db_name": "PostgreSQL",
"query": "DELETE FROM strat_balance_accounts WHERE strat_run_id = $1",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Uuid"
]
},
"nullable": []
},
"hash": "8561a660ec592e77fa0f7fedb85237b67c7f5ec2625b503d39a5578202580c99"
}
| 0 |
.sqlx | /mono/.sqlx/query-07a65bb2ca2d259bf85652b3e3745a883b181647195e0c4a971ba19f0c124f7b.json | {
"db_name": "PostgreSQL",
"query": "DELETE FROM virtual_balance_accounts WHERE id = ANY($1)",
"describe": {
"columns": [],
"parameters": {
"Left": [
"UuidArray"
]
},
"nullable": []
},
"hash": "07a65bb2ca2d259bf85652b3e3745a883b181647195e0c4a971ba19f0c124f7b"
}
| 0 |
.sqlx | /mono/.sqlx/query-ebdda01f9c9e26c135af6123a2f49643fe931733176f87dd5abc098f17609cfd.json | {
"db_name": "PostgreSQL",
"query": "\n SELECT\n vba.id AS \"id: _\",\n vba.account_id AS \"account_id: _\",\n vba.account_status AS \"account_status: _\",\n vba.asset AS \"asset: _\",\n vba.amount AS \"amount: _\",\n vba.created_at AS \"created_at: _\",\n ad.venue AS \"venue: _\"\n FROM virtual_balance_accounts AS vba\n JOIN account_details AS ad ON vba.account_id = ad.account_id\n WHERE vba.id = $1\n ",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "id: _",
"type_info": "Uuid"
},
{
"ordinal": 1,
"name": "account_id: _",
"type_info": "Uuid"
},
{
"ordinal": 2,
"name": "account_status: _",
"type_info": {
"Custom": {
"name": "account_status",
"kind": {
"Enum": [
"ACTIVE",
"INACTIVE"
]
}
}
}
},
{
"ordinal": 3,
"name": "asset: _",
"type_info": {
"Custom": {
"name": "asset",
"kind": {
"Enum": [
"CAD",
"USD",
"BTC",
"ETH",
"DAI",
"USDT",
"EUR",
"LINK",
"SOL",
"GALA",
"WAXL",
"CHR",
"ALICE",
"ETC",
"POND",
"API3",
"BTT",
"EUL",
"SNX",
"ORCA",
"REQ",
"SXP",
"COMP",
"BAL",
"ANKR",
"BADGER",
"CQT",
"ONEINCH",
"QNT",
"AUD",
"ATOM",
"SAMO",
"POLS",
"USDC",
"PLA",
"RAY",
"PARA",
"ROOK",
"FIS",
"UNI",
"AGLD",
"KSM",
"OMG",
"BAT",
"TBTC",
"BIT",
"OXT",
"PERP",
"RAD",
"SGB",
"NMR",
"RNDR",
"APT",
"MINA",
"SRM",
"BNC",
"JPY",
"STG",
"FTM",
"KAR",
"FLOWH",
"MV",
"SHIB",
"KP3R",
"KNC",
"ALPHA",
"FIDA",
"ENS",
"GNO",
"CHF",
"FLOW",
"STEP",
"MASK",
"TRIBE",
"FLR",
"FIL",
"ASTR",
"GAL",
"NYM",
"TRU",
"OCEAN",
"CELR",
"ANT",
"TRX",
"WAVES",
"ICX",
"STX",
"RBC",
"OGN",
"GBP",
"SDN",
"GMT",
"GLMR",
"JASMY",
"CRV",
"ARPA",
"ZRX",
"CVX",
"XTZ",
"ACH",
"ETHW",
"EGLD",
"ENJ",
"DASH",
"KAVA",
"GRT",
"CFG",
"FXS",
"MIR",
"BOBA",
"LSK",
"LDO",
"KINT",
"MSOL",
"SAND",
"RUNE",
"XRT",
"OXY",
"SYN",
"ACA",
"HDX",
"WBTC",
"STORJ",
"TLM",
"BAND",
"UNFI",
"LPT",
"MC",
"UST",
"T",
"POWR",
"SCRT",
"IMX",
"DYDX",
"RLC",
"ADX",
"FARM",
"XMR",
"SPELL",
"IDEX",
"XZEC",
"RARI",
"MXC",
"BNT",
"XRP",
"CHZ",
"PAXG",
"BLUR",
"MANA",
"REP",
"DOGE",
"ALCX",
"C98",
"FET",
"ADA",
"AUDIO",
"FORTH",
"TOKE",
"YFI",
"REN",
"CTSI",
"TVK",
"NODL",
"GARI",
"EWT",
"BCH",
"EOS",
"SC",
"MKR",
"SUSHI",
"KEEP",
"SBR",
"MATIC",
"GST",
"GMX",
"KIN",
"AKT",
"DOT",
"RPL",
"COTI",
"AXS",
"AAVE",
"ETH2",
"ALGO",
"CSM",
"XLM",
"MNGO",
"LRC",
"BICO",
"DENT",
"KFEE",
"MLN",
"BSX",
"HFT",
"ATLAS",
"LUNA",
"KEY",
"JUNO",
"WOO",
"POLIS",
"AIR",
"INTR",
"NANO",
"LCX",
"AVAX",
"LTC",
"MULTI",
"LUNA2",
"TEER",
"KILT",
"QTUM",
"PHA",
"INJ",
"PSTAKE",
"BOND",
"CVC",
"WETH",
"NEAR",
"GHST",
"YGG",
"RARE",
"BLZ",
"MOVR",
"AED",
"GTC",
"XCN",
"SUPER",
"ICP",
"APE",
"REPV2",
"UMA",
"DOTPARACHAIN",
"KSMPARACHAIN",
"EURHOLD",
"AUDHOLD",
"CADHOLD",
"CHFHOLD",
"USDHOLD",
"AEDHOLD",
"GBPHOLD",
"ADASTAKING",
"MINASTAKING",
"KAVASTAKING",
"KSM07STAKING",
"DOT28STAKING",
"ALGOSTAKING",
"XTZSTAKING",
"LUNASTAKING",
"FLOWSTAKING",
"MATIC04STAKING",
"SOLSTAKING",
"GRT28STAKING",
"SCRT21STAKING",
"XBTSTAKING",
"FLOWHSTAKING",
"TRXSTAKING",
"SOL03STAKING",
"KAVA21STAKING",
"ETH2STAKING",
"USDSTAKING",
"MATICSTAKING",
"DOTSTAKING",
"EURSTAKING",
"USDTSTAKING",
"ATOM21STAKING",
"FLRSTAKING",
"KSMSTAKING",
"SCRTSTAKING",
"FLOW14STAKING",
"ATOMSTAKING",
"USDCSTAKING",
"GRTSTAKING"
]
}
}
}
},
{
"ordinal": 4,
"name": "amount: _",
"type_info": "Numeric"
},
{
"ordinal": 5,
"name": "created_at: _",
"type_info": "Timestamptz"
},
{
"ordinal": 6,
"name": "venue: _",
"type_info": {
"Custom": {
"name": "venue",
"kind": {
"Enum": [
"KRAKEN",
"POLONIEX",
"COINBASE",
"BACKTEST"
]
}
}
}
}
],
"parameters": {
"Left": [
"Uuid"
]
},
"nullable": [
false,
false,
false,
false,
false,
false,
false
]
},
"hash": "ebdda01f9c9e26c135af6123a2f49643fe931733176f87dd5abc098f17609cfd"
}
| 0 |
.sqlx | /mono/.sqlx/query-eab7fb92251e25637a9f87c5d328c2ac685992281c010e59d378f631c73e62d3.json | {
"db_name": "PostgreSQL",
"query": "\n INSERT INTO trades (id, exchange, trade_ref, pos_trade_ref, order_ref, base, quote, time, order_side, order_type, price, cost, fee, volume, margin, user_ref, extra_fields, strat_run_id)\n VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18)\n ON CONFLICT (trade_ref) DO NOTHING\n ",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Uuid",
{
"Custom": {
"name": "exchange",
"kind": {
"Enum": [
"KRAKEN",
"POLONIEX",
"COINBASE",
"BACKTEST"
]
}
}
},
"Varchar",
"Varchar",
"Varchar",
{
"Custom": {
"name": "asset",
"kind": {
"Enum": [
"CAD",
"USD",
"BTC",
"ETH",
"DAI",
"USDT",
"EUR",
"LINK",
"SOL",
"GALA",
"WAXL",
"CHR",
"ALICE",
"ETC",
"POND",
"API3",
"BTT",
"EUL",
"SNX",
"ORCA",
"REQ",
"SXP",
"COMP",
"BAL",
"ANKR",
"BADGER",
"CQT",
"ONEINCH",
"QNT",
"AUD",
"ATOM",
"SAMO",
"POLS",
"USDC",
"PLA",
"RAY",
"PARA",
"ROOK",
"FIS",
"UNI",
"AGLD",
"KSM",
"OMG",
"BAT",
"TBTC",
"BIT",
"OXT",
"PERP",
"RAD",
"SGB",
"NMR",
"RNDR",
"APT",
"MINA",
"SRM",
"BNC",
"JPY",
"STG",
"FTM",
"KAR",
"FLOWH",
"MV",
"SHIB",
"KP3R",
"KNC",
"ALPHA",
"FIDA",
"ENS",
"GNO",
"CHF",
"FLOW",
"STEP",
"MASK",
"TRIBE",
"FLR",
"FIL",
"ASTR",
"GAL",
"NYM",
"TRU",
"OCEAN",
"CELR",
"ANT",
"TRX",
"WAVES",
"ICX",
"STX",
"RBC",
"OGN",
"GBP",
"SDN",
"GMT",
"GLMR",
"JASMY",
"CRV",
"ARPA",
"ZRX",
"CVX",
"XTZ",
"ACH",
"ETHW",
"EGLD",
"ENJ",
"DASH",
"KAVA",
"GRT",
"CFG",
"FXS",
"MIR",
"BOBA",
"LSK",
"LDO",
"KINT",
"MSOL",
"SAND",
"RUNE",
"XRT",
"OXY",
"SYN",
"ACA",
"HDX",
"WBTC",
"STORJ",
"TLM",
"BAND",
"UNFI",
"LPT",
"MC",
"UST",
"T",
"POWR",
"SCRT",
"IMX",
"DYDX",
"RLC",
"ADX",
"FARM",
"XMR",
"SPELL",
"IDEX",
"XZEC",
"RARI",
"MXC",
"BNT",
"XRP",
"CHZ",
"PAXG",
"BLUR",
"MANA",
"REP",
"DOGE",
"ALCX",
"C98",
"FET",
"ADA",
"AUDIO",
"FORTH",
"TOKE",
"YFI",
"REN",
"CTSI",
"TVK",
"NODL",
"GARI",
"EWT",
"BCH",
"EOS",
"SC",
"MKR",
"SUSHI",
"KEEP",
"SBR",
"MATIC",
"GST",
"GMX",
"KIN",
"AKT",
"DOT",
"RPL",
"COTI",
"AXS",
"AAVE",
"ETH2",
"ALGO",
"CSM",
"XLM",
"MNGO",
"LRC",
"BICO",
"DENT",
"KFEE",
"MLN",
"BSX",
"HFT",
"ATLAS",
"LUNA",
"KEY",
"JUNO",
"WOO",
"POLIS",
"AIR",
"INTR",
"NANO",
"LCX",
"AVAX",
"LTC",
"MULTI",
"LUNA2",
"TEER",
"KILT",
"QTUM",
"PHA",
"INJ",
"PSTAKE",
"BOND",
"CVC",
"WETH",
"NEAR",
"GHST",
"YGG",
"RARE",
"BLZ",
"MOVR",
"AED",
"GTC",
"XCN",
"SUPER",
"ICP",
"APE",
"REPV2",
"UMA",
"DOTPARACHAIN",
"KSMPARACHAIN",
"EURHOLD",
"AUDHOLD",
"CADHOLD",
"CHFHOLD",
"USDHOLD",
"AEDHOLD",
"GBPHOLD",
"ADASTAKING",
"MINASTAKING",
"KAVASTAKING",
"KSM07STAKING",
"DOT28STAKING",
"ALGOSTAKING",
"XTZSTAKING",
"LUNASTAKING",
"FLOWSTAKING",
"MATIC04STAKING",
"SOLSTAKING",
"GRT28STAKING",
"SCRT21STAKING",
"XBTSTAKING",
"FLOWHSTAKING",
"TRXSTAKING",
"SOL03STAKING",
"KAVA21STAKING",
"ETH2STAKING",
"USDSTAKING",
"MATICSTAKING",
"DOTSTAKING",
"EURSTAKING",
"USDTSTAKING",
"ATOM21STAKING",
"FLRSTAKING",
"KSMSTAKING",
"SCRTSTAKING",
"FLOW14STAKING",
"ATOMSTAKING",
"USDCSTAKING",
"GRTSTAKING"
]
}
}
},
{
"Custom": {
"name": "asset",
"kind": {
"Enum": [
"CAD",
"USD",
"BTC",
"ETH",
"DAI",
"USDT",
"EUR",
"LINK",
"SOL",
"GALA",
"WAXL",
"CHR",
"ALICE",
"ETC",
"POND",
"API3",
"BTT",
"EUL",
"SNX",
"ORCA",
"REQ",
"SXP",
"COMP",
"BAL",
"ANKR",
"BADGER",
"CQT",
"ONEINCH",
"QNT",
"AUD",
"ATOM",
"SAMO",
"POLS",
"USDC",
"PLA",
"RAY",
"PARA",
"ROOK",
"FIS",
"UNI",
"AGLD",
"KSM",
"OMG",
"BAT",
"TBTC",
"BIT",
"OXT",
"PERP",
"RAD",
"SGB",
"NMR",
"RNDR",
"APT",
"MINA",
"SRM",
"BNC",
"JPY",
"STG",
"FTM",
"KAR",
"FLOWH",
"MV",
"SHIB",
"KP3R",
"KNC",
"ALPHA",
"FIDA",
"ENS",
"GNO",
"CHF",
"FLOW",
"STEP",
"MASK",
"TRIBE",
"FLR",
"FIL",
"ASTR",
"GAL",
"NYM",
"TRU",
"OCEAN",
"CELR",
"ANT",
"TRX",
"WAVES",
"ICX",
"STX",
"RBC",
"OGN",
"GBP",
"SDN",
"GMT",
"GLMR",
"JASMY",
"CRV",
"ARPA",
"ZRX",
"CVX",
"XTZ",
"ACH",
"ETHW",
"EGLD",
"ENJ",
"DASH",
"KAVA",
"GRT",
"CFG",
"FXS",
"MIR",
"BOBA",
"LSK",
"LDO",
"KINT",
"MSOL",
"SAND",
"RUNE",
"XRT",
"OXY",
"SYN",
"ACA",
"HDX",
"WBTC",
"STORJ",
"TLM",
"BAND",
"UNFI",
"LPT",
"MC",
"UST",
"T",
"POWR",
"SCRT",
"IMX",
"DYDX",
"RLC",
"ADX",
"FARM",
"XMR",
"SPELL",
"IDEX",
"XZEC",
"RARI",
"MXC",
"BNT",
"XRP",
"CHZ",
"PAXG",
"BLUR",
"MANA",
"REP",
"DOGE",
"ALCX",
"C98",
"FET",
"ADA",
"AUDIO",
"FORTH",
"TOKE",
"YFI",
"REN",
"CTSI",
"TVK",
"NODL",
"GARI",
"EWT",
"BCH",
"EOS",
"SC",
"MKR",
"SUSHI",
"KEEP",
"SBR",
"MATIC",
"GST",
"GMX",
"KIN",
"AKT",
"DOT",
"RPL",
"COTI",
"AXS",
"AAVE",
"ETH2",
"ALGO",
"CSM",
"XLM",
"MNGO",
"LRC",
"BICO",
"DENT",
"KFEE",
"MLN",
"BSX",
"HFT",
"ATLAS",
"LUNA",
"KEY",
"JUNO",
"WOO",
"POLIS",
"AIR",
"INTR",
"NANO",
"LCX",
"AVAX",
"LTC",
"MULTI",
"LUNA2",
"TEER",
"KILT",
"QTUM",
"PHA",
"INJ",
"PSTAKE",
"BOND",
"CVC",
"WETH",
"NEAR",
"GHST",
"YGG",
"RARE",
"BLZ",
"MOVR",
"AED",
"GTC",
"XCN",
"SUPER",
"ICP",
"APE",
"REPV2",
"UMA",
"DOTPARACHAIN",
"KSMPARACHAIN",
"EURHOLD",
"AUDHOLD",
"CADHOLD",
"CHFHOLD",
"USDHOLD",
"AEDHOLD",
"GBPHOLD",
"ADASTAKING",
"MINASTAKING",
"KAVASTAKING",
"KSM07STAKING",
"DOT28STAKING",
"ALGOSTAKING",
"XTZSTAKING",
"LUNASTAKING",
"FLOWSTAKING",
"MATIC04STAKING",
"SOLSTAKING",
"GRT28STAKING",
"SCRT21STAKING",
"XBTSTAKING",
"FLOWHSTAKING",
"TRXSTAKING",
"SOL03STAKING",
"KAVA21STAKING",
"ETH2STAKING",
"USDSTAKING",
"MATICSTAKING",
"DOTSTAKING",
"EURSTAKING",
"USDTSTAKING",
"ATOM21STAKING",
"FLRSTAKING",
"KSMSTAKING",
"SCRTSTAKING",
"FLOW14STAKING",
"ATOMSTAKING",
"USDCSTAKING",
"GRTSTAKING"
]
}
}
},
"Timestamptz",
{
"Custom": {
"name": "order_side",
"kind": {
"Enum": [
"SELL",
"BUY"
]
}
}
},
{
"Custom": {
"name": "order_type",
"kind": {
"Enum": [
"MARKET",
"LIMIT",
"LIMIT_MAKER_ONLY"
]
}
}
},
"Numeric",
"Numeric",
"Numeric",
"Numeric",
"Numeric",
"Int4",
"Jsonb",
"Uuid"
]
},
"nullable": []
},
"hash": "eab7fb92251e25637a9f87c5d328c2ac685992281c010e59d378f631c73e62d3"
}
| 0 |
.sqlx | /mono/.sqlx/query-4c95265755ef6f87a47402653fe66245aad89455ce34dcae644a8f07078391de.json | {
"db_name": "PostgreSQL",
"query": "\n INSERT INTO archive (timestamp, archive_type, exchange, base, quote, last_price, data)\n VALUES ($1, $2, $3, $4, $5, $6, $7)\n ",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Timestamptz",
{
"Custom": {
"name": "archive_type",
"kind": {
"Enum": [
"TICKER",
"BOOK"
]
}
}
},
{
"Custom": {
"name": "exchange",
"kind": {
"Enum": [
"KRAKEN",
"POLONIEX",
"COINBASE",
"BACKTEST"
]
}
}
},
{
"Custom": {
"name": "asset",
"kind": {
"Enum": [
"CAD",
"USD",
"BTC",
"ETH",
"DAI",
"USDT",
"EUR",
"LINK",
"SOL",
"GALA",
"WAXL",
"CHR",
"ALICE",
"ETC",
"POND",
"API3",
"BTT",
"EUL",
"SNX",
"ORCA",
"REQ",
"SXP",
"COMP",
"BAL",
"ANKR",
"BADGER",
"CQT",
"ONEINCH",
"QNT",
"AUD",
"ATOM",
"SAMO",
"POLS",
"USDC",
"PLA",
"RAY",
"PARA",
"ROOK",
"FIS",
"UNI",
"AGLD",
"KSM",
"OMG",
"BAT",
"TBTC",
"BIT",
"OXT",
"PERP",
"RAD",
"SGB",
"NMR",
"RNDR",
"APT",
"MINA",
"SRM",
"BNC",
"JPY",
"STG",
"FTM",
"KAR",
"FLOWH",
"MV",
"SHIB",
"KP3R",
"KNC",
"ALPHA",
"FIDA",
"ENS",
"GNO",
"CHF",
"FLOW",
"STEP",
"MASK",
"TRIBE",
"FLR",
"FIL",
"ASTR",
"GAL",
"NYM",
"TRU",
"OCEAN",
"CELR",
"ANT",
"TRX",
"WAVES",
"ICX",
"STX",
"RBC",
"OGN",
"GBP",
"SDN",
"GMT",
"GLMR",
"JASMY",
"CRV",
"ARPA",
"ZRX",
"CVX",
"XTZ",
"ACH",
"ETHW",
"EGLD",
"ENJ",
"DASH",
"KAVA",
"GRT",
"CFG",
"FXS",
"MIR",
"BOBA",
"LSK",
"LDO",
"KINT",
"MSOL",
"SAND",
"RUNE",
"XRT",
"OXY",
"SYN",
"ACA",
"HDX",
"WBTC",
"STORJ",
"TLM",
"BAND",
"UNFI",
"LPT",
"MC",
"UST",
"T",
"POWR",
"SCRT",
"IMX",
"DYDX",
"RLC",
"ADX",
"FARM",
"XMR",
"SPELL",
"IDEX",
"XZEC",
"RARI",
"MXC",
"BNT",
"XRP",
"CHZ",
"PAXG",
"BLUR",
"MANA",
"REP",
"DOGE",
"ALCX",
"C98",
"FET",
"ADA",
"AUDIO",
"FORTH",
"TOKE",
"YFI",
"REN",
"CTSI",
"TVK",
"NODL",
"GARI",
"EWT",
"BCH",
"EOS",
"SC",
"MKR",
"SUSHI",
"KEEP",
"SBR",
"MATIC",
"GST",
"GMX",
"KIN",
"AKT",
"DOT",
"RPL",
"COTI",
"AXS",
"AAVE",
"ETH2",
"ALGO",
"CSM",
"XLM",
"MNGO",
"LRC",
"BICO",
"DENT",
"KFEE",
"MLN",
"BSX",
"HFT",
"ATLAS",
"LUNA",
"KEY",
"JUNO",
"WOO",
"POLIS",
"AIR",
"INTR",
"NANO",
"LCX",
"AVAX",
"LTC",
"MULTI",
"LUNA2",
"TEER",
"KILT",
"QTUM",
"PHA",
"INJ",
"PSTAKE",
"BOND",
"CVC",
"WETH",
"NEAR",
"GHST",
"YGG",
"RARE",
"BLZ",
"MOVR",
"AED",
"GTC",
"XCN",
"SUPER",
"ICP",
"APE",
"REPV2",
"UMA",
"DOTPARACHAIN",
"KSMPARACHAIN",
"EURHOLD",
"AUDHOLD",
"CADHOLD",
"CHFHOLD",
"USDHOLD",
"AEDHOLD",
"GBPHOLD",
"ADASTAKING",
"MINASTAKING",
"KAVASTAKING",
"KSM07STAKING",
"DOT28STAKING",
"ALGOSTAKING",
"XTZSTAKING",
"LUNASTAKING",
"FLOWSTAKING",
"MATIC04STAKING",
"SOLSTAKING",
"GRT28STAKING",
"SCRT21STAKING",
"XBTSTAKING",
"FLOWHSTAKING",
"TRXSTAKING",
"SOL03STAKING",
"KAVA21STAKING",
"ETH2STAKING",
"USDSTAKING",
"MATICSTAKING",
"DOTSTAKING",
"EURSTAKING",
"USDTSTAKING",
"ATOM21STAKING",
"FLRSTAKING",
"KSMSTAKING",
"SCRTSTAKING",
"FLOW14STAKING",
"ATOMSTAKING",
"USDCSTAKING",
"GRTSTAKING"
]
}
}
},
{
"Custom": {
"name": "asset",
"kind": {
"Enum": [
"CAD",
"USD",
"BTC",
"ETH",
"DAI",
"USDT",
"EUR",
"LINK",
"SOL",
"GALA",
"WAXL",
"CHR",
"ALICE",
"ETC",
"POND",
"API3",
"BTT",
"EUL",
"SNX",
"ORCA",
"REQ",
"SXP",
"COMP",
"BAL",
"ANKR",
"BADGER",
"CQT",
"ONEINCH",
"QNT",
"AUD",
"ATOM",
"SAMO",
"POLS",
"USDC",
"PLA",
"RAY",
"PARA",
"ROOK",
"FIS",
"UNI",
"AGLD",
"KSM",
"OMG",
"BAT",
"TBTC",
"BIT",
"OXT",
"PERP",
"RAD",
"SGB",
"NMR",
"RNDR",
"APT",
"MINA",
"SRM",
"BNC",
"JPY",
"STG",
"FTM",
"KAR",
"FLOWH",
"MV",
"SHIB",
"KP3R",
"KNC",
"ALPHA",
"FIDA",
"ENS",
"GNO",
"CHF",
"FLOW",
"STEP",
"MASK",
"TRIBE",
"FLR",
"FIL",
"ASTR",
"GAL",
"NYM",
"TRU",
"OCEAN",
"CELR",
"ANT",
"TRX",
"WAVES",
"ICX",
"STX",
"RBC",
"OGN",
"GBP",
"SDN",
"GMT",
"GLMR",
"JASMY",
"CRV",
"ARPA",
"ZRX",
"CVX",
"XTZ",
"ACH",
"ETHW",
"EGLD",
"ENJ",
"DASH",
"KAVA",
"GRT",
"CFG",
"FXS",
"MIR",
"BOBA",
"LSK",
"LDO",
"KINT",
"MSOL",
"SAND",
"RUNE",
"XRT",
"OXY",
"SYN",
"ACA",
"HDX",
"WBTC",
"STORJ",
"TLM",
"BAND",
"UNFI",
"LPT",
"MC",
"UST",
"T",
"POWR",
"SCRT",
"IMX",
"DYDX",
"RLC",
"ADX",
"FARM",
"XMR",
"SPELL",
"IDEX",
"XZEC",
"RARI",
"MXC",
"BNT",
"XRP",
"CHZ",
"PAXG",
"BLUR",
"MANA",
"REP",
"DOGE",
"ALCX",
"C98",
"FET",
"ADA",
"AUDIO",
"FORTH",
"TOKE",
"YFI",
"REN",
"CTSI",
"TVK",
"NODL",
"GARI",
"EWT",
"BCH",
"EOS",
"SC",
"MKR",
"SUSHI",
"KEEP",
"SBR",
"MATIC",
"GST",
"GMX",
"KIN",
"AKT",
"DOT",
"RPL",
"COTI",
"AXS",
"AAVE",
"ETH2",
"ALGO",
"CSM",
"XLM",
"MNGO",
"LRC",
"BICO",
"DENT",
"KFEE",
"MLN",
"BSX",
"HFT",
"ATLAS",
"LUNA",
"KEY",
"JUNO",
"WOO",
"POLIS",
"AIR",
"INTR",
"NANO",
"LCX",
"AVAX",
"LTC",
"MULTI",
"LUNA2",
"TEER",
"KILT",
"QTUM",
"PHA",
"INJ",
"PSTAKE",
"BOND",
"CVC",
"WETH",
"NEAR",
"GHST",
"YGG",
"RARE",
"BLZ",
"MOVR",
"AED",
"GTC",
"XCN",
"SUPER",
"ICP",
"APE",
"REPV2",
"UMA",
"DOTPARACHAIN",
"KSMPARACHAIN",
"EURHOLD",
"AUDHOLD",
"CADHOLD",
"CHFHOLD",
"USDHOLD",
"AEDHOLD",
"GBPHOLD",
"ADASTAKING",
"MINASTAKING",
"KAVASTAKING",
"KSM07STAKING",
"DOT28STAKING",
"ALGOSTAKING",
"XTZSTAKING",
"LUNASTAKING",
"FLOWSTAKING",
"MATIC04STAKING",
"SOLSTAKING",
"GRT28STAKING",
"SCRT21STAKING",
"XBTSTAKING",
"FLOWHSTAKING",
"TRXSTAKING",
"SOL03STAKING",
"KAVA21STAKING",
"ETH2STAKING",
"USDSTAKING",
"MATICSTAKING",
"DOTSTAKING",
"EURSTAKING",
"USDTSTAKING",
"ATOM21STAKING",
"FLRSTAKING",
"KSMSTAKING",
"SCRTSTAKING",
"FLOW14STAKING",
"ATOMSTAKING",
"USDCSTAKING",
"GRTSTAKING"
]
}
}
},
"Numeric",
"Jsonb"
]
},
"nullable": []
},
"hash": "4c95265755ef6f87a47402653fe66245aad89455ce34dcae644a8f07078391de"
}
| 0 |
.sqlx | /mono/.sqlx/query-4b0f6ff375bdbc69ffec505a48f98bd9337e0c9e00559aaa08350840dd743463.json | {
"db_name": "PostgreSQL",
"query": "\n INSERT INTO opportunities (id, run_id)\n VALUES ($1, $2)\n ON CONFLICT (id) DO NOTHING\n ",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Uuid",
"Uuid"
]
},
"nullable": []
},
"hash": "4b0f6ff375bdbc69ffec505a48f98bd9337e0c9e00559aaa08350840dd743463"
}
| 0 |
.sqlx | /mono/.sqlx/query-c7c965a6c9f6b30041c9d008befceccab76fef5398415572f78cfa4edeaf9a84.json | {
"db_name": "PostgreSQL",
"query": "\n INSERT INTO virtual_balance_accounts (id, account_id, account_status, asset, amount, created_at)\n VALUES ($1, $2, $3, $4, $5, $6)\n ON CONFLICT (id) DO NOTHING\n ",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Uuid",
"Uuid",
{
"Custom": {
"name": "account_status",
"kind": {
"Enum": [
"ACTIVE",
"INACTIVE"
]
}
}
},
{
"Custom": {
"name": "asset",
"kind": {
"Enum": [
"CAD",
"USD",
"BTC",
"ETH",
"DAI",
"USDT",
"EUR",
"LINK",
"SOL",
"GALA",
"WAXL",
"CHR",
"ALICE",
"ETC",
"POND",
"API3",
"BTT",
"EUL",
"SNX",
"ORCA",
"REQ",
"SXP",
"COMP",
"BAL",
"ANKR",
"BADGER",
"CQT",
"ONEINCH",
"QNT",
"AUD",
"ATOM",
"SAMO",
"POLS",
"USDC",
"PLA",
"RAY",
"PARA",
"ROOK",
"FIS",
"UNI",
"AGLD",
"KSM",
"OMG",
"BAT",
"TBTC",
"BIT",
"OXT",
"PERP",
"RAD",
"SGB",
"NMR",
"RNDR",
"APT",
"MINA",
"SRM",
"BNC",
"JPY",
"STG",
"FTM",
"KAR",
"FLOWH",
"MV",
"SHIB",
"KP3R",
"KNC",
"ALPHA",
"FIDA",
"ENS",
"GNO",
"CHF",
"FLOW",
"STEP",
"MASK",
"TRIBE",
"FLR",
"FIL",
"ASTR",
"GAL",
"NYM",
"TRU",
"OCEAN",
"CELR",
"ANT",
"TRX",
"WAVES",
"ICX",
"STX",
"RBC",
"OGN",
"GBP",
"SDN",
"GMT",
"GLMR",
"JASMY",
"CRV",
"ARPA",
"ZRX",
"CVX",
"XTZ",
"ACH",
"ETHW",
"EGLD",
"ENJ",
"DASH",
"KAVA",
"GRT",
"CFG",
"FXS",
"MIR",
"BOBA",
"LSK",
"LDO",
"KINT",
"MSOL",
"SAND",
"RUNE",
"XRT",
"OXY",
"SYN",
"ACA",
"HDX",
"WBTC",
"STORJ",
"TLM",
"BAND",
"UNFI",
"LPT",
"MC",
"UST",
"T",
"POWR",
"SCRT",
"IMX",
"DYDX",
"RLC",
"ADX",
"FARM",
"XMR",
"SPELL",
"IDEX",
"XZEC",
"RARI",
"MXC",
"BNT",
"XRP",
"CHZ",
"PAXG",
"BLUR",
"MANA",
"REP",
"DOGE",
"ALCX",
"C98",
"FET",
"ADA",
"AUDIO",
"FORTH",
"TOKE",
"YFI",
"REN",
"CTSI",
"TVK",
"NODL",
"GARI",
"EWT",
"BCH",
"EOS",
"SC",
"MKR",
"SUSHI",
"KEEP",
"SBR",
"MATIC",
"GST",
"GMX",
"KIN",
"AKT",
"DOT",
"RPL",
"COTI",
"AXS",
"AAVE",
"ETH2",
"ALGO",
"CSM",
"XLM",
"MNGO",
"LRC",
"BICO",
"DENT",
"KFEE",
"MLN",
"BSX",
"HFT",
"ATLAS",
"LUNA",
"KEY",
"JUNO",
"WOO",
"POLIS",
"AIR",
"INTR",
"NANO",
"LCX",
"AVAX",
"LTC",
"MULTI",
"LUNA2",
"TEER",
"KILT",
"QTUM",
"PHA",
"INJ",
"PSTAKE",
"BOND",
"CVC",
"WETH",
"NEAR",
"GHST",
"YGG",
"RARE",
"BLZ",
"MOVR",
"AED",
"GTC",
"XCN",
"SUPER",
"ICP",
"APE",
"REPV2",
"UMA",
"DOTPARACHAIN",
"KSMPARACHAIN",
"EURHOLD",
"AUDHOLD",
"CADHOLD",
"CHFHOLD",
"USDHOLD",
"AEDHOLD",
"GBPHOLD",
"ADASTAKING",
"MINASTAKING",
"KAVASTAKING",
"KSM07STAKING",
"DOT28STAKING",
"ALGOSTAKING",
"XTZSTAKING",
"LUNASTAKING",
"FLOWSTAKING",
"MATIC04STAKING",
"SOLSTAKING",
"GRT28STAKING",
"SCRT21STAKING",
"XBTSTAKING",
"FLOWHSTAKING",
"TRXSTAKING",
"SOL03STAKING",
"KAVA21STAKING",
"ETH2STAKING",
"USDSTAKING",
"MATICSTAKING",
"DOTSTAKING",
"EURSTAKING",
"USDTSTAKING",
"ATOM21STAKING",
"FLRSTAKING",
"KSMSTAKING",
"SCRTSTAKING",
"FLOW14STAKING",
"ATOMSTAKING",
"USDCSTAKING",
"GRTSTAKING"
]
}
}
},
"Numeric",
"Timestamptz"
]
},
"nullable": []
},
"hash": "c7c965a6c9f6b30041c9d008befceccab76fef5398415572f78cfa4edeaf9a84"
}
| 0 |
.sqlx | /mono/.sqlx/query-e8f0bfefb70b1b004df0789bffd6e01b3ca15c1a2a05232f9af31306c3078c9e.json | {
"db_name": "PostgreSQL",
"query": "\n INSERT INTO balance_accounts (id, asset, amount)\n VALUES ($1, $2, $3)\n ON CONFLICT (id) DO NOTHING\n ",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Uuid",
{
"Custom": {
"name": "asset",
"kind": {
"Enum": [
"CAD",
"USD",
"BTC",
"ETH",
"DAI",
"USDT",
"EUR",
"LINK",
"SOL",
"GALA",
"WAXL",
"CHR",
"ALICE",
"ETC",
"POND",
"API3",
"BTT",
"EUL",
"SNX",
"ORCA",
"REQ",
"SXP",
"COMP",
"BAL",
"ANKR",
"BADGER",
"CQT",
"ONEINCH",
"QNT",
"AUD",
"ATOM",
"SAMO",
"POLS",
"USDC",
"PLA",
"RAY",
"PARA",
"ROOK",
"FIS",
"UNI",
"AGLD",
"KSM",
"OMG",
"BAT",
"TBTC",
"BIT",
"OXT",
"PERP",
"RAD",
"SGB",
"NMR",
"RNDR",
"APT",
"MINA",
"SRM",
"BNC",
"JPY",
"STG",
"FTM",
"KAR",
"FLOWH",
"MV",
"SHIB",
"KP3R",
"KNC",
"ALPHA",
"FIDA",
"ENS",
"GNO",
"CHF",
"FLOW",
"STEP",
"MASK",
"TRIBE",
"FLR",
"FIL",
"ASTR",
"GAL",
"NYM",
"TRU",
"OCEAN",
"CELR",
"ANT",
"TRX",
"WAVES",
"ICX",
"STX",
"RBC",
"OGN",
"GBP",
"SDN",
"GMT",
"GLMR",
"JASMY",
"CRV",
"ARPA",
"ZRX",
"CVX",
"XTZ",
"ACH",
"ETHW",
"EGLD",
"ENJ",
"DASH",
"KAVA",
"GRT",
"CFG",
"FXS",
"MIR",
"BOBA",
"LSK",
"LDO",
"KINT",
"MSOL",
"SAND",
"RUNE",
"XRT",
"OXY",
"SYN",
"ACA",
"HDX",
"WBTC",
"STORJ",
"TLM",
"BAND",
"UNFI",
"LPT",
"MC",
"UST",
"T",
"POWR",
"SCRT",
"IMX",
"DYDX",
"RLC",
"ADX",
"FARM",
"XMR",
"SPELL",
"IDEX",
"XZEC",
"RARI",
"MXC",
"BNT",
"XRP",
"CHZ",
"PAXG",
"BLUR",
"MANA",
"REP",
"DOGE",
"ALCX",
"C98",
"FET",
"ADA",
"AUDIO",
"FORTH",
"TOKE",
"YFI",
"REN",
"CTSI",
"TVK",
"NODL",
"GARI",
"EWT",
"BCH",
"EOS",
"SC",
"MKR",
"SUSHI",
"KEEP",
"SBR",
"MATIC",
"GST",
"GMX",
"KIN",
"AKT",
"DOT",
"RPL",
"COTI",
"AXS",
"AAVE",
"ETH2",
"ALGO",
"CSM",
"XLM",
"MNGO",
"LRC",
"BICO",
"DENT",
"KFEE",
"MLN",
"BSX",
"HFT",
"ATLAS",
"LUNA",
"KEY",
"JUNO",
"WOO",
"POLIS",
"AIR",
"INTR",
"NANO",
"LCX",
"AVAX",
"LTC",
"MULTI",
"LUNA2",
"TEER",
"KILT",
"QTUM",
"PHA",
"INJ",
"PSTAKE",
"BOND",
"CVC",
"WETH",
"NEAR",
"GHST",
"YGG",
"RARE",
"BLZ",
"MOVR",
"AED",
"GTC",
"XCN",
"SUPER",
"ICP",
"APE",
"REPV2",
"UMA",
"DOTPARACHAIN",
"KSMPARACHAIN",
"EURHOLD",
"AUDHOLD",
"CADHOLD",
"CHFHOLD",
"USDHOLD",
"AEDHOLD",
"GBPHOLD",
"ADASTAKING",
"MINASTAKING",
"KAVASTAKING",
"KSM07STAKING",
"DOT28STAKING",
"ALGOSTAKING",
"XTZSTAKING",
"LUNASTAKING",
"FLOWSTAKING",
"MATIC04STAKING",
"SOLSTAKING",
"GRT28STAKING",
"SCRT21STAKING",
"XBTSTAKING",
"FLOWHSTAKING",
"TRXSTAKING",
"SOL03STAKING",
"KAVA21STAKING",
"ETH2STAKING",
"USDSTAKING",
"MATICSTAKING",
"DOTSTAKING",
"EURSTAKING",
"USDTSTAKING",
"ATOM21STAKING",
"FLRSTAKING",
"KSMSTAKING",
"SCRTSTAKING",
"FLOW14STAKING",
"ATOMSTAKING",
"USDCSTAKING",
"GRTSTAKING"
]
}
}
},
"Numeric"
]
},
"nullable": []
},
"hash": "e8f0bfefb70b1b004df0789bffd6e01b3ca15c1a2a05232f9af31306c3078c9e"
}
| 0 |
.sqlx | /mono/.sqlx/query-43a3918c44f5faab9ccbe58e229c76f6c706db511b6d449aa3c7545a3a6bc07a.json | {
"db_name": "PostgreSQL",
"query": "\n UPDATE orders\n SET volume_filled = volume_filled + $1,\n total_cost = COALESCE(total_cost, 0) + $2\n WHERE id = $3\n ",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Numeric",
"Numeric",
"Uuid"
]
},
"nullable": []
},
"hash": "43a3918c44f5faab9ccbe58e229c76f6c706db511b6d449aa3c7545a3a6bc07a"
}
| 0 |
.sqlx | /mono/.sqlx/query-def55a32f6cab3a6c0ee4bd8c8ff0031eb916945e2c7eeeaa37ee6a652fb2efc.json | {
"db_name": "PostgreSQL",
"query": "DELETE FROM orders WHERE strat_run_id = $1",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Uuid"
]
},
"nullable": []
},
"hash": "def55a32f6cab3a6c0ee4bd8c8ff0031eb916945e2c7eeeaa37ee6a652fb2efc"
}
| 0 |
.sqlx | /mono/.sqlx/query-5275cda6ec6a246087eb45130d252f25469edd929d31829e4636224d182e1c73.json | {
"db_name": "PostgreSQL",
"query": "DELETE FROM vba_balance_ledgers WHERE vba_id = ANY($1)",
"describe": {
"columns": [],
"parameters": {
"Left": [
"UuidArray"
]
},
"nullable": []
},
"hash": "5275cda6ec6a246087eb45130d252f25469edd929d31829e4636224d182e1c73"
}
| 0 |
.sqlx | /mono/.sqlx/query-df64f7b325ef6cfb62115a9fd1ed139e60254f895e2af58e792c0eb96f02e9d5.json | {
"db_name": "PostgreSQL",
"query": "SELECT strat_id FROM strat_runs WHERE id = $1",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "strat_id",
"type_info": "Uuid"
}
],
"parameters": {
"Left": [
"Uuid"
]
},
"nullable": [
false
]
},
"hash": "df64f7b325ef6cfb62115a9fd1ed139e60254f895e2af58e792c0eb96f02e9d5"
}
| 0 |
.sqlx | /mono/.sqlx/query-ab449cd0a3430661c6c843a960412fdafd2aab94b3d96a3256d6779a42300001.json | {
"db_name": "PostgreSQL",
"query": "SELECT vba_id FROM strat_balance_accounts WHERE strat_run_id = $1",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "vba_id",
"type_info": "Uuid"
}
],
"parameters": {
"Left": [
"Uuid"
]
},
"nullable": [
false
]
},
"hash": "ab449cd0a3430661c6c843a960412fdafd2aab94b3d96a3256d6779a42300001"
}
| 0 |
.sqlx | /mono/.sqlx/query-9366095a4805111b455d1f28f179acaacae49621454ccfab34ebff80da5af868.json | {
"db_name": "PostgreSQL",
"query": "DELETE FROM trades WHERE strat_run_id = $1",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Uuid"
]
},
"nullable": []
},
"hash": "9366095a4805111b455d1f28f179acaacae49621454ccfab34ebff80da5af868"
}
| 0 |
.sqlx | /mono/.sqlx/query-3e360c5406d7086fa47689ac2372f314d856536e7005467258a3883b8b530de1.json | {
"db_name": "PostgreSQL",
"query": "\n INSERT INTO vba_balance_ledgers (id, vba_id, amount, created_at)\n VALUES ($1, $2, $3, $4)\n ON CONFLICT (id) DO NOTHING\n ",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Uuid",
"Uuid",
"Numeric",
"Timestamptz"
]
},
"nullable": []
},
"hash": "3e360c5406d7086fa47689ac2372f314d856536e7005467258a3883b8b530de1"
}
| 0 |
.sqlx | /mono/.sqlx/query-994d2d33eccf006cf331c7e9f59c3fa48877d6cd1e99f478b4f2b52c2e04981e.json | {
"db_name": "PostgreSQL",
"query": "DELETE FROM trade_metrics WHERE run_id = $1",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Uuid"
]
},
"nullable": []
},
"hash": "994d2d33eccf006cf331c7e9f59c3fa48877d6cd1e99f478b4f2b52c2e04981e"
}
| 0 |
.sqlx | /mono/.sqlx/query-7cdd0c7cc51556e2289a409b52bbd34a83521b9c04b011fc2847414387ab74b8.json | {
"db_name": "PostgreSQL",
"query": "DELETE FROM strategies WHERE id = $1",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Uuid"
]
},
"nullable": []
},
"hash": "7cdd0c7cc51556e2289a409b52bbd34a83521b9c04b011fc2847414387ab74b8"
}
| 0 |
.sqlx | /mono/.sqlx/query-2f9d5a6d3b241c0157fe3f570ae165a407de6cb8c3207e77fc88b7ed3fcfabb8.json | {
"db_name": "PostgreSQL",
"query": "\n INSERT INTO strat_balance_accounts (strat_run_id, vba_id)\n VALUES ($1, $2)\n ",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Uuid",
"Uuid"
]
},
"nullable": []
},
"hash": "2f9d5a6d3b241c0157fe3f570ae165a407de6cb8c3207e77fc88b7ed3fcfabb8"
}
| 0 |
.sqlx | /mono/.sqlx/query-835737d03a7ea3713eb4e5df97f867952812d97574350c9e9bc6cb3f410b01c8.json | {
"db_name": "PostgreSQL",
"query": "\n INSERT INTO account_details (id, name, account_id, venue)\n VALUES ($1, $2, $3, $4)\n ON CONFLICT (id) DO NOTHING\n ",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Uuid",
"Text",
"Uuid",
{
"Custom": {
"name": "venue",
"kind": {
"Enum": [
"KRAKEN",
"POLONIEX",
"COINBASE",
"BACKTEST"
]
}
}
}
]
},
"nullable": []
},
"hash": "835737d03a7ea3713eb4e5df97f867952812d97574350c9e9bc6cb3f410b01c8"
}
| 0 |
.sqlx | /mono/.sqlx/query-d61aae21438cd3337515decfce002879ca1936feb87d7e85dc9cfa50377cea1c.json | {
"db_name": "PostgreSQL",
"query": "DELETE FROM strat_runs WHERE id = $1",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Uuid"
]
},
"nullable": []
},
"hash": "d61aae21438cd3337515decfce002879ca1936feb87d7e85dc9cfa50377cea1c"
}
| 0 |
migrations | /mono/migrations/20230920121900_disallow_cancel_new_or_pending_order.sql | CREATE OR REPLACE FUNCTION check_cancellation_status_transition()
RETURNS TRIGGER AS
$$
BEGIN
IF (OLD.order_status = 'FILLED' OR OLD.order_status = 'CANCELLED' OR OLD.order_status = 'ERROR') AND
NEW.cancellation_status IS DISTINCT FROM OLD.cancellation_status THEN
RAISE EXCEPTION 'Can not cancel order which has reached terminal state';
END IF;
IF (OLD.order_status = 'NEW' OR OLD.order_status = 'PENDING') AND
NEW.cancellation_status IS DISTINCT FROM OLD.cancellation_status THEN
RAISE EXCEPTION 'Can not cancel order which has not hit the exchange';
END IF;
RETURN NEW;
END ;
$$ LANGUAGE plpgsql;
CREATE TRIGGER orders_before_update_cancellation_status
BEFORE UPDATE OF cancellation_status
ON orders
FOR EACH ROW
EXECUTE FUNCTION check_cancellation_status_transition(); | 0 |
migrations | /mono/migrations/20240206200214_create_ohlcv_table.sql | CREATE TABLE if not exists ohlcv
(
timestamp TIMESTAMPTZ,
exchange exchange,
interval int4,
base asset,
quote asset,
open decimal NOT NULL,
high decimal NOT NULL,
low decimal NOT NULL,
close decimal NOT NULL,
volume decimal,
vwap decimal,
count int4,
PRIMARY KEY (timestamp, exchange, interval, base, quote)
); | 0 |
migrations | /mono/migrations/20230823183057_add_pair_field_to_db_tables.sql | CREATE OR REPLACE FUNCTION set_pair_column()
RETURNS TRIGGER AS $$
BEGIN
NEW.pair := NEW.base::TEXT || '_' || NEW.quote::TEXT;
RETURN NEW;
END;
$$ LANGUAGE plpgsql;
ALTER TABLE orders ADD COLUMN pair TEXT;
CREATE TRIGGER set_pair_orders
BEFORE INSERT
ON orders
FOR EACH ROW
EXECUTE PROCEDURE set_pair_column();
ALTER TABLE trades ADD COLUMN pair TEXT;
CREATE TRIGGER set_pair_trades
BEFORE INSERT
ON trades
FOR EACH ROW
EXECUTE PROCEDURE set_pair_column();
| 0 |
migrations | /mono/migrations/20240417224331_save_order_cdc.sql | -- Add migration script here
CREATE OR REPLACE FUNCTION notify_order_execution_engine() RETURNS trigger AS
$$
BEGIN
PERFORM pg_notify('order_execution_engine', row_to_json(NEW)::text);
RETURN NEW;
END;
$$ LANGUAGE plpgsql;
CREATE TRIGGER emit_order_created
AFTER INSERT OR UPDATE
ON orders
FOR EACH ROW
WHEN (NEW.order_status = 'NEW' OR NEW.cancellation_status = 'REQUESTED')
EXECUTE FUNCTION notify_order_execution_engine();
| 0 |
migrations | /mono/migrations/20230821190855_add_total_cost_to_orders.sql | -- Add migration script here
ALTER TABLE orders ADD COLUMN total_cost decimal; | 0 |
migrations | /mono/migrations/20231104191316_nullify_requested_cancellation_on_terminal_state.sql | -- Add migration script here
ALTER type cancellation_status ADD VALUE 'ABORTED' BEFORE 'COMPLETE';
CREATE OR REPLACE FUNCTION nullify_requested_cancellation_on_change_to_terminal_state()
RETURNS TRIGGER AS
$$
BEGIN
IF (NEW.order_status = 'FILLED' OR NEW.order_status = 'ERROR') AND
OLD.cancellation_status IS NOT NULL THEN
NEW.cancellation_status = 'ABORTED';
END IF;
IF (NEW.order_status = 'CANCELLED') THEN
NEW.cancellation_status = 'COMPLETE';
END IF;
RETURN NEW;
END ;
$$ LANGUAGE plpgsql;
CREATE TRIGGER nullify_requested_cancellation_on_change_to_terminal_state
BEFORE UPDATE OF order_status
ON orders
FOR EACH ROW
EXECUTE FUNCTION nullify_requested_cancellation_on_change_to_terminal_state();
| 0 |
migrations | /mono/migrations/20240424202241_add_price_field_to_archive_table.sql | -- Add migration script here
ALTER TABLE archive
ADD COLUMN IF NOT EXISTS last_price decimal;
| 0 |
migrations | /mono/migrations/20231113191450_fix_orders_with_invalid_cancellation_status.sql | DROP TRIGGER orders_before_update_cancellation_status on orders;
UPDATE orders
SET cancellation_status = 'ABORTED'
WHERE order_status IN ('FILLED', 'CANCELLED', 'ERROR')
AND cancellation_status IS NOT NULL;
CREATE TRIGGER orders_before_update_cancellation_status
BEFORE UPDATE OF cancellation_status
ON orders
FOR EACH ROW
EXECUTE FUNCTION check_cancellation_status_transition(); | 0 |
migrations | /mono/migrations/20240425190420_revert_save_order_cdc.sql | DROP TRIGGER emit_order_created ON orders;
DROP FUNCTION notify_order_execution_engine();
| 0 |
migrations | /mono/migrations/20240122165737_prevent_order_status_open_to_pending.sql | CREATE OR REPLACE FUNCTION prevent_order_status_open_to_pending()
RETURNS TRIGGER AS $$
BEGIN
IF NEW.order_status = 'PENDING' AND OLD.order_status = 'OPEN' THEN
RAISE EXCEPTION 'Cannot update order status to pending if already open.';
END IF;
RETURN NEW;
END;
$$ LANGUAGE plpgsql;
CREATE TRIGGER order_prevent_order_status_open_to_pending
BEFORE UPDATE OF order_status
ON orders
FOR EACH ROW
EXECUTE FUNCTION prevent_order_status_open_to_pending(); | 0 |
migrations | /mono/migrations/20240415174112_add_run_id_field_to_orders_and_trades_tables.sql | ALTER TABLE trades
ADD COLUMN IF NOT EXISTS strat_run_id uuid;
ALTER TABLE orders
ADD COLUMN IF NOT EXISTS strat_run_id uuid; | 0 |
migrations | /mono/migrations/20240424180904_add_pnl_mv.sql | -- Create a stored procedure to refresh or create the materialized view
CREATE OR REPLACE FUNCTION refresh_or_create_pnl_materialized_view() RETURNS VOID AS
$$
BEGIN
-- Check if the materialized view exists
IF EXISTS (SELECT 1 FROM information_schema.views WHERE table_name = 'pnl_mv') THEN
-- Refresh the materialized view
REFRESH MATERIALIZED VIEW pnl_mv;
ELSE
-- Create the materialized view
CREATE MATERIALIZED VIEW IF NOT EXISTS pnl_mv AS
SELECT created_at,
pair,
strat_run_id,
SUM(CASE WHEN order_side = 'BUY' THEN cost END)
OVER (PARTITION BY pair, strat_run_id ORDER BY created_at) /
SUM(CASE WHEN order_side = 'BUY' THEN volume END)
OVER (PARTITION BY pair, strat_run_id ORDER BY created_at) AS average_cost,
SUM(CASE WHEN order_side = 'SELL' THEN cost END)
OVER (PARTITION BY pair, strat_run_id ORDER BY created_at) /
SUM(CASE WHEN order_side = 'SELL' THEN volume END)
OVER (PARTITION BY pair, strat_run_id ORDER BY created_at) AS vwap_sell,
SUM(CASE WHEN order_side = 'SELL' THEN cost END)
OVER (PARTITION BY pair, strat_run_id ORDER BY created_at) AS net_proceeds,
SUM(CASE WHEN order_side = 'SELL' THEN volume END)
OVER (PARTITION BY pair, strat_run_id ORDER BY created_at) AS volume_sold
FROM trades
GROUP BY created_at, order_side, cost, volume, pair, strat_run_id
ORDER BY created_at;
END IF;
END;
$$ LANGUAGE plpgsql;
-- Create a trigger function to execute the stored procedure after insert, update, or delete operations
CREATE OR REPLACE FUNCTION refresh_pnl_materialized_view_trigger_func() RETURNS TRIGGER AS
$$
BEGIN
PERFORM refresh_or_create_pnl_materialized_view();
RETURN NULL;
END;
$$
LANGUAGE plpgsql;
-- Create a trigger to execute the trigger function after insert, update, or delete operations on the trades table
CREATE TRIGGER refresh_pnl_materialized_view_trigger
AFTER INSERT OR UPDATE OR DELETE
ON trades
FOR EACH STATEMENT
EXECUTE FUNCTION refresh_pnl_materialized_view_trigger_func();
| 0 |
migrations | /mono/migrations/20240523154427_add_indicators_table.sql | CREATE TABLE if not exists indicator_sma
(
venue venue NOT NULL,
pair text NOT NULL,
period text NOT NULL,
value jsonb NOT NULL,
timestamp timestamp with time zone NOT NULL
);
CREATE TABLE if not exists indicator_ema
(
venue venue NOT NULL,
pair text NOT NULL,
period text NOT NULL,
value jsonb NOT NULL,
timestamp timestamp with time zone NOT NULL
);
CREATE TABLE if not exists indicator_rsi
(
venue venue NOT NULL,
pair text NOT NULL,
period text NOT NULL,
value jsonb NOT NULL,
timestamp timestamp with time zone NOT NULL
);
CREATE TABLE if not exists indicator_stddev
(
venue venue NOT NULL,
pair text NOT NULL,
period text NOT NULL,
value jsonb NOT NULL,
timestamp timestamp with time zone NOT NULL
); | 0 |
migrations | /mono/migrations/20240423153544_remove_available_field_in_vba_table.sql | ALTER TABLE virtual_balance_accounts
DROP COLUMN IF EXISTS available;
ALTER TABLE balance_metrics
DROP COLUMN IF EXISTS available_balance; | 0 |
migrations | /mono/migrations/20230525221343_add_asset_enum_entries.sql | -- Add migration script here
ALTER TYPE trading_strategy ADD VALUE 'UNKNOWN';
ALTER TYPE asset ADD VALUE 'GALA';
ALTER TYPE asset ADD VALUE 'WAXL';
ALTER TYPE asset ADD VALUE 'CHR';
ALTER TYPE asset ADD VALUE 'ALICE';
ALTER TYPE asset ADD VALUE 'ETC';
ALTER TYPE asset ADD VALUE 'POND';
ALTER TYPE asset ADD VALUE 'API3';
ALTER TYPE asset ADD VALUE 'BTT';
ALTER TYPE asset ADD VALUE 'EUL';
ALTER TYPE asset ADD VALUE 'SNX';
ALTER TYPE asset ADD VALUE 'ORCA';
ALTER TYPE asset ADD VALUE 'REQ';
ALTER TYPE asset ADD VALUE 'SXP';
ALTER TYPE asset ADD VALUE 'COMP';
ALTER TYPE asset ADD VALUE 'BAL';
ALTER TYPE asset ADD VALUE 'ANKR';
ALTER TYPE asset ADD VALUE 'BADGER';
ALTER TYPE asset ADD VALUE 'CQT';
ALTER TYPE asset ADD VALUE 'ONEINCH';
ALTER TYPE asset ADD VALUE 'QNT';
ALTER TYPE asset ADD VALUE 'AUD';
ALTER TYPE asset ADD VALUE 'ATOM';
ALTER TYPE asset ADD VALUE 'SAMO';
ALTER TYPE asset ADD VALUE 'POLS';
ALTER TYPE asset ADD VALUE 'USDC';
ALTER TYPE asset ADD VALUE 'PLA';
ALTER TYPE asset ADD VALUE 'RAY';
ALTER TYPE asset ADD VALUE 'PARA';
ALTER TYPE asset ADD VALUE 'ROOK';
ALTER TYPE asset ADD VALUE 'FIS';
ALTER TYPE asset ADD VALUE 'UNI';
ALTER TYPE asset ADD VALUE 'AGLD';
ALTER TYPE asset ADD VALUE 'KSM';
ALTER TYPE asset ADD VALUE 'OMG';
ALTER TYPE asset ADD VALUE 'BAT';
ALTER TYPE asset ADD VALUE 'TBTC';
ALTER TYPE asset ADD VALUE 'BIT';
ALTER TYPE asset ADD VALUE 'OXT';
ALTER TYPE asset ADD VALUE 'PERP';
ALTER TYPE asset ADD VALUE 'RAD';
ALTER TYPE asset ADD VALUE 'SGB';
ALTER TYPE asset ADD VALUE 'NMR';
ALTER TYPE asset ADD VALUE 'RNDR';
ALTER TYPE asset ADD VALUE 'APT';
ALTER TYPE asset ADD VALUE 'MINA';
ALTER TYPE asset ADD VALUE 'SRM';
ALTER TYPE asset ADD VALUE 'BNC';
ALTER TYPE asset ADD VALUE 'JPY';
ALTER TYPE asset ADD VALUE 'STG';
ALTER TYPE asset ADD VALUE 'FTM';
ALTER TYPE asset ADD VALUE 'KAR';
ALTER TYPE asset ADD VALUE 'FLOWH';
ALTER TYPE asset ADD VALUE 'MV';
ALTER TYPE asset ADD VALUE 'SHIB';
ALTER TYPE asset ADD VALUE 'KP3R';
ALTER TYPE asset ADD VALUE 'KNC';
ALTER TYPE asset ADD VALUE 'ALPHA';
ALTER TYPE asset ADD VALUE 'FIDA';
ALTER TYPE asset ADD VALUE 'ENS';
ALTER TYPE asset ADD VALUE 'GNO';
ALTER TYPE asset ADD VALUE 'CHF';
ALTER TYPE asset ADD VALUE 'FLOW';
ALTER TYPE asset ADD VALUE 'STEP';
ALTER TYPE asset ADD VALUE 'MASK';
ALTER TYPE asset ADD VALUE 'TRIBE';
ALTER TYPE asset ADD VALUE 'FLR';
ALTER TYPE asset ADD VALUE 'FIL';
ALTER TYPE asset ADD VALUE 'ASTR';
ALTER TYPE asset ADD VALUE 'GAL';
ALTER TYPE asset ADD VALUE 'NYM';
ALTER TYPE asset ADD VALUE 'TRU';
ALTER TYPE asset ADD VALUE 'OCEAN';
ALTER TYPE asset ADD VALUE 'CELR';
ALTER TYPE asset ADD VALUE 'ANT';
ALTER TYPE asset ADD VALUE 'TRX';
ALTER TYPE asset ADD VALUE 'WAVES';
ALTER TYPE asset ADD VALUE 'ICX';
ALTER TYPE asset ADD VALUE 'STX';
ALTER TYPE asset ADD VALUE 'RBC';
ALTER TYPE asset ADD VALUE 'OGN';
ALTER TYPE asset ADD VALUE 'GBP';
ALTER TYPE asset ADD VALUE 'SDN';
ALTER TYPE asset ADD VALUE 'GMT';
ALTER TYPE asset ADD VALUE 'GLMR';
ALTER TYPE asset ADD VALUE 'JASMY';
ALTER TYPE asset ADD VALUE 'CRV';
ALTER TYPE asset ADD VALUE 'ARPA';
ALTER TYPE asset ADD VALUE 'ZRX';
ALTER TYPE asset ADD VALUE 'CVX';
ALTER TYPE asset ADD VALUE 'XTZ';
ALTER TYPE asset ADD VALUE 'ACH';
ALTER TYPE asset ADD VALUE 'ETHW';
ALTER TYPE asset ADD VALUE 'EGLD';
ALTER TYPE asset ADD VALUE 'ENJ';
ALTER TYPE asset ADD VALUE 'DASH';
ALTER TYPE asset ADD VALUE 'KAVA';
ALTER TYPE asset ADD VALUE 'GRT';
ALTER TYPE asset ADD VALUE 'CFG';
ALTER TYPE asset ADD VALUE 'FXS';
ALTER TYPE asset ADD VALUE 'MIR';
ALTER TYPE asset ADD VALUE 'BOBA';
ALTER TYPE asset ADD VALUE 'LSK';
ALTER TYPE asset ADD VALUE 'LDO';
ALTER TYPE asset ADD VALUE 'KINT';
ALTER TYPE asset ADD VALUE 'MSOL';
ALTER TYPE asset ADD VALUE 'SAND';
ALTER TYPE asset ADD VALUE 'RUNE';
ALTER TYPE asset ADD VALUE 'XRT';
ALTER TYPE asset ADD VALUE 'OXY';
ALTER TYPE asset ADD VALUE 'SYN';
ALTER TYPE asset ADD VALUE 'ACA';
ALTER TYPE asset ADD VALUE 'HDX';
ALTER TYPE asset ADD VALUE 'WBTC';
ALTER TYPE asset ADD VALUE 'STORJ';
ALTER TYPE asset ADD VALUE 'TLM';
ALTER TYPE asset ADD VALUE 'BAND';
ALTER TYPE asset ADD VALUE 'UNFI';
ALTER TYPE asset ADD VALUE 'LPT';
ALTER TYPE asset ADD VALUE 'MC';
ALTER TYPE asset ADD VALUE 'UST';
ALTER TYPE asset ADD VALUE 'T';
ALTER TYPE asset ADD VALUE 'POWR';
ALTER TYPE asset ADD VALUE 'SCRT';
ALTER TYPE asset ADD VALUE 'IMX';
ALTER TYPE asset ADD VALUE 'DYDX';
ALTER TYPE asset ADD VALUE 'RLC';
ALTER TYPE asset ADD VALUE 'ADX';
ALTER TYPE asset ADD VALUE 'FARM';
ALTER TYPE asset ADD VALUE 'XMR';
ALTER TYPE asset ADD VALUE 'SPELL';
ALTER TYPE asset ADD VALUE 'IDEX';
ALTER TYPE asset ADD VALUE 'XZEC';
ALTER TYPE asset ADD VALUE 'RARI';
ALTER TYPE asset ADD VALUE 'MXC';
ALTER TYPE asset ADD VALUE 'BNT';
ALTER TYPE asset ADD VALUE 'XRP';
ALTER TYPE asset ADD VALUE 'CHZ';
ALTER TYPE asset ADD VALUE 'PAXG';
ALTER TYPE asset ADD VALUE 'BLUR';
ALTER TYPE asset ADD VALUE 'MANA';
ALTER TYPE asset ADD VALUE 'REP';
ALTER TYPE asset ADD VALUE 'DOGE';
ALTER TYPE asset ADD VALUE 'ALCX';
ALTER TYPE asset ADD VALUE 'C98';
ALTER TYPE asset ADD VALUE 'FET';
ALTER TYPE asset ADD VALUE 'ADA';
ALTER TYPE asset ADD VALUE 'AUDIO';
ALTER TYPE asset ADD VALUE 'FORTH';
ALTER TYPE asset ADD VALUE 'TOKE';
ALTER TYPE asset ADD VALUE 'YFI';
ALTER TYPE asset ADD VALUE 'REN';
ALTER TYPE asset ADD VALUE 'CTSI';
ALTER TYPE asset ADD VALUE 'TVK';
ALTER TYPE asset ADD VALUE 'NODL';
ALTER TYPE asset ADD VALUE 'GARI';
ALTER TYPE asset ADD VALUE 'EWT';
ALTER TYPE asset ADD VALUE 'BCH';
ALTER TYPE asset ADD VALUE 'EOS';
ALTER TYPE asset ADD VALUE 'SC';
ALTER TYPE asset ADD VALUE 'MKR';
ALTER TYPE asset ADD VALUE 'SUSHI';
ALTER TYPE asset ADD VALUE 'KEEP';
ALTER TYPE asset ADD VALUE 'SBR';
ALTER TYPE asset ADD VALUE 'MATIC';
ALTER TYPE asset ADD VALUE 'GST';
ALTER TYPE asset ADD VALUE 'GMX';
ALTER TYPE asset ADD VALUE 'KIN';
ALTER TYPE asset ADD VALUE 'AKT';
ALTER TYPE asset ADD VALUE 'DOT';
ALTER TYPE asset ADD VALUE 'RPL';
ALTER TYPE asset ADD VALUE 'COTI';
ALTER TYPE asset ADD VALUE 'AXS';
ALTER TYPE asset ADD VALUE 'AAVE';
ALTER TYPE asset ADD VALUE 'ETH2';
ALTER TYPE asset ADD VALUE 'ALGO';
ALTER TYPE asset ADD VALUE 'CSM';
ALTER TYPE asset ADD VALUE 'XLM';
ALTER TYPE asset ADD VALUE 'MNGO';
ALTER TYPE asset ADD VALUE 'LRC';
ALTER TYPE asset ADD VALUE 'BICO';
ALTER TYPE asset ADD VALUE 'DENT';
ALTER TYPE asset ADD VALUE 'KFEE';
ALTER TYPE asset ADD VALUE 'MLN';
ALTER TYPE asset ADD VALUE 'BSX';
ALTER TYPE asset ADD VALUE 'HFT';
ALTER TYPE asset ADD VALUE 'ATLAS';
ALTER TYPE asset ADD VALUE 'LUNA';
ALTER TYPE asset ADD VALUE 'KEY';
ALTER TYPE asset ADD VALUE 'JUNO';
ALTER TYPE asset ADD VALUE 'WOO';
ALTER TYPE asset ADD VALUE 'POLIS';
ALTER TYPE asset ADD VALUE 'AIR';
ALTER TYPE asset ADD VALUE 'INTR';
ALTER TYPE asset ADD VALUE 'NANO';
ALTER TYPE asset ADD VALUE 'LCX';
ALTER TYPE asset ADD VALUE 'AVAX';
ALTER TYPE asset ADD VALUE 'LTC';
ALTER TYPE asset ADD VALUE 'MULTI';
ALTER TYPE asset ADD VALUE 'LUNA2';
ALTER TYPE asset ADD VALUE 'TEER';
ALTER TYPE asset ADD VALUE 'KILT';
ALTER TYPE asset ADD VALUE 'QTUM';
ALTER TYPE asset ADD VALUE 'PHA';
ALTER TYPE asset ADD VALUE 'INJ';
ALTER TYPE asset ADD VALUE 'PSTAKE';
ALTER TYPE asset ADD VALUE 'BOND';
ALTER TYPE asset ADD VALUE 'CVC';
ALTER TYPE asset ADD VALUE 'WETH';
ALTER TYPE asset ADD VALUE 'NEAR';
ALTER TYPE asset ADD VALUE 'GHST';
ALTER TYPE asset ADD VALUE 'YGG';
ALTER TYPE asset ADD VALUE 'RARE';
ALTER TYPE asset ADD VALUE 'BLZ';
ALTER TYPE asset ADD VALUE 'MOVR';
ALTER TYPE asset ADD VALUE 'AED';
ALTER TYPE asset ADD VALUE 'GTC';
ALTER TYPE asset ADD VALUE 'XCN';
ALTER TYPE asset ADD VALUE 'SUPER';
ALTER TYPE asset ADD VALUE 'ICP';
ALTER TYPE asset ADD VALUE 'APE';
ALTER TYPE asset ADD VALUE 'REPV2';
ALTER TYPE asset ADD VALUE 'UMA';
ALTER TYPE asset ADD VALUE 'DOTPARACHAIN';
ALTER TYPE asset ADD VALUE 'KSMPARACHAIN';
ALTER TYPE asset ADD VALUE 'EURHOLD';
ALTER TYPE asset ADD VALUE 'AUDHOLD';
ALTER TYPE asset ADD VALUE 'CADHOLD';
ALTER TYPE asset ADD VALUE 'CHFHOLD';
ALTER TYPE asset ADD VALUE 'USDHOLD';
ALTER TYPE asset ADD VALUE 'AEDHOLD';
ALTER TYPE asset ADD VALUE 'GBPHOLD';
ALTER TYPE asset ADD VALUE 'ADASTAKING';
ALTER TYPE asset ADD VALUE 'MINASTAKING';
ALTER TYPE asset ADD VALUE 'KAVASTAKING';
ALTER TYPE asset ADD VALUE 'KSM07STAKING';
ALTER TYPE asset ADD VALUE 'DOT28STAKING';
ALTER TYPE asset ADD VALUE 'ALGOSTAKING';
ALTER TYPE asset ADD VALUE 'XTZSTAKING';
ALTER TYPE asset ADD VALUE 'LUNASTAKING';
ALTER TYPE asset ADD VALUE 'FLOWSTAKING';
ALTER TYPE asset ADD VALUE 'MATIC04STAKING';
ALTER TYPE asset ADD VALUE 'SOLSTAKING';
ALTER TYPE asset ADD VALUE 'GRT28STAKING';
ALTER TYPE asset ADD VALUE 'SCRT21STAKING';
ALTER TYPE asset ADD VALUE 'XBTSTAKING';
ALTER TYPE asset ADD VALUE 'FLOWHSTAKING';
ALTER TYPE asset ADD VALUE 'TRXSTAKING';
ALTER TYPE asset ADD VALUE 'SOL03STAKING';
ALTER TYPE asset ADD VALUE 'KAVA21STAKING';
ALTER TYPE asset ADD VALUE 'ETH2STAKING';
ALTER TYPE asset ADD VALUE 'USDSTAKING';
ALTER TYPE asset ADD VALUE 'MATICSTAKING';
ALTER TYPE asset ADD VALUE 'DOTSTAKING';
ALTER TYPE asset ADD VALUE 'EURSTAKING';
ALTER TYPE asset ADD VALUE 'USDTSTAKING';
ALTER TYPE asset ADD VALUE 'ATOM21STAKING';
ALTER TYPE asset ADD VALUE 'FLRSTAKING';
ALTER TYPE asset ADD VALUE 'KSMSTAKING';
ALTER TYPE asset ADD VALUE 'SCRTSTAKING';
ALTER TYPE asset ADD VALUE 'FLOW14STAKING';
ALTER TYPE asset ADD VALUE 'ATOMSTAKING';
ALTER TYPE asset ADD VALUE 'USDCSTAKING';
ALTER TYPE asset ADD VALUE 'GRTSTAKING';
| 0 |
migrations | /mono/migrations/20230219195425_crate_kraken_collector_tables.sql | -- Add migration script here
CREATE TYPE trading_strategy AS ENUM (
'MARKET_MAKER_ON_TICKER',
'MIRROR',
'TRIANGULAR_ARBITRAGE'
);
CREATE TYPE asset AS ENUM (
'CAD',
'USD',
'BTC',
'ETH',
'DAI',
'USDT',
'EUR',
'LINK',
'SOL'
);
CREATE TYPE exchange AS ENUM (
'KRAKEN',
'POLONIEX',
'COINBASE'
);
CREATE TYPE order_side AS ENUM (
'SELL',
'BUY'
);
CREATE TYPE order_type AS ENUM (
'MARKET',
'LIMIT'
);
CREATE TYPE order_status AS ENUM (
'NEW',
'PENDING',
'OPEN',
'FILLED',
'CANCELLATION_REQUESTED',
'CANCELLATION_PENDING',
'CANCELLED',
'ERROR'
);
CREATE TABLE if not exists orders
(
id uuid PRIMARY KEY,
strategy trading_strategy NOT NULL,
exchange exchange NOT NULL,
exchange_order_ref varchar unique,
user_ref SERIAL unique NOT NULL,
error varchar,
order_type order_type NOT NULL,
status order_status NOT NULL DEFAULT 'NEW',
base asset NOT NULL,
quote asset NOT NULL,
order_side order_side NOT NULL,
price decimal,
volume decimal NOT NULL,
volume_filled decimal NOT NULL DEFAULT 0,
expire_time TIMESTAMPTZ,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
extra_fields jsonb
);
CREATE TABLE if not exists trades
(
id uuid PRIMARY KEY,
exchange exchange NOT NULL,
trade_ref varchar unique NOT NULL,
pos_trade_ref varchar NOT NULL,
order_ref varchar NOT NULL,
base asset NOT NULL,
quote asset NOT NULL,
time TIMESTAMPTZ NOT NULL,
order_side order_side NOT NULL,
order_type order_type NOT NULL,
price decimal NOT NULL,
cost decimal,
fee decimal NOT NULL,
volume decimal NOT NULL,
margin decimal,
user_ref int4,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
updated_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
extra_fields jsonb
);
CREATE OR REPLACE FUNCTION set_updated_at_timestamp() RETURNS TRIGGER AS
$$
BEGIN
NEW.updated_at = NOW();
RETURN NEW;
END;
$$ LANGUAGE plpgsql;
CREATE TRIGGER set_timestamp
BEFORE UPDATE
ON orders
FOR EACH ROW
EXECUTE PROCEDURE set_updated_at_timestamp(); | 0 |
migrations | /mono/migrations/20240216200955_adding_trade_metrics_table.sql | CREATE TABLE if not exists trade_metrics
(
run_id uuid NOT NULL,
profit decimal NOT NULL DEFAULT 0,
average_cost decimal NOT NULL DEFAULT 0,
vwap_delta decimal NOT NULL DEFAULT 0,
average_sell decimal NOT NULL DEFAULT 0,
volume_sold decimal NOT NULL DEFAULT 0,
volume_bought decimal NOT NULL DEFAULT 0,
cost_basis decimal NOT NULL DEFAULT 0,
net_proceeds decimal NOT NULL DEFAULT 0,
buy_cost decimal NOT NULL DEFAULT 0,
fees decimal NOT NULL DEFAULT 0,
base asset NOT NULL,
quote asset NOT NULL,
base_available_balance decimal NOT NULL DEFAULT 0,
quote_available_balance decimal NOT NULL DEFAULT 0,
base_available_market_balance decimal NOT NULL DEFAULT 0,
quote_available_market_balance decimal NOT NULL DEFAULT 0,
time timestamp with time zone NOT NULL
); | 0 |
migrations | /mono/migrations/20240327131614_add_balance_metrics_table.sql | ALTER TABLE trade_metrics
DROP COLUMN IF EXISTS base_available_balance,
DROP COLUMN IF EXISTS quote_available_balance,
DROP COLUMN IF EXISTS base_available_market_balance,
DROP COLUMN IF EXISTS quote_available_market_balance,
ADD COLUMN IF NOT EXISTS time_volume_weighted_average_cost decimal,
ADD COLUMN IF NOT EXISTS time_volume_weighted_average_sell decimal;
CREATE TABLE if not exists balance_metrics
(
run_id uuid NOT NULL,
asset asset NOT NULL,
balance decimal,
available_balance decimal,
time timestamp with time zone NOT NULL
); | 0 |
migrations | /mono/migrations/20230920121809_remove_cancellation_requested_and_rename_status.sql | ALTER TYPE order_status RENAME TO order_status_old;
CREATE TYPE order_status AS ENUM (
'NEW',
'PENDING',
'OPEN',
'FILLED',
'CANCELLATION_PENDING',
'CANCELLED',
'ERROR'
);
ALTER TABLE orders
ADD COLUMN order_status order_status NOT NULL DEFAULT 'NEW';
UPDATE orders
SET order_status =
CASE
-- there should be no orders stuck in CANCELLATION_REQUESTED and if there are, that's an error
WHEN status = 'CANCELLATION_REQUESTED' THEN 'ERROR'
ELSE status::text::order_status
END;
ALTER TABLE orders
DROP COLUMN status;
DROP TYPE order_status_old;
| 0 |
migrations | /mono/migrations/20231110194426_add_balance_tables.sql | CREATE TYPE account_status AS ENUM (
'ACTIVE',
'INACTIVE'
);
CREATE TABLE if not exists balance_accounts
(
id uuid PRIMARY KEY,
asset asset NOT NULL,
amount decimal NOT NULL
);
CREATE TABLE account_details
(
id uuid PRIMARY KEY,
name text NOT NULL,
account_id uuid NOT NULL,
FOREIGN KEY (account_id) REFERENCES balance_accounts (id)
);
CREATE TABLE if not exists virtual_balance_accounts
(
id uuid PRIMARY KEY,
account_id uuid NOT NULL,
account_status account_status NOT NULL,
asset asset NOT NULL,
amount decimal NOT NULL,
available decimal NOT NULL,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
FOREIGN KEY (account_id) REFERENCES balance_accounts (id)
);
CREATE TABLE vba_balance_ledgers
(
id uuid PRIMARY KEY,
vba_id uuid NOT NULL,
amount decimal NOT NULL,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
FOREIGN KEY (vba_id) REFERENCES virtual_balance_accounts (id)
);
CREATE OR REPLACE FUNCTION update_total_amount()
RETURNS TRIGGER AS
$$
BEGIN
UPDATE virtual_balance_accounts
SET amount = amount + NEW.amount
WHERE id = NEW.vba_id;
RETURN NEW;
END;
$$ LANGUAGE plpgsql;
CREATE TRIGGER vba_balance_ledger_update_trigger
AFTER INSERT
ON vba_balance_ledgers
FOR EACH ROW
EXECUTE PROCEDURE update_total_amount();
| 0 |
migrations | /mono/migrations/20240318183629_add_opportunity_tables.sql | CREATE TABLE if not exists opportunities
(
id uuid PRIMARY KEY,
run_id uuid NOT NULL
);
CREATE TABLE if not exists opportunities_orders
(
opportunity_id uuid NOT NULL,
order_id uuid NOT NULL,
PRIMARY KEY (opportunity_id, order_id),
FOREIGN KEY (opportunity_id) REFERENCES opportunities (id),
FOREIGN KEY (order_id) REFERENCES orders (id)
); | 0 |
migrations | /mono/migrations/20230619143626_add_maker_only_order_type.sql | -- Add migration script here
ALTER TYPE order_type ADD VALUE 'LIMIT_MAKER_ONLY';
| 0 |
migrations | /mono/migrations/20240410143925_add_venue_field_to_account_details.sql | CREATE TYPE venue AS ENUM (
'KRAKEN',
'POLONIEX',
'COINBASE',
'BACKTEST'
);
ALTER TABLE account_details
ADD COLUMN IF NOT EXISTS venue venue NOT NULL; | 0 |
migrations | /mono/migrations/20231123181245_adding_archive_service_tables.sql | -- Add migration script here
CREATE TYPE archive_type AS ENUM (
'TICKER',
'BOOK'
);
CREATE TABLE if not exists archive
(
exchange exchange NOT NULL,
archive_type archive_type NOT NULL,
base asset NOT NULL,
quote asset NOT NULL,
timestamp TIMESTAMPTZ NOT NULL,
data JSONB NOT NULL
);
| 0 |
migrations | /mono/migrations/20240507163633_alter_pnl_function_to_use_time.sql | CREATE OR REPLACE FUNCTION refresh_or_create_pnl_materialized_view() RETURNS VOID AS
$$
BEGIN
-- Check if the materialized view exists
IF EXISTS (SELECT 1 FROM information_schema.views WHERE table_name = 'pnl_mv') THEN
-- Refresh the materialized view
REFRESH MATERIALIZED VIEW pnl_mv;
ELSE
-- Create the materialized view
CREATE MATERIALIZED VIEW IF NOT EXISTS pnl_mv AS
SELECT time,
pair,
strat_run_id,
SUM(CASE WHEN order_side = 'BUY' THEN cost END)
OVER (PARTITION BY pair, strat_run_id ORDER BY time) /
SUM(CASE WHEN order_side = 'BUY' THEN volume END)
OVER (PARTITION BY pair, strat_run_id ORDER BY time) AS average_cost,
SUM(CASE WHEN order_side = 'SELL' THEN cost END)
OVER (PARTITION BY pair, strat_run_id ORDER BY time) /
SUM(CASE WHEN order_side = 'SELL' THEN volume END)
OVER (PARTITION BY pair, strat_run_id ORDER BY time) AS vwap_sell,
SUM(CASE WHEN order_side = 'SELL' THEN cost END)
OVER (PARTITION BY pair, strat_run_id ORDER BY time) AS net_proceeds,
SUM(CASE WHEN order_side = 'SELL' THEN volume END)
OVER (PARTITION BY pair, strat_run_id ORDER BY time) AS volume_sold
FROM trades
GROUP BY time, order_side, cost, volume, pair, strat_run_id
ORDER BY time;
END IF;
END;
$$ LANGUAGE plpgsql; | 0 |
migrations | /mono/migrations/20230920121828_add_cancellation_status.sql | CREATE TYPE cancellation_status AS ENUM (
'REQUESTED',
'PENDING',
'COMPLETE'
);
ALTER TABLE orders
ADD COLUMN cancellation_status cancellation_status;
| 0 |
migrations | /mono/migrations/20230920121845_disallow_status_change_from_terminal_state.sql | CREATE OR REPLACE FUNCTION check_order_status_transition()
RETURNS TRIGGER AS
$$
BEGIN
IF (OLD.order_status = 'FILLED' OR OLD.order_status = 'CANCELLED' OR OLD.order_status = 'ERROR') AND
NEW.order_status != OLD.order_status THEN
RAISE EXCEPTION 'Transition from FILLED, CANCELLED or ERROR to another status is not allowed';
END IF;
RETURN NEW;
END ;
$$ LANGUAGE plpgsql;
CREATE TRIGGER orders_before_update_order_status
BEFORE UPDATE OF order_status
ON orders
FOR EACH ROW
EXECUTE FUNCTION check_order_status_transition(); | 0 |
migrations | /mono/migrations/20240319141459_add_strat_tables.sql | CREATE TABLE strategies
(
id uuid PRIMARY KEY,
name trading_strategy NOT NULL
);
CREATE TABLE strat_runs
(
id uuid PRIMARY KEY,
strat_id uuid NOT NULL,
name text NOT NULL,
meta jsonb,
FOREIGN KEY (strat_id) REFERENCES strategies (id)
);
CREATE TABLE strat_balance_accounts
(
strat_run_id uuid NOT NULL,
vba_id uuid NOT NULL,
FOREIGN KEY (vba_id) REFERENCES virtual_balance_accounts (id),
FOREIGN KEY (strat_run_id) REFERENCES strat_runs (id)
);
| 0 |
migrations | /mono/migrations/20231106212123_disallow_decreasing_volume_filled.sql | CREATE OR REPLACE FUNCTION prevent_lower_volume_filled()
RETURNS TRIGGER AS $$
BEGIN
-- Check if the new volume_filled is less than the old volume_filled
IF NEW.volume_filled < OLD.volume_filled THEN
RAISE EXCEPTION 'Update rejected: volume_filled cannot be decreased.';
END IF;
RETURN NEW;
END;
$$ LANGUAGE plpgsql;
CREATE TRIGGER check_volume_filled_before_update
BEFORE UPDATE OF volume_filled
ON orders
FOR EACH ROW
EXECUTE FUNCTION prevent_lower_volume_filled(); | 0 |
migrations | /mono/migrations/20240110171507_add_backtest_exchange_enum_variant.sql | -- Add migration script here
ALTER TYPE exchange ADD VALUE 'BACKTEST'; | 0 |
docker | /mono/docker/.gitignore | # Make touch files
.build/
.push/
| 0 |
docker | /mono/docker/Makefile |
.build/makedeb: makedeb.Dockerfile
docker buildx build -f makedeb.Dockerfile -t registry.gitlab.com/fdr-group/mono/ci/makedeb . --push
docker build -f makedeb.Dockerfile -t registry.gitlab.com/fdr-group/mono/ci/makedeb .
mkdir -p .build && date +%s > .build/grafana
.push/makedeb: .build/makedeb
docker push registry.gitlab.com/fdr-group/mono/ci/makedeb
mkdir -p .push && date +%s > .push/makedeb
.build/makedeb_multiarch: makedeb.Dockerfile
docker buildx build -f makedeb.Dockerfile -t registry.gitlab.com/fdr-group/mono/ci/makedeb . --push --platform linux/amd64,linux/arm64
| 0 |
docker | /mono/docker/makedeb.Dockerfile | FROM ubuntu:22.04
RUN apt update && apt install -y wget gpg
RUN wget -qO - 'https://proget.makedeb.org/debian-feeds/makedeb.pub' \
| gpg --dearmor | tee /usr/share/keyrings/makedeb-archive-keyring.gpg 1> /dev/null
RUN echo 'deb [signed-by=/usr/share/keyrings/makedeb-archive-keyring.gpg arch=all] https://proget.makedeb.org/ makedeb main' \
| tee /etc/apt/sources.list.d/makedeb.list
RUN apt update && apt install -y git makedeb && rm -rf /var/lib/apt/lists/*
# Switch to a non-root user
RUN useradd --system makedeb
USER makedeb | 0 |
wsl | /mono/docker/wsl/.wslconfig | [wsl2]
kernel=C:\\Users\\All Users\\bzImage
| 0 |
wsl | /mono/docker/wsl/build.sh | #!/bin/bash
mkdir -p src && cd src
if [ -d "WSL2-Linux-Kernel" ]; then
echo "Directory exists."
else
git clone https://github.com/microsoft/WSL2-Linux-Kernel.git
fi
cd WSL2-Linux-Kernel
sed -i 's/# CONFIG_NETFILTER_XT_MATCH_RECENT is not set/CONFIG_NETFILTER_XT_MATCH_RECENT=y/' Microsoft/config-wsl
sed -i 's/-microsoft-standard-WSL2/-fdr-standard-WSL2/' Microsoft/config-wsl
make -j $(expr $(nproc) - 1) KCONFIG_CONFIG=Microsoft/config-wsl | 0 |
wsl | /mono/docker/wsl/Dockerfile | FROM ubuntu:latest
ARG DEBIAN_FRONTEND=noninteractive
RUN apt update && apt install -y \
build-essential \
flex \
bison \
dwarves \
libssl-dev \
libelf-dev \
python3 \
git \
bc
WORKDIR /kernel
ADD build.sh .
CMD build.sh
| 0 |
rust | /mono/docker/rust/local.Dockerfile | # ---- Build Stage ----
FROM registry.gitlab.com/fdr-group/mono/rust-builder:latest AS build
WORKDIR /app
COPY . .
RUN --mount=type=cache,target=/app/.cargo_docker_cache \
--mount=type=cache,target=/app/target/docker \
CARGO_BUILD_INCREMENTAL=true \
SQLX_OFFLINE=true \
PROFILE=debug \
CARGO_TARGET_DIR=/app/target/docker \
CARGO_HOME=/app/.cargo_docker_cache \
cargo build --release
RUN --mount=type=cache,target=/app/.cargo_docker_cache \
--mount=type=cache,target=/app/target/docker \
cargo metadata --format-version=1 | \
jq -r '.packages[] | select(.source == null) | .targets[] | select(.kind[] | contains("bin")) | .name' \
> /app/workspace_bins.txt
RUN --mount=type=cache,target=/app/.cargo_docker_cache \
--mount=type=cache,target=/app/target/docker \
mkdir -p /app/release; \
while IFS= read -r binary; do \
cp "/app/target/docker/release/$binary" "/app/release/"; \
done < /app/workspace_bins.txt
## ---- Local Stage: All binaries in single image ----
FROM debian:bookworm AS omnibus
ARG DEBIAN_FRONTEND=noninteractive
RUN apt update && apt install -y \
openssl \
ca-certificates
COPY --from=build /app/release/* ./app/
WORKDIR /app
CMD /app/$SERVICE --config config.toml
## ---- Production Stage: Single binary per image ----
FROM debian:bookworm AS release
ARG DEBIAN_FRONTEND=noninteractive
RUN apt update && apt install -y \
openssl \
ca-certificates
ARG BINARY_NAME
ENV BINARY_NAME $BINARY_NAME
COPY --from=build /app/release/$BINARY_NAME ./app/$BINARY_NAME
WORKDIR /app
CMD /app/$BINARY_NAME --config config.toml | 0 |
rust | /mono/docker/rust/sqlx-cli.Dockerfile | FROM registry.gitlab.com/fdr-group/mono/rust-builder:latest
RUN cargo install sqlx-cli
| 0 |
rust | /mono/docker/rust/ci-release.Dockerfile | # ---- Release Image With Service Binary ----
# This image is used to run the service binary.
# It is built on top of the base image and adds the service binary.
FROM registry.gitlab.com/fdr-group/mono/fdr-service-base:latest
ARG BINARY_NAME
ARG BINARY_LOCATION
ADD $BINARY_LOCATION /app/$BINARY_NAME
ENV BINARY_NAME $BINARY_NAME
WORKDIR /app
CMD /app/$BINARY_NAME --config config.toml | 0 |
rust | /mono/docker/rust/ci-base.Dockerfile | # ---- Base Release Image ----
# This image is used as the base for all release images.
# It contains the necessary dependencies to run the service binary.
FROM debian:bookworm
ARG DEBIAN_FRONTEND=noninteractive
RUN apt update && apt install -y \
openssl \
libssl-dev \
ca-certificates
| 0 |
rust | /mono/docker/rust/ci-builder.Dockerfile | # ---- Builder Image ----
FROM rust:1.77.2-slim-bookworm
ARG DEBIAN_FRONTEND=noninteractive
RUN apt update && apt install -y \
iputils-ping \
libpq-dev \
cmake \
pkg-config \
gcc \
g++ \
python3 \
libssl-dev \
protobuf-compiler \
git \
jq \
postgresql-client
WORKDIR /app
RUN rustup component add rustfmt clippy
RUN rustup install nightly
RUN cargo install cargo-audit
RUN cargo install cargo-udeps
RUN CARGO_NET_GIT_FETCH_WITH_CLI=true cargo install mdbook mdbook-mermaid
CMD cargo build --release | 0 |
postgresql-migrate | /mono/helm/postgresql-migrate/values.yaml |
name: postgresql-migrate
activeDeadlineSeconds: 60 # Allow the job to run for 1 minute | 0 |
postgresql-migrate | /mono/helm/postgresql-migrate/Chart.yaml | apiVersion: v2
name: fdr-postgresql-migrate
description: Run the PostgreSQL sqlx migrations.
type: application
version: "0.1.0"
| 0 |
values | /mono/helm/postgresql-migrate/values/dev.yaml | 0 |
|
values | /mono/helm/postgresql-migrate/values/local.yaml |
createSecrets: true
secrets:
postgresql_username: file://sym-secrets/postgresql_username
postgresql_password: file://sym-secrets/postgresql_password
# Enable to jump into the and debug
# command: [sleep, inf]
# activeDeadlineSeconds: 3600
| 0 |
files | /mono/helm/postgresql-migrate/files/migrate.sh | #!/bin/env sh
echo "Decoding migrations"
mkdir -p /migrations/decoded
for file in /migrations/encoded/*
do
base64 -d "$file" > "/migrations/decoded/$(basename "$file")"
done
echo "Listing migrations:"
find /migrations/decoded -type f -exec shasum {} \; | sort -k 2
export DATABASE_URL="postgres://${PGUSER}:${PGPASSWORD}@${PGHOST}:${PGPORT}/${PGDATABASE}"
pgpassword_redacted=$(echo "$PGPASSWORD" | tr '[:print:]' '*')
database_url_redacted="postgres://${PGUSER}:${pgpassword_redacted}@${PGHOST}:${PGPORT}/${PGDATABASE}"
echo "\nConnecting to $database_url_redacted\n"
echo "Running migrations..."
cargo sqlx migrate run --source /migrations/decoded
if [ "$?" -ne 0 ]; then
echo "Failed to run migrations :("
exit 1
fi
echo "Migrations complete!"
| 0 |
templates | /mono/helm/postgresql-migrate/templates/cfgmap-migrations.yaml | {{/* Migrations are base 64 encoded to avoid problems caused by CR line endings being stripped */}}
apiVersion: v1
kind: ConfigMap
metadata:
name: postgresql-migrations
data:
{{- $scope := . }}
{{- range $migrationFile, $_ := .Files.Glob "migrations/*.sql" }}
{{- with $scope }}
{{ $migrationFile | base }}: {{ (.Files.Get $migrationFile) | b64enc }}
{{- end }}
{{- end }} | 0 |
templates | /mono/helm/postgresql-migrate/templates/job.yaml | {{ $scriptMountPath := "/postgresql/bin" }}
{{- if .Values.createSecrets }}
{{ include "common.secrets-v2" . }}
{{- end }}
---
apiVersion: batch/v1
kind: Job
metadata:
name: postgresql-migrate
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: {{ .Values.activeDeadlineSeconds }}
ttlSecondsAfterFinished: 3600 # Keep the job for 1 hour after completion
template:
spec:
restartPolicy: Never
containers:
- name: postgresql-migrate
image: registry.gitlab.com/fdr-group/mono/sqlx-cli:latest
{{- if (.Values.command) }}
command: {{ .Values.command | toJson }}
{{- else }}
command:
- {{ $scriptMountPath }}/migrate.sh
{{- end }}
env:
- name: PGUSER
valueFrom:
secretKeyRef:
name: postgresql-migrate-secrets
key: postgresql_username
- name: PGPASSWORD
valueFrom:
secretKeyRef:
name: postgresql-migrate-secrets
key: postgresql_password
- name: PGHOST
value: postgresql.default.svc.cluster.local
- name: PGPORT
value: '5432'
- name: PGDATABASE
value: trading
volumeMounts:
- name: postgresql-migrate-sh
mountPath: {{ $scriptMountPath }}
readOnly: true
- name: postgresql-migrations
mountPath: /migrations/encoded
readOnly: true
volumes:
- name: postgresql-migrate-sh
configMap:
name: postgresql-migrate-sh
defaultMode: 0555
- name: postgresql-migrations
configMap:
name: postgresql-migrations
defaultMode: 0555
---
apiVersion: v1
kind: ConfigMap
metadata:
name: postgresql-migrate-sh
data:
migrate.sh: |
{{ ($.Files.Get "files/migrate.sh") | indent 4 }} | 0 |
strat-market-maker | /mono/helm/strat-market-maker/.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-market-maker | /mono/helm/strat-market-maker/values.yaml | replicaCount: 1
name: strat-market-maker
image:
name: strat-market-maker
repository: registry.gitlab.com/fdr-group/mono/rs/market-makers
pullPolicy: IfNotPresent
tag: "latest"
imagePullSecrets: []
nameOverride: ""
fullnameOverride: "strat-market-maker"
serviceAccount:
create: true
annotations: {}
name: "strat-market-maker"
service:
type: ClusterIP
port: 3000
ingress:
enabled: false
autoscaling:
enabled: false
command: ["/app/strategy-manager"]
| 0 |
strat-market-maker | /mono/helm/strat-market-maker/Chart.yaml | apiVersion: v2
name: strat-market-maker
description: Market Maker Strategy
type: application
version: 0.1.0
appVersion: "0.1.0"
| 0 |
strat-market-maker | /mono/helm/strat-market-maker/values-local.yaml | SERVICE: "strategy-manager"
RUST_LOG: debug
image:
tag: "local"
createSecrets: true
configToml: |
use_market_balance = true
back_test = false
run_id = "90d99ddf-ba11-480e-9a31-792670745053"
[kafka_consumer]
group_id = "market_makers"
bootstrap_servers = "redpanda:9093"
enable_partition_eof = "false"
session_timeout_ms = "60000"
auto_commit = "false"
offset_reset = "latest"
topics = ["kraken_ticker", "kraken_orders"]
[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
[[exchange_adapter]]
url = "http://proxy-kraken"
port = 3000
exchange = "KRAKEN"
strategy = "MARKET_MAKER_ON_TICKER"
[[strategies]]
[strategies.MarketMakerOnTicker]
max_orders = 1
cancel_threshold = "0.0009"
desired_profit = "0.001"
price_guard = "Bucket"
set_bid = "50"
pair = "DOT_USD"
exchange = "KRAKEN"
strat_run_id = "90d99ddf-ba11-480e-9a31-792670745053"
[[strategies.subscribed_keys]]
exchange = "KRAKEN"
pairs = ["DOT_USD"]
[[strategies]]
[strategies.MarketMakerOnTicker]
max_orders = 0
cancel_threshold = "0.0001"
desired_profit = "0.0001"
set_bid = "10000"
pair = "USDC_USD"
exchange = "KRAKEN"
strat_run_id = "36075ee7-5be3-44de-a02a-8c8be82b47da"
[strategies.MarketMakerOnTicker.price_guard.Static]
min_sell_price = 1
max_buy_price = 1
[[strategies]]
[strategies.MarketMakerOnTicker]
max_orders = 0
cancel_threshold = "0.00048"
desired_profit = "0.0005"
price_guard = "Bucket"
set_bid = "0.50"
pair = "ETH_USD"
exchange = "KRAKEN"
strat_run_id = "80d99ddf-ba11-480e-9a31-792670745053"
[metrics]
prefix = "fdr"
[server]
port = 3000
listen_address = "0.0.0.0"
[tracing]
level = "DEBUG"
tempo_url = "http://tempo"
tempo_port = 4317
service_name = "market_maker"
[notify_subscribers]
ticker = true
book = false
order_cancelled = true
trade = true
alert = true
order_placed = true
order_error = true
[markets.KRAKEN.DOT_USD]
vwap_decay_factor = 0.0001
vwap_history = 100
[markets.KRAKEN.DOT_USD.ticker_delta]
decay_factor = 0.001
[markets.KRAKEN.DOT_USD.ticker_delta.coefficient]
time_window = 30
increase_by = "0.5"
[markets.KRAKEN.DOT_USD.volume_weights]
profit_weight_scalar = "5.811629"
balance_weight_scalar = "0.3923507"
[markets.KRAKEN.USDC_USD]
vwap_decay_factor = 0.0001
vwap_history = 0
[markets.KRAKEN.USDC_USD.ticker_delta]
decay_factor = 0.001
[markets.KRAKEN.USDC_USD.ticker_delta.coefficient]
time_window = 30
increase_by = "0"
[markets.KRAKEN.USDC_USD.volume_weights]
profit_weight_scalar = "5.811629"
balance_weight_scalar = "0.3923507"
[markets.KRAKEN.ETH_USD]
vwap_decay_factor = 0.0001
vwap_history = 100
[markets.KRAKEN.ETH_USD.ticker_delta]
decay_factor = 0.001
[markets.KRAKEN.ETH_USD.ticker_delta.coefficient]
time_window = 30
increase_by = "0.05"
[markets.KRAKEN.ETH_USD.volume_weights]
profit_weight_scalar = "5.811629"
balance_weight_scalar = "0.3923507"
[postgres]
hostname = "postgresql"
port = 5432
database = "trading"
max_connections = 100
username = "trading"
password = "trading"
| 0 |
strat-market-maker | /mono/helm/strat-market-maker/values-dev.yaml | SERVICE: "strategy-manager"
RUST_LOG: info
imagePullSecrets:
- name: gitlab-registry
image:
tag: "amd64-e5a12b4e"
configToml: |
use_market_balance = true
backtest = false
[kafka_consumer]
group_id = "market_makers"
bootstrap_servers = "redpanda.fdr-data.svc.cluster.local:9093"
enable_partition_eof = "false"
session_timeout_ms = "6000"
auto_commit = "false"
offset_reset = "latest"
topics = ["market_volatility", "kraken_ticker", "kraken_orders", "kraken_book_dot_usd", "kraken_book_eth_usd", "kraken_balances", "kraken_account_balances", "kraken_open_orders", "kraken_vwap", "kraken_assets", "kraken_pairs", "kraken_order_book", "kraken_trade_volume"]
[kafka_producer]
bootstrap_servers = "redpanda.fdr-data.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.fdr-proxies.svc.cluster.local"
port = 3000
exchange = "KRAKEN"
strategy = "MARKET_MAKER_ON_TICKER"
[server]
listen_address = "0.0.0.0"
port = 3000
[metrics]
prefix = "fdr"
[tracing]
level = "DEBUG"
tempo-url = "http://tempo.fdr-monitoring.svc.cluster.local"
tempo-port = 4317
service-name = "market_maker"
[order_book_manager]
pairs = ["dot_usd", "eth_usd"]
[notify_subscribers]
ticker = true
book = false
order_cancelled = true
trade = true
alert = true
order_placed = true
order_error = true
[markets]
"eth_usd" = { vwap_decay_factor = 0.0001, vwap_history = 10, base_balance = 0, quote_balance = 10236, exchange = "KRAKEN", ticker_delta = { decay_factor = 0.001, coefficient = { time_window = 60, increase_by = 0.05 } }, volume_weights = { profit_weight_scalar = 2, balance_weight_scalar = 5 }}
"dot_usd" = { vwap_decay_factor = 0.0001, vwap_history = 10, base_balance = 0, quote_balance = 10236, exchange = "KRAKEN", ticker_delta = { decay_factor = 0.001, coefficient = { time_window = 60, increase_by = 0.05 } }, volume_weights = { profit_weight_scalar = 2, balance_weight_scalar = 4 }}
[[strategies]]
MarketMakerOnTicker = {pair = "eth_usd", cancel_threshold = 0.00025, max_orders = 1, set_bid = 0.05, price_strategy = { "StaticFromTicker" = {desired_profit = 0.0003, price_guard = "SimplifiedAverageCost"}}}
[[strategies]]
MarketMakerOnTicker = {pair = "dot_usd", cancel_threshold = 0.00025, max_orders = 1, set_bid = 25, price_strategy = { "StaticFromTicker" = {desired_profit = 0.0003, price_guard = "SimplifiedAverageCost"}}}
| 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.