Skip to content

alex-pumpkin/simulator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple simulator

Usage

JDK 17 is required.

Run application:

./mvnw spring-boot:run

Connect to WebSocket:

curl -i -N --output - \
     -H "Connection: Upgrade" \
     -H "Upgrade: websocket" \
     -H "Host: localhost:8080" \
     -H "Origin: http://localhost:8080" \
     -H "Sec-WebSocket-Key: blahblah" \
     -H "Sec-WebSocket-Version: 13" \
     http://localhost:8080/trades

Register "buy" order:

curl -H "Content-Type: application/json" \
     http://localhost:8080/orders/buy \
     -d '{"uuid":"1","symbol":"A","price":10,"quantity":80}'

Register "sell" order:

curl -H "Content-Type: application/json" \
     http://localhost:8080/orders/sell \
     -d '{"uuid":"2","symbol":"A","price":10,"quantity":100}'

Cancel order:

curl -XDELETE http://localhost:8080/orders/2

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages