A dependable and sustainable energy supply is crucial as energy consumption continues to rise due to population growth, economic development, and improved living standards. The use of fossil fuels leads to CO2 emissions and are subject to volatility in prices. Capital-intensive technologies to reduce emissions are challenging to implement on a practical scale, and economic instruments are likely to play a role in future energy systems by encouraging adoption of these technologies. Carbon trading is an emerging economic instrument that enables entities (plants, governments, etc.) to exchange emission rights, allowing economic and environmental aspects to be balanced. This study introduces a scalable carbon trading modelling approach, integrated into previously developed DECO2 open-source energy planning framework. Direct and indirect optimisation approaches are proposed, both consisting of superstructure-based mixed-integer nonlinear programming formulations. Carbon price is a variable in the direct optimisation or a parameter in the indirect optimisation approach. While the direct optimisation approach involves more non-linearity, it is shown to result in solutions with greater decarbonisation, higher profits, and lower costs, compared to the indirect optimisation results. A novel feature of this multi-period model not considered in previous works is the simultaneous emissions trading across time periods and among entities (power plants and government). This enables efficient and coordinated emission allowances trading among various entities and timeframes. Various new costs and revenue streams are added into the energy planning framework; therefore, profits can also be predicted, along with predictions of electricity prices. New energy resources (nuclear and wind) and carbon capture utilisation and storage are also introduced to the modified DECO2 model. The models are tested on the Pakistan's power sector. Minimisation of emissions using direct optimisation showed that the carbon trading increased profits significantly in the second, third, and fourth planning periods (4.74, 3.86, and 3.55 times, respectively), but in the first period, profits were slightly higher without carbon trading (1.06 times more). Minimisation of budget using indirect optimisation showed higher profits in case of no carbon trading for all the periods. Between 2021 and 2040, hydropower is expected to grow the most (by a minimum of 3.14 times and a maximum of 15.87 times), followed by solar (with an expected increase between 2.54 and 3.26 times) and wind generation (which may increase by 2.35 to 2.66 times). Deployment of emission reduction technologies is significantly lower when carbon trading is implemented as compared to when it is not, due to increased pressure on CO2-intensive generation. Results show that incorporating carbon trading into an energy market leads to both financial (increased profits) and environmental (lower emissions) sustainability, and that using direct optimisation approach increases benefits of carbon markets.