Skip to content

Commit

Permalink
rm methods user event records
Browse files Browse the repository at this point in the history
  • Loading branch information
crispheaney committed Dec 10, 2024
1 parent d741f42 commit 4a1467a
Showing 1 changed file with 0 additions and 67 deletions.
67 changes: 0 additions & 67 deletions sdk/src/dlob/DLOB.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,73 +170,6 @@ export class DLOB {
return true;
}

public handleOrderRecord(record: OrderRecord, slot: number): void {
this.insertOrder(record.order, record.user.toString(), slot, false);
}

public handleOrderActionRecord(
record: OrderActionRecord,
slot: number
): void {
if (isOneOfVariant(record.action, ['place', 'expire'])) {
return;
}

if (isVariant(record.action, 'trigger')) {
if (record.taker !== null) {
const takerOrder = this.getOrder(record.takerOrderId, record.taker);
if (takerOrder) {
this.trigger(takerOrder, record.taker, slot, false);
}
}

if (record.maker !== null) {
const makerOrder = this.getOrder(record.makerOrderId, record.maker);
if (makerOrder) {
this.trigger(makerOrder, record.maker, slot, false);
}
}
} else if (isVariant(record.action, 'fill')) {
if (record.taker !== null) {
const takerOrder = this.getOrder(record.takerOrderId, record.taker);
if (takerOrder) {
this.updateOrder(
takerOrder,
record.taker,
slot,
record.takerOrderCumulativeBaseAssetAmountFilled
);
}
}

if (record.maker !== null) {
const makerOrder = this.getOrder(record.makerOrderId, record.maker);
if (makerOrder) {
this.updateOrder(
makerOrder,
record.maker,
slot,
record.makerOrderCumulativeBaseAssetAmountFilled
);
}
}
} else if (isVariant(record.action, 'cancel')) {
if (record.taker !== null) {
const takerOrder = this.getOrder(record.takerOrderId, record.taker);
if (takerOrder) {
this.delete(takerOrder, record.taker, slot);
}
}

if (record.maker !== null) {
const makerOrder = this.getOrder(record.makerOrderId, record.maker);
if (makerOrder) {
this.delete(makerOrder, record.maker, slot);
}
}
}
}

public insertOrder(
order: Order,
userAccount: string,
Expand Down

0 comments on commit 4a1467a

Please sign in to comment.