Lifecycle actions
| Action | JavaScript method | Python method |
|---|---|---|
| Open by ticks | openPosition | open_position |
| Open by percent range | openPositionByPct | open_position_by_pct |
| Open by price range | openPositionByPrice | open_position_by_price |
| Read opened position key from a receipt | extractOpenedKeyFromReceipt | extract_opened_key_from_receipt |
| Add collateral | addCollateral | add_collateral |
| Remove collateral | removeCollateral | remove_collateral |
| Change range by ticks | changeRange | change_range |
| Change range by percent | changeRangeByPct | change_range_by_pct |
| Change range by price | changeRangeByPrice | change_range_by_price |
| Collect fees | collectFeesToUSDC | collect_fees_to_usdc |
| Compound fees | compoundFees | compound_fees |
| Exit position | exitPosition | exit_position |
| Allow bot | allowBotForPosition | allow_bot_for_position |
| Withdraw dust | withdrawDust | withdraw_dust |
| Return NFT | returnNft | return_nft |
Core reads and utilities
| Category | JavaScript method | Python method |
|---|---|---|
| User position listings | getUserPositionKeys, getUserPositionDetailsReadable | get_user_position_keys, get_user_position_details_readable |
| Fees and spot amounts | pendingFees, spotAmounts | pending_fees, spot_amounts |
| Raw position reads | getPosition, getPositionDetails | get_position, get_position_details |
| Readable position reads | getPositionReadable, getPositionDetailsReadable | get_position_readable, get_position_details_readable |
| Position polling | waitForPosition | wait_for_position |
| USDC helpers | usdcDecimals, walletUsdcBalance | usdc_decimals, wallet_usdc_balance |
| DEX and pool resolution | resolveDexAdapter, getPoolAddress | resolve_dex_adapter, get_pool_address |
| Receipt and error decoding | decodeReceiptEvents, decodeCustomError | decode_receipt_events, decode_custom_error |
| Allowlist and pool status | isPoolAllowed, isPoolDeprecated, listAllowedPools | is_pool_allowed, is_pool_deprecated, list_allowed_pools |
| USDC valuation reads | positionValueUsdc, valuationUsdc | position_value_usdc, valuation_usdc |
| Low-level manager/core calls | callManager, sendManager, callCore, sendCore | call_manager, send_manager, call_core, send_core |
Python automation functions
| Function | What you use it for | Typical use |
|---|---|---|
| run_strategy(...) | Run a strategy file on an interval. | Start your automated workflow. |
| read_snapshot(...) | Read the position data your strategy uses. | Check prices, range status, and pending fees. |
| execute_actions(...) | Apply planned actions such as set range, compound, collect, or exit. | Turn strategy decisions into real actions. |
| load_state(...) and save_state(...) | Keep strategy state between runs. | Track timers or other strategy memory. |
| usdc_to_raw(...) | Convert a readable USDC amount into raw units. | Use thresholds like $10 or $25 in a strategy. |
Best starting points
- For standard SDK integration, start with openPosition, readPosition, listUserPositions, and endToEnd examples in the language folder you plan to use.
- For Python automation, start with python/strategies/example_strategy.py, add your position key, and keep EXECUTE = False for the first run.
- If you want to use another chain, change RPC_URL to an RPC endpoint for that network before running the examples or strategy.
- Use the read methods to confirm position state and pending fees before moving on to live lifecycle actions.
Execution defaults
Lifecycle writes default to 0.5% slippage when a method accepts slippage and none is supplied. For Python automation, keep EXECUTE = False until you have reviewed the planned actions.