Add liquidity
(→Example) |
(→Example) |
||
(3 intermediate revisions by one user not shown) | |||
Line 1: | Line 1: | ||
'''add liquidity''' is a command that allows you to add liquidity to a liquidity pool on a decentralized exchange. | '''add liquidity''' is a command that allows you to add liquidity to a liquidity pool on a decentralized exchange. | ||
− | |||
− | |||
== Parameters == | == Parameters == | ||
Line 7: | Line 5: | ||
'''Exchange:''' The decentralized exchange where the liquidity pool resides. | '''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 to which you want to add liquidity. | + | '''Token A ID''' and '''Token B ID:''' The pair of tokens involved in the liquidity pool to which you want to add liquidity. These can be the symbol of the token or their contract addresses. |
'''Amount A''' and '''Amount B:''' The amount of each respective token that you want to contribute to the liquidity pool. | '''Amount A''' and '''Amount B:''' The amount of each respective token that you want to contribute to the liquidity pool. | ||
Line 18: | Line 16: | ||
ui console view | ui console view | ||
config defi wallet("your private key") | config defi wallet("your private key") | ||
− | add liquidity(" | + | add liquidity("PancakeSwap", "ETH", "DAI", "1", "1000", '#txid') |
log object(#txid) | log object(#txid) | ||
</pre> | </pre> | ||
− | The script above adds liquidity to the ETH-DAI pool on | + | 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 script above adds liquidity to the ETH-DAI pool on PancakeSwap, contributing 1 ETH and 1000 DAI. It then logs the transaction details to the console. | ||
− | + | Note that this script assumes that the tokens already exist in you wallet in the specified amounts. It also assumes you have enough of the native token to pay gas fees. |
Latest revision as of 02:06, 5 July 2023
add liquidity is a command that allows you to add liquidity to a liquidity pool on a decentralized exchange.
[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 to which you want to add liquidity. These can be the symbol of the token or their contract addresses.
Amount A and Amount B: The amount of each respective token that you want to contribute to the liquidity pool.
Transaction Info Variable: (optional) The variable to store the transaction information after the liquidity is added. The default is '#txinfo'.
[edit] Example
ui console view config defi wallet("your private key") add liquidity("PancakeSwap", "ETH", "DAI", "1", "1000", '#txid') log object(#txid)
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 script above adds liquidity to the ETH-DAI pool on PancakeSwap, contributing 1 ETH and 1000 DAI. It then logs the transaction details to the console.
Note that this script assumes that the tokens already exist in you wallet in the specified amounts. It also assumes you have enough of the native token to pay gas fees.