Go to file
microwavedcola1 0fed0c544c mass rename
Signed-off-by: microwavedcola1 <microwavedcola@gmail.com>
2023-11-17 17:09:42 +01:00
.github mass rename 2023-11-17 17:09:42 +01:00
curl-demo demo and fix python 2021-10-14 09:59:24 +02:00
mango-service-v4 mass rename 2023-11-17 17:09:42 +01:00
py mass rename 2023-11-17 17:09:42 +01:00
.gitignore mass rename 2023-11-17 17:09:42 +01:00
.gitmodules mass rename 2023-11-17 17:09:42 +01:00
Dockerfile unified-api 2021-12-09 07:02:23 +01:00
README.md mass rename 2023-11-17 17:09:42 +01:00
docker-compose.yml mass rename 2023-11-17 17:09:42 +01:00
docker.env unified-api 2021-12-09 07:02:23 +01:00
entrypoint.sh unified-api 2021-12-09 07:02:23 +01:00
nginx.conf mass rename 2023-11-17 17:09:42 +01:00

README.md

Introduction

REST and WEBSOCKET API Services for mango markets version 3, and some simple clients and examples. Aimed to follow spec as close as possible to popular exchanges like ftx, etc. Current motivation is to enable traders to bring their existing tools to mango markets.

Note

REST Service requires the user to run a local copy with his/her own private key. An alternative approach which is known and was not taken is to prepare solana transactions in a centrally hosted REST API Service and send them back to the client for signing using their wallet. The advantages of this would be that we could have a centrally hosted service, and would save local hosting, the disadvantages of this would be complicating the REST clients users want to use with solana specific signing code and would need us to ship and maintain clients for various programming languages. Also such a centrally hosted service would then need authorization, authentication, rate limiting, etc. to prevent abuse of the configured RPC node, which so far is not the aim of this project.

WEBSOCKET API currently streams L1, and L2 level orderbook data.

Documentation

See https://microwavedcola1.github.io/mango-service-v4/#tag/default

Directory structure

.
├── README.md
├── mango-service-v4 - REST API Service for mango markets version 3
└── py               - python3 client for above REST API Service

How to run

  • docker-compose up starts the REST API Service and the WEBSOCKET API Service, and a ngninx reverse proxy
  • The REST API is then available e.g. curl http://localhost/api/wallet/balances
  • the WEBSOCKET API is then available e.g.wscat --connect ws://localhost/ws (note by default the websocket program when run in isolation is available at ws://localhost/v1/ws )

Todos

losely sorted in order of importance/priority

  • rpc node related issues
    • ensure that order has been placed or definitely not placed on the server side
    • some off chain services are used, these might use other nodes, mixing data from various nodes, might be problematic, what if one node is behind?
  • populate still undefined fields in various endpoints
  • todos sprinkled over code
  • when null vs when undefined as return field value,- doublecheck for every endpoint/dto
  • serum-history might be decomissioned, seek replacement
  • technical debt
    • cleanup tsconfig.json
    • add pre commit tools e.g. husky/pre-commit for code formatting and linting

Feedback

so far from beta tasters, from twitter, discord, etc.