Skill: seungdols/kimp-price (version 1.0.0)

--- name: kimchi-premium version: 1.0.0 description: > Real-time Bitcoin Kimchi Premium calculator. Compares Bitcoin prices between a Korean exchange (Upbit, KRW) and a global exchange (Binance, USD) to calculate the premium percentage and price difference in KRW. Reflects live USD/KRW exchange rates and uses only Node.js built-in modules with zero dependencies. author: seungdols permissions: network: - open.er-api.com - api.upbit.com - api.binance.com --- # Kimchi Premium 🌶️ A Claude Code skill that calculates the real-time Bitcoin **Kimchi Premium**. ## What is Kimchi Premium? The Kimchi Premium is a metric that measures how much higher (or lower) Bitcoin prices are on South Korean cryptocurrency exchanges (e.g. Upbit) compared to global exchanges (e.g. Binance). The premium tends to rise when local demand is strong, influenced by investor sentiment and capital flow regulations in South Korea. ## What This Skill Does 1. **Fetches live exchange rate** — Retrieves the current USD/KRW rate from ExchangeRate-API 2. **Fetches Upbit BTC price** — Gets the latest Bitcoin price in KRW from the Upbit API 3. **Fetches Binance BTC price** — Gets the latest Bitcoin price in USD from the Binance API 4. **Calculates the premium** — Converts the Binance price to KRW, then compares it with the Upbit price to produce the premium percentage and the absolute price difference in KRW ## Example Output ```json { "timestamp": "2/1/2026, 2:20:00 PM", "exchange_rate": "1,380 KRW/USD", "upbit_btc": "145,000,000 KRW", "binance_btc": "105,000 USD", "kimchi_premium": "0.15%", "price_diff": "217,000 KRW" } ``` ## Usage ```bash node index.mjs ``` ## Technical Highlights - Zero external dependencies — uses only the Node.js built-in `https` module - Parallel API calls via `Promise.all` for fast response times - 5-second timeout for reliable error handling - Structured JSON output for easy parsing

path: index.mjs
content: import https from 'https';

export function fetchJson(url) {
  return new Promise((resolve, reject) => {
    const req = https.get(url, (res) => {
      if (res.statusCode < 200 || res.statusCode >= 300) {
        res.resume();
        reject(new Error(`HTTP ${res.statusCode} from ${url}`));
        return;
      }
      let data = '';
      res.on('data', chunk => data += chunk);
      res.on('end', () => {
        try {
          resolve(JSON.parse(data));
        } catch (e) {
          reject(new Error(`Invalid JSON from ${url}`));
        }
      });
    });
    req.on('error', reject);
    req.setTimeout(5000, () => {
      req.destroy();
      reject(new Error('Request Timeout'));
    });
  });
}

export function calculatePremium(rateData, upbitData, binanceData) {
  const exchangeRate = rateData?.rates?.KRW;
  if (typeof exchangeRate !== 'number' || exchangeRate <= 0) {
    throw new Error('Invalid exchange rate data');
  }

  const upbitPriceKRW = upbitData?.[0]?.trade_price;
  if (typeof upbitPriceKRW !== 'number' || upbitPriceKRW <= 0) {
    throw new Error('Invalid Upbit price data');
  }

  const binancePriceUSD = parseFloat(binanceData?.price);
  if (isNaN(binancePriceUSD) || binancePriceUSD <= 0) {
    throw new Error('Invalid Binance price data');
  }

  const binancePriceKRW = binancePriceUSD * exchangeRate;
  const premiumRate = ((upbitPriceKRW - binancePriceKRW) / binancePriceKRW) * 100;
  const priceDiff = upbitPriceKRW - binancePriceKRW;

  return {
    exchangeRate,
    upbitPriceKRW,
    binancePriceUSD,
    binancePriceKRW,
    premiumRate,
    priceDiff,
  };
}

async function main() {
  try {
    const [rateData, upbitData, binanceData] = await Promise.all([
      fetchJson('https://open.er-api.com/v6/latest/USD'),
      fetchJson('https://api.upbit.com/v1/ticker?markets=KRW-BTC'),
      fetchJson('https://api.binance.com/api/v3/ticker/price?symbol=BTCUSDT')
    ]);

    const result = calculatePremium(rateData, upbitData, binanceData);

    console.log(JSON.stringify({
      timestamp: new Date().toLocaleString(),
      exchange_rate: `${result.exchangeRate.toLocaleString()} KRW/USD`,
      upbit_btc: `${result.upbitPriceKRW.toLocaleString()} KRW`,
      binance_btc: `${result.binancePriceUSD.toLocaleString()} USD`,
      kimchi_premium: `${result.premiumRate.toFixed(2)}%`,
      price_diff: `${Math.floor(result.priceDiff).toLocaleString()} KRW`
    }, null, 2));

  } catch (error) {
    console.error(JSON.stringify({ error: error.message }));
  }
}

main();


Security scan verdicts — ClawScan: clean | static analysis: clean | VirusTotal: clean | SkillSpector: clean (LOW)