Get token price

From UBot Studio
(Difference between revisions)
Jump to: navigation, search
(Created page with "'''$get token price''' is a function that returns the current market price of a specified token on a specific blockchain chain. == Parameters == '''Chain:''' The blockchain ...")
 
(Example)
 
(One intermediate revision by one user not shown)
Line 14: Line 14:
  
 
<pre>
 
<pre>
config defi wallet("your private key")
 
 
log("DAI Token Price: {$get token price("BinanceSmartChain", "DAI")}")
 
log("DAI Token Price: {$get token price("BinanceSmartChain", "DAI")}")
 
log("ETH Token Price: {$get token price("Avalanche", "ETH")}")
 
log("ETH Token Price: {$get token price("Avalanche", "ETH")}")
 
</pre>
 
</pre>
 
Please replace "your private key" with your actual DeFi wallet's private key.
 
 
Be mindful when you are handling your private key. It's a sensitive piece of data that allows full control over your funds in your DeFi wallet. Therefore, never share this key publicly or with anyone.
 
  
 
The output will be the current price of the selected Token for the specified chain.
 
The output will be the current price of the selected Token for the specified chain.
Line 30: Line 25:
 
<p>ETH Token Price: $3245.21</p>
 
<p>ETH Token Price: $3245.21</p>
 
</blockquote>
 
</blockquote>
 
Knowing the current token price can help you make informed decisions about whether to trade, hold, or invest in a particular token. However, keep in mind that cryptocurrency prices can be highly volatile and may change rapidly.
 

Latest revision as of 01:56, 5 July 2023

$get token price is a function that returns the current market price of a specified token on a specific blockchain chain.

[edit] Parameters

Chain: The blockchain where the token resides.

Token ID: The token for which you want to check the price. This can be the symbol of the token or its contract address.

[edit] Return Value

This function returns the current market price of the given token on the specified chain.

[edit] Example

log("DAI Token Price: {$get token price("BinanceSmartChain", "DAI")}")
log("ETH Token Price: {$get token price("Avalanche", "ETH")}")

The output will be the current price of the selected Token for the specified chain.

Example Output:

DAI Token Price: $1.01

ETH Token Price: $3245.21

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox