repo_id stringclasses 137
values | file_path stringlengths 10 89 | content stringlengths 0 990k | __index_level_0__ int64 0 0 |
|---|---|---|---|
mono | /mono/.editorconfig | root = true
[*]
max_line_length = 120
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 2
| 0 |
mono | /mono/init.sh | #!/usr/bin/env bash
echo -e "__________________ _____ ______ _____ _ _______ "
echo -e "| ___| _ \ ___ \ | __ \| ___ \ _ | | | | ___ \ "
echo -e "| |_ | | | | |_/ / | | \/| |_/ / | | | | | | |_/ / "
echo -e "| _| | | | | / | | __ | /| | | | | | | __/ "
echo -e "| | | |/ /| |\ \ | |_\ \| |\... | 0 |
mono | /mono/Tiltfile.test | # Tiltfile
update_settings(max_parallel_updates=8, k8s_upsert_timeout_secs=120)
load('ext://min_tilt_version', 'min_tilt_version')
load('ext://min_k8s_version', 'min_k8s_version')
load('ext://helm_remote', 'helm_remote')
load('ext://helm_resource', 'helm_resource', 'helm_repo')
load('scripts/tilt/port_forward.py', 'fdr... | 0 |
mono | /mono/Tiltfile | # Tiltfile
update_settings(max_parallel_updates=8, k8s_upsert_timeout_secs=120)
load('ext://min_tilt_version', 'min_tilt_version')
load('ext://min_k8s_version', 'min_k8s_version')
load('ext://helm_remote', 'helm_remote')
load('ext://helm_resource', 'helm_resource', 'helm_repo')
load('scripts/tilt/port_forward.py', 'fdr... | 0 |
mono | /mono/Cargo.toml | [workspace]
members = [
"crates/*",
]
resolver = "2"
[workspace.package]
version = "0.1.0"
edition = "2021"
[workspace.dependencies]
anyhow = "1.0.75"
arc-swap = "1.6.0"
async-channel = "2.2.1"
async-trait = "0.1.74"
axum = "0.7.4"
axum-tracing-opentelemetry = "0.18.0"
base64 = "0.22.0"
chrono = "0.4.0"
clap = {... | 0 |
mono | /mono/.envrc | #!/usr/bin/env bash
GIT_ROOT="$(git rev-parse --show-toplevel)"
# AWS
export AWS_PROFILE=fdr-dev # default, but can be overridden
export AWS_CONFIG_FILE="${GIT_ROOT}/.aws"
# Python
export PYTHONWARNINGS=ignore
# Kubernetes
export KUBECONFIG="$HOME/.kube/config:${GIT_ROOT}/kubeconfig.yaml"
# Support overriding valu... | 0 |
mono | /mono/.gitlab-ci.yml | include:
# todo: this file depends on arm builders which we no longer have
# - local: "/.gitlab/.gitlab-makedeb-ci.yml"
# - local: "/.gitlab/.gitlab-general-ci.yml"
- local: "/.gitlab/.gitlab-rust-ci.yml"
- local: "/.gitlab/.gitlab-docker-ci.yml"
- local: "/.gitlab/.gitlab-terraform-ci.yml"
- local: "/.... | 0 |
mono | /mono/.gitignore | .DS_Store
# Editor files
.idea
# Local config
**/.cargo_docker_cache
**/.secrets
**/sym-secrets
# Local environment
.env
.envrc.local
# Rust
**/target
**/config-local.toml
# Terraform
.terraform
*.tfstate
*.tfstate.backup
docs/mermaid.min.js
docs/mermaid-init.js
opportunities.csv
success.csv
trades.csv
services... | 0 |
mono | /mono/Cargo.lock | # This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
[[package]]
name = "addr2line"
version = "0.21.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb"
dependencies = [
"giml... | 0 |
mono | /mono/kubeconfig.yaml | apiVersion: v1
kind: Config
preferences: { }
contexts:
- name: fdr-dev
context:
cluster: fdr-dev
user: aws-developer
namespace: default
- name: fdr-dev-admin
context:
cluster: fdr-dev
user: aws-admin
namespace: default
clusters:
- name: fdr-dev
cluster:
cer... | 0 |
mono | /mono/Makefile | .PHONY: up down secrets env sqlx-check migrations rust-builder helm-update
ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
# ----------------------------------------
# Bring Localstack Up
# ----------------------------------------
up:
tilt up
# ----------------------------------------
# Bring... | 0 |
mono | /mono/rustfmt.toml | # Maximum width of each line.
# Default: 100
max_width = 120 | 0 |
mono | /mono/.dockerignore | **/node_modules
.env
./target/debug
./target/sqlx-tmp
| 0 |
mono | /mono/.aws | # TODO: Update to use a DevOps role once it is created
[profile state]
sso_start_url = https://fdrgroup.awsapps.com/start
sso_region = us-east-1
sso_account_id = 806085365067
sso_role_name = AdministratorAccess
region = us-east-2
output = json
[profile fdr-dev]
sso_start_url = https://fdrgroup.awsapps.com/start
sso_re... | 0 |
mono | /mono/README.md | # Monorepo
---
The FDR monorepo contains a set of modules and services that work together to execute trading strategies.
## Getting started
### Prerequisites
- [Docker](https://docs.docker.com/get-docker/)
- [Tilt](https://docs.tilt.dev/install.html)
- [Kubectl](https://kubernetes.io/docs/tasks/tools/install-kubec... | 0 |
.gitlab | /mono/.gitlab/.gitlab-docker-ci.yml | ###############################################################################
# BUILDER PIPELINE DEFINITION
###############################################################################
.ci-image-rules: &ci-image-rules
rules:
- if: !reference [ .is, scheduled ]
when: never
... | 0 |
.gitlab | /mono/.gitlab/.gitlab-change-rules-ci.yml | ###############################################################################
# DEFINE CHANGES AND RULES FOR CI PIPELINES
###############################################################################
.is:
default-branch: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
merge-request: $CI_PIPELINE_SOURCE == "... | 0 |
.gitlab | /mono/.gitlab/.gitlab-general-ci.yml | stages:
- check
check::aws:
stage: check
image: docker
script:
- echo $ECR_REGISTRY_ADD
- printenv | grep AWS_ > aws.env
- docker login -p $CI_REGISTRY_PASSWORD -u $CI_REGISTRY_USER registry.gitlab.com
- docker run --rm --env-file ./aws.env amazon/aws-cli ecr get-login-password | 0 |
.gitlab | /mono/.gitlab/.gitlab-makedeb-ci.yml | stages:
build
.only-makedeb: &only-makedeb
rules:
- changes:
paths:
- "infra/debpkgs/**/*"
makedeb::build:
image: registry.gitlab.com/fdr-group/mono/ci/makedeb
stage: build
tags:
- aarch64
<<: *only-makedeb
needs: [ ]
parallel:
matrix:
- PKGDIR:
- infra/de... | 0 |
.gitlab | /mono/.gitlab/.gitlab-rust-ci.yml | ###############################################################################
# RUST PIPELINE DEFINITION
###############################################################################
# jobs that use this anchor will always run on main / tag pipelines but will only run on merge request pipe... | 0 |
.gitlab | /mono/.gitlab/.gitlab-terraform-ci.yml | ###############################################################################
# INFRA PIPELINE DEFINITION
###############################################################################
# jobs that use this anchor will always run on main / tag pipelines but will only run on merge request pip... | 0 |
.secrets | /mono/.secrets/postgresql_username | trading
| 0 |
.secrets | /mono/.secrets/postgresql_test_password | trading-test
| 0 |
.secrets | /mono/.secrets/postgresql_test_username | trading-test
| 0 |
.secrets | /mono/.secrets/kraken_api_secret | fillinfromkrakenaccount
| 0 |
.secrets | /mono/.secrets/kraken_api_key | fillinfromkrakenaccount
| 0 |
.secrets | /mono/.secrets/poloniex_api_key | fillinfrompoloaccount
| 0 |
.secrets | /mono/.secrets/poloniex_api_secret | fillinfrompoloaccount
| 0 |
.secrets | /mono/.secrets/.gitkeep | 0 | |
.secrets | /mono/.secrets/postgresql_password | trading
| 0 |
database | /mono/test/database/strat_runs.sql | INSERT INTO public.strat_runs (id, strat_id, name, meta) VALUES ('90d99ddf-ba11-480e-9a31-792670745053', '80e28dec-ba11-481f-1c32-792570742054', 'Market Maker DOTUSD', null);
INSERT INTO public.strat_runs (id, strat_id, name, meta) VALUES ('80d99ddf-ba11-480e-9a31-792670745053', '80e28dec-ba11-481f-1c32-792570742054', ... | 0 |
database | /mono/test/database/strategies.sql | INSERT INTO public.strategies (id, name) VALUES ('80e28dec-ba11-481f-1c32-792570742054', 'MARKET_MAKER_ON_TICKER');
INSERT INTO public.strategies (id, name) VALUES ('5c6897f9-258f-4ae0-a044-ecd1db996493', 'TRIANGULAR_ARBITRAGE');
| 0 |
database | /mono/test/database/import.sh | #!/bin/bash
# Define variables
POSTGRES_USER="trading-test"
POSTGRES_PASSWORD="trading-test"
DATABASE_NAME="trading-test"
BALANCE_ACCOUNTS="test/database/balance_accounts.sql"
STRAT_BALANCE_ACCOUNTS="test/database/strat_balance_accounts.sql"
STRAT_RUNS="test/database/strat_runs.sql"
VIRTUAL_BALANCE_ACCOUNTS="test/data... | 0 |
database | /mono/test/database/virtual_balance_accounts.sql | INSERT INTO public.virtual_balance_accounts (id, account_id, account_status, asset, amount, available, created_at)
VALUES ('40e22dec-ba11-481f-1c32-982570742054', '23e28dec-ba11-481f-1c32-792570742054', 'ACTIVE', 'DOT', 0, 0,
'2024-03-27 15:52:59.196000 +00:00');
INSERT INTO public.virtual_balance_accounts (id,... | 0 |
database | /mono/test/database/strat_balance_accounts.sql | INSERT INTO public.strat_balance_accounts (strat_run_id, vba_id) VALUES ('90d99ddf-ba11-480e-9a31-792670745053', '40e22dec-ba11-481f-1c32-982570742054');
INSERT INTO public.strat_balance_accounts (strat_run_id, vba_id) VALUES ('90d99ddf-ba11-480e-9a31-792670745053', '50e32cec-ba11-481f-1c32-232570742054');
INSERT INTO ... | 0 |
database | /mono/test/database/balance_accounts.sql | INSERT INTO public.balance_accounts (id, asset, amount) VALUES ('23e28dec-ba11-481f-1c32-792570742054', 'DOT', 0);
INSERT INTO public.balance_accounts (id, asset, amount) VALUES ('12e28dec-ba11-481f-1c32-322570742054', 'USD', 0);
INSERT INTO public.balance_accounts (id, asset, amount) VALUES ('23e28dec-ba11-481f-1c32-3... | 0 |
.cargo | /mono/.cargo/audit.toml | [advisories]
ignore = [
"RUSTSEC-2021-0145", # `rsa` no update path
"RUSTSEC-2023-0071", # `rsa` no update path
]
[output]
quiet = false
deny = ["warnings"] | 0 |
.cargo | /mono/.cargo/config | [alias]
ci-check = "check --all --all-targets --all-features"
ci-clippy = "clippy --all --all-targets --all-features -- -Dwarnings -Drust-2018-idioms"
ci-format = "fmt --all -- --config imports_granularity=crate --check"
[build]
rustflags = ["--cfg", "tokio_unstable"]
rustdocflags = ["--cfg", "tokio_unstable"]
# In c... | 0 |
infra | /mono/infra/.gitignore | # Local files used to track Makefile changes
.sync/
!.sync/READMD.md
# Ignore backup config files
*.backup.yaml
# Secrets
secrets/
!secrets/README.md | 0 |
infra | /mono/infra/Makefile |
.PHONY: clean docs sync
clean:
find .sync/* ! -name README.md -exec rm {} \;
docs:
find modules/ -name main.tf -printf '%h\n' | xargs -I {} sh -c "docker run --rm --volume \"${PWD}/{}:/terraform-docs\" quay.io/terraform-docs/terraform-docs:0.16.0 markdown /terraform-docs > {}/README.md"
##########################... | 0 |
infra | /mono/infra/docker-compose.yaml | version: "3.9"
services:
strat-market-makers:
profiles: ["dev"]
image: registry.gitlab.com/fdr-group/mono/rs/market-makers:aarch64-346737ea
labels:
"com.fdr.logging": promtail
environment:
- RUST_LOG=info
container_name: market-makers
volumes:
- type: bind
source: ${... | 0 |
infra | /mono/infra/README.md | # Infrastructure
This directory contains the configuration for the infrastructure and operational workloads that support the FDR system.
This include the provisioning of servers and networks, database configrations, and general tuning.
## Structure
```
infra/
โโโ envs
โ โโโ Different infrastructure environments... | 0 |
infra | /mono/infra/docker-compose.ops.yaml | version: "3.9"
secrets:
grafana_cloud_prometheus_api_key:
file: ./secrets/grafana_cloud_prometheus_api_key
grafana_cloud_loki_api_key:
file: ./secrets/grafana_cloud_loki_api_key
volumes:
# TODO: Create a mounted volume to store Prom data or move Prom to a managed DB
postgres_data: {}
services:
post... | 0 |
.sync | /mono/infra/.sync/README.md | This directory contains temporary files to be used by make to track make targets and determine the last time a file was
synced. Make doesn't actually look at the contents of the file and only checks the last updated time. | 0 |
debpkgs | /mono/infra/debpkgs/README.md | # Deb Pkgs
This directory is used to manage and build custom Debian packages for tools that either don't distribute Debian
installers or that we would like to customize the installation of.
This directory user `makedeb` to build Debian package. Makedeb is based on Arch's makepkg and uses the same PKGBUILD
- https:/... | 0 |
node_exporter | /mono/infra/debpkgs/node_exporter/PKGBUILD | # This PKGBUILD is used to build a deb for node_exporter. Based on
# https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=prometheus-node-exporter-bin
# Maintainer: Dawson <dawson@3304813.com>
pkgname=node_exporter
pkgver=1.5.0
pkgrel=1
pkgdesc='Exporter for machine metrics'
arch=('amd64' 'arm64')
depends=()
provide... | 0 |
node_exporter | /mono/infra/debpkgs/node_exporter/node-exporter.service | [Unit]
Description=Exporter for machine metrics
After=network.target
[Service]
User=node_exporter
Group=node_exporter
ExecStart=/usr/bin/node_exporter
[Install]
WantedBy=multi-user.target
| 0 |
ci-user | /mono/infra/modules/ci-user/main.tf |
variable "ecr_repository_arns" {
type = list(string)
description = "The ARN of the ECR repository images will be pushed to."
}
# TODO: Apply a permission boundary that limits this user to only be used as a service account
resource "aws_iam_user" "ci" {
name = "ci-user"
path = "/fdr/"
# Ignore tag ch... | 0 |
ci-user | /mono/infra/modules/ci-user/README.md | ## Requirements
No requirements.
## Providers
| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | n/a |
## Modules
No modules.
## Resources
| Name | Type |
|------|------|
| [aws_iam_user.ci](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_u... | 0 |
vpc | /mono/infra/modules/vpc/main.tf | terraform {
required_version = ">= 1.5.0"
required_providers {
aws = {
source = "hashicorp/aws"
version = ">= 4.0"
}
}
}
resource "aws_vpc" "vpc" {
cidr_block = var.cidr_block
tags = var.tags
lifecycle {
prevent_destroy = true
}
}
resource "aws_subnet" "default" {
vpc_id ... | 0 |
vpc | /mono/infra/modules/vpc/variables.tf |
variable "cidr_block" {
description = "The VPC CIDR block. All other internal blocks are derrived"
validation {
condition = can(regex("10\\.\\d+\\.0\\.0/16", var.cidr_block))
error_message = "The CIDR block must be a 10.x block allocating a \\16."
}
}
variable "tags" {
default = {}
type ... | 0 |
vpc | /mono/infra/modules/vpc/outputs.tf | output "vpc_id" {
value = aws_vpc.vpc.id
description = "The ID of the VPC created"
}
output "default_subnet_id" {
value = aws_subnet.default.id
description = "The default subnet ID"
} | 0 |
vpc | /mono/infra/modules/vpc/README.md | ## Requirements
| Name | Version |
|------|---------|
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | ~> 4.0 |
## Providers
| Name | Version |
|------|---------|
| <a name="provider_aws"></a> [aws](#provider\_aws) | ~> 4.0 |
## Modules
No modules.
## Resources
| Name | Type |
|------|------|
| [aws_i... | 0 |
tf-state | /mono/infra/modules/tf-state/main.tf | /**
This module creates an AWS S3 bucket, KMS key, and DynamoDB table used to manage the Terraform state and should be
used for all Terraform state. This module currently creates the basic resources required to store state, but in the
future this module can be extended to include role based access controls to state.
*/... | 0 |
End of preview. Expand in Data Studio
- Downloads last month
- 16