add additional step of checking LP token value

This commit is contained in:
Oliver Eggert
2024-07-05 16:38:41 -07:00
parent 14e623bb96
commit af5ecee5d5
2 changed files with 10 additions and 4 deletions

View File

@@ -109,7 +109,7 @@ if (response_vote.result.meta.TransactionResult == "tesSUCCESS") {
console.error("Error sending transaction:", response_vote) console.error("Error sending transaction:", response_vote)
} }
// OPTIONAL: Get LP tokens value // Get LP tokens value
console.log("------- Calculate value of my LP tokens -------") console.log("------- Calculate value of my LP tokens -------")
const lp_deposit_data = lp_deposit.result.meta.AffectedNodes const lp_deposit_data = lp_deposit.result.meta.AffectedNodes

View File

@@ -50,12 +50,18 @@ You can contribute either one or both assets to an AMM pool. Contributing just o
### 4. Vote on trading fees ### 4. Vote on trading fees
This step isn't required, but you're encouraged to submit a vote for a fee structure you believe makes sense. This step is optional, but you're encouraged to submit a vote for a fee structure you believe makes sense.
{% code-snippet file="/_code-samples/add-amm-lp/js/add-amm-lp.js" language="js" from="// Vote on fees" before="// Withdraw by redeeming LP tokens" /%} {% code-snippet file="/_code-samples/add-amm-lp/js/add-amm-lp.js" language="js" from="// Vote on fees" before="// Get LP tokens value" /%}
### 5. Withdraw assets from the AMM ### 5. Check the value of your LP tokens
This step is optional, but is useful for checking on your LP token values without withdrawing the assets.
{% code-snippet file="/_code-samples/add-amm-lp/js/add-amm-lp.js" language="js" from="// Get LP tokens value" before="// Withdraw by redeeming LP tokens" /%}
### 6. Withdraw assets from the AMM
Similar to depositing assets, you can withdraw either one or both assets from the AMM pool. Withdrawing a single asset incurs a fee, while withdrawing both does not. When you withdraw by redeeming LP Tokens, you are paid out in both assets. Similar to depositing assets, you can withdraw either one or both assets from the AMM pool. Withdrawing a single asset incurs a fee, while withdrawing both does not. When you withdraw by redeeming LP Tokens, you are paid out in both assets.