# arl:lock-position — Ammora SDK 0.3.8 Permanently lock liquidity in a concentrated position. npm run arl:lock-position -- [liquidity] Locking is one-way. Without a liquidity argument this locks everything still unlocked, which is what a creator proving their liquidity is committed usually wants. If you are creating the pool as well, the factory's createProductionPoolLocked seals the first position in the creating call, so there is no window where it is unlocked at all. [Read in Docs](https://docs.ammora.org/examples?command=arl%3Alock-position) · [Detailed guide](https://docs.ammora.org/guides/src-arl-readme) · [Local setup](https://docs.ammora.org/guides/example-setup) ## Context and execution GIWA Sepolia 91342. Public SDK 0.3.8, Math 0.3.0. Source revision: `a9b3fd798fa51495e8defec99a25de59e4d70672`. Install the SDK in your app, or prepare the example project using the local setup guide for its npm commands. Review the entry source and guide for required arguments, roles and deployment selection. `AMMORA_SEND=0` does not turn send-only commands into previews. Never put CLI keys in a browser or resend an uncertain transaction. Command: `npm run arl:lock-position -- ` (`tsx src/arl/lock-position.ts`). Omit `--` and arguments when the source accepts none. ## Entry file: `src/arl/lock-position.ts` ```typescript /** * Permanently lock liquidity in a concentrated position. * * npm run arl:lock-position -- [liquidity] * * Locking is one-way. Without a liquidity argument this locks everything still unlocked, * which is what a creator proving their liquidity is committed usually wants. * * If you are creating the pool as well, the factory's createProductionPoolLocked seals the * first position in the creating call, so there is no window where it is unlocked at all. */ import { DammV2Client } from "@ammora-protocol/sdk"; import { clientOptions, address, deployment, reader, signer } from "../shared/env.js"; import { aboutPosition, main, requireContract, send } from "../shared/run.js"; main(async () => { const [poolArgument, tokenIdArgument, liquidityArgument] = process.argv.slice(2); const pool = address("ARL_POOL", poolArgument); if (!tokenIdArgument || !/^\d+$/.test(tokenIdArgument)) { throw new Error("usage: [liquidity]"); } const tokenId = BigInt(tokenIdArgument); const { wallet, account } = signer(); const client = await reader(); const contracts = deployment().contracts.launch; await requireContract(client, "pool", pool); const sdk = new DammV2Client( client, pool, "concentrated", contracts.concentratedFactory, contracts.concentratedPositionManager, clientOptions(), ); const position = await aboutPosition(tokenId, () => sdk.getManagedConcentratedPosition(tokenId)) as { unlockedLiquidity: bigint; permanentLockedLiquidity: bigint; }; const liquidity = liquidityArgument ? BigInt(liquidityArgument) : position.unlockedLiquidity; console.log(`pool ${pool}`); console.log(`position ${tokenId}`); console.log(`unlocked ${position.unlockedLiquidity}`); console.log(`already locked ${position.permanentLockedLiquidity}`); console.log(`locking ${liquidity}`); if (liquidity === 0n) { console.log("\nnothing unlocked to lock, no transaction sent"); return; } if (liquidity > position.unlockedLiquidity) { throw new Error(`only ${position.unlockedLiquidity} is unlocked`); } console.log("\nthis cannot be undone"); await send( "permanentLockPosition", await sdk.planPermanentLockManagedConcentratedPosition(tokenId, liquidity, account.address), wallet, account, client, ); }); ``` ## Supporting files Keep relative paths intact. Local imports are listed recursively; JSON templates are choices to review, not approved inputs. Runtime-selected files and wallet/environment setup still follow the detailed guide. - [src/shared/env.ts](https://docs.ammora.org/examples/source/src/shared/env.ts.txt) - [src/shared/input.ts](https://docs.ammora.org/examples/source/src/shared/input.ts.txt) - [src/shared/retry.ts](https://docs.ammora.org/examples/source/src/shared/retry.ts.txt) - [src/shared/rpc.ts](https://docs.ammora.org/examples/source/src/shared/rpc.ts.txt) - [src/shared/run.ts](https://docs.ammora.org/examples/source/src/shared/run.ts.txt) - [package.json](https://docs.ammora.org/examples/source/package.json.txt) - [package-lock.json](https://docs.ammora.org/examples/source/package-lock.json.txt) - [tsconfig.json](https://docs.ammora.org/examples/source/tsconfig.json.txt) - [.env.giwa.example](https://docs.ammora.org/examples/source/file.env.giwa.example.txt) - [.nvmrc](https://docs.ammora.org/examples/source/file.nvmrc.txt) ## AI implementation checklist Use the actual SDK exports and parameter types in the linked files. Start with reads and unsigned plans where supported. Use a connected wallet for browser signing. Preserve raw integer units, exact approvals, caller authority, deadlines and receipt reconciliation. Report local checks separately from live-chain verification.