1. How to Track the Open Event
When a Book is created, an Open event is emitted, similar to the PairCreated event in the Uniswap V2 factory.
/**
 * @notice Event emitted when a new book is opened
 * @param id The book id
 * @param base The base currency
 * @param quote The quote currency
 * @param unitSize The unit size of the book
 * @param makerPolicy The maker fee policy
 * @param takerPolicy The taker fee policy
 * @param hooks The hooks contract
 */
event Open(
    BookId indexed id,
    Currency indexed base,
    Currency indexed quote,
    uint64 unitSize,
    FeePolicy makerPolicy,
    FeePolicy takerPolicy,
    IHooks hooks
);
In Clober, the hook ID is typically set to a zero byte, meaning no hooks are used.
Note: There is no on-chain method to directly retrieve the list of created book IDs. Instead, you can use the Subgraph to query the currently created books and their properties.
Below are the Subgraph API endpoint URLs for each chain and an example GraphQL query to retrieve the complete list of book IDs:
{
  books {
    id
    unitSize
    makerPolicy
    makerFee
    isMakerFeeInQuote
    takerPolicy
    takerFee
    isTakerFeeInQuote
    base {
      id
      name
      symbol
      decimals
    }
    quote {
      id
      name
      symbol
      decimals
    }
  }
}
# Example Response
{
    "id": "1006415447378313295959389996353932278895563148367958226350",
    "unitSize": "1",
    "makerPolicy": "8888608",
    "makerFee": "0",
    "isMakerFeeInQuote": true,
    "takerPolicy": "8888708",
    "takerFee": "0.0001",
    "isTakerFeeInQuote": true,
    "base": {
        "id": "0x3a98250f98dd388c211206983453837c8365bdc1",
        "name": "ShMonad",
        "symbol": "shMON",
        "decimals": "18"
    },
    "quote": {
        "id": "0x88b8e2161dedc77ef4ab7585569d2415a1c1055d",
        "name": "Tether USD",
        "symbol": "USDT",
        "decimals": "6"
    }
},