get_kimp
Calculate the Kimchi Premium (KIMP) for cryptocurrencies by comparing Korean exchange prices with international markets using Bithumb KRW pricing and Naver exchange rates.
Instructions
김치 프리미엄(KIMP)을 계산합니다. Bithumb의 KRW 가격과 Naver 환율 정보를 사용하여 실시간 김프를 계산합니다. USDT, USDC 같은 스테이블코인의 김프를 확인할 수 있습니다.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| symbol | No | 암호화폐 심볼 (예: USDT, USDC, BTC, ETH) | USDT |
Implementation Reference
- index.js:130-145 (registration)Registers the 'get_kimp' tool including its name, description, and input schema in the MCP server's tool list.{ name: 'get_kimp', description: '김치 프리미엄(KIMP)을 계산합니다. Bithumb의 KRW 가격과 Naver 환율 정보를 사용하여 실시간 김프를 계산합니다. USDT, USDC 같은 스테이블코인의 김프를 확인할 수 있습니다.', inputSchema: { type: 'object', properties: { symbol: { type: 'string', description: '암호화폐 심볼 (예: USDT, USDC, BTC, ETH)', default: 'USDT', }, }, required: [], }, },
- index.js:134-144 (schema)Input schema definition for the 'get_kimp' tool, specifying an optional 'symbol' parameter.inputSchema: { type: 'object', properties: { symbol: { type: 'string', description: '암호화폐 심볼 (예: USDT, USDC, BTC, ETH)', default: 'USDT', }, }, required: [], },
- index.js:181-214 (handler)MCP tool handler for 'get_kimp': extracts symbol argument, calls calculateKimp, and formats a user-friendly text response.case 'get_kimp': { const symbol = args?.symbol || 'USDT'; result = await calculateKimp(symbol); // 결과를 읽기 쉽게 포맷 let text = `📊 ${result.symbol} 김치 프리미엄 분석\n\n`; if (result.success) { text += `💰 Bithumb 가격: ${result.krwPrice.toLocaleString('ko-KR')} KRW\n`; text += `💱 현재 환율: ${result.exchangeRate.toLocaleString('ko-KR', { minimumFractionDigits: 2, maximumFractionDigits: 2 })} KRW/USD\n`; text += `💵 달러 환산 가격: $${result.usdPrice.toFixed(4)}\n\n`; if (result.kimp !== null) { const kimpSign = result.kimp >= 0 ? '+' : ''; text += `🔥 김치 프리미엄: ${kimpSign}${result.kimp.toFixed(2)}%\n`; text += `📈 차익: ${kimpSign}$${result.kimchiPremium.toFixed(4)}\n`; } else { text += `ℹ️ ${result.symbol}의 정확한 김프 계산을 위해서는 해외 거래소 가격이 필요합니다.\n`; } text += `\n⏰ 조회 시간: ${new Date(result.timestamp).toLocaleString('ko-KR')}`; } else { text += `❌ 오류: ${result.error}`; } return { content: [ { type: 'text', text: text, }, ], }; }
- index.js:66-108 (helper)Core helper function that fetches Bithumb price and exchange rate, computes USD equivalent and kimchi premium for stablecoins.async function calculateKimp(symbol = 'USDT') { try { // 1. Bithumb에서 KRW 가격 조회 const krwPrice = await bithumbPrice(symbol, 'KRW'); // 2. 환율 조회 const exchangeRate = await getExchangeRate(); // 3. 달러 기준 가격 계산 (KRW 가격 / 환율) const usdPrice = krwPrice / exchangeRate; // 4. 김치 프리미엄 계산 // USDT/USDC는 1달러 기준, 다른 코인은 해외 거래소 가격 필요 let kimp, kimchiPremium; if (symbol.toUpperCase() === 'USDT' || symbol.toUpperCase() === 'USDC') { // 스테이블코인: 1달러 대비 프리미엄 kimp = ((usdPrice - 1) / 1) * 100; kimchiPremium = usdPrice - 1; } else { // 다른 코인: 해외 가격 정보 없이 환율 기준만 표시 kimp = null; kimchiPremium = null; } return { success: true, symbol: symbol.toUpperCase(), krwPrice: krwPrice, exchangeRate: exchangeRate, usdPrice: usdPrice, kimp: kimp, kimchiPremium: kimchiPremium, timestamp: new Date().toISOString(), }; } catch (error) { return { success: false, error: error.message, timestamp: new Date().toISOString(), }; } }