Get liquidity pool value

From UBot Studio
(Difference between revisions)
Jump to: navigation, search
(Created page with "'''$get liquidity value''' is a function that returns the value of your investment in a liquidity pool on a decentralized exchange (DEX) in USD. This function enables you to ...")
 
 
(6 intermediate revisions by one user not shown)
Line 1: Line 1:
'''$get liquidity value''' is a function that returns the value of your investment in a liquidity pool on a decentralized exchange (DEX) in USD.
+
'''$get liquidity pool value''' is a function that returns the value, in USD, that you have currently invested in a specific liquidity pool on a decentralized exchange.
 
+
This function enables you to track the current value of your investment in a specific liquidity pool.
+
  
 
== Parameters ==
 
== Parameters ==
  
'''Exchange:''' The decentralized exchange where you have invested.
+
'''Exchange:''' The decentralized exchange where the liquidity pool resides.
 
+
'''Token A ID:''' The first token of the liquidity pair in which you have invested.
+
  
'''Token B ID:''' The second token of the liquidity pair in which you have invested.
+
'''Token A ID''' and '''Token B ID:''' The pair of tokens involved in the liquidity pool for which you want to check your investment value. This can be the token's symbol or the contract address.
  
 
== Return Value ==
 
== Return Value ==
  
This function returns a string representing the value of your investment in USD.
+
This function returns the dollar value of your current investment in the specified liquidity pool.
  
 
== Example ==
 
== Example ==
  
 
<pre>
 
<pre>
log("The value of my liquidity in USD is: {$get liquidity value("SushiSwap", "ETH", "SUSHI")}")
+
ui console view
 +
config defi wallet("your private key")
 +
log("Liquidity Pool Investment Value: ${$get liquidity pool value("PancakeSwap", "ETH", "DAI")}")
 
</pre>
 
</pre>
  
In the example above, the value of the user's investment in the ETH-SUSHI liquidity pool on SushiSwap is fetched and logged.
+
Please replace "your private key" with your actual DeFi wallet's private key.
  
== Post-Run ==
+
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.
  
After running this function, '''RecordTxData''' is executed to record transaction data.
+
The example command will return the current investment value in USD that you have in the ETH-DAI pool on PancakeSwap.
  
**Please note:**
+
Example Output:
  
This function requires access to real-time data and an active, stable internet connection to provide accurate results. Also, the return value is an approximate worth of the funds based on the current market conditions and rates. The actual value may vary while performing transactions like swapping or liquidity removal.
+
<blockquote>
 +
<p>Liquidity Pool Investment Value: $1500.00</p>
 +
</blockquote>

Latest revision as of 01:39, 5 July 2023

$get liquidity pool value is a function that returns the value, in USD, that you have currently invested in a specific liquidity pool on a decentralized exchange.

[edit] Parameters

Exchange: The decentralized exchange where the liquidity pool resides.

Token A ID and Token B ID: The pair of tokens involved in the liquidity pool for which you want to check your investment value. This can be the token's symbol or the contract address.

[edit] Return Value

This function returns the dollar value of your current investment in the specified liquidity pool.

[edit] Example

ui console view
config defi wallet("your private key")
log("Liquidity Pool Investment Value: ${$get liquidity pool value("PancakeSwap", "ETH", "DAI")}")

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 example command will return the current investment value in USD that you have in the ETH-DAI pool on PancakeSwap.

Example Output:

Liquidity Pool Investment Value: $1500.00

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox