Begin by placing the onions, butter, and olive oil into a large pan or stockpot with a lid. Allow the butter to melt over medium heat, then add the onions. Cook them gently until soft and translucent, stirring occasionally to prevent them from browning.
Once the onions are tender, add the whole chicken to the pot. Pour in enough water until the bird is almost submerged. Cover with the lid and bring the water to a boil.
When boiling, reduce the heat to a simmer and poach the chicken for about one and a half hours. This gentle cooking method ensures the meat becomes tender and flavorful.
After the chicken is cooked, remove it from the pot. Strain the cooking liquid into another pan, keeping the onions to return to the dish later. Boil the liquid hard to reduce it, concentrating the flavors into a tasty gelatinous stock.
Allow the chicken to cool before stripping all the meat off the carcass, discarding the bones and skin. Shred the meat into bite-sized pieces and set aside.
In a large bowl, combine the shredded chicken with the reserved onions. Mix well, then add the eggs and season with salt and black pepper. Stir until everything is well combined.
Preheat your oven to 230°C (gas 8, 446°F). While the oven heats up, grease a round pie dish with a little olive oil.
Line the dish with three sheets of filo pastry, alternating the direction each time and brushing each layer with a little olive oil. This will create a beautiful and flaky crust.
Pour the chicken mixture into the lined dish, folding in the overhanging edges of the filo pastry to seal the pie. Top it with three more layers of filo pastry, again brushing with olive oil.
Once you have completed the top layer, fold in the overhanging edges to create a seal, then brush the top with more olive oil for a golden finish.
Bake the pie in the preheated oven for 15 minutes until the pastry is crisp and lightly golden.
After 15 minutes, remove the pie from the oven and reduce the heat to 200°C (gas 6, 392°F). Cut the pie into six or eight wedges and return it to the oven for an additional 45 minutes.
Once baked, allow the pie to rest for 10 to 20 minutes before serving, still warm. This resting time helps the filling settle.