Skip to content

Commit

Permalink
Feature/heroku deploy (#30)
Browse files Browse the repository at this point in the history
* Test Heroku deploy

* smaker-mock deployment

* typo

* change web to worker

* move docker files

* rename jobs?

* no need to rename

* fix maker's mock

* fix factor

* println prices

---------

Co-authored-by: Luke Rogerson <[email protected]>
  • Loading branch information
uv-orbs and Luke-Rogerson authored Nov 19, 2023
1 parent b1d1b55 commit f6d7cb5
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions cmd/maker-mock/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func placeOrder(side string, price, size decimal.Decimal) {
req.Header.Add("X-Public-Key", pubKey)

res, err := client.Do(req)
fmt.Printf("res is ------->: %#v\n", res)
//fmt.Printf("res is ------->: %#v\n", res)
if err != nil {
log.Fatalf("error post: %v", err)
}
Expand All @@ -122,18 +122,22 @@ func placeOrder(side string, price, size decimal.Decimal) {

func updateOrders(price decimal.Decimal) {
cancelAllOrders()
factor := decimal.NewFromFloat(1.01)
factor := decimal.NewFromFloat(1.001)
curPrice := price
fmt.Println("------ Market Price: ", price.String())
// ASK
for i := 0; i < depthSize; i++ {
curPrice = curPrice.Mul(factor)
fmt.Println("Ask Price: ", curPrice.String())
curSize := decimal.NewFromFloat(float64(i+1) * 10)
placeOrder("sell", curPrice, curSize)
}

factor = decimal.NewFromFloat(0.99)
// BIDS
factor = decimal.NewFromFloat(0.999)
curPrice = price
for i := 0; i < depthSize; i++ {
curPrice := curPrice.Mul(factor)
curPrice = curPrice.Mul(factor)
fmt.Println("Bid Price: ", curPrice.String())
curSize := decimal.NewFromFloat(float64(i+1) * 10)
placeOrder("buy", curPrice, curSize)
}
Expand Down

0 comments on commit f6d7cb5

Please sign in to comment.