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 ...")
 
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.
+
'''$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.
  
This function enables you to track the current value of your investment in a specific liquidity pool.
+
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 you have invested.
+
'''Exchange:''' The decentralized exchange where your liquidity pool is located.
  
'''Token A ID:''' The first token of the liquidity pair in which you have invested.
+
'''Token A ID:''' The ID of the first token in the liquidity pool.
  
'''Token B ID:''' The second token of the liquidity pair in which you have invested.
+
'''Token B ID:''' The ID of the second token in the liquidity pool.
  
== Return Value ==
+
== Return Value ==  
  
This function returns a string representing the value of your investment in USD.
+
This function returns a string value which is the current value of your liquidity pool investment in USD.
  
 
== Example ==
 
== Example ==
  
 
<pre>
 
<pre>
log("The value of my liquidity in USD is: {$get liquidity value("SushiSwap", "ETH", "SUSHI")}")
+
define areacode
 +
ui text msg("Your investment value in USDT/ETH on Uniswap is: {$defi liquidity pool value("Uniswap", "USDT", "ETH")}")
 
</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.
+
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.
 
+
== Post-Run ==
+
 
+
After running this function, '''RecordTxData''' is executed to record transaction data.
+
 
+
**Please note:**
+
 
+
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.
+

Revision as of 18:31, 4 July 2023

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

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.

Contents

User Level

This function is exclusively available for enterprise users.

Parameters

Exchange: The decentralized exchange where your liquidity pool is located.

Token A ID: The ID of the first token in the liquidity pool.

Token B ID: The ID of the second token in the liquidity pool.

Return Value

This function returns a string value which is the current value of your liquidity pool investment in USD.

Example

define areacode
ui text msg("Your investment value in USDT/ETH on Uniswap is: {$defi liquidity pool value("Uniswap", "USDT", "ETH")}")

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.

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox