DocsMethod reference

Position methods

Read, open, reduce, close, and adjust leveraged positions on Ethereum.

All four methods operate on Ethereum. market is ETH or BTC; type is long or short. Position IDs belong to their pool, so retain the market and side alongside the ID.

getPositions

Read one wallet's positions for a market and side. No signing.

Input
userAddress, market, type.
Output
PositionInfo[]: position ID, raw collateral and debt, their token symbols and decimals, current leverage, and LSD leverage.
Refresh
Read on Portfolio/Positions open and after the canonical receipt of a position or Borrow action. The app rejects malformed records; failed groups must not become empty balances.

increasePosition

Prepare a new position or add to an existing one.

Input
market, type, positionId (0 for new), userAddress, leverage, inputTokenAddress, positive amount, slippage, and optional targets.
Output
Position ID, slippage, and candidate routes with leverage, execution price, collateral/debt details, and ordered txs.
Review and refresh
FxAeon restricts routes to FxRoute. Sign only the selected, reviewed route, including exact approvals when returned. Reload positions after its action receipt is confirmed.

reducePosition

Prepare a partial reduction or full close of an existing position.

Input
market, type, existing positionId, userAddress, outputTokenAddress, positive amount, slippage, optional isClosePosition and targets.
Output
Position ID, slippage, and candidate routes with ordered transactions and minOut, execution price, leverage, collateral, and debt details.
Amount caveat
Partial reductions use raw collateral for longs, raw debt for BTC shorts, and raw debt converted with the live stETH-per-token rate for ETH shorts. The amount is not universally denominated in the output token. FxAeon derives it from the reviewed position; full close uses the SDK's close branch.
Refresh
Use the reviewed FxRoute, stop on any failed step, and reload positions after the canonical action receipt.

adjustPositionLeverage

Prepare a leverage change for an existing position.

Input
market, type, existing positionId, userAddress, target leverage, slippage, and optional targets.
Output
Position ID, slippage, and candidate routes with leverage, execution price, collateral/debt details, and ordered transactions.
Review and refresh
The app binds the returned leverage to the requested target and permits FxRoute only. Every step requires wallet approval. Reload positions after the canonical action receipt.

Token support is market-specific. See the service token and route validation (opens in a new tab) and position read and reduction handling (opens in a new tab).