exchange.IO("lp.unstake", ...)
Aerodrome and Velodrome: takes staked positions out of the gauge; Slipstream positions also claim their accrued rewards.
exchange.IO(k, positionIds)Examples
Take every staked position out of the gauge.
javascript
function main() {
var ids = exchange.IO("lp.positions").filter(function (p) {
return p.staked
}).map(function (p) { return p.id })
if (ids.length == 0) {
return
}
var r = exchange.IO("lp.unstake", ids)
if (!r) {
Log("Unstaking failed:", GetLastError())
return
}
r.positions.forEach(function (p) {
Log(p.id, "taken out, rewards received:", p.rewards)
})
}Returns
| Type | Description |
object / null value |
|
Arguments
| Name | Type | Required | Description |
k | string | Yes | Set to |
positionIds | string / array | Yes | Position IDs: one ID or an array; Slipstream positions such as |
See Also
Aerodrome / Velodrome exchange.IO exchange.IO("lp.stake") exchange.IO("lp.unstake") exchange.IO("lp.claim") exchange.IO("lp.positions") exchange.IO("lp.pools")
Remarks
One transaction per position. A Slipstream position NFT comes back together with its accrued rewards; a basic pool returns all staked LP tokens and leaves the rewards in the gauge for lp.claim.
Once taken out, the position earns trading fees again and can be increased, decreased, collected or withdrawn; to withdraw, just call lp.remove, which takes staked positions out first.