In a large dutch oven, heat the olive oil over medium high heat. Add the onions and garlic and cook until the onion is translucent - about 5 minutes. Add the smoked paprika, cumin and oregano and stir to combine. Add the sherry and cook until almost all the liquid has evaporated, about 5 minutes. Add the stock, tomatoes, lentils and potatoes. Bring soup to a boil and reduce to a simmer. Cover and simmer for 15 - 20 minutes or until the lentils and potatoes are tender. Taste and adjust seasonings. Add the pimente de espelette or cayenne pepper to taste.