Get liquidity pool value

From UBot Studio
(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
'''$defi liquidity pool value''' is a function that calculates the value of your investment in a liquidity pool on a specific decentralized exchange, shown in USD.
+
'''$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.
 
+
This function is extremely useful for enterprise users who are providing liquidity on decentralized exchanges and want to know the current value of their investment.
+
 
+
== User Level ==
+
 
+
This function is exclusively available for enterprise users.
+
  
 
== Parameters ==
 
== Parameters ==
  
'''Exchange:''' The decentralized exchange where your liquidity pool is located.
+
'''Exchange:''' The decentralized exchange platform where the liquidity pool is located. The specific exchange can be picked from the dropdown menu.
  
'''Token A ID:''' The ID of the first token in the liquidity pool.
+
'''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 B ID:''' The ID of the second token in the liquidity pool.
+
'''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 value which is the current value of your liquidity pool investment in USD.
+
This function returns a string that represents the value in USD of the liquidity provided in the pool with the specified tokens.
  
 
== Example ==
 
== Example ==
  
 
<pre>
 
<pre>
define areacode
+
ui console view
ui text msg("Your investment value in USDT/ETH on Uniswap is: {$defi liquidity pool value("Uniswap", "USDT", "ETH")}")
+
config defi wallet("your private key here")
 +
log("Liquidity pool value in USD: {$liquidity pool value("PancakeSwap","0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c","0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82")}")
 
</pre>
 
</pre>
  
In this example, the function is calculating the current value of your investment in the USDT/ETH liquidity pool on Uniswap in USD, and then displaying that value in the UI.
+
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.
 +
 
 +
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:
 +
 
 +
<blockquote>
 +
Liquidity pool value in USD: 500
 +
</blockquote>

Revision as of 19:00, 4 July 2023

$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.

Parameters

Exchange: The decentralized exchange platform where the liquidity pool is located. The specific exchange can be picked from the dropdown menu.

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 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

This function returns a string that represents the value in USD of the liquidity provided in the pool with the specified tokens.

Example

ui console view
config defi wallet("your private key here")
log("Liquidity pool value in USD: {$liquidity pool value("PancakeSwap","0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c","0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82")}")

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.

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:

Liquidity pool value in USD: 500
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox