asianscore

package module
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 22, 2026 License: MIT Imports: 7 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

asianscore-go

Go Reference

Zero-dependency Go client and sports quantitative modeling library for AsianScore — real-time Football & NBA live scores, Dixon-Coles xG probabilities, Power odds devigging, fractional Kelly sizing, and pre-kickoff SHA-256 verifiable prediction ledger verification.

Install

go get github.com/AIYIXIU/asianscore-go@v1.0.1

Quickstart

package main

import (
    "context"
    "fmt"
    asianscore "github.com/AIYIXIU/asianscore-go"
)

func main() {
    summary, err := asianscore.FetchSummary(context.Background(), nil)
    if err != nil {
        panic(err)
    }
    fmt.Printf("Locked=%d Settled=%d AvgBrier=%.4f\n",
        summary.Ledger.TotalLocked, summary.Ledger.Settled, summary.Ledger.AvgBrier)

    fair, _ := asianscore.DevigPower([]float64{1.95, 3.50, 4.10})
    probs := asianscore.DixonColes(1.65, 1.05, -0.05)
    stake := asianscore.KellyFraction(probs.Home, 1.95, 0.25)
    fmt.Printf("Fair=%v HomeWin=%.3f Kelly=%.3f\n", fair, probs.Home, stake)
}

License

MIT License — see LICENSE.

Documentation

Overview

Package asianscore provides a zero-dependency Go client and quantitative sports modeling primitives for AsianScore (https://asianscore.com/).

Features:

Index

Constants

View Source
const DefaultSummaryURL = "https://asianscore.com/api/widget/summary"

DefaultSummaryURL is the public CORS-enabled AsianScore summary JSON endpoint.

Variables

This section is empty.

Functions

func DevigPower

func DevigPower(decimalOdds []float64) ([]float64, error)

DevigPower computes fair probabilities using the power devigging method.

func KellyFraction

func KellyFraction(fairProb, decimalOdds, scale float64) float64

KellyFraction computes fractional Kelly stake sizing given fair probability and decimal odds.

Types

type LedgerSummary

type LedgerSummary struct {
	TotalLocked int     `json:"totalLocked"`
	Settled     int     `json:"settled"`
	Hits        int     `json:"hits"`
	HitRatePct  float64 `json:"hitRatePct"`
	AvgBrier    float64 `json:"avgBrier"`
}

LedgerSummary holds aggregate SHA-256 verifiable prediction ledger metrics.

type MatchSummary

type MatchSummary struct {
	ID         string `json:"id"`
	League     string `json:"league"`
	State      string `json:"state"`
	Kickoff    string `json:"kickoff"`
	HomeTeam   string `json:"homeTeam"`
	AwayTeam   string `json:"awayTeam"`
	HomeScore  int    `json:"homeScore"`
	AwayScore  int    `json:"awayScore"`
	TopLabel   string `json:"topLabel"`
	TopProbPct int    `json:"topProbPct"`
	URL        string `json:"url"`
}

MatchSummary describes an upcoming or live fixture from AsianScore.

type OutcomeProbs

type OutcomeProbs struct {
	Home   float64
	Draw   float64
	Away   float64
	Over25 float64
}

OutcomeProbs holds 1X2 and Over 2.5 goal probabilities from Dixon-Coles.

func DixonColes

func DixonColes(lambdaHome, lambdaAway, rho float64) OutcomeProbs

DixonColes computes low-score correlated bivariate Poisson football probabilities.

type WidgetSummary

type WidgetSummary struct {
	Brand   string         `json:"brand"`
	Ledger  LedgerSummary  `json:"ledger"`
	Matches []MatchSummary `json:"matches"`
}

WidgetSummary is the top-level JSON payload returned by DefaultSummaryURL.

func FetchSummary

func FetchSummary(ctx context.Context, client *http.Client) (*WidgetSummary, error)

FetchSummary retrieves live scores and verifiable ledger metrics from AsianScore.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL