Get liquidity pool balance

From UBot Studio
(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
'''$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 token balance''' is a function that displays the quantity of LP (Liquidity Provider) tokens you have. LP tokens are given when you invest in a liquidity pool and represent your stake in the pool. This function is commonly used by enterprise users who are engaged in liquidity providing in DeFi protocols.
 
+
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 your liquidity pool is located.
+
'''Exchange:''' The decentralized exchange platform where the liquidity pool is located. The specific exchange can be chosen 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 LP balance. You can select 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 LP balance. You can select the token from the dropdown menu or type its contract address.
  
== Return Value ==  
+
== Return Value ==
  
This function returns a string value which is the current quantity of LP tokens you hold.
+
This function returns a string that represents the quantity of LP tokens associated with the specified tokens in the liquidity pool.
  
 
== Example ==
 
== Example ==
  
 
<pre>
 
<pre>
ui text msg("Your USDT/ETH LP tokens on Uniswap are: {$defi liquidity pool tokens("Uniswap", "USDT", "ETH")}")
+
ui console view
 +
config defi wallet("your private key here")
 +
log("LP Token Balance: {$lp token balance("PancakeSwap","0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c","0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82")}")
 
</pre>
 
</pre>
  
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.
+
Be sure to replace "your private key here" with your actual private key. Remember, private keys are sensitive information, and they should be stored and handled securely.
 +
 
 +
The output of this script will display the balance of LP tokens for the specified liquidity pool (with tokens signified by IDs "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c" and "0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82" on the "PancakeSwap" exchange). An example of the resulting output could be:
 +
 
 +
<blockquote>
 +
LP Token Balance

Revision as of 19:00, 4 July 2023

$lp token balance is a function that displays the quantity of LP (Liquidity Provider) tokens you have. LP tokens are given when you invest in a liquidity pool and represent your stake in the pool. This function is commonly used by enterprise users who are engaged in liquidity providing in DeFi protocols.

Parameters

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

Token A ID: The identifier of the first token in the liquidity pool for which you want to calculate the LP balance. You can select 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 LP balance. You can select the token from the dropdown menu or type its contract address.

Return Value

This function returns a string that represents the quantity of LP tokens associated with the specified tokens in the liquidity pool.

Example

ui console view
config defi wallet("your private key here")
log("LP Token Balance: {$lp token balance("PancakeSwap","0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c","0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82")}")

Be sure to replace "your private key here" with your actual private key. Remember, private keys are sensitive information, and they should be stored and handled securely.

The output of this script will display the balance of LP tokens for the specified liquidity pool (with tokens signified by IDs "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c" and "0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82" on the "PancakeSwap" exchange). An example of the resulting output could be:

LP Token Balance
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox