Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.mobula.io/llms.txt

Use this file to discover all available pages before exploring further.

Returns

onBarsUpdated
OnBarsUpdatedResponse!
Bar update payload pushed on each swap on the pair. See OnBarsUpdatedResponse.

Arguments

pairId
String
Pair identifier in <pairAddress>:<networkId> form. Required — BAD_USER_INPUT if missing.
commitmentLevel
[BarCommitmentLevel!]
Allow-list of commitment levels to receive. Defaults to [Confirmed]. See BarCommitmentLevel.
quoteToken
QuoteToken
Force the quote-token side (token0 or token1). See QuoteToken.

Example

subscription OnBarsUpdated {
  onBarsUpdated(
    pairId: "BGm1tav58oGcsQJehL9WXBFXF7D27vZsKefj4xJKD5Y:1399811149"
    commitmentLevel: [Confirmed]
    quoteToken: token1
  ) {
    pairAddress
    networkId
    commitmentLevel
    quoteToken
    quoteTokenAddress
    aggregates {
      r5  { t usd { o h l c v volume buys sells } }
      r60 { t usd { o h l c v volume } }
      r1D { t usd { o h l c v volume } }
    }
  }
}