diff --git a/init.sql b/init.sql index 814133e..14c4e7f 100644 --- a/init.sql +++ b/init.sql @@ -31,10 +31,6 @@ CREATE TABLE orders( pubkey TEXT NOT NULL REFERENCES users(pubkey), side ORDER_SIDE NOT NULL, quantity BIGINT NOT NULL, - price BIGINT NOT NULL -); -CREATE TABLE trades( - id UUID PRIMARY KEY DEFAULT uuid_generate_v4(), - order_id_1 UUID NOT NULL REFERENCES orders(id), - order_id_2 UUID NOT NULL REFERENCES orders(id) + price BIGINT NOT NULL, + order_id UUID REFERENCES orders(id) ); diff --git a/pages/bmarket_order.html b/pages/bmarket_order.html deleted file mode 100644 index 563c6f6..0000000 --- a/pages/bmarket_order.html +++ /dev/null @@ -1,83 +0,0 @@ - - - -
-
-
-
- _ _
- _ __ ___ __ _ _ __| | _____| |_
-| '_ ` _ \ / _` | '__| |/ / _ \ __|
-| | | | | | (_| | | | < __/ |_
-|_| |_| |_|\__,_|_| |_|\_\___|\__|
-
-
- Quantity | -Price | -Price | -Quantity | -
---|---|---|---|
{{.BuyQuantity}} | -
-
-
- {{.BuyPrice}}
-
- |
-
-
- {{.SellPrice}}
-
-
- |
- {{.SellQuantity}} | -
-
-
- _ _
- _ __ ___ __ _ _ __| | _____| |_
-| '_ ` _ \ / _` | '__| |/ / _ \ __|
-| | | | | | (_| | | | < __/ |_
-|_| |_| |_|\__,_|_| |_|\_\___|\__|
-
-
-
+
+
+ _ _
+ _ __ ___ __ _ _ __| | _____| |_
+| '_ ` _ \ / _` | '__| |/ / _ \ __|
+| | | | | | (_| | | | < __/ |_
+|_| |_| |_|\__,_|_| |_|\_\___|\__|
+
+
+ BUY YES | +SELL | +BUY NO | +|||||
---|---|---|---|---|---|---|---|
+
+ YES
+ {{.Quantity}} @ {{.Price}}
+
+ |
+ {{ else }}
+ + {{ end }} + {{ if and (eq .ShareId $.YesShare.Id) (eq .Side "SELL") }} + |
+
+ YES
+ {{.Quantity}} @ {{.Price}}
+
+ |
+ {{ else }}
+ + {{ end }} + {{ if and (eq .ShareId $.NoShare.Id) (eq .Side "SELL") }} + |
+
+ NO
+ {{.Quantity}} @ {{.Price}}
+
+ |
+ {{ else }}
+ + {{ end }} + {{ if and (eq .ShareId $.NoShare.Id) (eq .Side "BUY") }} + |
+
+ NO
+ {{.Quantity}} @ {{.Price}}
+
+ |
+ {{ else }}
+ + {{ end }} + |