The International Monetary Fund (IMF) has ranked Nigeria Second Richest Country in Africa after Egypt.
According to the IMF, South Africa came third, based on the amount of dollars in foreign reserves, the Gross Domestic Product (GDP) and the Purchasing Power Parity (PPP).
The full list as released by the IMF is reproduced here:
Peak value of GDP (PPP) as of 2019
1 Egypt 1,391.734 2019
2 Nigeria 1,214.827 2019
3 South Africa 813.100 2019
4 Algeria 684.649 2019
5 Morocco 330.381 2019
6 Ethiopia 240.705 2019
7 Ghana 211.127 2019
8 Angola 203.763 2019
9 Kenya 190.970 2019
10 Libya 187.796 2010
11 Tanzania 186.060 2019
12 Sudan 177.678 2018
13 Tunisia 150.834 2019
14 Côte d’Ivoire 117.030 2019
15 Uganda 104.893 2019
16 Cameroon 101.124 2019
17 Democratic Republic of the Congo 77.441 2019
18 Zambia 76.520 2019
19 Senegal 47.335 2018
20 Mali 44.028 2018
21 Madagascar 42.705 2018
22 Botswana 41.556 2018
23 Burkina Faso 38.794 2018
24 Mozambique 38.679 2018
25 Gabon 38.582 2018
26 Equatorial Guinea 37.689 2012
27 Zimbabwe 35.565 2018
28 South Sudan 35.254 2011
29 Chad 30.563 2015
30 Republic of the Congo 29.749 2018
31 Mauritius 29.187 2018
32 Guinea 28.637 2018
33 Benin 27.471 2018
34 Namibia 27.444 2018
35 Rwanda 26.997 2018
36 Malawi 23.682 2018
37 Niger 23.475 2018
38 Somalia 19.568 2018
39 Mauritania 18.119 2018
40 Togo 13.886 2018
41 Sierra Leone 12.619 2014
42 Eswatini (Swaziland) 11.496 2018
43 Eritrea 9.997 2018
44 Burundi 8.184 2018
45 Lesotho 7.231 2018
46 Liberia 6.440 2018
47 Central African Republic 4.293 2012
48 Cape Verde 3.983 2018
49 Djibouti 3.964 2018
50 Gambia 3.884 2018
51 Guinea-Bissau 3.385 2018
52 Seychelles 2.873 2018
53 Comoros 1.384 2018.