Get farm balance

From UBot Studio
(Difference between revisions)
Jump to: navigation, search
(Created page with "'''$get lp token balance''' is a function that returns the balance of Liquidity Provider (LP) tokens you have staked in a particular yield farm. Yield farming, also known as ...")
 
 
(3 intermediate revisions by one user not shown)
Line 1: Line 1:
'''$get lp token balance''' is a function that returns the balance of Liquidity Provider (LP) tokens you have staked in a particular yield farm.
+
'''$get farm balance''' is a function that returns the balance of LP (Liquidity Provider) tokens you have staked in a specific yield farm.
 
+
Yield farming, also known as liquidity mining, is a process that allows cryptocurrency holders to lock up their holdings, in return for rewards, typically in the form of additional cryptocurrency.
+
  
 
== Parameters ==
 
== Parameters ==
  
'''Farm:''' The yield farm where you have staked your LP tokens.
+
'''Farm:''' The yield farm from where you want to claim your rewards. If the farm you want isn't in the list, you can find it and get it added to the list via the '''$find farm by tokens''' function.
  
 
== Return Value ==
 
== Return Value ==
  
This function returns a string representing the quantity of staked LP tokens you have in the specified yield farm.
+
This function returns the total number of LP tokens you have staked in the chosen yield farm.
  
 
== Example ==
 
== Example ==
  
 
<pre>
 
<pre>
log("LP Tokens Staked in Farm: {$get lp token balance("SushiSwap")}")
+
ui console view
 +
config defi wallet("your private key")
 +
log("Farm Balance: {$get farm balance("DOGE_WBNB_Farm")}")
 
</pre>
 
</pre>
  
In the example above, the function retrieves the balance of LP tokens staked in the specified yield farm on the SushiSwap network and logs the balance.
+
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 staked LP tokens you have in the specified farm.
  
**Please note:**
+
Example Output:
  
This function will only show the balance of your LP tokens staked in the yield farm. It does not fetch the underlying assets or their value. For that, you will need to use additional functions like '''$get liquidity value''' and others.
+
<blockquote>
 +
<p>Farm Balance: 50</p>
 +
</blockquote>

Latest revision as of 00:12, 5 July 2023

$get farm balance is a function that returns the balance of LP (Liquidity Provider) tokens you have staked in a specific yield farm.

[edit] Parameters

Farm: The yield farm from where you want to claim your rewards. If the farm you want isn't in the list, you can find it and get it added to the list via the $find farm by tokens function.

[edit] Return Value

This function returns the total number of LP tokens you have staked in the chosen yield farm.

[edit] Example

ui console view
config defi wallet("your private key")
log("Farm Balance: {$get farm balance("DOGE_WBNB_Farm")}")

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 staked LP tokens you have in the specified farm.

Example Output:

Farm Balance: 50

Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox