High-Frequency Market Predictor
Predicts short-term price movement from tick data
License:
Decentralized
Generally available API for a market price using decentralized token economics.
Learn more about this licenseMetric Type
Sharpe Ratio
Current Baseline
2.4
Tokens per DeltaOne
1,000 hHMP
Est. Value per DeltaOne
AMM not deployed
Next step: register your model to create a new token and reward data contributions
Step 1: Install Hokusai ML Platform SDK
Install the SDK using pip:
pip install git+https://github.com/Hokusai-protocol/hokusai-data-pipeline.git#subdirectory=hokusai-ml-platformStep 2: Set up your environment
Configure your Hokusai API key (this authenticates both Hokusai and MLflow):
export HOKUSAI_API_KEY="your-hokusai-api-key-here"Note: Use your Hokusai API key, not an MLflow token. The Hokusai API key authenticates both services.
Verify your setup:
from hokusai.core import ModelRegistry
import os
# Verify API key is set
if not os.getenv("HOKUSAI_API_KEY"):
raise ValueError("Please set HOKUSAI_API_KEY environment variable")
# This should not raise any errors
registry = ModelRegistry()
print("✅ Hokusai ML Platform installed successfully!")Step 3: Register your model
Use this code to register your model with Hokusai:
Token ID Format:
- Accepts both uppercase and lowercase (e.g., "LSCOR", "lscor", "Lscor")
- Automatically normalized to uppercase for consistency
- Must contain only letters, numbers, and hyphens
- Cannot start or end with a hyphen
- Maximum 64 characters
import os
import mlflow
from hokusai.core import ModelRegistry
# Set up MLflow tracking URI
mlflow.set_tracking_uri("https://registry.hokus.ai/api/mlflow")
# IMPORTANT: Use your Hokusai API key, NOT an MLflow token
# The Hokusai API key authenticates both the registry and MLflow
os.environ["MLFLOW_TRACKING_TOKEN"] = os.getenv("HOKUSAI_API_KEY")
# Initialize registry
registry = ModelRegistry()
# Register your model
with mlflow.start_run() as run:
# Log your model (replace with your actual model)
mlflow.sklearn.log_model(
your_trained_model,
"model",
registered_model_name="High-Frequency Market Predictor"
)
# Register with Hokusai
model_uri = f"runs:/{run.info.run_id}/model"
registered_model = registry.register_tokenized_model(
model_uri=model_uri,
model_name="High-Frequency Market Predictor", # Changed from 'name'
token_id="hHMP", # Can be uppercase or lowercase
metric_name="accuracy", # Changed from 'benchmark_metric'
baseline_value=0.92, # Changed from 'benchmark_value' (now a float)
additional_tags={"author": "your-name", "version": "1.0"} # Changed from 'tags'
)
print(f"✅ Model registered successfully: {registered_model.name}")Parameters:
model_uri: Path to the MLflow model (e.g., "runs:/abc123/model")model_name: Name for the registered modeltoken_id: Unique token identifier (normalized to uppercase)metric_name: Performance metric name (e.g., "accuracy", "f1_score")baseline_value: Baseline performance value (numeric float)additional_tags: Optional metadata dictionary
Common Registration Errors:
TypeError: unexpected keyword argument 'name'
→ Use model_name instead of name
TypeError: unexpected keyword argument 'benchmark_metric'
→ Use metric_name instead of benchmark_metric
TypeError: unexpected keyword argument 'benchmark_value'
→ Use baseline_value instead of benchmark_value
TypeError: unexpected keyword argument 'tags'
→ Use additional_tags instead of tags
ValueError: baseline_value must be numeric
→ Remove quotes from number (use 0.92 not "0.92")