Get liquidity pool balance

From UBot Studio
(Difference between revisions)
Jump to: navigation, search
 
(4 intermediate revisions by one user not shown)
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.
+
'''$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.
  
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.
+
LP tokens are given when you invest into a liquidity pool. They represent your share or stake in the pool.
 
+
== 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 where the liquidity pool resides.
  
'''Token A ID:''' The ID of the first token in the liquidity pool.
+
'''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 ID of the second token in the liquidity pool.
+
== Return Value ==
  
== Return Value ==
+
This function returns the number of LP tokens you currently hold from the specified liquidity pool.
 
+
This function returns a string value which is the current quantity of LP tokens you hold.
+
  
 
== 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")
 +
log("LP Token Balance: {$get liquidity pool balance("PancakeSwap", "ETH", "DAI")}")
 
</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.
+
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:
 +
 
 +
<blockquote>
 +
<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