This paper suggests a trading market platform designed for making P2P energy transactions. The problem is formulated in terms of Knapsack 0-1 Problem and Dynamic Programming Algorithm is implemented to bring maximum financial benefit to prosumers. The communication between agents is achieved through MQTT message protocol and agents are represented by Raspberry Pi microprocessor. Case study is presented for a neighborhood of 3 prosumers and 4 consumers and simulation results show that during every auction seller gets the highest economic surplus, while consumers get locally produced energy at cheaper than grid price.Moreover, within the scope of this research project energy forecasting and blockchain are also covered. Since the proposed model is 30 minutes ahead, accurate prediction of generation and consumption is essential. ARIMA estimation model was chosen among other four compared models due to its high accuracy. Ethereum smart contracts are integrated to provide more transparency and security to the framework.