Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/loathers/pricegun
Better item pricing for the Kingdom of Loathing
https://github.com/loathers/pricegun
Last synced: about 1 month ago
JSON representation
Better item pricing for the Kingdom of Loathing
- Host: GitHub
- URL: https://github.com/loathers/pricegun
- Owner: loathers
- Created: 2024-06-04T13:05:41.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-06-05T12:11:47.000Z (7 months ago)
- Last Synced: 2024-10-24T17:54:28.060Z (about 2 months ago)
- Language: TypeScript
- Size: 29.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# pricegun
## Method
The algorithm is constantly being improved and updated, but is currently based on calculating a modified Time Weighted Average Price as follows
```math
P_{\mathrm{TWAP}} = \frac{\sum_{j}{P_j \cdot T_j \cdot V_j^E}}{\sum_j{T_j} \cdot V_j^E}
```where
- $P_{\mathrm{TWAP}}$ is the Time Weighted Average Price
- $P_j$ is the price of the item at a given transaction
- $T_j$ is the time since the transaction epoch
- $V_j$ is the volume of a given transaction
- $E$ is a factor for dampening the impact of sudden high volume transactions
- $j$ is the individual transaction## Development
To install dependencies:
```bash
bun install
```To run:
```bash
bun run index.ts
```