def METHOD_NAME(database: 'DBHandler', addresses: Sequence[ChecksumEvmAddress]) -> dict[str, Any]:
    """
    Query staking information for the liquity module related to both the LQTY staking
    and the stability pool. It returns a dictionary combining the information from all
    the addresses and stats per address.
    """
    result: dict[str, Any] = {}
    if len(addresses) == 0:
        return result
    history_events_db = DBHistoryEvents(database)
    with database.conn.read_ctx() as cursor:
        result['global_stats'] = _get_stats(
            cursor=cursor,
            history_events_db=history_events_db,
            query_staking=QUERY_STAKING_EVENTS,
            bindings_staking=BINDINGS_STAKING_EVENTS,
            query_stability_pool=QUERY_STABILITY_POOL_EVENTS,
            bindings_stability_pool=BINDINGS_STABILITY_POOL_EVENTS,
            query_stability_pool_deposits=QUERY_STABILITY_POOL_DEPOSITS,
            deposit_pool_bindings=[A_LUSD.identifier, HistoryEventType.STAKING.serialize(), HistoryEventSubType.DEPOSIT_ASSET.serialize()],  # noqa: E501
            withdrawal_pool_bindings=[A_LUSD.identifier, HistoryEventType.STAKING.serialize(), HistoryEventSubType.REMOVE_ASSET.serialize()],  # noqa: E501
        )
        result['by_address'] = {}
        query_staking_events_with_address = QUERY_STAKING_EVENTS + ' AND location_label=?'
        query_stability_pool_events_with_address = QUERY_STABILITY_POOL_EVENTS + ' AND location_label=?'  # noqa: E501
        query_stability_pool_deposits = QUERY_STABILITY_POOL_DEPOSITS + ' AND location_label=?'
        for address in addresses:
            result['by_address'][address] = _get_stats(
                cursor=cursor,
                history_events_db=history_events_db,
                query_staking=query_staking_events_with_address,
                bindings_staking=[*BINDINGS_STAKING_EVENTS, address],
                query_stability_pool=query_stability_pool_events_with_address,
                bindings_stability_pool=[*BINDINGS_STABILITY_POOL_EVENTS, address],
                query_stability_pool_deposits=query_stability_pool_deposits,
                deposit_pool_bindings=[A_LUSD.identifier, HistoryEventType.STAKING.serialize(), HistoryEventSubType.DEPOSIT_ASSET.serialize(), address],  # noqa: E501
                withdrawal_pool_bindings=[A_LUSD.identifier, HistoryEventType.STAKING.serialize(), HistoryEventSubType.REMOVE_ASSET.serialize(), address],  # noqa: E501
            )
    return result