The "Your Endpoint" Guide

To facilitate algobuilders in mining Sportstensor, we've developed an easy-way that only requires builders to setup a POST endpoint on their end that will receive and respond to prediction requests.

Support for Builders

Please get in touch via Discord / TG with @conidig who will be supporting you through the whole process.

1. Entry fee

To participate in the Sportstensor network, you need to pay an entry fee. This fee is dynamic and depends on the number of spots that have been registered in the last network epoch (roughly every 72 minutes). You can check the Registration Cost over SN41 taostats page.

To pay the registration fee, please send the equivalent amount in USDT (TRX20) to the following address TM6f3eGjydG5iRdGJFaPXqbZP35PL49mgS but not before you have your local environment setup to respond to prediction requests. Let's see how to do that:

2. Setting up your local environment

A POST endpoint is required on your end to receive and process requests, an example of a FastAPI application is the following:

from fastapi import FastAPI, HTTPException
from pydantic import BaseModel
import logging

# Initialize the FastAPI app
app = FastAPI()

# Configure logging
logging.basicConfig(level=logging.INFO)

# Define the request model
class PredictionRequest(BaseModel):
    homeTeamName: str
    awayTeamName: str
    matchDate: str
    league: str

# Define the inference endpoint
@app.post("/inference")
async def retreive_model_inference_result(request: PredictionRequest):
    try:
        # Log input data
        logging.info("Received prediction request: %s", request.dict())

        # Placeholder for custom model inference logic
        # Replace with actual model inference code
        # prediction = make_prediction(request.homeTeamName, request.awayTeamName, request.matchDate, request.league)
        # return {
        #     'choice': prediction.choice,
        #     'probability': prediction.probability
        # }
        return {
            'choice': 'HomeTeam',
            'probability': 0.2
        }
    except Exception as e:
        logging.error(f"Error inferencing models: {e}")
        raise HTTPException(status_code=500, detail="Internal server error.")

# Run the app
if __name__ == "__main__":
    import uvicorn
    uvicorn.run(app, host="0.0.0.0", port=31145)

Example of requests that your endpoint will receive:

{'homeTeamName': 'Utah Jazz', 'awayTeamName': 'San Antonio Spurs', 'matchDate': '2024-11-27T02:00:00Z', 'league': 'NBA'}

You can currently make predictions for NFL, MLB, EPL and MLS: Upcoming requests are visibile in our dashboard and Team Names for the leagues can be found in this repository.

Once your endpoint is ready and exposed to the public, please share it with the ST responsible person :)

3. Sponsorship

If you believe your model is exceptionally good we offer a sponsorship program to cover your registration fee. Please mind your TAO earnings will be used to repay the registration fee before taking home profit. Sponsorship is reserved for high conviction algobuilders - as in ones we believe will actually do well.

4. Monitoring and Adjusting

Once the miner is running, it’s essential to monitor performance and make adjustments as needed:

To assess the effectiveness of your miner, it’s essential to review performance metrics such as the Incentive Value. TAOstats.io provides a detailed performance overview for each miner, including specific metrics that reflect how well a miner is contributing to the network. For your miner on Sportstensor, you can view subnet 41-specific metrics. Your individual UID will be communicated to you by our support.

5. Using TAOstats to Evaluate Performance

  1. Visit the TAOstats Website: Go to TAOstats.io subnet 41-specific page.

  2. Understanding the Key Metrics: On the subnet 41 dashboard, you’ll see a list of all miners currently active on Sportstensor, along with performance indicators. The primary metrics you should focus on is:

    • Incentive Value: This is a crucial metric for evaluating a miner’s reward potential. The Incentive Value indicates how much TAO the network is currently willing to allocate to a miner based on the miner’s contributions.

  3. Locate Your Miner: Use your UID (the unique identifier you use for mining) to locate your specific miner on the subnet 41 performance page. You can search by UID or scroll through the list to find your miner.

  4. Analyzing the Incentive Value:

    • High Incentive Value: A high Incentive Value suggests that your miner is performing well, producing quality outputs, and earning substantial rewards.

    • Low Incentive Value: If the Incentive Value is low, it may indicate that your miner’s outputs are not as valued by the network and you'll be at risk of de-registration and forced to go again through the registration phase to re-partecipate. In this case, consider improving your model, adjusting configurations, or reviewing the quality of your predictions.

  5. Monitor Trends Over Time: TAOstats allows you to track these metrics over time. By observing changes in your miner’s Incentive Value, you can gauge the impact of any adjustments you make to improve performance.

  6. Adjustments Based on Performance: If your miner’s Incentive Value remains low, consider optimizing your model: Experiment with different machine learning models to improve the quality of outputs.

Last updated