🤖 AI Trading Assistant for Coinone Exchange
An intelligent trading skill that goes beyond simple API wrappers. Provides situational analysis, slippage calculation, and risk management for optimal trade execution.
npm install @1xp-ai/coinone-skillimport {
getTicker,
getOrderbook,
analyzeMarket,
calculateSlippage,
recommendOrderType
} from '@1xp-ai/coinone-skill';
// Get current BTC price
const ticker = await getTicker('BTC');
console.log(`BTC/KRW: ${ticker.last}`);
// Analyze market conditions
const orderbook = await getOrderbook('BTC');
const analysis = analyzeMarket(orderbook);
console.log(`Spread: ${analysis.spreadPercent?.toFixed(2)}%`);
console.log(`Market Imbalance: ${analysis.imbalance?.toFixed(2)}`);
// Get order recommendation
const orderType = recommendOrderType(analysis.spreadPercent!, 0.5);
console.log(`Recommended: ${orderType} order`);- Real-time ticker, orderbook, and trade data
- Spread/depth/imbalance metrics
- OHLCV chart data
- Slippage calculation before order
- Order type recommendation (LIMIT vs MARKET)
- Large order splitting
-
Balance/limits validation
-
Minimum order checks
-
Slippage threshold warnings
-
Public WS client with auto-reconnect
- Error code reference included in
skill/ERROR_CODES.md
Quote currency defaults to
KRWunless specified.
| Function | Description |
|---|---|
getTicker(target, quote?) |
Get current price |
getAllTickers(quote?) |
Get all market tickers |
getOrderbook(target, quote?, size?) |
Orderbook depth |
getRecentTrades(target, quote?) |
Recent trades |
getChart(target, quote?, interval?) |
OHLCV chart data |
getMarkets(quote?) |
Markets list |
getMarketInfo(target, quote?) |
Single market info |
getCurrencies() |
Supported currencies |
getRangeUnits(quote?) |
Tick/qty units |
getUTCTicker(target, quote?) |
UTC ticker (single) |
getAllUTCTickers(quote?) |
UTC tickers (all) |
| Function | Description |
|---|---|
getBalance(credentials) |
Account balances |
placeOrder(order, credentials) |
Place buy/sell order |
cancelOrder(orderId, credentials) |
Cancel an order |
getOpenOrders(quote, target, credentials) |
Open orders |
getCompletedOrders(quote, target, credentials) |
Completed orders |
| Function | Description |
|---|---|
analyzeMarket(orderbook) |
Market conditions |
calculateSlippage(levels, qty) |
Expected slippage |
recommendOrderType(spread, threshold) |
LIMIT/MARKET recommendation |
checkRisk(params) |
Risk validation |
splitOrder(qty, maxSize) |
Split large orders |
analyzeSnapshot(symbol, orderbook, trades) |
Advanced microstructure metrics |
Timezone: All time fields/examples use KST (Asia/Seoul) unless noted.
import { getBalance, placeOrder } from '@1xp-ai/coinone-skill';
const credentials = {
accessToken: process.env.COINONE_ACCESS_TOKEN!,
secretKey: process.env.COINONE_SECRET_KEY!
};
const balance = await getBalance(credentials);# Run all tests
npm test
# With coverage
npm run coverageCoverage: 94.62% statements ✅
coinone-skill/
├── src/
│ ├── api/
│ │ ├── public.ts # Public API endpoints
│ │ └── private.ts # Authenticated endpoints
│ ├── trading.ts # Trading logic & analysis
│ └── index.ts # Main exports
├── skill/ # Skill documentation (GitHub Pages)
│ ├── SKILL.md
│ ├── SECURITY.md
│ ├── HEARTBEAT.md
│ └── package.json
└── docs/ # Internal documentation
├── API.md
├── VERSIONING.md
└── TASKS.md
- Fork the repository
- Create feature branch (
git checkout -b feat/amazing-feature) - Commit changes (
git commit -m 'feat: add amazing feature') - Push to branch (
git push origin feat/amazing-feature) - Open a Pull Request
We use Conventional Commits:
feat:New feature (bumps minor version)fix:Bug fix (bumps patch version)feat!:/BREAKING CHANGE:Breaking change (bumps major version)docs:Documentation onlychore:Maintenance
MIT © 1XP-AI
Built with ❤️ by the 1XP-AI Team