Toby Green talks about this a little bit in A Fistful of Shells
In the 1500s, European traders actively sought to trade for gold and gold dust with West African gold producing societies like Asante and through merchants carrying gold from inland goldfields. In the 1500s trading for slaves was still very limited in scale, but throughout 1500s and 1600s there seems to be a trend of Akan societies relying on gold as an export good and really limiting the number of slaves exported compared to other regions of West Africa.
According to Green, the discovery of massive gold strike in Minas Gerais region of Brazil in the 1690s created a giant shift. Massive flows of Brazilian gold to Europe devalued the metal and made trading for smaller amounts of West African gold less attractive.
With gold devalued in West Africa (for european traders), the export of enslaved persons became something of a "commodity of last resort", intensifying slave exports from the region. However, West African societies internally still valued gold, so Green points to the unexpected situation of non-gold producing regions like Dahomey and Oyo exporting slaves and importing Brazilian gold and silver after 1690.