Date: April 15, 2026
Duration: 30 minutes
Status: Complete — Ready for SW23 implementation
Next: Integrate ticker endpoint into kraken_query.py
Document how to get current BCH/EUR price from Kraken’s public API for use in the escrow price feed. This fills a knowledge gap from RS017-019 which covered Balance/Trade/Withdraw but not price queries.
URL: https://api.kraken.com/0/public/Ticker
Method: GET
Authentication: None required (public endpoint)
Rate Limit: Not documented for public endpoints (assumed permissive)
Parameters:
pair (required): Currency pair, e.g., BCHEURExample request:
curl "https://api.kraken.com/0/public/Ticker?pair=BCHEUR"
Successful response:
{
"error": [],
"result": {
"BCHEUR": {
"a": ["373.810000", "1", "1.000"],
"b": ["373.570000", "1", "1.000"],
"c": ["373.540000", "0.30129519"],
"v": ["289.14403311", "313.55040886"],
"p": ["368.297120", "368.450088"],
"t": [420, 454],
"l": ["363.100000", "363.100000"],
"h": ["374.840000", "374.840000"],
"o": "370.860000"
}
}
}
| Field | Meaning | Format | Use Case |
|---|---|---|---|
a |
Ask price (sell offers) | [price, whole lot volume, lot volume] | Use this for buying BCH |
b |
Bid price (buy offers) | [price, whole lot volume, lot volume] | Use for selling BCH |
c |
Last trade closed | [price, lot volume] | Reference/display only |
v |
Volume | [today, last 24 hours] | Market activity indicator |
p |
Volume weighted average | [today, last 24 hours] | Average price |
t |
Number of trades | [today, last 24 hours] | Market activity |
l |
Low price | [today, last 24 hours] | Price range |
h |
High price | [today, last 24 hours] | Price range |
o |
Opening price | today | Daily reference |
Critical: All price arrays have price as first element: field[0]
Use: result["BCHEUR"]["a"][0] (ask price)
Reasoning:
Example from live data:
For buying: Always use ask (higher price, what we pay)
EUR → BCH amount:
ask_price = float(data["result"]["BCHEUR"]["a"][0])
bch_amount = eur_amount / ask_price
Example:
€100 / €373.81 = 0.2675 BCH
Error response format:
{
"error": ["EQuery:Unknown asset pair"],
"result": {}
}
Common errors:
EQuery:Unknown asset pair - Invalid pair name (try XBCHZEUR if BCHEUR fails)Recommended handling:
error array is emptyresult contains pair keyNot explicitly documented for public ticker endpoint
Conservative approach:
For SMS bridge:
import requests
def get_bch_eur_price():
"""
Get current BCH/EUR ask price from Kraken public API.
Returns price in EUR or None if error.
"""
try:
response = requests.get(
"https://api.kraken.com/0/public/Ticker",
params={"pair": "BCHEUR"},
timeout=10
)
data = response.json()
# Check for API errors
if data.get("error"):
print(f"Kraken API error: {data['error']}")
return None
# Extract ask price (what we pay to buy)
ask_price = float(data["result"]["BCHEUR"]["a"][0])
return ask_price
except (requests.RequestException, KeyError, ValueError) as e:
print(f"Error getting Kraken price: {e}")
return None
# Usage:
price = get_bch_eur_price()
if price:
print(f"Current BCH/EUR ask price: €{price:.2f}")
eur_amount = 100
bch_amount = eur_amount / price
print(f"€{eur_amount} = {bch_amount:.8f} BCH")
Expected output (based on live data):
Current BCH/EUR ask price: €373.81
€100 = 0.26752430 BCH
Current system uses: get_eur_to_bch() from get_price.py (external service)
Kraken ticker advantages:
Considerations:
Immediate (SW23):
get_bch_eur_price() to kraken_query.pyget_eur_to_bch() call in smsbridge_loop.pyFuture (when buying enabled):
Live test performed: 2026-04-15
BCHEUR (not XBCHZEUR) ✅Small spread = liquid market = good for PoC
RS017-019 covered:
RS036 adds:
Complete Kraken knowledge base now ready for SW23 implementation.
kraken_query.pyResearch completed: April 15, 2026
Prepared by: Suso (testing), Coordination (documentation)
Ready for: SW23 implementation
This research session completes the Kraken API knowledge base started in RS017-019.
---
## Order Book Depth (For Production Buying)
### Why Depth Matters
The Ticker endpoint only shows the **best ask price and volume at that level**. For larger purchases, you may need to buy across multiple price levels.
**Example:**
- Want: €1000 worth of BCH
- Level 1: €373.81 with 1 BCH available (€373.81)
- Level 2: €373.85 with 2.5 BCH available (€934.62)
- Must buy from both levels → Average price €373.83
### Depth Endpoint
**URL:** `https://api.kraken.com/0/public/Depth`
**Parameters:**
- `pair=BCHEUR`
- `count=10` (number of price levels, default 100)
**Request:**
```bash
curl "https://api.kraken.com/0/public/Depth?pair=BCHEUR&count=10"
Response format:
{
"result": {
"BCHEUR": {
"asks": [
["373.810000", "1.000", 1234567890],
["373.850000", "2.500", 1234567891],
...
],
"bids": [...]
}
}
}
Each ask: [price, volume, timestamp]
For PoC: Use simple market order (Kraken handles multi-level automatically)
For Production:
See: Future SW document for production buying implementation
Order book depth test:
Top 5 ask levels:
Total available: 3.84 BCH (€1,435)
Market impact simulation:
| Order Size | BCH Received | Avg Price | Slippage | Impact |
|---|---|---|---|---|
| €50 | 0.134 BCH | €373.79 | €0.01 | Negligible |
| €200 | 0.535 BCH | €373.79 | €0.02 | 0.005% - Tiny |
| €500 | 1.337 BCH | €373.79 | €0.02 | 0.005% - Tiny |
| €1,000 | 2.675 BCH | €373.80 | €0.05 | 0.013% - Minimal |
Conclusion: BCHEUR pair has sufficient liquidity for Asgaya’s use case. Even €1,000 transactions cause <0.02% slippage. No need for order splitting or advanced strategies for PoC/early production.
PoC transactions (€1-100): Zero market impact
Production (€100-1,000): Minimal impact (<0.02%)
Future consideration: Orders >€5,000 might need splitting
Location: ~/Documents/asgaya/knowledge/research/RS036_kraken_ticker_api.md
Then tomorrow’s SW23 can reference it: “See RS036 for endpoint details”
Knowledge gap filled! ✅
Want me to save this, or do you want to review/edit first? 📝