Transaction Structure
Every CLMM interaction goes throughcreateVaultSyncTransaction, which returns three parts:
Deposit Liquidity
clmmAction.depositLiquidity creates a new LP position on the CLMM with a specified tick range. The LP position keypair is generated internally and returned in result.signers.
Parameters
The LP position keypair is generated internally by the SDK. After calling
createVaultSyncTransaction, the keypair is available in result.signers[0]. Save the public key to reference this position in future operations (add liquidity, withdraw, claim emissions).Add Liquidity
clmmAction.addLiquidity adds more liquidity to an existing LP position.
Parameters
A matching policy must exist before executing. See Policy Builders.
Withdraw Liquidity
clmmAction.withdrawLiquidity removes liquidity from an LP position, receiving PT and SY back.
Parameters
A matching policy must exist before executing. See Policy Builders.
Buy PT
clmmAction.buyPt buys PT with SY on the CLMM.
Parameters
A matching policy must exist before executing. See Policy Builders.
Sell PT
clmmAction.sellPt sells PT for SY on the CLMM.
Parameters
A matching policy must exist before executing. See Policy Builders.
Buy YT
clmmAction.buyYt buys YT with SY on the CLMM.
Parameters
A matching policy must exist before executing. See Policy Builders.
Sell YT
clmmAction.sellYt sells YT for SY on the CLMM.
Parameters
A matching policy must exist before executing. See Policy Builders.
Trade PT (Low-Level)
clmmAction.tradePt is a low-level PT/SY swap that accepts a SwapDirection. For most use cases, prefer buyPt or sellPt.
Parameters
A matching policy must exist before executing. See Policy Builders.
Claim Farm Emission
clmmAction.claimFarmEmission claims farm emissions from an LP position.
Parameters
A matching policy must exist before executing. See Policy Builders.