Type/to search
Built-in Functions
Structures
Built-in Variables and Constants
Conventions
Exchanges
Capability Matrix
Centralized Exchanges
Decentralized Exchanges (DEX)
Hyperliquid
Lighter
edgeX
Aster
Aevo
Pendle
WOOFi Pro
Uniswap / PancakeSwap
Aerodrome / Velodrome
exchange.IO("lp.stake", ...)
exchange.IO("lp.unstake", ...)
exchange.IO("lp.claim", ...)
KyberSwap
1inch
EVM DEX Common Commands
Jupiter
OKX DEX
DEX Strategy Examples
Prediction Markets
Securities and Futures
On-chain & Custom

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

TypeDescription

object / null value

{positions: [{id, gauge, txHash, rewards}]}, where rewards is the reward tokens received in that transaction; basic pools also have lpTokens (the LP tokens returned). Null with an error on failure.

Arguments

NameTypeRequiredDescription

k

string

Yes

Set to lp.unstake to take positions out of the gauge.

positionIds

string / array

Yes

Position IDs: one ID or an array; Slipstream positions such as aero:123 or aero2:456 (velo: and velo2: on Velodrome), basic pools by the pool address.

See Also

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.