nansen

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2026 License: MIT Imports: 10 Imported by: 0

README

nansen-go

Nansen AI Golang SDK

Go Reference

A Go client for the Nansen AI API that tries to stay out of your way. No third-party dependencies, no surprises — just the standard library and an API that feels like the rest of your Go code.

Why you might like it

  • Nothing to vendor. The whole thing is built on the standard library. go get it and you're done — no dependency tree to audit.
  • Contexts everywhere. Every call takes a context.Context first, so timeouts and cancellation work exactly the way you'd expect.
  • Configured with options, not structs. WithBaseURL, WithHTTPClient, WithTimeout, WithRetry — mix and match what you need.
  • Safe to share. Create one client and hand it to as many goroutines as you like. No locks, no fuss.
  • Typed on purpose. Chains, sort fields, trader types, and labels are real constants. Optional request fields are pointers, so a stray false or 0 never sneaks into your JSON.
  • Errors you can actually inspect. Failures come back as an *APIError with the status code, message, raw body, and rate-limit headers — and they play nicely with errors.Is.
  • Retries when you want them. Opt in with WithRetry and the client backs off exponentially on 429s, honoring Retry-After, RateLimit-Reset, and X-RateLimit-Reset along the way.

Installation

go get github.com/tigusigalpa/nansen-go

Quick Start

package main

import (
    "context"
    "fmt"
    "log"
    "os"
    "time"

    "github.com/tigusigalpa/nansen-go"
)

func main() {
    client, err := nansen.New(os.Getenv("NANSEN_API_KEY"),
        nansen.WithTimeout(30*time.Second),
        nansen.WithRetry(3, 500*time.Millisecond, 5*time.Second),
    )
    if err != nil {
        log.Fatal(err)
    }

    ctx, cancel := context.WithTimeout(context.Background(), 15*time.Second)
    defer cancel()

    tf := nansen.Timeframe24H
    resp, err := client.TokenGodMode.TokenScreener(ctx, &nansen.TokenScreenerRequest{
        Chains: []nansen.Chain{nansen.ChainEthereum, nansen.ChainSolana},
        Timeframe: &tf,
        Pagination: &nansen.PaginationRequest{
            Page:    nansen.IntPtr(1),
            PerPage: nansen.IntPtr(20),
        },
    })
    if err != nil {
        log.Fatal(err)
    }

    for _, t := range resp.Data {
        fmt.Printf("%s on %s\n", t.TokenSymbol, t.Chain)
    }
}

You'll need a NANSEN_API_KEY — grab one from Nansen.

Configuring the client

Everything is optional. Pass only the options you care about; the rest fall back to sensible defaults.

client, err := nansen.New(apiKey,
    nansen.WithBaseURL("https://api.nansen.ai"),
    nansen.WithHTTPClient(&http.Client{Timeout: 10*time.Second}),
    nansen.WithTimeout(30*time.Second),
    nansen.WithRetry(3, 500*time.Millisecond, 5*time.Second),
)
Option Description
WithBaseURL Override the default base URL (https://api.nansen.ai).
WithHTTPClient Provide a custom *http.Client.
WithTimeout A default request timeout, used when your context doesn't already carry a deadline.
WithRetry Turns on automatic retries with exponential backoff. Takes max attempts, initial delay, and max delay.

What's available

The API surface is split into services that hang off the client:

  • client.SmartMoney — netflows, holdings, and DEX trades.
  • client.TokenGodMode — the token screener, flow intelligence, and who-bought-sold.
  • client.Profiler — current balances and DEX trade history for an address.
  • client.Portfolio — DeFi holdings.
  • client.Historical — the backtesting endpoints under /api/v1beta1/.

When things go wrong

Every API failure comes back as an *nansen.APIError, so you can dig into exactly what happened:

resp, err := client.SmartMoney.Netflow(ctx, req)
if err != nil {
    var apiErr *nansen.APIError
    if errors.As(err, &apiErr) {
        fmt.Println(apiErr.StatusCode)
        fmt.Println(apiErr.Message)
        fmt.Println(apiErr.RawBody)
        fmt.Println(apiErr.Headers.Get("RateLimit-Remaining"))
        if apiErr.RetryAfter != nil {
            fmt.Println("retry after:", *apiErr.RetryAfter)
        }
        if apiErr.RateLimitRemaining != nil {
            fmt.Println("requests remaining:", *apiErr.RateLimitRemaining)
        }
    }
}

If you just want to branch on the kind of failure, reach for errors.Is and the built-in sentinels:

if errors.Is(err, nansen.ErrRateLimited) { /* ... */ }
if errors.Is(err, nansen.ErrUnauthorized) { /* ... */ }
if errors.Is(err, nansen.ErrNotFound)      { /* ... */ }

About retries

Once you've called WithRetry, the client quietly retries a few situations for you:

  • 429 Too Many Requests — it waits according to Retry-After or RateLimit-Reset/X-RateLimit-Reset, and stashes RateLimit-Remaining/X-RateLimit-Remaining on the returned APIError in case you want to peek at your remaining quota.
  • Transient 5xx responses — the kind that usually clear up on a second try.
  • Flaky network errors — unless your context has already been cancelled.

Backoff grows exponentially but never exceeds the max delay you set. One thing worth knowing: your timeout budget (from WithTimeout or a deadline on the context) covers all the attempts together, not each one on its own — so you always stay within the bound you asked for.

Optional fields and pointer helpers

Optional request fields are pointers, which means false, 0, and empty strings only get sent when you actually mean them:

req := &nansen.TokenScreenerRequest{
    Chains: []nansen.Chain{nansen.ChainSolana},
    Filters: &nansen.TokenScreenerFilters{
        IncludeStablecoins: nansen.BoolPtr(false),
        MarketCapUSD: &nansen.NumericRangeFilter{
            Min: nansen.Float64Ptr(1_000_000),
            Max: nansen.Float64Ptr(50_000_000),
        },
    },
}

To keep that from getting tedious, there are little helpers for the common types:

  • StringPtr(s string) *string
  • IntPtr(i int) *int
  • BoolPtr(b bool) *bool
  • Float64Ptr(f float64) *float64

Examples

If you'd rather learn by running something, the examples directory has a few complete programs:

Point one at your API key and go:

NANSEN_API_KEY=your_api_key go run ./examples/screener

Endpoints covered

Smart Money
  • POST /api/v1/smart-money/netflow
  • POST /api/v1/smart-money/holdings
  • POST /api/v1/smart-money/dex-trades
Token God Mode & Screener
  • POST /api/v1/token-screener
  • POST /api/v1/tgm/flow-intelligence
  • POST /api/v1/tgm/who-bought-sold
Profiler
  • POST /api/v1/profiler/address/current-balance
  • POST /api/v1/profiler/dex-trades
Portfolio
  • POST /api/v1/portfolio/defi-holdings
Historical Data (Backtesting)
  • POST /api/v1beta1/tgm/historical-token-flow-summary
  • POST /api/v1beta1/smart-money/historical-token-balances

Testing

There's a unit test suite covering the retry/backoff logic, error mapping, and option validation. Run it the usual way:

go test ./...

License

MIT © Igor Sazonov. See LICENSE.

Documentation

Overview

Package nansen provides a fast, concurrent-safe, and idiomatic Go client for the Nansen AI API (https://docs.nansen.ai/).

The client has zero third-party dependencies, relying exclusively on the Go standard library (net/http, encoding/json, context, time). Every service method accepts a context.Context as its first argument to support timeouts and cancellation, and the Client (along with its services) is safe for concurrent use across multiple goroutines.

Construct a client with New, configuring it with functional options such as WithBaseURL, WithHTTPClient, WithTimeout, and WithRetry:

client, err := nansen.New(os.Getenv("NANSEN_API_KEY"),
    nansen.WithTimeout(30*time.Second),
    nansen.WithRetry(3, 500*time.Millisecond, 5*time.Second),
)

Endpoints are grouped into services exposed as fields on Client: SmartMoney, TokenGodMode, Profiler, Portfolio, and Historical.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound        = errors.New("nansen: resource not found")
	ErrUnauthorized    = errors.New("nansen: unauthorized")
	ErrRateLimited     = errors.New("nansen: rate limited")
	ErrBadRequest      = errors.New("nansen: bad request")
	ErrPaymentRequired = errors.New("nansen: payment required")
	ErrForbidden       = errors.New("nansen: forbidden")
	ErrValidation      = errors.New("nansen: validation error")
	ErrInternal        = errors.New("nansen: internal server error")
)

Functions

func BoolPtr

func BoolPtr(b bool) *bool

func Float64Ptr

func Float64Ptr(f float64) *float64

func IntPtr

func IntPtr(i int) *int

func StringPtr

func StringPtr(s string) *string

Pointer helpers make it easy to build JSON requests without sending zero-values.

Types

type APIError

type APIError struct {
	StatusCode int
	Message    string
	RawBody    []byte
	Headers    http.Header

	// RetryAfter is populated when the response included a Retry-After
	// header, expressing how long the caller should wait before retrying.
	RetryAfter *time.Duration

	// RateLimitRemaining reflects the RateLimit-Remaining or
	// X-RateLimit-Remaining header, when present, indicating how many
	// requests remain in the current rate-limit window.
	RateLimitRemaining *int
}

func (*APIError) Error

func (e *APIError) Error() string

func (*APIError) Is

func (e *APIError) Is(target error) bool

type BuyOrSell

type BuyOrSell string

BuyOrSell controls the trade direction for who-bought-sold queries.

const (
	Buy  BuyOrSell = "BUY"
	Sell BuyOrSell = "SELL"
)

type Chain

type Chain string

Chain represents a blockchain network supported across Nansen endpoints.

const (
	ChainAll         Chain = "all"
	ChainArbitrum    Chain = "arbitrum"
	ChainAvalanche   Chain = "avalanche"
	ChainBase        Chain = "base"
	ChainBitcoin     Chain = "bitcoin"
	ChainBNB         Chain = "bnb"
	ChainCitrea      Chain = "citrea"
	ChainEthereum    Chain = "ethereum"
	ChainHyperEVM    Chain = "hyperevm"
	ChainHyperliquid Chain = "hyperliquid"
	ChainInjective   Chain = "injective"
	ChainIotaEVM     Chain = "iotaevm"
	ChainLinea       Chain = "linea"
	ChainMantle      Chain = "mantle"
	ChainMantra      Chain = "mantra"
	ChainMonad       Chain = "monad"
	ChainNear        Chain = "near"
	ChainOptimism    Chain = "optimism"
	ChainPlasma      Chain = "plasma"
	ChainPolygon     Chain = "polygon"
	ChainRonin       Chain = "ronin"
	ChainScroll      Chain = "scroll"
	ChainSei         Chain = "sei"
	ChainSolana      Chain = "solana"
	ChainSonic       Chain = "sonic"
	ChainStarknet    Chain = "starknet"
	ChainSui         Chain = "sui"
	ChainTon         Chain = "ton"
	ChainTron        Chain = "tron"
)

type Client

type Client struct {
	SmartMoney   *SmartMoneyService
	TokenGodMode *TokenGodModeService
	Profiler     *ProfilerService
	Portfolio    *PortfolioService
	Historical   *HistoricalService
	// contains filtered or unexported fields
}

func New

func New(apiKey string, opts ...Option) (*Client, error)

type DateRange

type DateRange struct {
	From string `json:"from"`
	To   string `json:"to"`
}

DateRange is an explicit ISO-8601 interval.

type HistoricalService

type HistoricalService struct {
	// contains filtered or unexported fields
}

HistoricalService provides access to backtesting (v1beta1) endpoints.

func (*HistoricalService) HistoricalSmartMoneyTokenBalances

HistoricalSmartMoneyTokenBalances returns point-in-time smart-money token balances.

func (*HistoricalService) HistoricalTokenFlowSummary

HistoricalTokenFlowSummary returns temporally-correct token flow intelligence.

type HistoricalSmartMoneyFilterType

type HistoricalSmartMoneyFilterType string

HistoricalSmartMoneyFilterType enumerates the label types available for historical smart-money balances.

const (
	HistoricalLabelFund               HistoricalSmartMoneyFilterType = "Fund"
	HistoricalLabelSmartTrader        HistoricalSmartMoneyFilterType = "Smart Trader"
	HistoricalLabel30DSmartTrader     HistoricalSmartMoneyFilterType = "30D Smart Trader"
	HistoricalLabel90DSmartTrader     HistoricalSmartMoneyFilterType = "90D Smart Trader"
	HistoricalLabel180DSmartTrader    HistoricalSmartMoneyFilterType = "180D Smart Trader"
	HistoricalLabelSmartDexTrader     HistoricalSmartMoneyFilterType = "Smart Dex Trader"
	HistoricalLabel30DSmartDexTrader  HistoricalSmartMoneyFilterType = "30D Smart Dex Trader"
	HistoricalLabel90DSmartDexTrader  HistoricalSmartMoneyFilterType = "90D Smart Dex Trader"
	HistoricalLabel180DSmartDexTrader HistoricalSmartMoneyFilterType = "180D Smart Dex Trader"
	HistoricalLabelSmartHLPerpsTrader HistoricalSmartMoneyFilterType = "Smart HL Perps Trader"
)

type HoldingsSummary

type HoldingsSummary struct {
	TotalValueUSD   float64 `json:"total_value_usd"`
	TotalAssetsUSD  float64 `json:"total_assets_usd"`
	TotalDebtsUSD   float64 `json:"total_debts_usd"`
	TotalRewardsUSD float64 `json:"total_rewards_usd"`
	TokenCount      int     `json:"token_count"`
	ProtocolCount   int     `json:"protocol_count"`
}

type IntegerRangeFilter

type IntegerRangeFilter struct {
	Min *int `json:"min,omitempty"`
	Max *int `json:"max,omitempty"`
}

IntegerRangeFilter filters integer values by inclusive min/max bounds.

type NumericRangeFilter

type NumericRangeFilter struct {
	Min *float64 `json:"min,omitempty"`
	Max *float64 `json:"max,omitempty"`
}

NumericRangeFilter filters numeric values by inclusive min/max bounds.

type Option

type Option func(*Client) error

func WithBaseURL

func WithBaseURL(url string) Option

func WithHTTPClient

func WithHTTPClient(client *http.Client) Option

func WithRetry

func WithRetry(maxAttempts int, initialDelay, maxDelay time.Duration) Option

func WithTimeout

func WithTimeout(timeout time.Duration) Option

type PaginationInfo

type PaginationInfo struct {
	Page       int  `json:"page"`
	PerPage    int  `json:"per_page"`
	IsLastPage bool `json:"is_last_page"`
}

PaginationInfo is returned with paginated responses.

type PaginationRequest

type PaginationRequest struct {
	Page    *int `json:"page,omitempty"`
	PerPage *int `json:"per_page,omitempty"`
}

PaginationRequest controls paging. Pointer fields are omitted when nil so that the API applies its own defaults.

type PortfolioDefiHoldingsRequest

type PortfolioDefiHoldingsRequest struct {
	WalletAddress string `json:"wallet_address"`
}

type PortfolioDefiHoldingsResponse

type PortfolioDefiHoldingsResponse struct {
	Summary   HoldingsSummary   `json:"summary"`
	Protocols []ProtocolHolding `json:"protocols"`
}

type PortfolioService

type PortfolioService struct {
	// contains filtered or unexported fields
}

PortfolioService provides access to portfolio-level endpoints.

func (*PortfolioService) DeFiHoldings

DeFiHoldings returns simplified DeFi holdings for a wallet address.

type PositionType

type PositionType string

PositionType describes the role of a DeFi token position.

const (
	PositionDeposit PositionType = "deposit"
	PositionStake   PositionType = "stake"
	PositionBorrow  PositionType = "borrow"
	PositionMixed   PositionType = "mixed"
)

type ProfilerAddressBalancesFilters

type ProfilerAddressBalancesFilters struct {
	ValueUSD     *NumericRangeFilter `json:"value_usd,omitempty"`
	PriceUSD     *NumericRangeFilter `json:"price_usd,omitempty"`
	TokenAmount  *IntegerRangeFilter `json:"token_amount,omitempty"`
	TokenSymbol  interface{}         `json:"token_symbol,omitempty"`
	TokenAddress interface{}         `json:"token_address,omitempty"`
	TokenName    interface{}         `json:"token_name,omitempty"`
}

type ProfilerAddressBalancesRequest

type ProfilerAddressBalancesRequest struct {
	Address       string                          `json:"address,omitempty"`
	EntityName    string                          `json:"entity_name,omitempty"`
	Chain         Chain                           `json:"chain"`
	HideSpamToken *bool                           `json:"hide_spam_token,omitempty"`
	Filters       *ProfilerAddressBalancesFilters `json:"filters,omitempty"`
	Pagination    *PaginationRequest              `json:"pagination,omitempty"`
	OrderBy       []SortOrder                     `json:"order_by,omitempty"`
}

type ProfilerAddressBalancesResponse

type ProfilerAddressBalancesResponse struct {
	Data       []ProfilerBalance `json:"data"`
	Pagination PaginationInfo    `json:"pagination"`
}

type ProfilerAddressBalancesSortField

type ProfilerAddressBalancesSortField string

ProfilerAddressBalancesSortField enumerates the sortable balance fields.

const (
	BalanceSortValueUSD    ProfilerAddressBalancesSortField = "value_usd"
	BalanceSortTokenSymbol ProfilerAddressBalancesSortField = "token_symbol"
)

type ProfilerBalance

type ProfilerBalance struct {
	Chain        string   `json:"chain"`
	Address      string   `json:"address"`
	TokenAddress string   `json:"token_address"`
	TokenSymbol  string   `json:"token_symbol"`
	TokenName    *string  `json:"token_name,omitempty"`
	TokenAmount  *float64 `json:"token_amount,omitempty"`
	PriceUsd     *float64 `json:"price_usd,omitempty"`
	ValueUsd     *float64 `json:"value_usd,omitempty"`
}

type ProfilerDexTrade

type ProfilerDexTrade struct {
	Chain                string   `json:"chain"`
	BlockTimestamp       string   `json:"block_timestamp"`
	TransactionHash      string   `json:"transaction_hash"`
	TraderAddress        string   `json:"trader_address"`
	TraderAddressLabel   *string  `json:"trader_address_label,omitempty"`
	TokenBoughtAddress   string   `json:"token_bought_address"`
	TokenSoldAddress     string   `json:"token_sold_address"`
	TokenBoughtAmount    *float64 `json:"token_bought_amount,omitempty"`
	TokenSoldAmount      *float64 `json:"token_sold_amount,omitempty"`
	TokenBoughtSymbol    *string  `json:"token_bought_symbol,omitempty"`
	TokenSoldSymbol      *string  `json:"token_sold_symbol,omitempty"`
	TokenBoughtAgeDays   *int     `json:"token_bought_age_days,omitempty"`
	TokenSoldAgeDays     *int     `json:"token_sold_age_days,omitempty"`
	TokenBoughtMarketCap *float64 `json:"token_bought_market_cap,omitempty"`
	TokenSoldMarketCap   *float64 `json:"token_sold_market_cap,omitempty"`
	TokenBoughtFDV       *float64 `json:"token_bought_fdv,omitempty"`
	TokenSoldFDV         *float64 `json:"token_sold_fdv,omitempty"`
	TradeValueUSD        *float64 `json:"trade_value_usd,omitempty"`
}

type ProfilerDexTradeFilters

type ProfilerDexTradeFilters struct {
	TokenBoughtAddress   string              `json:"token_bought_address,omitempty"`
	TokenSoldAddress     string              `json:"token_sold_address,omitempty"`
	TokenBoughtSymbol    string              `json:"token_bought_symbol,omitempty"`
	TokenSoldSymbol      string              `json:"token_sold_symbol,omitempty"`
	TokenBoughtAmount    *NumericRangeFilter `json:"token_bought_amount,omitempty"`
	TokenSoldAmount      *NumericRangeFilter `json:"token_sold_amount,omitempty"`
	TokenBoughtAgeDays   *IntegerRangeFilter `json:"token_bought_age_days,omitempty"`
	TokenSoldAgeDays     *IntegerRangeFilter `json:"token_sold_age_days,omitempty"`
	TokenBoughtMarketCap *NumericRangeFilter `json:"token_bought_market_cap,omitempty"`
	TokenSoldMarketCap   *NumericRangeFilter `json:"token_sold_market_cap,omitempty"`
	TokenBoughtFDV       *NumericRangeFilter `json:"token_bought_fdv,omitempty"`
	TokenSoldFDV         *NumericRangeFilter `json:"token_sold_fdv,omitempty"`
	TradeValueUSD        *NumericRangeFilter `json:"trade_value_usd,omitempty"`
}

type ProfilerDexTradeRequest

type ProfilerDexTradeRequest struct {
	Address    string                   `json:"address"`
	Chain      Chain                    `json:"chain"`
	Date       DateRange                `json:"date"`
	Filters    *ProfilerDexTradeFilters `json:"filters,omitempty"`
	Pagination *PaginationRequest       `json:"pagination,omitempty"`
	OrderBy    []SortOrder              `json:"order_by,omitempty"`
}

type ProfilerDexTradeResponse

type ProfilerDexTradeResponse struct {
	Data       []ProfilerDexTrade `json:"data"`
	Pagination PaginationInfo     `json:"pagination"`
}

type ProfilerDexTradeSortField

type ProfilerDexTradeSortField string

ProfilerDexTradeSortField enumerates the sortable trade fields.

const (
	ProfilerDexSortChain                ProfilerDexTradeSortField = "chain"
	ProfilerDexSortBlockTimestamp       ProfilerDexTradeSortField = "block_timestamp"
	ProfilerDexSortTransactionHash      ProfilerDexTradeSortField = "transaction_hash"
	ProfilerDexSortTokenBoughtAmount    ProfilerDexTradeSortField = "token_bought_amount"
	ProfilerDexSortTokenSoldAmount      ProfilerDexTradeSortField = "token_sold_amount"
	ProfilerDexSortTokenBoughtSymbol    ProfilerDexTradeSortField = "token_bought_symbol"
	ProfilerDexSortTokenSoldSymbol      ProfilerDexTradeSortField = "token_sold_symbol"
	ProfilerDexSortTokenBoughtAgeDays   ProfilerDexTradeSortField = "token_bought_age_days"
	ProfilerDexSortTokenSoldAgeDays     ProfilerDexTradeSortField = "token_sold_age_days"
	ProfilerDexSortTokenBoughtMarketCap ProfilerDexTradeSortField = "token_bought_market_cap"
	ProfilerDexSortTokenSoldMarketCap   ProfilerDexTradeSortField = "token_sold_market_cap"
	ProfilerDexSortTokenBoughtFDV       ProfilerDexTradeSortField = "token_bought_fdv"
	ProfilerDexSortTokenSoldFDV         ProfilerDexTradeSortField = "token_sold_fdv"
	ProfilerDexSortTradeValueUSD        ProfilerDexTradeSortField = "trade_value_usd"
)

type ProfilerService

type ProfilerService struct {
	// contains filtered or unexported fields
}

ProfilerService provides access to wallet-level Profiler endpoints.

func (*ProfilerService) AddressCurrentBalance

AddressCurrentBalance returns current token balances for an address or entity.

func (*ProfilerService) AddressDEXTrades

AddressDEXTrades returns DEX trade history for a wallet address on a specific chain.

type ProtocolHolding

type ProtocolHolding struct {
	ProtocolName    string          `json:"protocol_name"`
	Chain           string          `json:"chain"`
	TotalValueUSD   float64         `json:"total_value_usd"`
	TotalAssetsUSD  float64         `json:"total_assets_usd"`
	TotalDebtsUSD   float64         `json:"total_debts_usd"`
	TotalRewardsUSD float64         `json:"total_rewards_usd"`
	Tokens          []ProtocolToken `json:"tokens"`
}

type ProtocolToken

type ProtocolToken struct {
	Address      *string      `json:"address,omitempty"`
	Symbol       *string      `json:"symbol,omitempty"`
	Amount       *float64     `json:"amount,omitempty"`
	ValueUSD     *float64     `json:"value_usd,omitempty"`
	PositionType PositionType `json:"position_type"`
}

type SmartMoneyDexTrade

type SmartMoneyDexTrade struct {
	Chain                string   `json:"chain"`
	BlockTimestamp       string   `json:"block_timestamp"`
	TransactionHash      string   `json:"transaction_hash"`
	TraderAddress        string   `json:"trader_address"`
	TraderAddressLabel   string   `json:"trader_address_label"`
	TokenBoughtAddress   string   `json:"token_bought_address"`
	TokenSoldAddress     string   `json:"token_sold_address"`
	TokenBoughtAmount    *float64 `json:"token_bought_amount,omitempty"`
	TokenSoldAmount      *float64 `json:"token_sold_amount,omitempty"`
	TokenBoughtSymbol    string   `json:"token_bought_symbol"`
	TokenSoldSymbol      string   `json:"token_sold_symbol"`
	TokenBoughtAgeDays   int      `json:"token_bought_age_days"`
	TokenSoldAgeDays     int      `json:"token_sold_age_days"`
	TokenBoughtMarketCap *float64 `json:"token_bought_market_cap,omitempty"`
	TokenSoldMarketCap   *float64 `json:"token_sold_market_cap,omitempty"`
	TokenBoughtFDV       *float64 `json:"token_bought_fdv,omitempty"`
	TokenSoldFDV         *float64 `json:"token_sold_fdv,omitempty"`
	TradeValueUSD        *float64 `json:"trade_value_usd,omitempty"`
}

type SmartMoneyDexTradesFilters

type SmartMoneyDexTradesFilters struct {
	IncludeSmartMoneyLabels []SmartMoneyLabel   `json:"include_smart_money_labels,omitempty"`
	ExcludeSmartMoneyLabels []SmartMoneyLabel   `json:"exclude_smart_money_labels,omitempty"`
	Chain                   interface{}         `json:"chain,omitempty"`
	TransactionHash         interface{}         `json:"transaction_hash,omitempty"`
	TraderAddress           interface{}         `json:"trader_address,omitempty"`
	TraderAddressLabel      interface{}         `json:"trader_address_label,omitempty"`
	TokenBoughtAddress      interface{}         `json:"token_bought_address,omitempty"`
	TokenSoldAddress        interface{}         `json:"token_sold_address,omitempty"`
	TokenBoughtAmount       *NumericRangeFilter `json:"token_bought_amount,omitempty"`
	TokenSoldAmount         *NumericRangeFilter `json:"token_sold_amount,omitempty"`
	TokenBoughtSymbol       interface{}         `json:"token_bought_symbol,omitempty"`
	TokenSoldSymbol         interface{}         `json:"token_sold_symbol,omitempty"`
	TokenBoughtAgeDays      *NumericRangeFilter `json:"token_bought_age_days,omitempty"`
	TokenSoldAgeDays        *NumericRangeFilter `json:"token_sold_age_days,omitempty"`
	TokenBoughtMarketCap    *NumericRangeFilter `json:"token_bought_market_cap,omitempty"`
	TokenSoldMarketCap      *NumericRangeFilter `json:"token_sold_market_cap,omitempty"`
	TokenBoughtFDV          *NumericRangeFilter `json:"token_bought_fdv,omitempty"`
	TokenSoldFDV            *NumericRangeFilter `json:"token_sold_fdv,omitempty"`
	TradeValueUSD           *NumericRangeFilter `json:"trade_value_usd,omitempty"`
}

type SmartMoneyDexTradesRequest

type SmartMoneyDexTradesRequest struct {
	Chains     []Chain                     `json:"chains"`
	Filters    *SmartMoneyDexTradesFilters `json:"filters,omitempty"`
	Pagination *PaginationRequest          `json:"pagination,omitempty"`
	OrderBy    []SortOrder                 `json:"order_by,omitempty"`
}

type SmartMoneyDexTradesResponse

type SmartMoneyDexTradesResponse struct {
	Data       []SmartMoneyDexTrade `json:"data"`
	Pagination PaginationInfo       `json:"pagination"`
}

type SmartMoneyDexTradesSortField

type SmartMoneyDexTradesSortField string

SmartMoneyDexTradesSortField enumerates the sortable fields for DEX trades.

const (
	DexTradesSortChain                SmartMoneyDexTradesSortField = "chain"
	DexTradesSortBlockTimestamp       SmartMoneyDexTradesSortField = "block_timestamp"
	DexTradesSortTransactionHash      SmartMoneyDexTradesSortField = "transaction_hash"
	DexTradesSortTraderAddress        SmartMoneyDexTradesSortField = "trader_address"
	DexTradesSortTraderAddressLabel   SmartMoneyDexTradesSortField = "trader_address_label"
	DexTradesSortTokenBoughtAddress   SmartMoneyDexTradesSortField = "token_bought_address"
	DexTradesSortTokenSoldAddress     SmartMoneyDexTradesSortField = "token_sold_address"
	DexTradesSortTokenBoughtAmount    SmartMoneyDexTradesSortField = "token_bought_amount"
	DexTradesSortTokenSoldAmount      SmartMoneyDexTradesSortField = "token_sold_amount"
	DexTradesSortTokenBoughtSymbol    SmartMoneyDexTradesSortField = "token_bought_symbol"
	DexTradesSortTokenSoldSymbol      SmartMoneyDexTradesSortField = "token_sold_symbol"
	DexTradesSortTokenBoughtAgeDays   SmartMoneyDexTradesSortField = "token_bought_age_days"
	DexTradesSortTokenSoldAgeDays     SmartMoneyDexTradesSortField = "token_sold_age_days"
	DexTradesSortTokenBoughtMarketCap SmartMoneyDexTradesSortField = "token_bought_market_cap"
	DexTradesSortTokenSoldMarketCap   SmartMoneyDexTradesSortField = "token_sold_market_cap"
	DexTradesSortTokenBoughtFDV       SmartMoneyDexTradesSortField = "token_bought_fdv"
	DexTradesSortTokenSoldFDV         SmartMoneyDexTradesSortField = "token_sold_fdv"
	DexTradesSortTradeValueUSD        SmartMoneyDexTradesSortField = "trade_value_usd"
)

type SmartMoneyHistoricalTokenBalance

type SmartMoneyHistoricalTokenBalance struct {
	Chain                   string   `json:"chain"`
	TokenAddress            string   `json:"token_address"`
	TokenSymbol             string   `json:"token_symbol"`
	TokenSectors            []string `json:"token_sectors,omitempty"`
	ValueUsd                *float64 `json:"value_usd,omitempty"`
	Balance24HPercentChange *float64 `json:"balance_24h_percent_change,omitempty"`
	HoldersCount            *int     `json:"holders_count,omitempty"`
	ShareOfHoldingsPercent  *float64 `json:"share_of_holdings_percent,omitempty"`
	TokenAgeDays            *int     `json:"token_age_days,omitempty"`
	MarketCapUsd            *float64 `json:"market_cap_usd,omitempty"`
}

type SmartMoneyHistoricalTokenBalancesFilters

type SmartMoneyHistoricalTokenBalancesFilters struct {
	SMFilter            []HistoricalSmartMoneyFilterType `json:"sm_filter,omitempty"`
	IncludeStablecoins  *bool                            `json:"include_stablecoins,omitempty"`
	IncludeNativeTokens *bool                            `json:"include_native_tokens,omitempty"`
	HoldersCount        *IntegerRangeFilter              `json:"holders_count,omitempty"`
}

type SmartMoneyHistoricalTokenBalancesRequest

type SmartMoneyHistoricalTokenBalancesRequest struct {
	AsOfDate             string                                    `json:"as_of_date"`
	Chains               []Chain                                   `json:"chains,omitempty"`
	Filters              *SmartMoneyHistoricalTokenBalancesFilters `json:"filters,omitempty"`
	ApplyBlacklistFilter *bool                                     `json:"apply_blacklist_filter,omitempty"`
	Pagination           *PaginationRequest                        `json:"pagination,omitempty"`
}

type SmartMoneyHistoricalTokenBalancesResponse

type SmartMoneyHistoricalTokenBalancesResponse struct {
	Data       []SmartMoneyHistoricalTokenBalance `json:"data"`
	Pagination PaginationInfo                     `json:"pagination"`
}

type SmartMoneyHolding

type SmartMoneyHolding struct {
	Chain                   string   `json:"chain"`
	TokenAddress            string   `json:"token_address"`
	TokenSymbol             string   `json:"token_symbol"`
	TokenSectors            []string `json:"token_sectors"`
	ValueUsd                *float64 `json:"value_usd,omitempty"`
	Balance24HPercentChange *float64 `json:"balance_24h_percent_change,omitempty"`
	HoldersCount            int      `json:"holders_count"`
	ShareOfHoldingsPercent  *float64 `json:"share_of_holdings_percent,omitempty"`
	TokenAgeDays            int      `json:"token_age_days"`
	MarketCapUsd            *float64 `json:"market_cap_usd,omitempty"`
}

type SmartMoneyHoldingsFilters

type SmartMoneyHoldingsFilters struct {
	IncludeSmartMoneyLabels []SmartMoneyLabel   `json:"include_smart_money_labels,omitempty"`
	ExcludeSmartMoneyLabels []SmartMoneyLabel   `json:"exclude_smart_money_labels,omitempty"`
	IncludeStablecoins      *bool               `json:"include_stablecoins,omitempty"`
	IncludeNativeTokens     *bool               `json:"include_native_tokens,omitempty"`
	ValueUSD                *NumericRangeFilter `json:"value_usd,omitempty"`
	Balance24HPercentChange *NumericRangeFilter `json:"balance_24h_percent_change,omitempty"`
	HoldersCount            *IntegerRangeFilter `json:"holders_count,omitempty"`
	ShareOfHoldingsPercent  *NumericRangeFilter `json:"share_of_holdings_percent,omitempty"`
	TokenAgeDays            *NumericRangeFilter `json:"token_age_days,omitempty"`
	MarketCapUSD            *NumericRangeFilter `json:"market_cap_usd,omitempty"`
	TokenAddress            interface{}         `json:"token_address,omitempty"`
	TokenSymbol             interface{}         `json:"token_symbol,omitempty"`
	TokenSectors            []string            `json:"token_sectors,omitempty"`
}

type SmartMoneyHoldingsRequest

type SmartMoneyHoldingsRequest struct {
	Chains     []Chain                    `json:"chains"`
	Filters    *SmartMoneyHoldingsFilters `json:"filters,omitempty"`
	Pagination *PaginationRequest         `json:"pagination,omitempty"`
	OrderBy    []SortOrder                `json:"order_by,omitempty"`
}

type SmartMoneyHoldingsResponse

type SmartMoneyHoldingsResponse struct {
	Data       []SmartMoneyHolding `json:"data"`
	Pagination PaginationInfo      `json:"pagination"`
}

type SmartMoneyHoldingsSortField

type SmartMoneyHoldingsSortField string

SmartMoneyHoldingsSortField enumerates the sortable fields for holdings.

const (
	HoldingsSortChain              SmartMoneyHoldingsSortField = "chain"
	HoldingsSortTokenAddress       SmartMoneyHoldingsSortField = "token_address"
	HoldingsSortTokenSymbol        SmartMoneyHoldingsSortField = "token_symbol"
	HoldingsSortValueUSD           SmartMoneyHoldingsSortField = "value_usd"
	HoldingsSortBalance24HChange   SmartMoneyHoldingsSortField = "balance_24h_percent_change"
	HoldingsSortHoldersCount       SmartMoneyHoldingsSortField = "holders_count"
	HoldingsSortShareOfHoldingsPct SmartMoneyHoldingsSortField = "share_of_holdings_percent"
	HoldingsSortTokenAgeDays       SmartMoneyHoldingsSortField = "token_age_days"
	HoldingsSortMarketCapUSD       SmartMoneyHoldingsSortField = "market_cap_usd"
)

type SmartMoneyLabel

type SmartMoneyLabel string

SmartMoneyLabel filters smart-money cohorts.

const (
	LabelFund               SmartMoneyLabel = "Fund"
	LabelSmartTrader        SmartMoneyLabel = "Smart Trader"
	Label30DSmartTrader     SmartMoneyLabel = "30D Smart Trader"
	Label90DSmartTrader     SmartMoneyLabel = "90D Smart Trader"
	Label180DSmartTrader    SmartMoneyLabel = "180D Smart Trader"
	LabelSmartHLPerpsTrader SmartMoneyLabel = "Smart HL Perps Trader"
)

type SmartMoneyNetflow

type SmartMoneyNetflow struct {
	TokenAddress  string   `json:"token_address"`
	TokenSymbol   string   `json:"token_symbol"`
	NetFlow1HUsd  *float64 `json:"net_flow_1h_usd,omitempty"`
	NetFlow24HUsd *float64 `json:"net_flow_24h_usd,omitempty"`
	NetFlow7DUsd  *float64 `json:"net_flow_7d_usd,omitempty"`
	NetFlow30DUsd *float64 `json:"net_flow_30d_usd,omitempty"`
	Chain         string   `json:"chain"`
	TokenSectors  []string `json:"token_sectors"`
	TraderCount   int      `json:"trader_count"`
	TokenAgeDays  int      `json:"token_age_days"`
	MarketCapUsd  *float64 `json:"market_cap_usd,omitempty"`
}

type SmartMoneyNetflowFilters

type SmartMoneyNetflowFilters struct {
	IncludeSmartMoneyLabels []SmartMoneyLabel   `json:"include_smart_money_labels,omitempty"`
	ExcludeSmartMoneyLabels []SmartMoneyLabel   `json:"exclude_smart_money_labels,omitempty"`
	TokenAddress            interface{}         `json:"token_address,omitempty"`
	IncludeStablecoins      *bool               `json:"include_stablecoins,omitempty"`
	IncludeNativeTokens     *bool               `json:"include_native_tokens,omitempty"`
	TokenSector             []string            `json:"token_sector,omitempty"`
	TraderCount             *IntegerRangeFilter `json:"trader_count,omitempty"`
	TokenAgeDays            *NumericRangeFilter `json:"token_age_days,omitempty"`
	MarketCapUSD            *NumericRangeFilter `json:"market_cap_usd,omitempty"`
}

type SmartMoneyNetflowRequest

type SmartMoneyNetflowRequest struct {
	Chains     []Chain                   `json:"chains"`
	Filters    *SmartMoneyNetflowFilters `json:"filters,omitempty"`
	Pagination *PaginationRequest        `json:"pagination,omitempty"`
	OrderBy    []SortOrder               `json:"order_by,omitempty"`
}

type SmartMoneyNetflowResponse

type SmartMoneyNetflowResponse struct {
	Data       []SmartMoneyNetflow `json:"data"`
	Pagination PaginationInfo      `json:"pagination"`
}

type SmartMoneyNetflowSortField

type SmartMoneyNetflowSortField string

SmartMoneyNetflowSortField enumerates the sortable fields for netflows.

const (
	NetflowSortChain         SmartMoneyNetflowSortField = "chain"
	NetflowSortTokenAddress  SmartMoneyNetflowSortField = "token_address"
	NetflowSortTokenSymbol   SmartMoneyNetflowSortField = "token_symbol"
	NetflowSortNetFlow1HUSD  SmartMoneyNetflowSortField = "net_flow_1h_usd"
	NetflowSortNetFlow24HUSD SmartMoneyNetflowSortField = "net_flow_24h_usd"
	NetflowSortNetFlow7DUSD  SmartMoneyNetflowSortField = "net_flow_7d_usd"
	NetflowSortNetFlow30DUSD SmartMoneyNetflowSortField = "net_flow_30d_usd"
	NetflowSortTokenSectors  SmartMoneyNetflowSortField = "token_sectors"
	NetflowSortTraderCount   SmartMoneyNetflowSortField = "trader_count"
	NetflowSortTokenAgeDays  SmartMoneyNetflowSortField = "token_age_days"
	NetflowSortMarketCapUSD  SmartMoneyNetflowSortField = "market_cap_usd"
)

type SmartMoneyService

type SmartMoneyService struct {
	// contains filtered or unexported fields
}

SmartMoneyService provides access to Smart Money endpoints.

func (*SmartMoneyService) DEXTrades

DEXTrades returns real-time DEX trading activity from smart money.

func (*SmartMoneyService) Holdings

Holdings returns aggregated token balances held by smart money.

func (*SmartMoneyService) Netflow

Netflow returns net capital flows for smart money wallets.

type SortDirection

type SortDirection string

SortDirection controls ordering of result sets.

const (
	SortAsc  SortDirection = "ASC"
	SortDesc SortDirection = "DESC"
)

type SortOrder

type SortOrder struct {
	Field     string        `json:"field"`
	Direction SortDirection `json:"direction"`
}

SortOrder describes a single field/direction pair.

type TGMFlowIntelligence

type TGMFlowIntelligence struct {
	PublicFigureNetFlowUSD  *float64 `json:"public_figure_net_flow_usd,omitempty"`
	PublicFigureAvgFlowUSD  *float64 `json:"public_figure_avg_flow_usd,omitempty"`
	PublicFigureWalletCount *int     `json:"public_figure_wallet_count,omitempty"`
	TopPnLNetFlowUSD        *float64 `json:"top_pnl_net_flow_usd,omitempty"`
	TopPnLAvgFlowUSD        *float64 `json:"top_pnl_avg_flow_usd,omitempty"`
	TopPnLWalletCount       *int     `json:"top_pnl_wallet_count,omitempty"`
	WhaleNetFlowUSD         *float64 `json:"whale_net_flow_usd,omitempty"`
	WhaleAvgFlowUSD         *float64 `json:"whale_avg_flow_usd,omitempty"`
	WhaleWalletCount        *int     `json:"whale_wallet_count,omitempty"`
	SmartTraderNetFlowUSD   *float64 `json:"smart_trader_net_flow_usd,omitempty"`
	SmartTraderAvgFlowUSD   *float64 `json:"smart_trader_avg_flow_usd,omitempty"`
	SmartTraderWalletCount  *int     `json:"smart_trader_wallet_count,omitempty"`
	ExchangeNetFlowUSD      *float64 `json:"exchange_net_flow_usd,omitempty"`
	ExchangeAvgFlowUSD      *float64 `json:"exchange_avg_flow_usd,omitempty"`
	ExchangeWalletCount     *int     `json:"exchange_wallet_count,omitempty"`
	FreshWalletsNetFlowUSD  *float64 `json:"fresh_wallets_net_flow_usd,omitempty"`
	FreshWalletsAvgFlowUSD  *float64 `json:"fresh_wallets_avg_flow_usd,omitempty"`
	FreshWalletsWalletCount *int     `json:"fresh_wallets_wallet_count,omitempty"`
}

type TGMFlowIntelligenceFilters

type TGMFlowIntelligenceFilters struct {
	PublicFigureNetFlowUSD  *NumericRangeFilter `json:"public_figure_net_flow_usd,omitempty"`
	PublicFigureAvgFlowUSD  *NumericRangeFilter `json:"public_figure_avg_flow_usd,omitempty"`
	PublicFigureWalletCount *IntegerRangeFilter `json:"public_figure_wallet_count,omitempty"`
	TopPnLNetFlowUSD        *NumericRangeFilter `json:"top_pnl_net_flow_usd,omitempty"`
	TopPnLAvgFlowUSD        *NumericRangeFilter `json:"top_pnl_avg_flow_usd,omitempty"`
	TopPnLWalletCount       *IntegerRangeFilter `json:"top_pnl_wallet_count,omitempty"`
	WhaleNetFlowUSD         *NumericRangeFilter `json:"whale_net_flow_usd,omitempty"`
	WhaleAvgFlowUSD         *NumericRangeFilter `json:"whale_avg_flow_usd,omitempty"`
	WhaleWalletCount        *IntegerRangeFilter `json:"whale_wallet_count,omitempty"`
	SmartTraderNetFlowUSD   *NumericRangeFilter `json:"smart_trader_net_flow_usd,omitempty"`
	SmartTraderAvgFlowUSD   *NumericRangeFilter `json:"smart_trader_avg_flow_usd,omitempty"`
	SmartTraderWalletCount  *IntegerRangeFilter `json:"smart_trader_wallet_count,omitempty"`
	ExchangeNetFlowUSD      *NumericRangeFilter `json:"exchange_net_flow_usd,omitempty"`
	ExchangeAvgFlowUSD      *NumericRangeFilter `json:"exchange_avg_flow_usd,omitempty"`
	ExchangeWalletCount     *IntegerRangeFilter `json:"exchange_wallet_count,omitempty"`
	FreshWalletsNetFlowUSD  *NumericRangeFilter `json:"fresh_wallets_net_flow_usd,omitempty"`
	FreshWalletsAvgFlowUSD  *NumericRangeFilter `json:"fresh_wallets_avg_flow_usd,omitempty"`
	FreshWalletsWalletCount *IntegerRangeFilter `json:"fresh_wallets_wallet_count,omitempty"`
}

type TGMFlowIntelligenceRequest

type TGMFlowIntelligenceRequest struct {
	Chain        Chain                         `json:"chain"`
	TokenAddress string                        `json:"token_address"`
	Timeframe    *TGMFlowIntelligenceTimeframe `json:"timeframe,omitempty"`
	Filters      *TGMFlowIntelligenceFilters   `json:"filters,omitempty"`
}

type TGMFlowIntelligenceResponse

type TGMFlowIntelligenceResponse struct {
	Data     []TGMFlowIntelligence `json:"data"`
	Warnings []string              `json:"warnings,omitempty"`
}

type TGMFlowIntelligenceTimeframe

type TGMFlowIntelligenceTimeframe string

TGMFlowIntelligenceTimeframe enumerates the supported flow-intelligence windows.

const (
	FlowTimeframe5M  TGMFlowIntelligenceTimeframe = "5m"
	FlowTimeframe1H  TGMFlowIntelligenceTimeframe = "1h"
	FlowTimeframe6H  TGMFlowIntelligenceTimeframe = "6h"
	FlowTimeframe12H TGMFlowIntelligenceTimeframe = "12h"
	FlowTimeframe1D  TGMFlowIntelligenceTimeframe = "1d"
	FlowTimeframe7D  TGMFlowIntelligenceTimeframe = "7d"
)

type TGMHistoricalTokenFlowSummary

type TGMHistoricalTokenFlowSummary struct {
	TokenSymbol             *string  `json:"token_symbol,omitempty"`
	PublicFigureNetFlowUSD  *float64 `json:"public_figure_net_flow_usd,omitempty"`
	PublicFigureAvgFlowUSD  *float64 `json:"public_figure_avg_flow_usd,omitempty"`
	PublicFigureWalletCount *int     `json:"public_figure_wallet_count,omitempty"`
	TopPnLNetFlowUSD        *float64 `json:"top_pnl_net_flow_usd,omitempty"`
	TopPnLAvgFlowUSD        *float64 `json:"top_pnl_avg_flow_usd,omitempty"`
	TopPnLWalletCount       *int     `json:"top_pnl_wallet_count,omitempty"`
	WhaleNetFlowUSD         *float64 `json:"whale_net_flow_usd,omitempty"`
	WhaleAvgFlowUSD         *float64 `json:"whale_avg_flow_usd,omitempty"`
	WhaleWalletCount        *int     `json:"whale_wallet_count,omitempty"`
	ExchangeNetFlowUSD      *float64 `json:"exchange_net_flow_usd,omitempty"`
	ExchangeAvgFlowUSD      *float64 `json:"exchange_avg_flow_usd,omitempty"`
	ExchangeWalletCount     *int     `json:"exchange_wallet_count,omitempty"`
	SmartTraderNetFlowUSD   *float64 `json:"smart_trader_net_flow_usd,omitempty"`
	SmartTraderAvgFlowUSD   *float64 `json:"smart_trader_avg_flow_usd,omitempty"`
	SmartTraderWalletCount  *int     `json:"smart_trader_wallet_count,omitempty"`
	FreshWalletsNetFlowUSD  *float64 `json:"fresh_wallets_net_flow_usd,omitempty"`
	FreshWalletsAvgFlowUSD  *float64 `json:"fresh_wallets_avg_flow_usd,omitempty"`
	FreshWalletsWalletCount *int     `json:"fresh_wallets_wallet_count,omitempty"`
}

type TGMHistoricalTokenFlowSummaryRequest

type TGMHistoricalTokenFlowSummaryRequest struct {
	Chain                Chain     `json:"chain"`
	TokenAddress         string    `json:"token_address"`
	DateRange            DateRange `json:"date_range"`
	ApplyBlacklistFilter *bool     `json:"apply_blacklist_filter,omitempty"`
}

type TGMHistoricalTokenFlowSummaryResponse

type TGMHistoricalTokenFlowSummaryResponse struct {
	Data     []TGMHistoricalTokenFlowSummary `json:"data"`
	Warnings []string                        `json:"warnings,omitempty"`
}

type TGMWhoBoughtSold

type TGMWhoBoughtSold struct {
	Address           string   `json:"address"`
	AddressLabel      *string  `json:"address_label,omitempty"`
	BoughtTokenVolume *float64 `json:"bought_token_volume,omitempty"`
	SoldTokenVolume   *float64 `json:"sold_token_volume,omitempty"`
	TokenTradeVolume  *float64 `json:"token_trade_volume,omitempty"`
	BoughtVolumeUSD   *float64 `json:"bought_volume_usd,omitempty"`
	SoldVolumeUSD     *float64 `json:"sold_volume_usd,omitempty"`
	TradeVolumeUSD    *float64 `json:"trade_volume_usd,omitempty"`
}

type TGMWhoBoughtSoldFilters

type TGMWhoBoughtSoldFilters struct {
	IncludeSmartMoneyLabels []SmartMoneyLabel   `json:"include_smart_money_labels,omitempty"`
	ExcludeSmartMoneyLabels []SmartMoneyLabel   `json:"exclude_smart_money_labels,omitempty"`
	Address                 interface{}         `json:"address,omitempty"`
	AddressLabel            interface{}         `json:"address_label,omitempty"`
	BoughtTokenVolume       *NumericRangeFilter `json:"bought_token_volume,omitempty"`
	SoldTokenVolume         *NumericRangeFilter `json:"sold_token_volume,omitempty"`
	TokenTradeVolume        *NumericRangeFilter `json:"token_trade_volume,omitempty"`
	BoughtVolumeUSD         *NumericRangeFilter `json:"bought_volume_usd,omitempty"`
	SoldVolumeUSD           *NumericRangeFilter `json:"sold_volume_usd,omitempty"`
	TradeVolumeUSD          *NumericRangeFilter `json:"trade_volume_usd,omitempty"`
}

type TGMWhoBoughtSoldRequest

type TGMWhoBoughtSoldRequest struct {
	Chain        Chain                    `json:"chain"`
	TokenAddress string                   `json:"token_address"`
	BuyOrSell    *BuyOrSell               `json:"buy_or_sell,omitempty"`
	Date         DateRange                `json:"date"`
	Pagination   *PaginationRequest       `json:"pagination,omitempty"`
	Filters      *TGMWhoBoughtSoldFilters `json:"filters,omitempty"`
	OrderBy      []SortOrder              `json:"order_by,omitempty"`
}

type TGMWhoBoughtSoldResponse

type TGMWhoBoughtSoldResponse struct {
	Data       []TGMWhoBoughtSold `json:"data"`
	Pagination PaginationInfo     `json:"pagination"`
}

type TGMWhoBoughtSoldSortField

type TGMWhoBoughtSoldSortField string

TGMWhoBoughtSoldSortField enumerates the sortable fields.

const (
	WhoBoughtSoldSortBoughtVolumeUSD   TGMWhoBoughtSoldSortField = "bought_volume_usd"
	WhoBoughtSoldSortSoldVolumeUSD     TGMWhoBoughtSoldSortField = "sold_volume_usd"
	WhoBoughtSoldSortTokenTradeVolume  TGMWhoBoughtSoldSortField = "token_trade_volume"
	WhoBoughtSoldSortTradeVolumeUSD    TGMWhoBoughtSoldSortField = "trade_volume_usd"
	WhoBoughtSoldSortBoughtTokenVolume TGMWhoBoughtSoldSortField = "bought_token_volume"
	WhoBoughtSoldSortSoldTokenVolume   TGMWhoBoughtSoldSortField = "sold_token_volume"
)

type TokenGodModeService

type TokenGodModeService struct {
	// contains filtered or unexported fields
}

TokenGodModeService provides access to Token God Mode and Screener endpoints.

func (*TokenGodModeService) FlowIntelligence

FlowIntelligence returns token flow summaries broken down by holder segments.

func (*TokenGodModeService) TokenScreener

TokenScreener discovers and screens tokens across multiple blockchains.

func (*TokenGodModeService) WhoBoughtSold

WhoBoughtSold returns aggregated summaries of token buyers or sellers.

type TokenScreenerFilters

type TokenScreenerFilters struct {
	TokenAddress            interface{}         `json:"token_address,omitempty"`
	TokenSymbol             interface{}         `json:"token_symbol,omitempty"`
	OnlySmartMoney          *bool               `json:"only_smart_money,omitempty"`
	TraderType              *TraderType         `json:"trader_type,omitempty"`
	Sectors                 []string            `json:"sectors,omitempty"`
	ExcludeSectors          []string            `json:"exclude_sectors,omitempty"`
	TokenAgeDays            *NumericRangeFilter `json:"token_age_days,omitempty"`
	MarketCapUSD            *NumericRangeFilter `json:"market_cap_usd,omitempty"`
	Liquidity               *NumericRangeFilter `json:"liquidity,omitempty"`
	PriceUSD                *NumericRangeFilter `json:"price_usd,omitempty"`
	PriceChange             *NumericRangeFilter `json:"price_change,omitempty"`
	FDV                     *NumericRangeFilter `json:"fdv,omitempty"`
	FDVMCRatio              *NumericRangeFilter `json:"fdv_mc_ratio,omitempty"`
	NofBuyers               *IntegerRangeFilter `json:"nof_buyers,omitempty"`
	NofTraders              *IntegerRangeFilter `json:"nof_traders,omitempty"`
	NofSellers              *IntegerRangeFilter `json:"nof_sellers,omitempty"`
	NofBuys                 *IntegerRangeFilter `json:"nof_buys,omitempty"`
	NofSells                *IntegerRangeFilter `json:"nof_sells,omitempty"`
	BuyVolume               *NumericRangeFilter `json:"buy_volume,omitempty"`
	SellVolume              *NumericRangeFilter `json:"sell_volume,omitempty"`
	Volume                  *NumericRangeFilter `json:"volume,omitempty"`
	Netflow                 *NumericRangeFilter `json:"netflow,omitempty"`
	InflowFDVRatio          *NumericRangeFilter `json:"inflow_fdv_ratio,omitempty"`
	OutflowFDVRatio         *NumericRangeFilter `json:"outflow_fdv_ratio,omitempty"`
	IncludeStablecoins      *bool               `json:"include_stablecoins,omitempty"`
	IncludeSmartMoneyLabels []SmartMoneyLabel   `json:"include_smart_money_labels,omitempty"`
	ExcludeSmartMoneyLabels []SmartMoneyLabel   `json:"exclude_smart_money_labels,omitempty"`
}

type TokenScreenerRequest

type TokenScreenerRequest struct {
	Chains     []Chain                 `json:"chains"`
	Timeframe  *TokenScreenerTimeframe `json:"timeframe,omitempty"`
	Date       *DateRange              `json:"date,omitempty"`
	Pagination *PaginationRequest      `json:"pagination,omitempty"`
	Filters    *TokenScreenerFilters   `json:"filters,omitempty"`
	OrderBy    []SortOrder             `json:"order_by,omitempty"`
}

type TokenScreenerResponse

type TokenScreenerResponse struct {
	Data       []TokenScreenerResult `json:"data"`
	Pagination PaginationInfo        `json:"pagination"`
}

type TokenScreenerResult

type TokenScreenerResult struct {
	Chain               string   `json:"chain"`
	TokenAddress        string   `json:"token_address"`
	TokenSymbol         string   `json:"token_symbol"`
	TokenAgeDays        *float64 `json:"token_age_days,omitempty"`
	TokenAgeHours       *float64 `json:"token_age_hours,omitempty"`
	TokenDeploymentDate *string  `json:"token_deployment_date,omitempty"`
	MarketCapUSD        *float64 `json:"market_cap_usd,omitempty"`
	Liquidity           *float64 `json:"liquidity,omitempty"`
	PriceUSD            *float64 `json:"price_usd,omitempty"`
	PriceChange         *float64 `json:"price_change,omitempty"`
	FDV                 *float64 `json:"fdv,omitempty"`
	FDVMCRatio          *float64 `json:"fdv_mc_ratio,omitempty"`
	NofTraders          *int     `json:"nof_traders,omitempty"`
	NofBuyers           *int     `json:"nof_buyers,omitempty"`
	NofSellers          *int     `json:"nof_sellers,omitempty"`
	NofBuys             *int     `json:"nof_buys,omitempty"`
	NofSells            *int     `json:"nof_sells,omitempty"`
	BuyVolume           *float64 `json:"buy_volume,omitempty"`
	SellVolume          *float64 `json:"sell_volume,omitempty"`
	Volume              *float64 `json:"volume,omitempty"`
	Netflow             *float64 `json:"netflow,omitempty"`
	InflowFDVRatio      *float64 `json:"inflow_fdv_ratio,omitempty"`
	OutflowFDVRatio     *float64 `json:"outflow_fdv_ratio,omitempty"`
}

type TokenScreenerSortField

type TokenScreenerSortField string

TokenScreenerSortField enumerates the sortable fields for the token screener.

const (
	ScreenerSortChain           TokenScreenerSortField = "chain"
	ScreenerSortTokenAddress    TokenScreenerSortField = "token_address"
	ScreenerSortTokenSymbol     TokenScreenerSortField = "token_symbol"
	ScreenerSortMarketCapUSD    TokenScreenerSortField = "market_cap_usd"
	ScreenerSortVolume          TokenScreenerSortField = "volume"
	ScreenerSortLiquidity       TokenScreenerSortField = "liquidity"
	ScreenerSortNofTraders      TokenScreenerSortField = "nof_traders"
	ScreenerSortNofBuyers       TokenScreenerSortField = "nof_buyers"
	ScreenerSortNofSellers      TokenScreenerSortField = "nof_sellers"
	ScreenerSortNofBuys         TokenScreenerSortField = "nof_buys"
	ScreenerSortNofSells        TokenScreenerSortField = "nof_sells"
	ScreenerSortPriceChange     TokenScreenerSortField = "price_change"
	ScreenerSortPriceUSD        TokenScreenerSortField = "price_usd"
	ScreenerSortNetflow         TokenScreenerSortField = "netflow"
	ScreenerSortBuyVolume       TokenScreenerSortField = "buy_volume"
	ScreenerSortSellVolume      TokenScreenerSortField = "sell_volume"
	ScreenerSortFDV             TokenScreenerSortField = "fdv"
	ScreenerSortFDVMCRatio      TokenScreenerSortField = "fdv_mc_ratio"
	ScreenerSortInflowFDVRatio  TokenScreenerSortField = "inflow_fdv_ratio"
	ScreenerSortOutflowFDVRatio TokenScreenerSortField = "outflow_fdv_ratio"
	ScreenerSortTokenAgeDays    TokenScreenerSortField = "token_age_days"
)

type TokenScreenerTimeframe

type TokenScreenerTimeframe string

TokenScreenerTimeframe enumerates the supported screener time windows.

const (
	Timeframe5M  TokenScreenerTimeframe = "5m"
	Timeframe10M TokenScreenerTimeframe = "10m"
	Timeframe1H  TokenScreenerTimeframe = "1h"
	Timeframe6H  TokenScreenerTimeframe = "6h"
	Timeframe24H TokenScreenerTimeframe = "24h"
	Timeframe7D  TokenScreenerTimeframe = "7d"
	Timeframe30D TokenScreenerTimeframe = "30d"
)

type TraderType

type TraderType string

TraderType filters the cohort of traders for the token screener.

const (
	TraderAll                   TraderType = "all"
	TraderSmartMoney            TraderType = "sm"
	TraderWhale                 TraderType = "whale"
	TraderPublicFigure          TraderType = "public_figure"
	TraderTrending              TraderType = "trending"
	TraderConsistentPerpsWinner TraderType = "consistent_perps_winner"
	TraderHighWinrateHLPerps    TraderType = "high_winrate_hl_perps_trader"
	TraderPredictedWinner       TraderType = "predicted_winner"
)

Directories

Path Synopsis
examples
profiler command
screener command
smart_money command

Jump to

Keyboard shortcuts

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