Skip to content

Commit

Permalink
Quartz sync: Nov 15, 2024, 4:13 PM
Browse files Browse the repository at this point in the history
  • Loading branch information
kociumba committed Nov 15, 2024
1 parent 9433422 commit 211de5c
Show file tree
Hide file tree
Showing 6 changed files with 324 additions and 5 deletions.
16 changes: 16 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# https://taskfile.dev

version: "3"

tasks:
docs:push:
cmds:
- npx quartz sync

docs:serve:
cmds:
- npx quartz build --serve

docs:build:
cmds:
- npx quartz build
9 changes: 9 additions & 0 deletions content/config.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
title: Config
draft: false
tags:
- config
- user-guide
---


11 changes: 8 additions & 3 deletions content/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
---
title: Welcome to Quartz
title: Welcome to the SkyDriver docs
---

This is a blank Quartz installation.
See the [documentation](https://quartz.jzhao.xyz) for how to get started.
I made these docs to document [config options](Config) in the `~/.skydriver/config.toml` file.
But now that this exists I might as well make it a full doc of the app.

> [!WARNING]
> These docs are not going to be fully finished for a while and for now the [readme](https://github.com/kociumba/SkyDriver/blob/main/README.md) is still the best way to learn the app.
For information on how to use and configure SkyDriver, follow the #user-guide tag. Every other type of info also has it's own tag: #config for anything related to configuration, #internals for anything that won't be interesting to someone who just wants to use SkyDriver.
149 changes: 149 additions & 0 deletions content/math.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,149 @@
---
title: The math behind SkyDriver
draft: false
tags:
- config
- internals
---


## Technical notes on math used in SkyDriver

> [!NOTE]
> This is just a slightly differently formatted version of [notes.md](https://github.com/kociumba/SkyDriver/blob/main/notes.md)
These notes are public because I frankly suck at math and it's much easier for non coders to spot math problems
in this format than in code.

**In other words if I fucked something up here please report it in [issues](https://github.com/kociumba/SkyDriver/issues/new/choose).**

If you do want to read the code for this it's in [internal/priceFluctuation](https://github.com/kociumba/SkyDriver/blob/main/internal/priceFluctuation.go)

### Price Prediction Math

This is how SkyDriver profit predictions without using historical bazaar data.

Smoothing Functions
Before applying the calculations, we now use smoothing functions to normalize the inputs. The current implementation allows for different smoothing functions:

---

- **No Smoothing:** Raw values are used without modification.

---

- **Sigmoid Smoothing:**

$$f(x) = \frac{200}{1 + e^{-kx}} - 100$$

---

- **Tanh Smoothing:**

$$f(x) = 100 \tanh(kx)$$

---

- **Saturating Smoothing:**

$$f(x) = \frac{100x}{\sqrt{1 + kx^2}}$$

---

- **Piecewise Smoothing:**

$$f(x) = \frac{x}{(1 + (\frac{x}{100})^n)^{\frac{1}{n}}} \text{ if } x > 0$$

$$f(x) = -\frac{-x}{(1 + (\frac{-x}{100})^n)^{\frac{1}{n}}} \text{ if } x \leq 0$$


Where $k$ and $n$ are adjustable parameters controlling the steepness of the function.

---

- ### Price Spread $(PS)$
$$PS = \frac{buyPrice - sellPrice}{sellPrice} \times 100$$

This gives us the percentage spread between the buy and sell prices.
This calculation assumes that the user will be flipping sell and buy orders.

---

- ### Volume Imbalance $(VI)$
$$VI = \frac{buyVolume - sellVolume}{buyVolume + sellVolume} \times 100$$

This measures the imbalance between buy and sell volumes.

---

- ### Order Imbalance $(OI)$
$$OI = \frac{buyOrders - sellOrders}{buyOrders + sellOrders} \times 100$$

This measures the imbalance between the number of buy and sell orders.

---

- ### Moving Week Trend $(MWT)$
$$MWT = \frac{buyMovingWeek - sellMovingWeek}{buyMovingWeek + sellMovingWeek} \times 100$$

This gives us a sense of the longer-term trend based on the past week's activity.

---

- ### Top Order Book Pressure $(TOBP)$
Using the top 30 orders from buy_summary and sell_summary:

$$TOBP = \frac{\sum_{i=1}^{30} (buyAmount_i \times buyPrice_i) - \sum_{i=1}^{30} (sellAmount_i \times sellPrice_i)}{\sum_{i=1}^{30} (buyAmount_i \times buyPrice_i) + \sum_{i=1}^{30} (sellAmount_i \times sellPrice_i)} \times 100$$

This measures the pressure from the visible orders.

---

- ### Volume Factor (VF)

$V_{total} = buyMovingWeek + sellMovingWeek$

Total volume:

$$VF = -100 + \left( \frac{V_{total} - V_{low}}{V_{high} - V_{low}} \right) \times 200$$

---

- ### Profit Margin Factor Calculation $(PMF)$

The profit margin factor $PMF$ is calculated based on the profit margin as a percentage of the sell price.

$PM = sellPrice - buyPrice$

$PM_{percentage} = \frac{PM}{sellPrice}$

Margin percentage:

$$PMF = -100 + \left( \frac{PM_{percentage} - PM_{low}}{PM_{high} - PM_{low}} \right) \times 200$$

---

### Price Prediction Formula

Combine these factors with appropriate weights:

$$P_{pred} = w_1 \times PS + w_2 \times VI + w_3 \times OI + w_4 \times MWT + w_5 \times TOBP + w_6 \times VF + w_7 \times PMF$$

Where $w_1$, $w_2$, $w_3$, $w_4$, $w_5$, $w_6$, and $w_7$ are weights that sum to 1.

### Interpretation

A positive $P_{pred}$ suggests a potential price increase.

A negative $P_{pred}$ suggests a potential price decrease.

The magnitude of $P_{pred}$ indicates the strength of the prediction.


### Confidence Measure

We can create a simple confidence measure based on the consistency of our indicators:

$$Confidence = \frac{\text{Number of indicators with the same sign as } P_{pred}}{7} \times 100$$

This gives us a percentage confidence in our prediction.
139 changes: 139 additions & 0 deletions content/usage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
---
title: Basic usage
draft: false
tags:
- user-guide
---

# SkyDriver User Guide

SkyDriver is a powerful command-line companion application for Hypixel Skyblock, focusing on bazaar data analysis and flipping opportunities. This guide will walk you through everything you need to know to use SkyDriver effectively.

## Quick Start

1. Download the latest release from the [releases page](https://github.com/kociumba/SkyDriver/releases)
2. Run SkyDriver in your terminal of choice to get started!

## Installation Options

### Direct Download
Download the latest release from our [releases page](https://github.com/kociumba/SkyDriver/releases).

### Go Install
If you have Go installed, you can use:
```bash
go install -ldflags="-s -w" github.com/kociumba/SkyDriver
```

> [!note]
> On Windows, installing via `go install` will result in a binary without an icon and typical Windows metadata.
## Basic Usage

SkyDriver provides a clean, table-based output showing bazaar opportunities:

```
╔═══════════════════════════════╦═════════╦════════╦══════════╦═══════════════════════════════╦════════════════════╗
║Product/price limit: 100000.00 ║SellPrice║BuyPrice║Difference║ Weekly Trafic ║Predicted/Confidence║
╠═══════════════════════════════╬═════════╬════════╬══════════╬═══════════════════════════════╬════════════════════╣
║1. FINE_AQUAMARINE_GEM ║22217.20 ║39409.20║17192.00 ║Sell:317284 | Buy:190413 ║▼ -43.47/100.00% ║
║2. ENCHANTED_CAKE ║18028.53 ║34975.14║16946.61 ║Sell:102213 | Buy:149330 ║▲ 0.32/60.00% ║
║3. MAGMA_CREAM_DISTILLATE ║4611.41 ║16657.69║12046.28 ║Sell:110370 | Buy:31200 ║▼ -63.92/100.00% ║
║4. HAMSTER_WHEEL ║59745.58 ║68212.58║8466.99 ║Sell:432596 | Buy:429592 ║▼ -57.53/100.00% ║
║5. GLACITE_JEWEL ║44873.70 ║53025.92║8152.22 ║Sell:199886 | Buy:122002 ║▼ -12.57/80.00% ║
║6. GOBLIN_EGG_YELLOW ║2503.59 ║9990.90 ║7487.31 ║Sell:112769 | Buy:74976 ║▼ -70.28/100.00% ║
║7. FOUL_FLESH ║27898.44 ║34999.35║7100.91 ║Sell:337081 | Buy:301615 ║▼ -58.41/100.00% ║
║8. ENCHANTMENT_REJUVENATE_1 ║19854.46 ║26949.95║7095.49 ║Sell:317132 | Buy:35152 ║▼ -59.01/100.00% ║
║9. ENCHANTED_GLOWSTONE ║51016.56 ║56943.24║5926.68 ║Sell:167883 | Buy:147181 ║▲ 17.95/40.00% ║
║10. FINE_PERIDOT_GEM ║42509.63 ║48399.20║5889.57 ║Sell:644392 | Buy:749316 ║▼ -37.09/80.00% ║
╚═══════════════════════════════╩═════════╩════════╩══════════╩═══════════════════════════════╩════════════════════╝
```

## Command-Line Options

### Core Parameters

| Flag | Description | Example |
|------|-------------|---------|
| `-limit` | Maximum buy price filter | `-limit 1000000` |
| `-sell` | Minimum weekly sales filter | `-sell 100000` |
| `-search` | Search items by name | `-search flawless` |
| `-max` | Maximum items to display | `-max 100` |
| `-json` | Output in JSON format | `-json` |
| `-skip` | Skip interactive prompts | `-skip` |

### Example Commands

1. Search for specific items:
```bash
SkyDriver -search flawless -max 100
```

2. Find high-volume trading opportunities:
```bash
SkyDriver -limit 10000000 -sell 100000 -max 100
```

3. Get JSON output for automation:
```bash
SkyDriver -json -search flawless -max 100 | jq '.results | length'
```

## Understanding the Output

### Table Columns

- **Product**: Item name
- **SellPrice**: Current instant sell price
- **BuyPrice**: Current instant buy price
- **Difference**: Potential profit margin
- **Weekly Traffic**: Trading volume data
- **Predicted/Confidence**: Market prediction and confidence level

### Prediction System

The prediction system helps evaluate potential profitability:

- **Positive numbers**: Likely profitable
- **Negative numbers**: Potentially risky
- **Confidence percentage**: Agreement level among internal indicators

> [!warning]
> **Important:** The prediction system should be used as one of many tools in your decision-making process, not as the sole indicator for trading decisions.
## Filtering Behavior

By default, SkyDriver filters out items that have:
- Less than 100 buy and sell price
- Less than 10 sales per week

> [!note]
> This filtering is disabled when using the `-search` flag, where only items with 0 sell price and 0 buy price are filtered.
## Advanced Usage

### JSON Output
Use the `-json` flag for programmatic access to data. The output follows a [defined schema](api/schema.json) and is compatible with tools like `jq`.

> [!tip]
> The `-json` flag automatically disables interactive prompts.
### View All Items
To see a complete list of bazaar items:
```bash
SkyDriver -max 10000000
```

## Getting Help

If you encounter issues:
1. Review this documentation
2. Check common CLI usage patterns
3. [Open an issue](https://github.com/kociumba/SkyDriver/issues/new/choose) if problems persist

## Mathematical Model

The prediction system uses seven internal indicators to evaluate market conditions. For detailed information about the mathematical model and its components, see our [[math|Mathematical Model]] page.

> [!tip]
> Remember that market conditions can change rapidly. Always verify predictions against current market conditions and your own research.
5 changes: 3 additions & 2 deletions quartz.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const config: QuartzConfig = {
},
locale: "en-US",
// github pages url
baseUrl: "skydriver.github.io/skydriver/",
baseUrl: "kociumba.github.io/SkyDriver/",
ignorePatterns: ["private", "templates", ".obsidian"],
defaultDateType: "created",
generateSocialImages: true,
Expand All @@ -27,7 +27,8 @@ const config: QuartzConfig = {
typography: {
header: "Schibsted Grotesk",
body: "Source Sans Pro",
code: "IBM Plex Mono",
// code: "IBM Plex Mono",
code: "Cascadia code NF",
},
colors: {
lightMode: {
Expand Down

0 comments on commit 211de5c

Please sign in to comment.