Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Security

## @meteora-ag/dlmm [1.5.3] - PR #213

### Fixed

- added `canClosePosition` field in `processPosition`

## @meteora-ag/dlmm [1.5.2] - PR #209

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion ts-client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@meteora-ag/dlmm",
"version": "1.5.2",
"version": "1.5.3-rc.0",
"description": "",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
Expand Down
11 changes: 11 additions & 0 deletions ts-client/src/dlmm/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6316,6 +6316,16 @@ export class DLMM {
currentEpoch
).amount;

const canClosePosition =
posShares.every((share) => share.isZero()) &&
feeInfos.every(
(feeInfo) =>
feeInfo.feeXPending.isZero() && feeInfo.feeYPending.isZero()
) &&
positionRewardInfos.every((rewardInfo) =>
rewardInfo.rewardPendings.every((reward) => reward.isZero())
);

return {
totalXAmount: totalXAmount.toString(),
totalYAmount: totalYAmount.toString(),
Expand All @@ -6337,6 +6347,7 @@ export class DLMM {
feeXExcludeTransferFee,
feeYExcludeTransferFee,
owner: position.owner(),
canClosePosition,
};
}

Expand Down
1 change: 1 addition & 0 deletions ts-client/src/dlmm/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ export interface PositionData {
totalXAmountExcludeTransferFee: BN;
totalYAmountExcludeTransferFee: BN;
owner: PublicKey;
canClosePosition: boolean;
}

export interface SwapWithPriceImpactParams {
Expand Down
Loading