Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ECO-484] Add order book state #518

Merged
merged 28 commits into from
Oct 9, 2023
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
e79de0d
add price filed to limit orders
CRBl69 Oct 3, 2023
0f9e1f3
add queue representation to limit orders
CRBl69 Oct 4, 2023
1c42a64
run cargo fmt
CRBl69 Oct 4, 2023
4b920de
run cargo sqlx prepare
CRBl69 Oct 4, 2023
22d6b1c
fix deps
CRBl69 Oct 4, 2023
6e3a8ea
add aggregator to docker
CRBl69 Oct 4, 2023
a213fc4
fix pr according to comments
CRBl69 Oct 5, 2023
991f028
add ws notifications for order book state
CRBl69 Oct 5, 2023
17c879d
use (txn_version,event_idx) instead of timestamp for queue ordering
CRBl69 Oct 5, 2023
e790fe4
fix docker issue
CRBl69 Oct 6, 2023
2951f7f
fix submodule issue
CRBl69 Oct 6, 2023
259e394
use ask and bid instead of true and false
CRBl69 Oct 6, 2023
3995470
remove ws updates for market and swap orders
CRBl69 Oct 6, 2023
56f8a8b
[ECO-616] Add assorted PR tweaks
alnoki Oct 6, 2023
08f00be
more fixes
CRBl69 Oct 7, 2023
4e7e936
Merge branch 'ECO-484' into ECO-616
alnoki Oct 7, 2023
9114044
do not aggregate duped fill events
CRBl69 Oct 7, 2023
e753d39
Merge pull request #520 from econia-labs/ECO-616
CRBl69 Oct 7, 2023
188537c
Merge branch 'main' into ECO-484
CRBl69 Oct 7, 2023
dc31e93
fix use of bitwise and instead of or
CRBl69 Oct 7, 2023
e1423de
[ECO-624] Fix async dedupe aggregator logic
alnoki Oct 7, 2023
aafedcb
add ws doc and more events
CRBl69 Oct 8, 2023
0eb778a
Update guard conditions for effectively serial
alnoki Oct 8, 2023
8494adc
add correct transaction flag
CRBl69 Oct 8, 2023
54ad20f
Add market order/swap closed logic
alnoki Oct 8, 2023
dfd6a34
Merge pull request #525 from econia-labs/ECO-624
CRBl69 Oct 8, 2023
7447c8e
Merge branch 'main' into ECO-484
CRBl69 Oct 8, 2023
2a0eb85
use SERIALIZABLE instead
CRBl69 Oct 8, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions src/docker/aggregator/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# This docker file is used to run the aggregator
FROM rust:slim-bookworm

ARG RUST_ROOT=src/rust
ARG DATABASE_URL
COPY $RUST_ROOT /app

RUN apt-get update && apt-get install -y \
libudev-dev \
build-essential \
libclang-dev \
libpq-dev \
libssl-dev \
lld \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /app

RUN cargo build --release -p aggregator

ENV DATABASE_URL=$DATABASE_URL

ENTRYPOINT ["cargo", "run", "--release", "-p", "aggregator"]
32 changes: 1 addition & 31 deletions src/docker/compose.dss-global.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,9 @@
version: "3.9"

include:
- compose.database.yaml
- compose.dss.yaml

services:

postgrest:
depends_on:
- diesel
- postgres
environment:
PGRST_DB_URI: "postgres://econia:econia@postgres:5432/econia"
PGRST_DB_ANON_ROLE: web_anon
PGRST_DB_SCHEMA: api
image: postgrest/postgrest
ports:
- "3001:3000"

processor:
build:
context: ../../
Expand All @@ -29,20 +16,3 @@ services:
- "./processor/config.yaml:/config.yaml"
environment:
- HEALTHCHECK_BEFORE_START=false

ws:
build:
context: ../../
dockerfile: src/docker/api/Dockerfile.ws
args:
- POSTGRES_WEBSOCKETS_VERSION=0.11.1.0
depends_on:
- diesel
- postgres
environment:
- PGWS_DB_URI=postgres://econia:econia@postgres/econia
- PGWS_JWT_SECRET=econia_is_dooooooooooooooooooope
- PGWS_CHECK_LISTENER_INTERVAL=1000
- PGWS_LISTEN_CHANNEL=econiaws
ports:
- 3000:3000
33 changes: 1 addition & 32 deletions src/docker/compose.dss-local.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
version: "3.9"

include:
- compose.database.yaml
- compose.dss.yaml

services:

streamer:
build:
context: ../../
Expand All @@ -15,45 +14,15 @@ services:
- "8080:8080"
- "8081:8081"

postgrest:
depends_on:
- diesel
- postgres
environment:
PGRST_DB_URI: "postgres://econia:econia@postgres:5432/econia"
PGRST_DB_ANON_ROLE: web_anon
PGRST_DB_SCHEMA: api
image: postgrest/postgrest
ports:
- "3001:3000"

processor:
build:
context: ../../
dockerfile: src/docker/processor/Dockerfile
depends_on:
- postgres
- streamer
ports:
- "8085:8085"
volumes:
- "./processor/config.yaml:/config.yaml"
environment:
- HEALTHCHECK_BEFORE_START=true

ws:
build:
context: ../../
dockerfile: src/docker/api/Dockerfile.ws
args:
- POSTGRES_WEBSOCKETS_VERSION=0.11.1.0
depends_on:
- diesel
- postgres
environment:
- PGWS_DB_URI=postgres://econia:econia@postgres/econia
- PGWS_JWT_SECRET=econia_is_dooooooooooooooooooope
- PGWS_CHECK_LISTENER_INTERVAL=1000
- PGWS_LISTEN_CHANNEL=econiaws
ports:
- 3000:3000
44 changes: 44 additions & 0 deletions src/docker/compose.dss.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
version: "3.9"

include:
- compose.database.yaml

services:
aggregator:
build:
context: ../../
dockerfile: src/docker/aggregator/Dockerfile
depends_on:
- diesel
- postgres
environment:
DATABASE_URL: "postgres://econia:econia@postgres:5432/econia"

postgrest:
depends_on:
- diesel
- postgres
environment:
PGRST_DB_URI: "postgres://econia:econia@postgres:5432/econia"
PGRST_DB_ANON_ROLE: web_anon
PGRST_DB_SCHEMA: api
image: postgrest/postgrest
ports:
- "3001:3000"

ws:
build:
context: ../../
dockerfile: src/docker/api/Dockerfile.ws
args:
- POSTGRES_WEBSOCKETS_VERSION=0.11.1.0
depends_on:
- diesel
- postgres
environment:
- PGWS_DB_URI=postgres://econia:econia@postgres/econia
- PGWS_JWT_SECRET=conjunctivodacryocystorhinostomy
- PGWS_CHECK_LISTENER_INTERVAL=1000
- PGWS_LISTEN_CHANNEL=econiaws
ports:
- 3000:3000

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading