Commit Graph

71 Commits

Author SHA1 Message Date
ekzyis b7a24b48fd Show pYes and volume in market row 2024-09-10 23:41:55 +02:00
ekzyis 5d5c91399f Rename vars and add comments 2024-09-10 22:50:19 +02:00
ekzyis 03689add7e Rename type MarketPoint to Point 2024-09-10 22:32:45 +02:00
ekzyis ecee2f2a46 Load chart data from db 2024-09-09 01:58:09 +02:00
ekzyis 215a9fb3b6 Show quantity of user shares 2024-08-26 06:15:33 -05:00
ekzyis 5587aeb03a Fix query for lmsr.Q1 & lmsr.Q2 2024-08-26 05:57:31 -05:00
ekzyis 3075f12fc1 Fix lmsr_b since maximum possible loss was off 2024-08-26 05:50:09 -05:00
ekzyis df7726e313 Update market form on input change 2024-08-26 05:50:09 -05:00
ekzyis bd7b2715bd Calculate probabilities using LMSR 2024-08-25 00:48:03 -05:00
ekzyis 6c723b0304 Return 404 if market not paid 2024-08-24 22:30:04 -05:00
ekzyis 845157c954 Add market form + page
* market form with question, description and end date
* markets cost 1k sats
* a goroutine polls pending invoices from the db and checks LND for their status
* markets are listed on front page (after paid)
* market page contains buttons to bet yes or no
* users have names now

TODO:
* show correct market percentage
* show how percentage changed over time in chart
* validate end date
* implement betting / order form
2024-08-24 02:35:15 -05:00
ekzyis 139bb2e5b1 Remove unnecessary argument 2024-07-21 20:39:12 -05:00
ekzyis 9b8734f5a9 Add QR component 2024-07-15 12:55:48 +02:00
ekzyis 3957d4d774 Return 501 Not Implemented for nostr auth 2024-07-15 06:22:50 +02:00
ekzyis 642e7785a1 Fix login redirects 2024-07-15 06:16:27 +02:00
ekzyis 782bfec93a Implement logout 2024-07-14 13:39:42 +02:00
ekzyis 8d84e29d34 Improve htmx comment about 302 Found in session check 2024-07-14 12:49:38 +02:00
ekzyis 738d511f01 Call tx.Rollback() in bail 2024-07-14 12:38:16 +02:00
ekzyis 23ab67e8fc Always use c.JSON in HandleSessionCheck 2024-07-14 12:01:41 +02:00
ekzyis 2ec59e96eb Return c.JSON 2024-07-12 22:15:48 +02:00
ekzyis 3ac346df4f Fix route 2024-07-12 20:35:47 +02:00
ekzyis 36ac326767 Check status code instead of returned error 2024-07-12 20:32:50 +02:00
ekzyis 4e13271dbd Don't throw if user already exists on signup 2024-07-12 20:30:34 +02:00
ekzyis 0f3866866a Don't use assert format version unnecessarily 2024-07-12 20:21:12 +02:00
ekzyis df1886632b Fix tests 2024-07-12 20:11:03 +02:00
ekzyis 2653e816bb Implement LNURL-auth 2024-07-12 15:18:44 +02:00
ekzyis ee3e5e82e4 Remove old code
* removed code that will not be used
* removed code that will most likely be rewritten
2024-07-12 11:00:51 +02:00
ekzyis 94d1f6c1d8 Add login page 2024-07-12 07:12:57 +02:00
ekzyis 02944da696 Add /about 2024-07-10 09:14:06 +02:00
ekzyis 3d3ae16617 Index page with templ 2024-07-10 04:47:25 +02:00
ekzyis 5969b23a31 Fix undefined CTE execution order
"""
The sub-statements in WITH are executed concurrently with each other and with the main query.
Therefore, when using data-modifying statements in WITH, the order in which the specified updates actually happen is unpredictable.
"""
-- https://www.postgresql.org/docs/14/queries-with.html

Also see https://stackoverflow.com/questions/47622827/cte-execution-order
2023-12-04 04:45:27 +01:00
ekzyis 0ea0cecfc3 Show market outcome 2023-12-04 02:36:09 +01:00
ekzyis fe5feccfee Implement market settlement 2023-12-04 01:36:59 +01:00
ekzyis 51e204b64a Add frontend for market settlement 2023-12-03 08:51:40 +01:00
ekzyis 938bff20e6 Add pubkey column to market table 2023-12-03 07:22:13 +01:00
ekzyis c7ae559777 Implement withdrawal 2023-12-03 06:21:57 +01:00
ekzyis ce95a2111b Update matchmaking 2023-12-03 02:03:48 +01:00
ekzyis 0be35c5cf5 Add TODO 2023-12-03 02:01:27 +01:00
ekzyis 555e8f0767 Remove unnecessary comments 2023-12-02 23:41:39 +01:00
ekzyis 28546962f3 Add msats to session 2023-12-02 23:30:48 +01:00
ekzyis 49cacb266c Order cancelation 2023-12-02 23:22:14 +01:00
ekzyis fd6111b590 Create sell orders 2023-11-29 18:48:21 +01:00
ekzyis 5edb220b37 Fix tx value used on BeginTx error 2023-11-29 18:38:04 +01:00
ekzyis 0ae9f671d4 Add sell order form 2023-11-29 08:11:56 +01:00
ekzyis c9de76ac75 Add market stats page 2023-11-29 04:11:46 +01:00
ekzyis ef304a3047 Fix typo 2023-11-27 18:29:07 +01:00
ekzyis e84db076a4 Use router-view for markets 2023-11-27 00:59:15 +01:00
ekzyis c96eeb7668 Show user orders 2023-11-27 00:21:39 +01:00
ekzyis fb7fbae699 Fix invoice polling finds no rows 2023-11-26 23:53:35 +01:00
ekzyis aa6db6a5e1 Fix foreign key constraint violation during market creation 2023-11-26 23:48:55 +01:00