Get liquidity pool balance

From UBot Studio
(Difference between revisions)
Jump to: navigation, search
(Created page with "'''$get lp tokens''' is a function that returns the quantity of Liquidity Provider (LP) tokens that you have in a liquidity pool on a decentralized exchange (DEX). LP tokens ...")
 
Line 1: Line 1:
'''$get lp tokens''' is a function that returns the quantity of Liquidity Provider (LP) tokens that you have in a liquidity pool on a decentralized exchange (DEX).
+
'''$defi liquidity pool tokens''' is a function that shows how many Liquidity Provider (LP) tokens you have. LP tokens are given when you invest into a liquidity pool and they represent your stake in the pool.
  
LP tokens are issued to liquidity providers when they invest into a liquidity pool. These tokens represent the provider's proportionate share in the pool and can be redeemed for the underlying assets at any time.
+
This function is especially useful for enterprise users who have staked in a liquidity pool and want to know the quantity of LP tokens they hold.
 +
 
 +
== User Level ==
 +
 
 +
This function is exclusively available for enterprise users.
  
 
== Parameters ==
 
== Parameters ==
  
'''Exchange:''' The decentralized exchange where you provided liquidity.
+
'''Exchange:''' The decentralized exchange where your liquidity pool is located.
  
'''Token A ID:''' The first token of the pair where you've invested.
+
'''Token A ID:''' The ID of the first token in the liquidity pool.
  
'''Token B ID:''' The second token of the pair where you've 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 number of LP tokens you have for the specified liquidity pool on the given exchange.
+
This function returns a string value which is the current quantity of LP tokens you hold.
  
 
== Example ==
 
== Example ==
  
 
<pre>
 
<pre>
log("Number of LP Tokens: {$get lp tokens("SushiSwap", "ETH", "SUSHI")}")
+
ui text msg("Your USDT/ETH LP tokens on Uniswap are: {$defi liquidity pool tokens("Uniswap", "USDT", "ETH")}")
 
</pre>
 
</pre>
  
In the example script above, the number of LP tokens the user has in the ETH-SUSHI liquidity pool on SushiSwap is determined and logged.
+
In this example, the function is calculating the quantity of LP tokens you hold in the USDT/ETH liquidity pool on Uniswap and displaying that value in the UI.
 
+
== Post-Run ==
+
 
+
After running this function, '''RecordTxData''' is executed to record transaction data.
+
 
+
**Please note:**
+
 
+
This function only shows the amount of LP tokens you hold in your wallet. It does not reveal the underlying assets or their worth. For that, you might use additional commands like '''$get liquidity value''' and others. Also, ensure that you're connected to the correct wallet account before running the function.
+

Revision as of 18:31, 4 July 2023

$defi liquidity pool tokens is a function that shows how many Liquidity Provider (LP) tokens you have. LP tokens are given when you invest into a liquidity pool and they represent your stake in the pool.

This function is especially useful for enterprise users who have staked in a liquidity pool and want to know the quantity of LP tokens they hold.

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 quantity of LP tokens you hold.

Example

ui text msg("Your USDT/ETH LP tokens on Uniswap are: {$defi liquidity pool tokens("Uniswap", "USDT", "ETH")}")

In this example, the function is calculating the quantity of LP tokens you hold in the USDT/ETH liquidity pool on Uniswap and displaying that value in the UI.

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox