Update Prices On A Token Market
Last updated
Last updated
In order to make sure every token that has been minted is overcollateralized, ramps need to have an up-to-date exchange rate of the token to the native coin of the blockchain on which the ramp has been deployed.
Suppose the ramp has been deployed on the Fantom blockchain and that we want to mint X amount of EUR. The ramp requires that the exchange of FTM to EUR be updated at least once every 24 hrs.
We will know that the exchange rate of our token needs to be updated if the value of the FTM Price In EUR (this parameter's name changes depending on the native coin of the blockchain and the token market that has been selected) is null; otherwise, we don't need to update the exchange rate.
To update our exchange rate, we go to the ramp's panel and select the EUR token as in the image below.
Then in the control panel menu of our ramp, we select the Fetch Price From API option to fetch the FTM price in EUR
In case you don't get a number for the exchange rate, refresh over and over again until you get a number like in the image above. Once you have the exchange rate, click on the Set Prices button, then on the Continue button and validate the transaction.
You should see the new exchange rate updated in the parameters' section of your ramp like in the image below:
You can also fetch multiple prices at once by running the Fetch All Prices From API, although that might be more tricky as it might return multiple NaN's and you might have to refresh multiple times to get all numbers.