mirror of
https://github.com/0x1d/drift-keeper.git
synced 2025-12-15 18:58:21 +01:00
Update dashboard and control script
This commit is contained in:
@@ -19,7 +19,7 @@ More information:
|
|||||||
- DigitalOcean API Key (optional)
|
- DigitalOcean API Key (optional)
|
||||||
|
|
||||||
Drift account is setup according to: https://docs.drift.trade/keeper-bots.
|
Drift account is setup according to: https://docs.drift.trade/keeper-bots.
|
||||||
The account can also be set up using the trading app: https://app.drift.trade/.
|
The account can also be set up using the DEX app: https://app.drift.trade/.
|
||||||
|
|
||||||
## Configure
|
## Configure
|
||||||
|
|
||||||
@@ -53,14 +53,13 @@ Provision a DigitalOcean Droplet and deploy Keeper Bot with current configuratio
|
|||||||
By default ~/.ssh/id_rsa.pub is added to DigitalOcean and the Droplet.
|
By default ~/.ssh/id_rsa.pub is added to DigitalOcean and the Droplet.
|
||||||
|
|
||||||
```
|
```
|
||||||
terraform init
|
./ctl.sh droplet provision
|
||||||
terraform apply
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Wait until Droplet is up and the `droplet_ip` is printed. You may connect to the Droplet using
|
Wait until Droplet is up and the `droplet_ip` is printed. You may connect to the Droplet using
|
||||||
|
|
||||||
```
|
```
|
||||||
ssh root@droplet_ip
|
./ctl.sh droplet connect
|
||||||
```
|
```
|
||||||
|
|
||||||
In case somethin went wrong with the provisioning, check the cloud-init-output log at `/var/log/cloud-init-output.log`.
|
In case somethin went wrong with the provisioning, check the cloud-init-output log at `/var/log/cloud-init-output.log`.
|
||||||
|
|||||||
37
ctl.sh
37
ctl.sh
@@ -5,6 +5,30 @@ API_ENDPOINT=https://api.mainnet-beta.solana.com/
|
|||||||
|
|
||||||
source .env
|
source .env
|
||||||
|
|
||||||
|
function image {
|
||||||
|
function build {
|
||||||
|
mkdir -p .build
|
||||||
|
git clone https://github.com/drift-labs/keeper-bots-v2 -b mainnet-beta .build/keeper-bots-v2
|
||||||
|
docker build -f Dockerfile -t ${DOCKER_IMAGE} .build/keeper-bots-v2
|
||||||
|
rm -rf .build
|
||||||
|
}
|
||||||
|
function push {
|
||||||
|
docker push ${DOCKER_IMAGE}
|
||||||
|
}
|
||||||
|
${@:-}
|
||||||
|
}
|
||||||
|
|
||||||
|
function droplet {
|
||||||
|
function provision {
|
||||||
|
terraform init
|
||||||
|
terraform apply
|
||||||
|
}
|
||||||
|
function connect {
|
||||||
|
ssh keeper@$(terraform output -raw droplet_ip)
|
||||||
|
}
|
||||||
|
${@:-}
|
||||||
|
}
|
||||||
|
|
||||||
function balance {
|
function balance {
|
||||||
function sol {
|
function sol {
|
||||||
local addr=${1:-$WALLET_ADDRESS}
|
local addr=${1:-$WALLET_ADDRESS}
|
||||||
@@ -41,17 +65,4 @@ function balance {
|
|||||||
${@:-}
|
${@:-}
|
||||||
}
|
}
|
||||||
|
|
||||||
function image {
|
|
||||||
function build {
|
|
||||||
mkdir -p .build
|
|
||||||
git clone https://github.com/drift-labs/keeper-bots-v2 -b mainnet-beta .build/keeper-bots-v2
|
|
||||||
docker build -f Dockerfile -t ${DOCKER_IMAGE} .build/keeper-bots-v2
|
|
||||||
rm -rf .build
|
|
||||||
}
|
|
||||||
function push {
|
|
||||||
docker push ${DOCKER_IMAGE}
|
|
||||||
}
|
|
||||||
${@:-}
|
|
||||||
}
|
|
||||||
|
|
||||||
${@:-}
|
${@:-}
|
||||||
@@ -176,7 +176,7 @@
|
|||||||
"useBackend": false
|
"useBackend": false
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"title": "PNL",
|
"title": "Profit",
|
||||||
"type": "stat"
|
"type": "stat"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -436,7 +436,7 @@
|
|||||||
"calcs": [],
|
"calcs": [],
|
||||||
"displayMode": "list",
|
"displayMode": "list",
|
||||||
"placement": "bottom",
|
"placement": "bottom",
|
||||||
"showLegend": false
|
"showLegend": true
|
||||||
},
|
},
|
||||||
"tooltip": {
|
"tooltip": {
|
||||||
"mode": "single",
|
"mode": "single",
|
||||||
@@ -538,7 +538,7 @@
|
|||||||
"calcs": [],
|
"calcs": [],
|
||||||
"displayMode": "list",
|
"displayMode": "list",
|
||||||
"placement": "bottom",
|
"placement": "bottom",
|
||||||
"showLegend": false
|
"showLegend": true
|
||||||
},
|
},
|
||||||
"tooltip": {
|
"tooltip": {
|
||||||
"mode": "single",
|
"mode": "single",
|
||||||
@@ -646,110 +646,6 @@
|
|||||||
"x": 0,
|
"x": 0,
|
||||||
"y": 23
|
"y": 23
|
||||||
},
|
},
|
||||||
"id": 2,
|
|
||||||
"options": {
|
|
||||||
"legend": {
|
|
||||||
"calcs": [
|
|
||||||
"lastNotNull"
|
|
||||||
],
|
|
||||||
"displayMode": "list",
|
|
||||||
"placement": "bottom",
|
|
||||||
"showLegend": true,
|
|
||||||
"sortBy": "Last *",
|
|
||||||
"sortDesc": true
|
|
||||||
},
|
|
||||||
"tooltip": {
|
|
||||||
"mode": "single",
|
|
||||||
"sort": "none"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"targets": [
|
|
||||||
{
|
|
||||||
"datasource": {
|
|
||||||
"type": "prometheus",
|
|
||||||
"uid": "PBFA97CFB590B2093"
|
|
||||||
},
|
|
||||||
"disableTextWrap": false,
|
|
||||||
"editorMode": "builder",
|
|
||||||
"expr": "successful_fills_total",
|
|
||||||
"fullMetaSearch": false,
|
|
||||||
"includeNullMetadata": false,
|
|
||||||
"instant": false,
|
|
||||||
"legendFormat": "__auto",
|
|
||||||
"range": true,
|
|
||||||
"refId": "A",
|
|
||||||
"useBackend": false
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"title": "Successful Fills Total",
|
|
||||||
"type": "timeseries"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"datasource": {
|
|
||||||
"type": "prometheus",
|
|
||||||
"uid": "PBFA97CFB590B2093"
|
|
||||||
},
|
|
||||||
"fieldConfig": {
|
|
||||||
"defaults": {
|
|
||||||
"color": {
|
|
||||||
"mode": "palette-classic"
|
|
||||||
},
|
|
||||||
"custom": {
|
|
||||||
"axisBorderShow": false,
|
|
||||||
"axisCenteredZero": false,
|
|
||||||
"axisColorMode": "text",
|
|
||||||
"axisLabel": "",
|
|
||||||
"axisPlacement": "auto",
|
|
||||||
"barAlignment": 0,
|
|
||||||
"drawStyle": "line",
|
|
||||||
"fillOpacity": 0,
|
|
||||||
"gradientMode": "none",
|
|
||||||
"hideFrom": {
|
|
||||||
"legend": false,
|
|
||||||
"tooltip": false,
|
|
||||||
"viz": false
|
|
||||||
},
|
|
||||||
"insertNulls": false,
|
|
||||||
"lineInterpolation": "linear",
|
|
||||||
"lineWidth": 1,
|
|
||||||
"pointSize": 5,
|
|
||||||
"scaleDistribution": {
|
|
||||||
"type": "linear"
|
|
||||||
},
|
|
||||||
"showPoints": "auto",
|
|
||||||
"spanNulls": false,
|
|
||||||
"stacking": {
|
|
||||||
"group": "A",
|
|
||||||
"mode": "none"
|
|
||||||
},
|
|
||||||
"thresholdsStyle": {
|
|
||||||
"mode": "off"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"displayName": "${__field.labels.instance}",
|
|
||||||
"mappings": [],
|
|
||||||
"thresholds": {
|
|
||||||
"mode": "absolute",
|
|
||||||
"steps": [
|
|
||||||
{
|
|
||||||
"color": "green",
|
|
||||||
"value": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"color": "red",
|
|
||||||
"value": 80
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"overrides": []
|
|
||||||
},
|
|
||||||
"gridPos": {
|
|
||||||
"h": 12,
|
|
||||||
"w": 12,
|
|
||||||
"x": 12,
|
|
||||||
"y": 23
|
|
||||||
},
|
|
||||||
"id": 1,
|
"id": 1,
|
||||||
"options": {
|
"options": {
|
||||||
"legend": {
|
"legend": {
|
||||||
@@ -788,81 +684,6 @@
|
|||||||
"title": "Attempted Fills Total",
|
"title": "Attempted Fills Total",
|
||||||
"type": "timeseries"
|
"type": "timeseries"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"datasource": {
|
|
||||||
"type": "prometheus",
|
|
||||||
"uid": "PBFA97CFB590B2093"
|
|
||||||
},
|
|
||||||
"fieldConfig": {
|
|
||||||
"defaults": {
|
|
||||||
"color": {
|
|
||||||
"mode": "continuous-BlPu"
|
|
||||||
},
|
|
||||||
"custom": {
|
|
||||||
"fillOpacity": 50,
|
|
||||||
"gradientMode": "hue",
|
|
||||||
"hideFrom": {
|
|
||||||
"legend": false,
|
|
||||||
"tooltip": false,
|
|
||||||
"viz": false
|
|
||||||
},
|
|
||||||
"lineWidth": 1
|
|
||||||
},
|
|
||||||
"displayName": "${__field.labels.instance}",
|
|
||||||
"mappings": [],
|
|
||||||
"thresholds": {
|
|
||||||
"mode": "absolute",
|
|
||||||
"steps": [
|
|
||||||
{
|
|
||||||
"color": "green",
|
|
||||||
"value": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"color": "red",
|
|
||||||
"value": 80
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"overrides": []
|
|
||||||
},
|
|
||||||
"gridPos": {
|
|
||||||
"h": 12,
|
|
||||||
"w": 12,
|
|
||||||
"x": 0,
|
|
||||||
"y": 35
|
|
||||||
},
|
|
||||||
"id": 6,
|
|
||||||
"options": {
|
|
||||||
"bucketOffset": 0,
|
|
||||||
"legend": {
|
|
||||||
"calcs": [],
|
|
||||||
"displayMode": "list",
|
|
||||||
"placement": "bottom",
|
|
||||||
"showLegend": true
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"targets": [
|
|
||||||
{
|
|
||||||
"datasource": {
|
|
||||||
"type": "prometheus",
|
|
||||||
"uid": "PBFA97CFB590B2093"
|
|
||||||
},
|
|
||||||
"disableTextWrap": false,
|
|
||||||
"editorMode": "builder",
|
|
||||||
"expr": "rate(sdk_call_duration_histogram_sum{method=\"sendTx\"}[$__rate_interval])",
|
|
||||||
"fullMetaSearch": false,
|
|
||||||
"includeNullMetadata": false,
|
|
||||||
"instant": false,
|
|
||||||
"legendFormat": "__auto",
|
|
||||||
"range": true,
|
|
||||||
"refId": "A",
|
|
||||||
"useBackend": false
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"title": "SendTX Duration",
|
|
||||||
"type": "histogram"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"datasource": {
|
"datasource": {
|
||||||
"type": "prometheus",
|
"type": "prometheus",
|
||||||
@@ -906,7 +727,7 @@
|
|||||||
"h": 12,
|
"h": 12,
|
||||||
"w": 12,
|
"w": 12,
|
||||||
"x": 12,
|
"x": 12,
|
||||||
"y": 35
|
"y": 23
|
||||||
},
|
},
|
||||||
"id": 5,
|
"id": 5,
|
||||||
"options": {
|
"options": {
|
||||||
@@ -957,6 +778,6 @@
|
|||||||
"timezone": "",
|
"timezone": "",
|
||||||
"title": "Drift Keeper",
|
"title": "Drift Keeper",
|
||||||
"uid": "f4c3a630-ffd0-41c8-a36a-52e0771b77fb",
|
"uid": "f4c3a630-ffd0-41c8-a36a-52e0771b77fb",
|
||||||
"version": 6,
|
"version": 5,
|
||||||
"weekStart": ""
|
"weekStart": ""
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user