rework market trends

This commit is contained in:
Sirttas
2026-06-22 12:30:28 +02:00
parent 35b2c9539a
commit 925d9eef73
9 changed files with 373 additions and 125 deletions
+117 -6
View File
@@ -466,7 +466,8 @@ paths:
get:
tags:
- market
summary: "Scan a single market type, returning its volume-weighted price quartiles"
summary: "Scan a single market type, returning its volume-weighted price quartiles\
\ and recent price trend"
operationId: scanMarketType
parameters:
- name: marketTypeId
@@ -497,12 +498,12 @@ paths:
minimum: 0
- name: salesTax
in: query
description: "Sales tax as a fraction (e.g. 0.036 for 3.6%), paid on sell\
description: "Sales tax as a fraction (e.g. 0.03375 for 3.375%), paid on sell\
\ orders"
required: false
schema:
type: number
default: 0.036
default: 0.03375
maximum: 1
minimum: 0
responses:
@@ -548,6 +549,39 @@ paths:
$ref: "#/components/schemas/MarketHistoryResponse"
"400":
description: The days parameter is not greater than 0
/market/{marketTypeId}/history/quartiles:
get:
tags:
- market
summary: Compute volume-weighted price quartiles and the recent price trend
from a type's market history
operationId: findQuartiles
parameters:
- name: marketTypeId
in: path
description: Id of the market type
required: true
schema:
type: integer
format: int64
- name: days
in: query
description: Optional number of most recent days to analyze; omit for the
full history
required: false
schema:
type: integer
format: int32
minimum: 1
responses:
"200":
description: The price quartiles of the type
content:
'*/*':
schema:
$ref: "#/components/schemas/HistoryQuartilesResponse"
"400":
description: The days parameter is not greater than 0
/market/types:
get:
tags:
@@ -620,7 +654,7 @@ paths:
tags:
- market
summary: "Scan every tracked market type, returning volume-weighted price quartiles\
\ for each"
\ and the recent price trend for each"
operationId: scanMarket
parameters:
- name: days
@@ -644,12 +678,12 @@ paths:
minimum: 0
- name: salesTax
in: query
description: "Sales tax as a fraction (e.g. 0.036 for 3.6%), paid on sell\
description: "Sales tax as a fraction (e.g. 0.03375 for 3.375%), paid on sell\
\ orders"
required: false
schema:
type: number
default: 0.036
default: 0.03375
maximum: 1
minimum: 0
responses:
@@ -694,6 +728,48 @@ paths:
Returned when:
- the types parameter is missing
- a types value is not a numeric id
/market/history/quartiles:
get:
tags:
- market
summary: Compute volume-weighted price quartiles and the recent price trend
for each requested market type
operationId: findAllQuartiles
parameters:
- name: types
in: query
description: "Market type ids to analyze, e.g. types=34,35"
required: true
schema:
type: array
items:
type: integer
format: int64
- name: days
in: query
description: Optional number of most recent days to analyze; omit for the
full history
required: false
schema:
type: integer
format: int32
minimum: 1
responses:
"200":
description: "The price quartiles for each requested type, one entry per\
\ type"
content:
'*/*':
schema:
type: array
items:
$ref: "#/components/schemas/HistoryQuartilesResponse"
"400":
description: |-
Returned when:
- the types parameter is missing
- a types value is not a numeric id
- the days parameter is not greater than 0
/ledgers:
get:
tags:
@@ -1126,6 +1202,12 @@ components:
totalVolume:
type: integer
format: int64
trend:
type: string
enum:
- UP
- DOWN
- FLAT
profit:
type: number
score:
@@ -1140,6 +1222,7 @@ components:
- score
- sell
- totalVolume
- trend
MarketHistoryResponse:
type: object
properties:
@@ -1169,6 +1252,34 @@ components:
- marketTypeId
- orderCount
- volume
HistoryQuartilesResponse:
type: object
properties:
marketTypeId:
type: integer
format: int64
q1:
type: number
median:
type: number
q3:
type: number
totalVolume:
type: integer
format: int64
trend:
type: string
enum:
- UP
- DOWN
- FLAT
required:
- marketTypeId
- median
- q1
- q3
- totalVolume
- trend
MarketTypeResponse:
type: object
properties: