Paths in rate pairs
Path can be used to make the rate of a custom rate pair track the rate of a global or custom rate pair e.g. to make testnet bitcoin’s exchange rate to USD track the same rate as livenet bitcoin to USD. This path would simply be
Paths in conversion pairs
In a conversion pair, the path can be used to dynamically calculate a rate based on an expression. The expression can be either a basic mathematical expression or can combine mathematical expressions and functions defined by Rehive. You can use paths in conversion pairs to make a pair track the rate of another rate pair, to pad a conversion rate to charge a built-in fee, or provide a discounted exchange fee.
Please contact Rehive if you would like assistance with paths. Here are some examples to help you get started:
Getting the rate for converting from EUR to ZAR
This path emulates what happens when “Auto” is selected for the currency pair EUR:ZAR. It first gets the ZAR to USD rate, then gets the EUR to USD rate, and derives the EUR to ZAR rate by dividing the ZAR to USD rate by the EUR to USD rate. This happens because Rehive’s base currency for rates is USD.
Bonus or more favorable rates
This path is an example of USD:ZAR + a fixed value. It pads the rate by 1. e.g. if the rate for USD to ZAR is 17.05, the above path would output a rate of 18.05.
The user would get 1 more ZAR than they would get from the regular rate. This acts like a bonus.
To make a less favorable rate, change the
Less favorable rate
This path would make the rate between USD and ZAR be 98% of the actual rate. You might do this if you wanted the user to get less ZAR from their USD than they would from the regular rate.
If the original rate for USD to ZAR is 17.05, this path would output a rate of 16.70, meaning the user would get less ZAR for their USD.
Complicated more favorable rate
This path first calculates the rate of EUR to ZAR by getting the USD:ZAR rate and dividing it by the USD:EUR rate (because the base rate is always in USD):
To create a less favorable rate where the user would get less ZAR for their EUR, change the
Read the full overview article to read more about the Conversion Extension as a whole.