Get liquidity pool balance

From UBot Studio
(Difference between revisions)
Jump to: navigation, search
 
(3 intermediate revisions by one user not shown)
Line 1: Line 1:
'''$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.
+
'''$get liquidity pool balance''' is a function that returns the number of LP (Liquidity Provider) tokens you have from a specific liquidity pool on a decentralized exchange.
 +
 
 +
LP tokens are given when you invest into a liquidity pool. They represent your share or stake in the pool.
  
 
== Parameters ==
 
== Parameters ==
  
'''Exchange:''' The decentralized exchange platform where the liquidity pool is located. The specific exchange can be chosen 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 LP balance. You can select 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 LP token balance. These can be the coin 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 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 that represents the quantity of LP tokens associated with the specified tokens in the liquidity pool.
+
This function returns the number of LP tokens you currently hold from the specified liquidity pool.
  
 
== Example ==
 
== Example ==
Line 17: Line 17:
 
<pre>
 
<pre>
 
ui console view
 
ui console view
config defi wallet("your private key here")
+
config defi wallet("your private key")
log("LP Token Balance: {$lp token balance("PancakeSwap","0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c","0x0E09FaBB73Bd3Ade0a17ECC321fD13a19e81cE82")}")
+
log("LP Token Balance: {$get liquidity pool balance("PancakeSwap", "ETH", "DAI")}")
 
</pre>
 
</pre>
  
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.
+
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 number of LP tokens you hold in the ETH-DAI pool on PancakeSwap.
  
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:
+
Example Output:
  
 
<blockquote>
 
<blockquote>
LP Token Balance
+
<p>LP Token Balance: 10</p>
 +
</blockquote>

Latest revision as of 01:36, 5 July 2023

$get liquidity pool balance is a function that returns the number of LP (Liquidity Provider) tokens you have from a specific liquidity pool on a decentralized exchange.

LP tokens are given when you invest into a liquidity pool. They represent your share or stake in the pool.

[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 LP token balance. These can be the coin symbol, or the contract address.

[edit] Return Value

This function returns the number of LP tokens you currently hold from the specified liquidity pool.

[edit] Example

ui console view
config defi wallet("your private key")
log("LP Token Balance: {$get liquidity pool balance("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 number of LP tokens you hold in the ETH-DAI pool on PancakeSwap.

Example Output:

LP Token Balance: 10

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox