diff --git a/MARKET_EVIDENCE.md b/MARKET_EVIDENCE.md index c04bc27..ffeb406 100644 --- a/MARKET_EVIDENCE.md +++ b/MARKET_EVIDENCE.md @@ -1,37 +1,48 @@ -# Market evidence from trades.csv +# Provisional relative ValueList -`trades.csv` contains asking listings. Its `offer` column is often an entire -inventory, while `lf` and `mlf` can contain several alternatives. Pairing all -items across those columns would invent exchange rates that nobody quoted. +Run `py -B provisional_valuelist.py` to regenerate: -Run `py -B extract_exchange_quotes.py` to regenerate `exchange_quotes.csv`. -This reads only exact unit-for-unit proposals: a single offered variant and a -single requested variant, with optional explicit quantities. It rejects -bundles, adds, alternatives, and quality descriptions. It also requires the -offered variant to appear in that listing's `offer` field and counts identical -quotes from an author once. The CSV keeps the source row and text for review. +- `provisional_valuelist.csv`: ranked relative estimates and confidence levels. +- `exchange_quotes.csv`: exact single-unit asking quotes with source text. +- `bundle_quotes.csv`: explicit multi-unit asking quotes with source text. -The current 835 listings yield 11 such asking quotes. They connect only small -groups of units, and each relation has too few independent quotes to claim a -market price. For example, one seller asks for five Dark Mage Evo in exchange -for one Shiny Dark Mage Evo; another asks for one Alucard Evo in exchange for -two Homura Evo. These are **proposed** ratios, not completed trades. +The current snapshot contains 886 listings. The parser found 11 simple quotes +and 11 bundle quotes. Seventeen quotes connect 24 variants to Aizen Evo; only +five variants receive a numeric entry. Other connected +variants remain in the CSV as unranked with `insufficient` confidence. -Shiny Aizen Evo has no clean unit-for-unit quote against normal Aizen Evo in -this file. One listing asks for 900 rerolls for a Shiny Aizen Evo, and another -asks for unspecified "bulks" of normal Aizen Evo. Neither gives a reliable -conversion between the two variants. Shiny and normal variants must remain -separate in any future valuation model. The known ordering supplied by the -user is Shiny Aizen Evo > Aizen Evo; the CSV does not establish the multiplier. +## How the estimates work -`interest_index.csv` is a separate demand-versus-supply report. Run -`py -B calculate_interest_index.py` to regenerate it. Its score is **not a -value**: it counts distinct authors requesting and offering each explicit Evo -or Unevo variant, requires at least 20 total mentions and five on each side, -then scales `(requested_by + 3) / (offered_by + 3)` to a median of 100. It -excludes `nlf`, quantities, reposts, and repeat mentions by an author. +The parser accepts an explicit `X + Y for Z` proposal or an offer/request pair +whose two sides contain only named variants and quantities. It rejects broad +wish lists, alternatives, unspecified adds, stats and quality descriptions, +and inventory rows that do not clearly describe a bundle. Each offered unit +must appear in the listing's `offer` field. Repeated identical quotes from one +author count once. -For a defensible relative ValueList, collect completed trades or several -independent, specific two-sided quotes per unit pair, including quantities, -variant, evolution, stat quality, and date. Then fit values only within a -connected network of comparable trades and show uncertainty for thin data. +The model fixes **Aizen Evo = 1,000 points**. It fits unit values so the sum of +points on each side of a proposed exchange is approximately equal. Direct +unit quotes have three times the weight of bundle quotes. A small pull toward +the 1,000-point reference keeps the sparse equations solvable. Values are +rounded to the nearest 50 points. This is an **asking-price model**, not a +record of completed exchanges; the regularization affects thin estimates. + +`low` means at least four distinct source rows mention the unit in accepted +quotes. `very_low` means two or three. The Aizen reference and Shiny Dark Mage +are also displayed when evidence is thinner; their counts are visible. No +entry earns high confidence from this dataset. `insufficient` entries have +no numeric value or rank. + +Shiny Aizen Evo is placed immediately above normal Aizen Evo from the ordering +provided by the user. Its confidence is `constraint_only`, and its numeric +value is deliberately blank: the file does not establish a multiplier. A +listing asks 900 rerolls for Shiny Aizen, and another asks for unspecified +"bulks" of normal Aizen; neither supplies a quantitative comparison. + +The rank of Shiny Aizen represents only **greater than Aizen Evo**. Its true +position relative to other units may be higher. For stronger values, collect +completed trades or repeated exact quotes with quantities, evolution state, +shiny state, stat quality, and date. Fit the model again as those arrive. + +`interest_index.csv`, generated by `py -B calculate_interest_index.py`, is a +separate demand-versus-supply report. It must not be read as a value ranking. diff --git a/calculate_interest_index.py b/calculate_interest_index.py index 9cf0fd7..300fed1 100644 --- a/calculate_interest_index.py +++ b/calculate_interest_index.py @@ -13,6 +13,7 @@ import csv from pathlib import Path import re from statistics import median +import unicodedata from discord_trade_parser import KNOWN_UNIT_NAMES, normalize_unit_names @@ -20,7 +21,12 @@ from discord_trade_parser import KNOWN_UNIT_NAMES, normalize_unit_names UNIT_NAMES = tuple( name for name in KNOWN_UNIT_NAMES if name.casefold() != "shiny skull knight" ) -CANONICAL_NAMES = {name.casefold(): normalize_unit_names(name) for name in UNIT_NAMES} +def canonical_key(name: str) -> str: + return "".join(char for char in unicodedata.normalize("NFKD", name.casefold()) + if not unicodedata.combining(char)) + + +CANONICAL_NAMES = {canonical_key(name): normalize_unit_names(name) for name in UNIT_NAMES} UNIT_PATTERN = re.compile( r"(?Shiny\s+)?(?P" + "|".join(re.escape(name).replace(r"\ ", r"\s+") for name in UNIT_NAMES) @@ -36,7 +42,7 @@ def variants(text: str, *, request: bool = False) -> set[str]: for match in UNIT_PATTERN.finditer(text): if request and MY_PREFIX.search(text[max(0, match.start() - 12):match.start()]): continue - name = CANONICAL_NAMES[match.group("unit").casefold()] + name = CANONICAL_NAMES[canonical_key(match.group("unit"))] shiny = "Shiny " if match.group("shiny") else "" evolution = match.group("evolution").capitalize() found.add(f"{shiny}{name} {evolution}")