> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sx.bet/llms.txt
> Use this file to discover all available pages before exploring further.

# Odds ladder

> The SX Bet odds ladder enforces 0.125% intervals to prevent diming. Learn how to validate and round odds.

We enforce an odds ladder to prevent diming. Your offer, in implied odds, must fall on one of the steps on the ladder. Currently, that is set to intervals of 0.125%, meaning that your offer cannot fall between the steps. An offer of 50.25% would be valid, but an offer of 50.20% would not. You can check if your odds would fall on the ladder by taking the modulus of your odds and 1.25 \* 10 ^ 17 and checking if it's equal to 0.

You can get the current interval from [`GET /metadata`](/api-reference/get-metadata). It will spit out a number from 0 to 1000, where 10 = 0.010%, and 125 = 0.125%.

<Warning>Odds not on the ladder will be rejected and your order(s) will not be posted.</Warning>

## Validating and rounding odds

<CodeGroup>
  ```javascript JavaScript theme={null}
  export const ODDS_LADDER_STEP_SIZE = 125n; // (0.125% = 125n, 0.25% = 250n, etc)

  /**
   * Check if the odds are valid, i.e., in one of the allowed steps
   * @param odds Odds to check (as bigint)
   */
  export function checkOddsLadderValid(odds: bigint): boolean {
    // Logic:
    // 100% = 10^20
    // 10% = 10^19
    // 1% = 10^18
    // 0.1% = 10^17
    // 0.001% = 10^15 → step = 10^15 * 125 = 1.25 * 10^17 = 0.125%
    const step = 10n ** 15n * ODDS_LADDER_STEP_SIZE;
    return odds % step === 0n;
  }

  /**
   * Rounds odds down to the nearest step.
   * @param odds Odds to round (as bigint).
   */
  export function roundDownOddsToNearestStep(odds: bigint): bigint {
    const step = 10n ** 15n * ODDS_LADDER_STEP_SIZE;
    return (odds / step) * step;
  }
  ```

  ```python Python theme={null}
  # No external dependencies required — uses the standard library only.

  ODDS_LADDER_STEP_SIZE = 125  # (0.125% = 125, 0.25% = 250, etc)
  STEP = 10**15 * ODDS_LADDER_STEP_SIZE  # 1.25 * 10^17 = 0.125%

  def check_odds_ladder_valid(odds: int) -> bool:
      """Check if odds fall on an allowed ladder step."""
      # 100% = 10^20, 0.001% = 10^15 → step = 10^15 * 125 = 0.125%
      return odds % STEP == 0

  def round_down_odds_to_nearest_step(odds: int) -> int:
      """Round odds down to the nearest ladder step."""
      return (odds // STEP) * STEP
  ```
</CodeGroup>
