Cancel Long Term Order
Details on how to withdraw long term order
How to cancel long term order?
Using API
Cancel long term order can be placed by calling ExitPool on the balancer vault. Here is how ExitPool looks like:
You can find complete details here. All the details remains same as ExitPool, only changes are in the way userData in ExitPoolRequest is constructed.
Request param details
Here is a sample way to create userData
in javascript.
The first parameter in the request data is always 4, which corresponds to the cancel long term order(CANCEL_LONG_TERM_ORDER) ExitKind. Other request parameter details are as follows:
orderId
: This is the orderId which you received when you placed long term order request.
Note:
The sender parameter in the request should be same as the recipient parameter in place long term order request.
LongTermOrderCancelled
LongTermOrderCancelled
event is emitted when the order is cancelled successfully.
Details available in the events:
orderId
: Represents the id of the order in the contract, this can be used to withdraw, cancel or to get the long term order details.buyTokenIndex
: This is the index of the pool token user wants to buy. Check this Vault API to get list of tokens and corresponding token index to use.sellTokenIndex
: This is the index of the pool token placed for sell. Check this Vault API to get list of tokens and corresponding token index to use.saleRate
: This represents the sale rate per block of the sell token.owner
: The details of the user placing the order.expirationBlock
: The block at which the order will expire.proceeds
: The sale proceeds from the order.unsoldAmount
: The unsold tokens from the order.
Place transaction using UI
Go to app.longswap.xyz.
Go to Long Term Swap tab.
Once the order history loads, go to the order card which you want to withdraw.
Click on Cancel and confirm the request from your wallet.
Verify the order is cancelled.
Last updated