A model is developed to optimise power sharing between two grid-connected prosumers that incorporates photovoltaic and wind energy conversion systems operating in a peerto-peer (P2P) energy-sharing arrangement. The city of Durban, South Africa, where wind and solar resources are abundant, is selected as a case study to analyse power flows between selected prosumers. The model optimally manages power flows among micro renewables-based energy generators while minimising the total cost of energy purchased from the power utility under a time-variable pricing structure. To evaluate the economic feasibility of the suggested peer-to-peer energy-sharing arrangement, a lifecycle cost analysis is conducted to determine when the proposed system will break even, in terms of money spent less achievable salvage value, using the suggested prosumers instead of providing power exclusively from the grid to satisfy load demands. The analysis predicts that the breakeven point will occur after 4.3 years at $13,500, with a projected saving at the end of the 20-year lifecycle of approximately $60,536.82, or 47.42%. Furthermore, the 'true' payback period method is used to assess the economic behaviour of the proposed system with P2P energy-sharing capabilities and indicates that the total investment cost would be recovered in 8.76 years. These results show that the optimally controlled peerto-peer energy-sharing scheme is economically feasible in the South African context and may be applied in any global location with similar operating conditions. This is an open access article under the terms of the Creative Commons Attribution-NonCommercial-NoDerivs License, which permits use and distribution in any medium, provided the original work is properly cited, the use is non-commercial and no modifications or adaptations are made.