Skip to content
/ nof1api Public

Go SDK for the nof1.ai. Fetch AI trading model performance, positions, and PnL data with typed structs and helpers. Perfect for building dashboards, automations, or CLI tools in minutes.

Notifications You must be signed in to change notification settings

dm-vev/nof1api

Repository files navigation

nof1api

Go SDK for the nof1.ai account totals, trades and conversations endpoints.
It wraps the public API into typed models, request helpers, filters and ready-to-run examples so that you can build dashboards, automations or CLI tooling in minutes.

Installation

go get github.com/dm-vev/nof1api

Quick start

package main

import (
	"context"
	"fmt"

	"github.com/dm-vev/nof1api"
)

func main() {
	client := nof1api.NewClient()
	resp, err := client.AccountTotals(context.Background(), nof1api.WithLastMarker(200))
	if err != nil {
		panic(err)
	}

	fmt.Printf("Last marker: %d\n", resp.LastHourlyMarkerRead)
	for _, account := range resp.AccountTotals {
		fmt.Printf("%s equity=%.2f PnL=%.2f%%\n", account.ModelID, account.DollarEquity, account.CumPnLPct)
	}

	// Fetch the latest realized trades and print profitable ones.
	tradesResp, err := client.Trades(context.Background())
	if err != nil {
		panic(err)
	}
	for _, trade := range nof1api.FilterTrades(tradesResp.Trades, nof1api.TradeNetPnLAtLeast(100)) {
		fmt.Printf("%s %s %.2f USD\n", trade.ModelID, trade.Symbol, trade.RealizedNetPnL)
	}

	conversationsResp, err := client.Conversations(context.Background())
	if err != nil {
		panic(err)
	}
	for _, conv := range conversationsResp.Conversations {
		fmt.Printf("%s skill=%s signals=%d\n", conv.ID, conv.Skill, len(conv.LLMResponse))
	}
}

Ready-to-run examples

All examples live inside cmd/:

  • cmd/example: fetch totals starting from a marker and print everything with filters.
  • cmd/lastmarker: print only the latest marker (good for schedulers).
  • cmd/modelpositions: load a single model (configured via NOF1_MODEL_ID) and show profitable longs.
  • cmd/trades: list recent trades and filter them with NOF1_MODEL_ID, NOF1_SYMBOL and NOF1_MIN_REALIZED_PNL env vars.

Run any example with go run ./cmd/<name>.

Development

gofmt -w .
go test ./...

PRs and issues welcome!

nof1api

About

Go SDK for the nof1.ai. Fetch AI trading model performance, positions, and PnL data with typed structs and helpers. Perfect for building dashboards, automations, or CLI tools in minutes.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages