Type/to search
Built-in Functions
Structures
Built-in Variables and Constants
Conventions
Exchanges
Capability Matrix
Centralized Exchanges
Decentralized Exchanges (DEX)
Prediction Markets
Securities and Futures
On-chain & Custom

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

TypeDescription

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 inf: on Uniswap) or when no ID is given.

Arguments

NameTypeRequiredDescription

k

string

Yes

Set to lp.track to register positions.

positionIds

string / array

Yes

Position IDs to register: one ID or an array such as ["v4:123456"]; on Aerodrome and Velodrome basic pool addresses can be registered too.

See Also

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.