👉🏼 "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).
This orderbook:
- receives orders from the frontend
- creates a batch every 10s (configured in
config.ts
) - generates bullshit agent solutions and finalizes the batch 2.5s after the batch is created
- 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);
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
Request a TLS certificate for the desired domains in the same region (e.g., us-east-1
). Validate domain ownership via CNAME
.
Create a CloudFront distribution with the following settings (legacy cache settings and CORs are important):
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
This project is distributed under the Apache 2.0 license.
You are welcome to contribute. See the guidelines here.