Skip to content

Commit 0b95caf

Browse files
committed
Fix LP controller
1 parent 8728c6f commit 0b95caf

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

src/api/controllers/LiquidityPoolController.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ export class LiquidityPoolController extends BaseApiController {
591591
if ((sender as string).startsWith('addr')) {
592592
query.where('deposits.senderPubKeyHash = :hash', {
593593
hash: lucidUtils.paymentCredentialOf(sender as string).hash
594-
}).orWhere('swaps.senderStakeKeyHash = :hash', {
594+
}).orWhere('deposits.senderStakeKeyHash = :hash', {
595595
hash: lucidUtils.stakeCredentialOf(sender as string).hash
596596
});
597597
} else {
@@ -675,7 +675,7 @@ export class LiquidityPoolController extends BaseApiController {
675675
if ((sender as string).startsWith('addr')) {
676676
query.where('withdraws.senderPubKeyHash = :hash', {
677677
hash: lucidUtils.paymentCredentialOf(sender as string).hash
678-
}).orWhere('swaps.senderStakeKeyHash = :hash', {
678+
}).orWhere('withdraws.senderStakeKeyHash = :hash', {
679679
hash: lucidUtils.stakeCredentialOf(sender as string).hash
680680
});
681681
} else {

src/dex/MinswapV2Analyzer.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import { LiquidityPoolDeposit } from '../db/entities/LiquidityPoolDeposit';
2525
import { LiquidityPoolWithdraw } from '../db/entities/LiquidityPoolWithdraw';
2626
import { OperationStatus } from '../db/entities/OperationStatus';
2727
import { LiquidityPool } from '../db/entities/LiquidityPool';
28+
import { logInfo } from '../logger';
2829

2930
/**
3031
* MinswapV2 constants.
@@ -199,6 +200,7 @@ export class MinswapV2Analyzer extends BaseAmmDexAnalyzer {
199200
const hasFactoryNft: boolean = output.assetBalances.some((balance: AssetBalance) => {
200201
return balance.asset.policyId === LP_TOKEN_POLICY_ID;
201202
});
203+
202204
if (! output.datum || ! hasFactoryNft) {
203205
return undefined;
204206
}

src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export function formatTransaction(block: BlockPraos | null, transaction: OgmiosT
9494
forTxHash: transaction.id,
9595
toAddress: output.address,
9696
datum: output.datum
97-
? (transaction.datums ? transaction.datums[output.datum] : output.datum)
97+
? (transaction.datums && output.datum in transaction.datums ? transaction.datums[output.datum] : output.datum)
9898
: (transaction.datums && output.datumHash ? transaction.datums[output.datumHash] : undefined),
9999
index: index,
100100
lovelaceBalance: BigInt(output.value.ada.lovelace),

0 commit comments

Comments
 (0)