You can create the shortcode as a string like this :
$rate = 2587.36;
$code = "[mycred_exchange from=\"mycred_default\" to=\"mycred_usd\" min=\"0.00001\" rate=\"$rate\"]";
and then, to execute the code
echo do_shortcode($code);
You can create the shortcode as a string like this :
$rate = 2587.36;
$code = "[mycred_exchange from=\"mycred_default\" to=\"mycred_usd\" min=\"0.00001\" rate=\"$rate\"]";
and then, to execute the code
echo do_shortcode($code);