exchange.IO("lp.track", ...)
Registers position IDs so that lp.positions finds them even when the node does not serve the full log history (recovering older positions after a restart).
exchange.IO(k, positionIds)Examples
After a restart, register the saved position IDs and list the positions.
javascript
function main() {
var ids = _G("lpIds") // saved with _G("lpIds", ids) when the positions were added
if (ids && ids.length > 0) {
Log("Registered:", exchange.IO("lp.track", ids))
}
Log(exchange.IO("lp.positions"))
}Returns
| Type | Description |
array / null value | Every position ID remembered by this process (V3 positions excluded). Null with an error for a prefix that does not match the exchange object (such as |
Arguments
| Name | Type | Required | Description |
k | string | Yes | Set to |
positionIds | string / array | Yes | Position IDs to register: one ID or an array such as |
See Also
Uniswap / PancakeSwap Aerodrome / Velodrome exchange.IO exchange.IO("lp.positions") exchange.IO("lp.add")
Remarks
Registration is for V4/Infinity CL positions (v4:, inf:), Slipstream positions (aero:, aero2:, velo:, velo2:) and basic pool addresses; V3 positions are listed by the PositionManager per wallet and are ignored. Registered positions are checked on chain, and lp.positions verifies ownership on chain every time (staked positions by their staker), leaving out transferred positions.
Registrations live in this process only and must be repeated after a restart: a strategy can save the IDs returned by lp.add (for example with _G()) and register them at startup. Positions created by lp.add in this process are remembered automatically.