Expose exact midpoint quotes for individual and batched assets

This commit is contained in:
2026-12-03 09:59:12 +08:00
parent d26c801888
commit b47058d75e
8 changed files with 180 additions and 49 deletions
+12
View File
@@ -48,3 +48,15 @@ POST http://127.0.0.1:9002/spreads
Content-Type: application/json
[{"token_id":"eb:YES:demo"},{"token_id":"eb:NO:demo"}]
### Load midpoint.jsonl into the same database first. Expected mid is "0.085".
GET http://127.0.0.1:9002/midpoint?token_id=eb%3AYES%3Amid-example
### Midpoints for YES and NO are "0.085" and "0.915".
GET http://127.0.0.1:9002/midpoints?token_ids=eb%3AYES%3Amid-example%2Ceb%3ANO%3Amid-example
### Same query with a JSON body
POST http://127.0.0.1:9002/midpoints
Content-Type: application/json
[{"token_id":"eb:YES:mid-example"},{"token_id":"eb:NO:mid-example"}]
+6
View File
@@ -0,0 +1,6 @@
{"op":"list","id":"mid-list","market":"mid-example","rules":"Local midpoint reference","tick_size":"0.0001"}
{"op":"open","id":"mid-open","market":"mid-example"}
{"op":"fund","id":"mid-cash1","account":"mid-yes","cents":100}
{"op":"fund","id":"mid-cash2","account":"mid-no","cents":100}
{"op":"order","id":"mid-bid","asset_id":"eb:YES:mid-example","account":"mid-yes","side":"buy","price_micros":80000,"qty":1}
{"op":"order","id":"mid-comp","asset_id":"eb:NO:mid-example","account":"mid-no","side":"buy","price_micros":910000,"qty":1}