Skip to content

Commit

Permalink
Add support for FX pools (#29)
Browse files Browse the repository at this point in the history
* docker-compose setup

* more tests

* allow deleting pools with associations

* pool defaults for 24h volume and fees

* pools data json column

* add fx data to subgraph

* subgraph to DB mappers

* FX pools parsing in SOR

* FX pools in the graph schema

* subgraph pool to DB update

* obsolete poolSyncAllPoolTypesVersions

* include pool tokens in subgraph sync

* obsolete poolReloadPoolTokenIndexes

covered by syncAllPoolsFromSubgraph

* obsolete poolReloadPoolNestedTokens

covered by syncAllPoolsFromSubgraph

* obsolete poolSync mutations

covered by syncAllPools

* fix pool type mapping for StablePhantom

* add nestedPool list when creating new pools

* renaming pool.data to pool.poolTypeSpecificData

* import all of the functions directly

to have references in the header

* delete cleanup based on constraints

* renaming

* rename column

* prisma schema

---------

Co-authored-by: franz <[email protected]>
  • Loading branch information
gmbronco and franzns authored Jan 18, 2024
1 parent 568181a commit bf17d89
Show file tree
Hide file tree
Showing 29 changed files with 901 additions and 473 deletions.
9 changes: 3 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,11 @@ userInitStakedBalances
### Setup database & Prisma from backup

Retrieve the current pg_dump file under `https://api-db-dump.s3.eu-central-1.amazonaws.com/canary/api-dump.YYYYMMDD`.
Database dumps are kept for the previous 7 days, replace YYYYMMDD in the URL above (ie: 20230317) to download a db dump.
Database dumps are kept for the previous 7 days, replace YYYYMMDD in the URL above (ie: 20230317) to download a db dump.

Run `docker-compose up -d` to start the database via docker compose.

Retrieve the docker container ID through `docker ps`.

Run `docker exec -i <container-ID> /bin/bash -c "PGPASSWORD=let-me-in psql --username backend database" < /path/on/your/machine/dump`
with the container-ID from the step before.
Run `docker exec -i $(docker ps -qf "name=balancer-backend") /bin/bash -c "PGPASSWORD=let-me-in psql --username backend database" < /path/on/your/machine/dump`

The output at the very end saying `ERROR: role "rdsadmin" does not exist` is normal and can be ignored.

Expand Down Expand Up @@ -90,4 +87,4 @@ To contribute, branch from `v2-canary` (which is our development branch) and ope

### Database Updates

If you make any changes to the database schema be sure to run `yarn prisma migrate dev --name <change_name>` which will create a new file in `prisma/migrations` that contains all the database changes you've made as an SQL update script.
If you make any changes to the database schema be sure to run `yarn prisma migrate dev --name <change_name>` which will create a new file in `prisma/migrations` that contains all the database changes you've made as an SQL update script.
9 changes: 8 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,17 @@ version: '3'

services:
postgres:
image: postgres
container_name: balancer-backend
image: postgres:14-alpine
ports:
- '5431:5432'
environment:
POSTGRES_USER: backend
POSTGRES_PASSWORD: let-me-in
POSTGRES_DB: database
networks:
- balancer

networks:
balancer:
name: balancer
Loading

0 comments on commit bf17d89

Please sign in to comment.