Withdraw Directly on Chain
Navigate to Polygonscan and paste in the contract address (listed below) for the contract you need to interact with and then navigate to the "Contract" section to interact with the contract.
Smart Contracts
V3 exchange:
0x3253a7e75539edaeb1db608ce6ef9aa1ac9126b6
Farms v1 (Single):
0xb9c951c85c8646dafcdc0ad99d326c621abbadce
Farms v2 (Dual):
0xb17c0f6b1c34cd3ee989c0df5b560de909f89f95
LP Token Withdrawal from Farms
Verify the correct farms by finding its PID. Withdrawing from farms requires a PID so you will need to know the PID where you farmed.
If you know the farm, you can find the "Farm ID" here
If you don't know what farms you had assets at, you can find out by following this guide:
1.1: Navigate to the farms contract (v1 or v2) on Polygonscan, navigate to
Read Contract
and call theuserInfo
function and input the farms PID and your wallet address and pressquery
, like this:If the
Amount
field is a non zero value, it means that you have a farm in this contract and you can proceed to the next step.
1.2: On the same farms page on PolygonScan, navigate to the
WriteContract
field, select the withdraw function and input the farms PID and the amount found on theuserInfo
field, then presswrite
and sign the transaction. This should withdraw the LP tokens to your wallet, to be deposited to exchange1.3: On the same farms page, query the
poolInfo
function by passing the PID to be used later (Depositing LP tokens to exchange steps)
Deposit LP Tokens to IDEX to Unwind
After you have withdrawn your LP tokens from farms, you must deposit the LP tokens to the exchange
1.1: Check how much you have in your balances. Query the
balanceOf
function on the LP contract itself to get the full value:1.2: Copy the full amount value and navigate to the exchange contract on Polygonscan, click on Write Contract then select
depositTokenByAddress
and input the amount on thequantityInAssetUnits
field and thelpToken
contract copied fromFarms Withdrawal, 2, i
tokenAddress
field then hit write and sign the transaction
Note: If you receive an error when depositing LP tokens to the contract, make sure that you haven't revoked (Ie: removed allowance, 0 approval). If you somehow revoked the contract, you will need to manually approve the LP tokens for the exchange contract.
How to check if you have allowance (approved)
Navigate to the LP token contract, then
ReadContract
and expand theAllowance
function2.1: Input your wallet address on the owner field and the exchange contract address on the spender field and click query to view the allowance
2.2: If the call returns
115792089237316195423570985008687907853269984665640564039457584007913129639935
it means you approved and have the max value as allowance. If it's less but not receiving any errors, then you can proceed.
If you don't have an allowance for the contract, you'll need to approve manually. First check your LP token balance by navigating to the LP contract > Read Only > then click
balanceOf
function to expand it and input your wallet address and copy the balance:Once you have copied their balance, then you’ll need to approve it. On the same LP token page, navigate to the
Write Contract
page then clickexpand
the approve function and the user can input the exchange contract on the spender field, and the balance they copied from step #3 on the amount field, then click write and sign the transaction.
Unwinding LP Tokens
To initiate token withdrawals, you must call the
exitWallet
function from the exchange contract.1.2: Then click on
Write Contract
and thenExit Wallet
and hit write and sign the transaction. Wait until the Chain Propagation Period is over.
Then, navigate to the LP contract on Polygonscan and select
Read Only
. Now find thebaseAssetAddress
andquoteAssetAddress
, click to expand and copy the addressesNavigate to the exchange contract and click
Write Contract
and scroll down toremoveLiquidityExit
and paste thebaseAssetAddress
andquoteAssetAddress
on the fields, click write then sign the transaction:This should withdraw your liquidity from the exchange as tokens.
Withdrawing Tokens
To initiate token withdrawals, you must call the
exitWallet
function from the exchange contract.1.2: Then click on
Write Contract
and thenExit Wallet
and hit write and sign the transaction. Wait until the Chain Propagation Period is over.
Note: To check if you have funds inside the contract, navigate to the exchange contract then click on Read Only
function. Expand loadBalanceInAssetUnitsByAddress
or similar functions (loadBalanceInAssetUnitsBySymbol
, loadBalanceInPipsByAddress
…) and enter the details on the fields. For example: For loadBalanceInAssetUnitsByAddress
you will need to enter the wallet address and the asset’s contract address (if you have LP deposited, you will need to query the LP token contract address, or the token address if just tokens)
Navigate to the exchange contract then
Write Contract
and scroll down towithdrawExit
function. Click to expand and enter the asset’s contract address. Click write and sign the transaction:
Last updated