@picon-finance/dlmm-sdk the same way an
interactive app would, just driven by a scheduler instead of a UI.
Watching for rebalance triggers
Subscribe toSwapEvent scoped to the pools you manage positions in, and compare
postBinId against your tracked positions’ [lowerBinId, upperBinId] ranges — this tells you
the moment the active bin exits (or approaches the edge of) a managed range, without polling:
withdraw followed by a fresh openPosition + depositByWeight at a
new range — there’s no dedicated “rebalance” instruction, since the underlying operations are
already permissionless and composable.
Harvesting fees on a schedule
position.getInfo() makes exactly one RPC round trip and returns netFeeX/netFeeY — cheap
enough to poll across a managed portfolio to decide when a claim is worth the transaction cost:
Position.claimAllFees() batches efficiently — see
SDK → Positions.
Implementing shape strategies
Since Spot/Curve/Bid-Ask aren’t SDK concepts (see Positions and liquidity), a shape-strategy bot owns this logic itself. The pattern is straightforward — generate a weight array as a pure function of range width and active-bin position, then pass it straight todepositByWeight:
Choosing a distribution mode for automated deposits
For a bot depositing on a user’s behalf without per-deposit user input,Balanced is usually
the safer default — it won’t silently overweight one side of a volatile active bin the way
UnbalancedX/UnbalancedY can. Be aware Balanced can leave part of a side’s requested amount
undeposited if the two sides’ weight demand is asymmetric (see
Positions and liquidity) — reconcile
your bot’s accounting against what was actually charged (readable from the resulting
DepositEvent), not just what was requested.