Methodology

Complete technical documentation for alaltin.com — how every gold price is calculated, where the data comes from, how sources are validated, and what every number on the site means. This page is intended for internal use and for anyone who wants to understand exactly how the platform works, from first principles. Live values from the production system are shown in green boxes.

1. The Price Cascade

Core concept: Every gold price that a Turkish consumer sees — whether at a bank, a jeweler in the Grand Bazaar (Kapalicarsi), a crypto exchange, or a physical bullion store — ultimately derives from a single global number: the London OTC interbank spot price for gold, quoted in US dollars per troy ounce (XAU/USD).

The London spot price is determined by the over-the-counter (OTC) market where major bullion banks (HSBC, JP Morgan, UBS, etc.) trade large gold bars (400 oz / ~12.4 kg Good Delivery bars) among themselves. This is not an exchange — it is a decentralized dealer market. The price is quoted continuously during market hours and is the global benchmark for gold.

To convert this international price into something meaningful for a Turkish buyer, we perform the following conversion chain:

London Spot (USD/oz) ÷ 31.1035 (troy oz to grams) × USD/TRY rate = TRY/gram (fine gold)

Step 1: USD per troy ounce to USD per gram. A troy ounce is exactly 31.1034768 grams (we use 31.1035 as the standard rounded constant — the difference is negligible at 0.0000007%). Dividing the per-ounce price by 31.1035 gives us the price per gram in US dollars.

Step 2: USD per gram to TRY per gram. Multiply by the current USD/TRY exchange rate. This rate itself is a consensus value derived from multiple sources (see Section 2).

Important: The resulting number is a theoretical reference price for 999.9 purity (fine) gold in TRY per gram. Nobody can actually buy gold at this price. It is the mathematical baseline from which all real-world prices are derived by adding various premiums, fees, spreads, and taxes. Think of it as the "speed of light" for gold pricing — a physical constant that real prices orbit around but never quite reach.

2. Consensus Engines

Why consensus? No single data source is perfectly reliable. APIs go down, scraped websites occasionally return stale data, and different sources may disagree by small amounts due to timing differences. Rather than trusting any single source and risking displaying incorrect prices to users, we aggregate multiple independent sources using a consensus algorithm.

We operate three separate consensus engines, each responsible for a different piece of the pricing puzzle. Each engine independently collects, validates, and combines its sources to produce a single trusted value.

Consensus Algorithm

3 or more sources available → Median (the middle value when sorted — resistant to outliers)

Exactly 2 sources → Average (arithmetic mean of both)

Only 1 source → Direct passthrough (used as-is, but confidence drops to "low")

The median is preferred over the average because it is robust to outliers. If one source out of five suddenly reports a wildly wrong value (e.g., a scraping error returns yesterday's price), the median ignores it entirely, while an average would be pulled toward the bad value.

Divergence Detection

Source diverges >3% from consensus → Rejected (excluded from consensus, which is then recalculated without it)

Source diverges 1-3% from consensus → Alert (included but flagged for investigation — may indicate a real market event or a data issue)

Source diverges <0.5% from consensus → Normal (healthy agreement)

Confidence Levels

High — 3+ sources agree within 0.5%. The consensus value is very reliable.

Medium — 2 sources, or 3+ with 0.5-1% spread. Reliable but with less certainty.

Low — Only 1 source available, or sources diverge significantly. The value may be stale or inaccurate.

Engine A: Gold Spot Consensus (International XAU/USD)

This engine determines the current international gold spot price in USD per troy ounce. It aggregates 4-6 independent international gold price APIs. These sources poll different upstream providers (some use LBMA data, some use Comex-derived prices, some interpolate from futures), so they provide genuine diversity rather than all echoing the same number.

Sources: GoldPriceZ, Gold-API.com, Metals.dev, LBMA daily fix, PAXG price interpolation (derived from the crypto token price, which tracks spot closely).

Engine B: FX Rate Consensus (USD/TRY)

This engine determines the current USD/TRY exchange rate. It is organized into 3 tiers because not all FX sources are equally reliable or timely for the Turkish lira:

Tier 1 — Consensus-forming (high frequency, <5 min staleness): Doviz.com, BigPara, Twelve Data. These are scraped/polled frequently and reflect real-time interbank rates. They form the actual consensus value.

Tier 2 — Validation (lower frequency, up to 12h staleness): ExchangeRate API, Frankfurter. These update less often but serve as a sanity check. If Tier 1 sources suddenly diverge from Tier 2 by more than 2%, something unusual is happening (either a rapid FX move or a data issue).

Tier 3 — Excluded from consensus: Binance USDT/TRY. This is excluded because the crypto USDT/TRY rate consistently trades at a premium to the interbank rate (often 1-3% higher) due to capital controls and crypto demand in Turkey. Including it would bias the consensus upward.

Engine C: Domestic Market Consensus (Turkish Wholesale / Kapalicarsi)

This engine determines the Turkish domestic wholesale gold price — the price at which gold dealers in Istanbul's Grand Bazaar (Kapalicarsi) trade 995-purity gram gold among themselves. This is the "local spot" for Turkey and is distinct from the international spot because it includes the Istanbul/domestic premium (see Section 5).

Sources: Altinkaynak (their "CH_T" / Carsi Toptan feed), Ozan Kur (has altin reference), Ahlatci Doviz (their digital gold/FX feed). All three are independent Turkish market data providers that report Kapalicarsi-level wholesale prices.

3. Purity Normalization

The problem: Gold products come in wildly different forms. A bank sells "gram altin" (gram gold) at 995 purity. A jeweler sells 22-karat coins. A crypto exchange sells PAXG tokens backed by 999.9 fine gold. A physical store sells bars ranging from 1 gram to 1 kilogram. How do you compare them fairly?

The solution: Normalize everything to a single common unit — fine gold TRY per gram at 999.9 purity. This is the "has altin" (pure gold) reference. By converting every price to this unit, we can compare apples to apples across all categories.

The normalization formula is simple: divide the price-per-gram by the purity fraction. This gives you the price per gram of pure gold content, regardless of what alloy the product actually is.

Fine Gold TRY/g = Price TRY/g ÷ purity fraction

Example with 995-purity gram gold: If gram altin (995 purity) costs 3,000 TRY/g, then the fine gold equivalent is 3,000 ÷ 0.995 = 3,015.08 TRY/g. The extra 15.08 TRY accounts for the fact that each gram of "gram altin" contains only 0.995 grams of actual gold.

Example with 22K coins: A Ceyrek Altin (quarter coin) weighs 1.754g gross at 22K (916.7/1000) purity. Its fine gold content is 1.754 × 0.9167 = 1.608g. If the coin costs 5,500 TRY, then the price per gram of fine gold is 5,500 ÷ 1.608 = 3,419.65 TRY/g. This is much higher than the spot reference, reflecting the minting premium and denomination convenience.

For per-unit products (coins): The formula has an extra step — first compute fine gold grams in the coin, then divide the coin price by that. Coin price ÷ (gross weight × purity) = fine TRY/g.

Purity Reference Table

PurityFractionWhere It Is Used
999.9 (24K)0.9999Has altin (pure gold reference), PAXG, XAUT tokens, some premium bars
9950.9950Standard "gram altin" — the most common unit in Turkish gold trading, LBMA Good Delivery minimum
916.7 (22K)0.9167Traditional Turkish coins: Ziynet, Cumhuriyet/Ata, Resat; also 22-ayar bilezik (bracelets)
750 (18K)0.7500Fine jewelry (ince taki)
585 (14K)0.5850Everyday jewelry (gunluk taki) — most common purity for wearable gold in Turkey

Darphane (Turkish State Mint) Coin Weights — Ziynet Series

Ziynet coins are the "decorative" series — thinner and lighter. When a Turk says "Ceyrek" (quarter), "Yarim" (half), or "Tam" (full) without further qualification, they almost always mean the Ziynet variant. These are the coins given as gifts at weddings, circumcisions, and celebrations. All are 22 karat (916.7/1000 purity).

Coin NameGross Weight (g)Fine Gold Content (g)Diameter (mm)
Ceyrek (Quarter)1.7541.60818
Yarim (Half)3.5083.21522
Tam (Full)7.0166.43130
Gremse (2.5x)17.54016.07740
Besi Bir Yerde (5x)35.08032.15446.5

Darphane Coin Weights — Ata/Cumhuriyet Series (Investment Coins)

Ata (also called Cumhuriyet or Meskuk) coins are the "investment" series — thicker and heavier than Ziynet coins of the same denomination. They carry the portrait of Ataturk (hence "Ata"). They contain ~3% more gold than their Ziynet equivalents and are preferred by investors over gift-givers. "Resat" and "Hamit" coins (Ottoman-era) have the same weight as Cumhuriyet but may carry a collector's premium.

Coin NameGross Weight (g)Fine Gold Content (g)Diameter (mm)
Ceyrek Ata (Quarter)1.8041.65415
Yarim Ata (Half)3.6083.30718
Cumhuriyet / Tam Ata (Full)7.2166.61522
Gremse Ata (2.5x)18.04116.53726
Besli Ata (5x)36.08233.07435

4. Reference Prices (Header Pills)

At the top of every page on alaltin.com, you see 3 colored pills in the header. These are the site's fundamental reference values — the "north stars" that every other number on the site is compared against. Here is exactly where each one comes from:

$/TRY (Blue pill)

The mid-point of the USD/TRY exchange rate from the FX Consensus Engine (Engine B, Section 2). The mid is calculated as the average of the consensus bid and ask: (bid + ask) / 2. This represents the "fair" interbank exchange rate — not the rate you'd get at a bank or exchange office (which would be worse), but the theoretical midpoint between buyers and sellers.

$/TRY pill = FX consensus mid = (consensus bid + consensus ask) / 2

Global Gold (Amber pill)

The theoretical price of 1 gram of 999.9-pure gold in Turkish lira, calculated from international data only (no Turkish sources). This is the Price Cascade result from Section 1. It represents what gold "should" cost in Turkey if there were zero friction — no premiums, no spreads, no taxes.

Global Gold pill = Spot (USD/oz) ÷ 31.1035 × USD/TRY mid = 999.9 fine TRY/gram

Local Gold (Orange pill)

The mid-point of the domestic wholesale gold price from the Domestic Market Consensus Engine (Engine C, Section 2). This is the price at which large gold dealers in Istanbul's Grand Bazaar trade 995-purity gram gold among themselves. It is displayed as-is in 995 purity (not normalized to 999.9) because "gram altin 995" is the standard trading unit in Turkey — normalizing it would confuse Turkish users who think in terms of gram altin.

Local Gold pill = Domestic consensus mid (995 purity, TRY/gram)

5. Friction Decomposition

Disclaimer: This decomposition is an approximation. The individual components (FX spread, Istanbul premium, channel markup) involve assumptions about how each entity prices gold internally. The total friction percentage (a source's sell price vs. the international reference) is accurate and directly observable. However, the breakdown into components is our analytical model — it is not verified against how banks, dealers, or exchanges actually set their prices internally. The components should be understood as "what portion of the total gap can be attributed to X" rather than "entity Y charges exactly X% for this service."

What is friction? The difference between what a Turkish consumer actually pays for gold and the theoretical international reference price. If the global reference says fine gold should cost 3,200 TRY/g and a bank sells gram altin at 3,360 TRY/g, the friction is 5%. But where does that 5% come from? We decompose it into 3 measurable components:

Total Friction = FX Spread Component + Istanbul Premium Component + Channel Markup

Total Friction

The overall percentage difference between a source's sell price and the international reference price (after purity normalization). This number is always accurate — it is a direct comparison of two observable prices.

Total Friction % = (Source Sell Price - Reference) / Reference × 100

Component 1: FX Spread

When a bank or dealer converts international gold prices to TRY, they use an exchange rate that is worse than the interbank mid. The bid-ask spread on USD/TRY represents the cost of currency conversion. We estimate the consumer's FX friction as half the bid-ask spread (since the consumer only crosses one side — they buy TRY, they don't also sell it).

FX Spread % = (USD/TRY Ask - USD/TRY Bid) / USD/TRY Mid × 100 ÷ 2

Component 2: Istanbul / Domestic Premium

The gap between the Turkish domestic wholesale price and what you'd expect from a pure international conversion. This premium reflects Turkey-specific factors: gold import quotas set by the CBRT, physical logistics of importing bullion, domestic demand surges (wedding season, economic uncertainty), and occasionally CBRT policy interventions. It is calculated after subtracting the FX component to avoid double-counting.

Istanbul Premium % = (Domestic Mid - Purity-Adjusted Reference) / Purity-Adjusted Reference × 100 - FX Spread %

Component 3: Channel Markup (Source-Specific)

Whatever friction remains after subtracting FX spread and Istanbul premium is the channel's own markup — the margin that the specific bank, store, or exchange charges. This is calculated per-source and varies widely: a competitive bank might add 0.5%, while a physical store selling small bars might add 3-5% (covering minting costs, inventory risk, and retail overhead).

Channel Markup = Total Friction - FX Spread - Istanbul Premium

Calculated independently for each source (bank, store, exchange, crypto).

Spread (Bid-Ask Spread in Basis Points)

Separately from friction, we also display each source's bid-ask spread — the gap between their buy (bid) and sell (ask) price. This tells you the round-trip cost: if you buy and immediately sell, you lose the spread. It is expressed in basis points (bps) where 1 bps = 0.01% and 100 bps = 1%.

spread_bps = floor((Sell - Buy) / Mid × 10,000)

1 bps = 0.01%. 100 bps = 1%. Typical bank spread: 85-150 bps. Typical dealer: 100-300 bps.

6. Calculator Formulas (/hesapla — Gold X-Ray)

The /hesapla page (Gold X-Ray Calculator) answers the question: "I have X Turkish lira (or I want X grams of gold) — how much actual gold do I get across different channels, after all fees and taxes?" It compares 3 channels side by side: Bank (digital), Physical Store, and Crypto Exchange.

BSMV (Kambiyo Vergisi — Turkish Banking Gold Tax)

BSMV (Banka ve Sigorta Muameleleri Vergisi) is a Turkish financial transaction tax applied to gold purchases through banks only. The current rate is 0.2% (2 per mille). It is charged on top of the bank's sell price. Crucially, BSMV is not charged when you sell gold back to the bank — only on purchases. Physical stores and crypto exchanges are not subject to BSMV.

Effective Bank Price = Bank Sell Price × (1 + 0.002)

Example: If a bank sells gram altin at 3,300 TRY, you actually pay 3,300 × 1.002 = 3,306.60 TRY.

Crypto Exchange Taker Fees

When buying tokenized gold (PAXG or XAUT) on a crypto exchange, the exchange charges a trading fee. We use the taker fee (market order fee) at the lowest VIP tier, since most retail users will be at this tier. The fee is applied to both buy and sell sides separately. For the calculator, we apply it once (on the buy side only).

ExchangeTaker Fee (Lowest Tier)
Binance0.10%
Bybit0.10%
OKX0.10%
MEXC0.10%
Bitget0.10%
Gate.io0.20%
Kraken0.40%
Coinbase0.60%

These are the lowest-tier (default) taker fees for market orders. Higher VIP tiers get lower fees. Fees apply separately to both buys and sells.

Physical Gold — Greedy Knapsack Algorithm

Physical gold (bars/ingots) comes in fixed denominations: 1g, 2.5g, 5g, 10g, 20g, 50g, 100g, 250g, 500g, and 1kg. You cannot buy 7.3 grams of physical gold — you must buy whole bars. Additionally, larger bars are cheaper per gram (a 1kg bar might cost 3,280 TRY/g while a 1g bar costs 3,450 TRY/g) because the minting/handling cost is spread over more gold.

In budget mode ("I have 50,000 TRY"), the calculator uses a greedy algorithm to maximize the amount of fine gold you get: it starts with the largest affordable bar, buys as many as possible, then moves to the next smaller size, and so on until the budget is exhausted or no more bars can be purchased. This is a greedy knapsack approach — not mathematically optimal in all edge cases, but close enough for practical purposes and much simpler than a full dynamic programming solution.

For each bar size (largest to smallest):
  quantity = floor(remaining_budget / unit_price)
  remaining_budget -= quantity × unit_price
Result: Maximum fine gold grams for the given budget

Fine Gold Calculation Per Channel

Each channel computes fine gold differently because the products have different purities and pricing structures:

Bank (digital, 995 purity):
  raw_grams = budget / (bank_sell × 1.002)  [includes BSMV]
  fine_grams = raw_grams × 0.995

Physical store (995 or 999.9 purity, per-bar):
  fine_grams = sum(quantity × bar_fine_gold_content) via knapsack

Crypto exchange (999.9 purity, per-ounce tokens):
  token_amount = budget / (token_sell_TRY × (1 + taker_fee))
  fine_grams = token_amount × 31.1035  [1 PAXG/XAUT = 1 troy oz]

7. Data Sources

alaltin.com aggregates data from 27+ sources across 6 categories. Each source is scraped or polled independently by its own dedicated scraper, and the raw data is fed into the appropriate consensus engine before being used in calculations. The total data cost is $0-1.79/month.

Independence note: Some sources may share upstream data providers. For example, multiple Turkish finance portals might source their FX rates from the same Reuters/Bloomberg feed. We mitigate this by using sources across different categories (interbank feeds, market data aggregators, direct exchange APIs) and by requiring consensus agreement rather than trusting any single source.

International Gold Spot

SourceFrequencyData Provided
GoldPriceZ~2 minXAU/USD spot (requires attribution link)
Gold-API.com~2 minXAU/USD spot (free tier, backup)
Metals.dev20-30 minXAU/USD spot ($1.79/mo licensed backup)
LBMADailyLondon Fix (official AM/PM benchmark, used for daily anchoring)

Foreign Exchange (USD/TRY)

SourceFrequencyData Provided
Doviz.com60sUSD/TRY bid/ask — Tier 1 (consensus-forming)
BigPara60sUSD/TRY bid/ask — Tier 1 (consensus-forming)
Twelve Data5-10 minUSD/TRY mid — Tier 1 (consensus-forming)
ExchangeRate APIHourlyUSD/TRY mid — Tier 2 (validation only)
Frankfurter (ECB)HourlyUSD/TRY mid — Tier 2 (validation only)
TCMBDaily 15:30Official central bank rate — Tier 2 (validation)

Domestic Wholesale (Kapalicarsi / Grand Bazaar)

SourceFrequencyData Provided
Altinkaynak (CH_T)45sWholesale 995 gram altin — Carsi Toptan feed
Ozan Kur45sHas altin (fine gold) reference price
Ahlatci Doviz60sGram altin, FX rates — digital dealer

Bank Prices (Digital Gold Accounts)

SourceFrequencyData Provided
Doviz.com Bank Feed60s28+ Turkish banks — gram, ceyrek, yarim, tam prices

Physical Retail Store

SourceFrequencyData Provided
Ahlatci Store60sAll bar sizes from 1g to 1kg — buy and sell prices

Crypto Exchanges (Tokenized Gold)

SourceFrequencyData Provided
Binance (WebSocket)Real-timePAXG/USDT, XAUT/USDT — primary, lowest latency
Kraken60sPAXG/USD — independent (not USDT-based)
OKX60sPAXG/USDT
Bybit60sPAXG/USDT
Gate.io60sPAXG/USDT
MEXC60sPAXG/USDT
Bitget60sPAXG/USDT
Coinbase60sPAXG/USD — independent (not USDT-based)

Stock Exchange (BIST — Borsa Istanbul)

SourceFrequencyData Provided
BigPara BISTTrading hoursALTIN.S1 gold certificate
Doviz.com BIST60sALTIN.S1 gold certificate

Data Freshness Classification

Each data point carries a timestamp. We classify freshness to help users understand how current the displayed prices are:

<2 minutes: Fresh — data is current and reliable

2-10 minutes: Delayed — data is slightly stale but still usable; may lag real market by a few cents

>10 minutes: Stale — data is old and may not reflect current market; source may be down

8. Constants

These are the hardcoded values used throughout the platform. They are either physical constants (troy ounce conversion), regulatory values (BSMV rate), or validated operational thresholds (price range guards).

ConstantValueExplanation
Troy ounce to grams31.1035Exact value is 31.1034768g. We use 31.1035 as the standard constant. The rounding error is <0.001%.
BSMV rate0.2%Kambiyo Vergisi (banking foreign exchange tax). Applied only to gold purchases through Turkish banks. Not applied to sales, physical stores, or crypto.
Max spread (normal)1,000 bps10% spread threshold. Any source reporting a bid-ask spread wider than 10% is flagged as suspicious (likely a data error or market halt).
Max spread (bank)5,000 bps50% spread threshold for banks specifically. Turkish banks dramatically widen their gold spreads outside trading hours (evenings, weekends) — spreads of 20-40% are normal at 3 AM.
Valid price range500 - 200,000 TRYAny gold price (per gram) outside this range is rejected as garbage data — likely a parsing error, API glitch, or unit mismatch.
Default staleness600s10 minutes. After this, a data point is considered stale. Some sources have tighter thresholds (e.g., Binance WebSocket: 30s).
Consensus divergence3%Any source diverging >3% from the calculated consensus value is rejected and excluded from the consensus recalculation.
Price change alert5%If a new price from a source differs by >5% from its previous value, it triggers a review flag. Real gold rarely moves 5% in one scrape interval.
Rolling average deviation20%A new price deviating >20% from the rolling average is almost certainly a parsing error (e.g., decimal point misplaced).