# `CCXT.Registry`
[🔗](https://github.com/ZenHive/ccxt_client/blob/main/lib/ccxt/registry.ex#L1)

Compile-time exchange lookup registry.

Maps exchange ID atoms and strings to their generated module names.
Built from the spec manifest at compile time — recompiles automatically
when the manifest changes.

## Usage

    CCXT.Registry.lookup(:bybit)
    #=> {:ok, CCXT.Bybit}

    CCXT.Registry.lookup!("binance")
    #=> CCXT.Binance

    CCXT.Registry.exchanges()
    #=> ["aftermath", "alpaca", "apex", ...]

    CCXT.Registry.loaded?(:bybit)
    #=> true  # if CCXT.Bybit module is compiled

# `exchanges`

```elixir
@spec exchanges() :: [String.t()]
```

Returns all registered exchange IDs as strings.

## Examples

    CCXT.Registry.exchanges()
    #=> ["aftermath", "alpaca", "apex", ...]

# `loaded?`

```elixir
@spec loaded?(String.t() | atom()) :: boolean()
```

Checks if the exchange module is compiled and loaded.

Returns true only if the exchange is registered AND its module is
available in the BEAM. Useful for distinguishing "known exchange"
from "exchange module exists."

## Examples

    CCXT.Registry.loaded?(:bybit)
    #=> true  # if CCXT.Bybit is compiled

# `lookup`

```elixir
@spec lookup(String.t() | atom()) ::
  {:ok, module()} | {:error, {:unknown_exchange, String.t()}}
```

Looks up the module for an exchange ID.

Accepts both string and atom IDs.

## Examples

    CCXT.Registry.lookup("bybit")
    #=> {:ok, CCXT.Bybit}

    CCXT.Registry.lookup(:unknown)
    #=> {:error, {:unknown_exchange, "unknown"}}

# `lookup!`

```elixir
@spec lookup!(String.t() | atom()) :: module()
```

Looks up the module for an exchange ID, raising on unknown.

## Examples

    CCXT.Registry.lookup!(:bybit)
    #=> CCXT.Bybit

# `module_for`

```elixir
@spec module_for(String.t() | atom()) :: module() | nil
```

Returns the module for an exchange ID, or nil if unknown.

## Examples

    CCXT.Registry.module_for("bybit")
    #=> CCXT.Bybit

    CCXT.Registry.module_for("nope")
    #=> nil

# `registered?`

```elixir
@spec registered?(String.t() | atom()) :: boolean()
```

Checks if an exchange ID is registered.

## Examples

    CCXT.Registry.registered?(:bybit)
    #=> true

---

*Consult [api-reference.md](api-reference.md) for complete listing*
