Get liquidity pool value

From UBot Studio
(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
'''$liquidity value''' is a function that calculates the value of your investment in a liquidity pool on a decentralized exchange, represented 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 aggregates and expresses the value of your liquidity provider (LP) tokens in USD, providing insight into the current value of your investment.
+
  
 
== Parameters ==
 
== Parameters ==
  
'''Exchange:''' The decentralized exchange where the liquidity pool resides. The available exchanges will be dependent on the "SwapNames" list set in your environment.
+
'''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 calculate the value of your investment. The available tokens will be dependent on the "CoinNames" list set in your environment.
+
'''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.
  
 
== Return Value ==
 
== Return Value ==
Returns a string that represents the value of your investment in the given liquidity pool in USD.
+
 
 +
This function returns the dollar value of your current investment in the specified liquidity pool.
  
 
== Example ==
 
== Example ==
 +
 
<pre>
 
<pre>
log("Value of investment in DAI-USDC SushiSwap pool: {$liquidity value("SushiSwap", "DAI", "USDC")}")
+
config defi wallet("your private key")
 +
log("Liquidity Pool Investment Value: {$get liquidity pool value("PancakeSwap", "ETH", "DAI")}")
 
</pre>
 
</pre>
  
The output will display the value of your investment in the specified liquidity pool, represented in USD.  
+
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:
 
Example Output:
 +
 
<blockquote>
 
<blockquote>
<p>Value of investment in DAI-USDC SushiSwap pool: 500 USD</p>
+
<p>Liquidity Pool Investment Value: $1500.00</p>
 
</blockquote>
 
</blockquote>
  
Remember, the actual value will vary depending on the current prices of the tokens and the amount of liquidity you have provided to the pool.
+
Knowing your investment value helps you to make more informed decisions about whether to add more liquidity or remove. However, note that return values are dependent on the current market rate and liquidity pool conditions on the specified exchange.

Revision as of 20:04, 4 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.

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.

Return Value

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

Example

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

Knowing your investment value helps you to make more informed decisions about whether to add more liquidity or remove. However, note that return values are dependent on the current market rate and liquidity pool conditions on the specified exchange.

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox