Skip to content

Market Data

Igor Sazonov edited this page Sep 23, 2026 · 1 revision

Market Data

This page covers the services for DEX and options volumes, open interest, fees and revenue, bridges, ETFs, and narratives. DEX/options/open-interest and fee endpoints are Free; derivatives and bridge endpoints require the Pro API. Each method takes context.Context and returns either a flexible decoded payload or an error.1

Volumes and open interest

The Volumes() service exposes the following methods.

Access Method Return type Purpose
Free GetDEXOverview(ctx, opts) map[string]any DEX volume overview.
Free GetDEXOverviewByChain(ctx, chain, opts) map[string]any DEX volume overview for one chain.
Free GetDEXSummary(ctx, protocol, opts) map[string]any DEX volume summary for one protocol.
Free GetOptionsOverview(ctx, opts) map[string]any Options DEX overview.
Free GetOptionsOverviewByChain(ctx, chain, opts) map[string]any Options DEX overview for one chain.
Free GetOptionsSummary(ctx, protocol, opts) map[string]any Options DEX summary for one protocol.
Free GetOpenInterestOverview(ctx, opts) map[string]any Perpetual-exchange open-interest overview.
Pro GetDerivativesOverview(ctx, opts) map[string]any Derivatives volume overview.
Pro GetDerivativesSummary(ctx, protocol, opts) map[string]any Derivatives volume summary for one protocol.

OverviewOptions has two required Boolean fields: ExcludeTotalDataChart and ExcludeTotalDataChartBreakdown. They are values—not pointers—because every route that accepts OverviewOptions requires both query flags. The optional DataType field is relevant to particular overview routes; the SDK validates each route's declared enum before sending a request.1

overview, err := client.Volumes().GetDEXOverview(ctx, defillama.OverviewOptions{
    ExcludeTotalDataChart:          true,
    ExcludeTotalDataChartBreakdown: true,
})
if err != nil {
    return err
}
_ = overview

For options, allowed DataType values are dailyPremiumVolume and dailyNotionalVolume. For fee methods, the documented values are dailyFees, dailyRevenue, and dailyHoldersRevenue.2

Fees and revenue

Fees() contains these Free methods:

Method Return type Purpose
GetOverview(ctx, opts) map[string]any Lists protocols with fee/revenue summaries and history.
GetOverviewByChain(ctx, chain, opts) map[string]any Returns the fee/revenue overview for one chain.
GetSummary(ctx, protocol, opts) map[string]any Returns fee/revenue history for one protocol.

GetSummary takes an optional *DimensionOptions, which currently has one optional field: DataType.

summary, err := client.Fees().GetSummary(ctx, "uniswap", &defillama.DimensionOptions{
    DataType: defillama.Ptr("dailyFees"),
})
if err != nil {
    return err
}
_ = summary

Bridges (Pro)

Bridge methods require a Pro-configured client.

Method Return type Purpose
GetBridges(ctx, opts) map[string]any Lists bridges; BridgesOptions can include chains.
GetBridge(ctx, id) map[string]any Retrieves a bridge by numeric ID.
GetBridgeVolume(ctx, chain, opts) []any Returns bridge volume for a chain; BridgeVolumeOptions can filter by ID.
GetBridgeDayStats(ctx, timestamp, chain, opts) map[string]any Returns daily bridge statistics.
GetBridgeTransactions(ctx, id, opts) map[string]any Returns bridge transactions with optional filters.

Use GetBridges to discover IDs. BridgeTransactionsOptions accepts Starttimestamp, Endtimestamp, Sourcechain, Address, and Limit. The client validates Limit in the inclusive range 1 to 6000 before a request.3

end := time.Now().UTC()
start := end.Add(-24 * time.Hour)

transactions, err := client.Bridges().GetBridgeTransactions(ctx, 1,
    &defillama.BridgeTransactionsOptions{
        Starttimestamp: defillama.Ptr(start.Unix()),
        Endtimestamp:   defillama.Ptr(end.Unix()),
        Sourcechain:    defillama.Ptr("Ethereum"),
        Limit:          defillama.Ptr(int64(100)),
    },
)
if err != nil {
    return err
}
_ = transactions

ETFs and narratives (Pro)

The Pro ETFs() service provides GetSnapshot(ctx) and GetFlows(ctx), each returning []any. The Pro Narratives() service provides GetPerformance(ctx, period), which also returns []any. The period value is a DefiLlama API path parameter; consult the official endpoint reference for supported values and output fields.2

flows, err := client.ETFs().GetFlows(ctx)
if err != nil {
    return err
}

performance, err := client.Narratives().GetPerformance(ctx, "7d")
if err != nil {
    return err
}
fmt.Println(len(flows), len(performance))

Flexible result shapes

These endpoints return map[string]any or []any because they carry dashboard-oriented payloads whose shape can evolve. Check dynamic types and keys before depending on a field. The complete endpoint list and official links are available in API Reference.

References

Clone this wiki locally