Skip to content

Commit

Permalink
sdk: add back to delete to dlob (#1418)
Browse files Browse the repository at this point in the history
  • Loading branch information
crispheaney authored Jan 8, 2025
1 parent 68e25c7 commit b78b0c3
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sdk/src/constants/spotMarkets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,8 @@ export const MainnetSpotMarkets: SpotMarketConfig[] = [
precision: new BN(10).pow(NINE),
precisionExp: NINE,
launchTs: 1716595200000,
pythFeedId: '0x41f858bae36e7ee3f4a3a6d4f176f0893d4a261460a52763350d00f8648195ee'
pythFeedId:
'0x41f858bae36e7ee3f4a3a6d4f176f0893d4a261460a52763350d00f8648195ee',
},
{
symbol: 'USDY',
Expand Down
22 changes: 22 additions & 0 deletions sdk/src/dlob/DLOB.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,28 @@ export class DLOB {
});
}

public delete(
order: Order,
userAccount: PublicKey,
slot: number,
onDelete?: OrderBookCallback
): void {
if (isVariant(order.status, 'init')) {
return;
}

this.updateRestingLimitOrders(slot);

this.getListForOnChainOrder(order, slot)?.remove(
order,
userAccount.toString()
);

if (onDelete) {
onDelete();
}
}

public getListForOnChainOrder(
order: Order,
slot: number
Expand Down

0 comments on commit b78b0c3

Please sign in to comment.