Get liquidity pool value

From UBot Studio
(Difference between revisions)
Jump to: navigation, search
 
(4 intermediate revisions by one user not shown)
Line 1: Line 1:
'''$liquidity pool value''' is a function that shows the value, measured in USD, that you've invested in a specific liquidity pool on a decentralized exchange. This function is vital for enterprise users who are involved in providing liquidity in DeFi protocols.
+
'''$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 ==
 
== Parameters ==
  
'''Exchange:''' The decentralized exchange platform where the liquidity pool is located. The specific exchange can be picked from the dropdown menu.
+
'''Exchange:''' The decentralized exchange where the liquidity pool resides.
  
'''Token A ID:''' The identifier of the first token in the liquidity pool for which you want to calculate the value. You can choose the token from the dropdown menu or type its contract address.
+
'''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.
 
+
'''Token B ID:''' The identifier of the second token in the liquidity pool for which you want to calculate the value. You can select the token from the dropdown menu or input its contract address.
+
  
 
== Return Value ==
 
== Return Value ==
  
This function returns a string that represents the value in USD of the liquidity provided in the pool with the specified tokens.
+
This function returns the dollar value of your current investment in the specified liquidity pool.
  
 
== Example ==
 
== Example ==
Line 17: Line 15:
 
<pre>
 
<pre>
 
ui console view
 
ui console view
config defi wallet("your private key here")
+
config defi wallet("your private key")
log("Liquidity pool value in USD: {$liquidity pool value("PancakeSwap","0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c","0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82")}")
+
log("Liquidity Pool Investment Value: ${$get liquidity pool value("PancakeSwap", "ETH", "DAI")}")
 
</pre>
 
</pre>
  
Remember to replace "your private key here" with your actual private key. As private keys are sensitive information, they should always be securely stored and handled.
+
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.
  
The script output will display the value in USD of the liquidity provided to the selected liquidity pool (with tokens denoted by "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c" and "0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82" on the "PancakeSwap" exchange). An example of the resulting output may look like:
+
Example Output:
  
 
<blockquote>
 
<blockquote>
Liquidity pool value in USD: 500
+
<p>Liquidity Pool Investment Value: $1500.00</p>
 
</blockquote>
 
</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