# Kimchi Premium Tracker (`automatic/kimchi-premium-tracker`) Actor

Kimchi premium board: Upbit KRW prices vs Binance USDT prices for a token watchlist or the top-turnover KRW markets, with the FX leg anchored on Upbit's own KRW-USDT pair and an optional Telegram alert when the premium crosses a threshold. Live board snapshot per run.

- **URL**: https://apify.com/automatic/kimchi-premium-tracker.md
- **Developed by:** [Philip Kirkbride](https://apify.com/automatic) (community)
- **Categories:** Business
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 result rows

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Kimchi Premium Tracker (Upbit × Binance)

Track the kimchi premium — the gap between Korean (Upbit KRW) prices and global (Binance USDT) prices — per token, with the KRW/USD rate taken from the market's own KRW-USDT pair. Each run returns one live record per token with both price legs, the implied USD price, the FX rate and the premium percentage. Use it for cross-exchange arbitrage research and Korean retail-flow monitoring, with the option of a Telegram digest when the premium crosses a threshold.

### Quick Start

```json
{"tokens": ["BTC", "ETH", "XRP", "SOL"]}
```

With no watchlist, the run tracks the top KRW markets by 24-hour turnover instead. Watchlist entries that match no Upbit KRW market produce no rows and are listed in the run warnings. An all-unmatched watchlist can finish successfully with an empty dataset.

### Input

| Name | Type | Default | Meaning |
| --- | --- | --- | --- |
| `tokens` | array | `[]` | Optional token watchlist, case-insensitive (`"BTC"` or `"KRW-BTC"` both work). Empty tracks the top KRW markets by 24h turnover. |
| `topTokens` | integer | `40` | Board size when no watchlist is given. |
| `alertPremiumPct` | number | `3` | Tokens whose premium magnitude reaches this percent go into the Telegram digest. The threshold is symmetric, so deep discounts count too. |
| `telegramChatId` | string | empty | Chat for the digest; requires the `TELEGRAM_BOT_TOKEN` secret environment variable. |
| `requestDelaySecs` | number | `0.25` | Pause between requests. |
| `maxPlausiblePremiumPct` | number | `50` | Suppress premiums whose absolute value exceeds this percent (1–1000). Both price legs are kept. Known symbol collisions are always suppressed, regardless of this setting. |

### What it returns

One dataset row per token:

| Field | Meaning |
| --- | --- |
| `recordKey` | Stable key, `kimchi:{SYMBOL}`. |
| `source`, `kind` | Record source and type. |
| `token`, `upbitMarket`, `koreanName` | Token symbol, Upbit market and Korean display name. |
| `upbitPriceKrw` | Upbit last trade price in KRW. |
| `upbitPriceUsdImplied` | The KRW price converted at the run's FX rate. |
| `upbitVolume24hKrw` | 24-hour KRW turnover used for ranking. |
| `upbitTradeAt` | Timestamp of the Upbit trade. |
| `binanceSymbol`, `binancePriceUsdt` | Binance pair and price in USDT, or `null` for a Korea-only token. |
| `usdtKrwRate` | The KRW/USD rate used. |
| `premiumPct` | The kimchi premium in percent, rounded to 4 decimal places; `null` when unavailable or suppressed. |
| `premiumWarning` | Reason a computed premium was suppressed, or `null`. |
| `marketWarning`, `priceFluctuations` | Boolean Upbit market-warning and price-fluctuation caution flags. |
| `sourceUrl`, `binanceUrl` | Public links to the two price sources. |
| `collectedAt` | UTC time the snapshot was taken. |

The run summary (`OUTPUT`) reports coverage counters, the alert digest and warnings such as Korea-only tokens with no global pair.

**Matching ticker symbols do not guarantee the same asset on both exchanges.** Known symbol collisions and price gaps beyond `maxPlausiblePremiumPct` (default 50% in either direction) get `premiumPct: null` with a `premiumWarning`. Both prices are kept for inspection. These checks are safeguards, not proof of asset identity; verify the asset and transfer network before acting. Upbit market warnings remain visible in `marketWarning` and `priceFluctuations`.

### Output example

Illustrative snapshot:

```json
{"recordKey":"kimchi:BTC","source":"upbit-binance","kind":"kimchi_premium","token":"BTC","upbitMarket":"KRW-BTC","koreanName":"비트코인","upbitPriceKrw":135200000,"upbitPriceUsdImplied":97203.2496944424,"upbitVolume24hKrw":81234567890.0,"upbitTradeAt":"2026-09-06T09:12:45+00:00","binanceSymbol":"BTCUSDT","binancePriceUsdt":96430.1,"usdtKrwRate":1390.9,"premiumPct":0.8018,"premiumWarning":null,"marketWarning":false,"priceFluctuations":false,"sourceUrl":"https://upbit.com/exchange?code=CRIX.UPBIT.KRW-BTC","binanceUrl":"https://www.binance.com/en/trade/BTC_USDT","collectedAt":"2026-09-06T09:12:47Z"}
```

### FAQ

**How is the premium computed?** `((upbitPriceKrw / usdtKrwRate) / binancePriceUsdt − 1) × 100`, with the KRW/USD rate anchored on the market's own KRW-USDT pair rather than a third-party FX feed.

**What about tokens listed only in Korea?** They keep their Upbit-side record with `premiumPct` as an explicit `null`, never guessed, and are named in the run warnings.

**How many tokens can I track?** Up to 100 watchlist entries, or the top 40 KRW markets by turnover (configurable with `topTokens`).

**Are both spikes and discounts alerted?** Yes — the threshold is symmetric, so a deep negative premium alerts exactly like a spike.

**Can I get the Telegram digest?** Set `telegramChatId` and provide the `TELEGRAM_BOT_TOKEN` secret. Without them, the run still collects the board; a failed or skipped send is a warning, not a failed run.

### Price

**$0.003 per result** delivered, plus **$0.005 per run start**. The run-start event is charged per GB of memory; the default 512 MB run is one start event. The start is charged even if the run saves no results. Platform usage is included in these prices.

For support, contact Apify support and include the Actor run ID.

# Actor input Schema

## `tokens` (type: `array`):

Optional token symbols (case-insensitive, 'BTC' or 'KRW-BTC' both accepted). Empty tracks the top KRW markets by 24h Upbit turnover.

## `topTokens` (type: `integer`):

How many top Upbit KRW markets (by 24h KRW turnover) the board tracks when no watchlist is given.

## `alertPremiumPct` (type: `number`):

Tokens whose kimchi premium magnitude is at or above this percent go into the Telegram digest (when telegramChatId and the TELEGRAM_BOT_TOKEN secret environment variable are configured). The threshold is symmetric: deep discounts count too.

## `telegramChatId` (type: `string`):

Optional Telegram chat id for the premium alert. Requires the TELEGRAM_BOT_TOKEN secret environment variable; the bot token is never an input. A failed or skipped send is a warning, never a failed run.

## `requestDelaySecs` (type: `number`):

Polite pause between batched Upbit ticker requests (the whole-board sweep only; watchlist runs need a single batch).

## `maxPlausiblePremiumPct` (type: `number`):

Plausibility guard: a computed |premium| above this percent is not published as real. premiumPct becomes null while both price legs are kept, and premiumWarning explains the suppression; symbols known to be different assets on Upbit and Binance are always suppressed. Default 50 leaves wide headroom over real premiums (about -5%..+14%).

## Actor input object example

```json
{
  "tokens": [],
  "topTokens": 40,
  "alertPremiumPct": 3,
  "telegramChatId": "",
  "requestDelaySecs": 0.25,
  "maxPlausiblePremiumPct": 50
}
```

# Actor output Schema

## `results` (type: `string`):

No description

## `summary` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "tokens": [],
    "topTokens": 40,
    "alertPremiumPct": 3,
    "telegramChatId": "",
    "requestDelaySecs": 0.25,
    "maxPlausiblePremiumPct": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("automatic/kimchi-premium-tracker").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "tokens": [],
    "topTokens": 40,
    "alertPremiumPct": 3,
    "telegramChatId": "",
    "requestDelaySecs": 0.25,
    "maxPlausiblePremiumPct": 50,
}

# Run the Actor and wait for it to finish
run = client.actor("automatic/kimchi-premium-tracker").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "tokens": [],
  "topTokens": 40,
  "alertPremiumPct": 3,
  "telegramChatId": "",
  "requestDelaySecs": 0.25,
  "maxPlausiblePremiumPct": 50
}' |
apify call automatic/kimchi-premium-tracker --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,automatic/kimchi-premium-tracker"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/OdZC84bpuuiGL113s/builds/fcaMWDJ79UqewTbLd/openapi.json
