Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Orderbook PoC for the demo day at the Solana Colosseum Accelerator (This is not the Urani Protocol).

Notifications You must be signed in to change notification settings

urani-trade/urani-orderbook-mvp-ts

Repository files navigation

Urani Orderbook MVP


👉🏼 "Quick n' dirty" proof-of-concept of a batching orderbook, presented at the Solana Colosseum Accelerator's Demo Day.

👉🏼 Note: this is NOT the Urani Protocol (which is authored by bt3gl), but rather our first MVP, authored by Sage (aka Gman).



Overview


This orderbook:

  1. receives orders from the frontend
  2. creates a batch every 10s (configured in config.ts)
  3. generates bullshit agent solutions and finalizes the batch 2.5s after the batch is created

Notes for the Demo
  • To reproduce the same batch solution scripted in the demo, uncomment this in routes.ts
  • To disable the mock orders and agent solutions, remove this code from app.ts and replace it with logic that submits the solution with the highest score for the batch.
setInterval(addMockOrders, batchInterval);

setTimeout(() => {
  setInterval(addMockSolutionsAndFillData, batchInterval);
}, 3 * batchInterval / 4);


Production Deployment


Create the AWS Instance


Create a t4g.small ec2 instance in the us-east-1 region:

  • ssh into the ec2 instance
  • clone the repo
  • install docker
  • create and fill .env.development.
  • run docker-compose:
docker compose up -d

Configure the TLS Certificate


Request a TLS certificate for the desired domains in the same region (e.g., us-east-1). Validate domain ownership via CNAME.


Configure CloudFront


Create a CloudFront distribution with the following settings (legacy cache settings and CORs are important):


Complete the Routing


Forward the desired domain (e.g., api.urani.trade) to the Cloudfront domain.

Then Update the env variables in Vercel to point to this domain



License and Contributing


This project is distributed under the Apache 2.0 license.

You are welcome to contribute. See the guidelines here.


About

Orderbook PoC for the demo day at the Solana Colosseum Accelerator (This is not the Urani Protocol).

Topics

Resources

Stars

Watchers

Forks

Languages