Developer Hub
🔮 For applications
Watch Hooks

This hook is used to calculate the total odds before a bet is placed. These are the odds at which the bet will be placed, not accounting for slippage. The total odds vary based on the bet amount and the chosen selections, as each selection can have its own settings for reinforcement and margin.



Before utilizing useOdds, it is essential to initialize event watchers and the SocketProvider:

  import { ChainProvider, SocketProvider, useWatchers } from '@azuro-org/sdk'
  export function Watchers() {
    return null
  function Providers(props: { children: React.ReactNode }) {
    const { children } = props
    return (
        <Watchers />

Provide selections and bet amount for calculating.

import { useOdds } from '@azuro-org/sdk'
const { odds, totalOdds, maxBet, loading } = useOdds({
  betAmount: '10',
  selections: [
      conditionId: '486903008559711340',
      outcomeId: '29',
      coreAddress: '0x34nsf41f...',

The odds is an object where the key combination is determined by the concatenation of conditionId and outcomeId:


Except of Single and Combo bets for Batch bet we use different amount structure batchBetAmounts.

The batchBetAmounts is an object where the key combination is determined by the concatenation of conditionId and outcomeId, the value is bet amount for outcome:

const selectionAmount = batchBetAmounts[`${conditionId}-${outcomeId}`]

Example of usage: Obtain the total odds for the provided selections.

import { type MarketOutcome, useOdds } from '@azuro-org/sdk'
type TotalOddsProps = {
  outcomes: MarketOutcome[]
  betAmount: string
function TotalOdds(props: TotalOddsProps) {
  const { outcomes, betAmount } = props
  const { totalOdds } = useOdds({
    selections: outcomes,
  return (


  selections: Selection[]
  betAmount?: string
  batchBetAmounts?: Record<string, string>
type Selection = {
  conditionId: string
  outcomeId: string
  coreAddress: string

Return Value

  loading: boolean
  odds: Record<string, number>
  totalOdds: number
  maxBet?: number