361 lines
28 KiB
HTML
361 lines
28 KiB
HTML
<!-- file: kb_demo_app/frontend/demo3.html -->
|
|
<!DOCTYPE html>
|
|
<html lang="fr">
|
|
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
<title>Demo3 On-chain DEX Discovery</title>
|
|
<link rel="stylesheet" href="sass/main.scss" />
|
|
</head>
|
|
|
|
<body class="bg-body-tertiary">
|
|
<header class="app-header">
|
|
<nav class="navbar navbar-expand-lg h-100 py-0 bg-light text-dark">
|
|
<div class="container my-0">
|
|
<a class="navbar-brand d-flex align-items-center" href="/">
|
|
<img alt="Logo" src="imgs/logo.png" class="app-logo" />
|
|
<span class="ps-2 fs-4 fw-bold text-primary font-logo">Khadhroony-BoBoBot</span>
|
|
</a>
|
|
<span class="badge text-bg-primary">Demo3</span>
|
|
</div>
|
|
</nav>
|
|
</header>
|
|
|
|
<main class="app-main">
|
|
<div class="osb-scrollable pt-1 pb-4" data-simplebar>
|
|
<div class="container-fluid py-4">
|
|
<div class="row g-4">
|
|
<div class="col-12 col-xxl-4">
|
|
<div class="card shadow-sm border-0 mb-4">
|
|
<div class="card-body">
|
|
<div class="d-flex justify-content-between align-items-center mb-3">
|
|
<h1 class="h4 mb-0">On-chain DEX discovery</h1>
|
|
<span id="demo3StatusBadge" class="badge text-bg-secondary">idle</span>
|
|
</div>
|
|
<p class="text-body-secondary small mb-3">
|
|
Recherche directement sur Solana via <code>getSignaturesForAddress</code> + <code>getTransaction</code>.
|
|
Le résultat sert à trouver une signature, un pool ou un mint à backfiller ensuite dans Demo Pipeline 2.
|
|
</p>
|
|
|
|
<div class="mb-3">
|
|
<label for="demo3PresetSelect" class="form-label">Preset DEX</label>
|
|
<select id="demo3PresetSelect" class="form-select"></select>
|
|
<div id="demo3PresetHelp" class="form-text">Choisis un DEX ou saisis un program id manuellement.</div>
|
|
</div>
|
|
|
|
<div class="mb-3">
|
|
<label for="demo3DexCodeInput" class="form-label">DEX code</label>
|
|
<input id="demo3DexCodeInput" type="text" class="form-control font-monospace" spellcheck="false" />
|
|
</div>
|
|
|
|
<div class="mb-3">
|
|
<label for="demo3ProgramIdInput" class="form-label">Program id filter</label>
|
|
<input id="demo3ProgramIdInput" type="text" class="form-control font-monospace" spellcheck="false" />
|
|
<div class="form-text">Used to filter matched instructions. With address source, signatures are fetched from Source address instead.</div>
|
|
</div>
|
|
|
|
<div class="row g-2 mb-3">
|
|
<div class="col-6">
|
|
<label for="demo3SignatureSourceSelect" class="form-label">Signature source</label>
|
|
<select id="demo3SignatureSourceSelect" class="form-select">
|
|
<option value="program_id">program_id</option>
|
|
<option value="address">address / pool / vault / position</option>
|
|
</select>
|
|
</div>
|
|
<div class="col-6">
|
|
<label for="demo3SourceAddressInput" class="form-label">Source addresses</label>
|
|
<textarea id="demo3SourceAddressInput" class="form-control font-monospace" rows="3" spellcheck="false" placeholder="pool / vault / position / config / mint addresses, one per line"></textarea>
|
|
</div>
|
|
<div class="col-12 form-text">Use address source to discover signatures around one or several pools, vaults, positions, configs or mints while keeping the program id filter.</div>
|
|
<div class="col-6">
|
|
<label for="demo3BeforeSignatureInput" class="form-label">Before signature</label>
|
|
<input id="demo3BeforeSignatureInput" type="text" class="form-control font-monospace" spellcheck="false" placeholder="optional pagination cursor" />
|
|
</div>
|
|
<div class="col-6">
|
|
<label for="demo3UntilSignatureInput" class="form-label">Until signature</label>
|
|
<input id="demo3UntilSignatureInput" type="text" class="form-control font-monospace" spellcheck="false" placeholder="optional stop cursor" />
|
|
</div>
|
|
<div class="col-6">
|
|
<label for="demo3MaxPagesInput" class="form-label">Max pages / address</label>
|
|
<input id="demo3MaxPagesInput" type="number" min="1" max="25" class="form-control" value="1" />
|
|
</div>
|
|
<div class="col-6">
|
|
<label for="demo3ScanOrderSelect" class="form-label">Scan order</label>
|
|
<select id="demo3ScanOrderSelect" class="form-select">
|
|
<option value="newest_first">newest_first</option>
|
|
<option value="oldest_first">oldest_first</option>
|
|
</select>
|
|
</div>
|
|
<div class="col-12 form-text">For pool creation analysis, scan a pool address with enough pages and use oldest_first to process the oldest fetched signatures first.</div>
|
|
</div>
|
|
|
|
<div class="row g-2">
|
|
<div class="col-12">
|
|
<label class="form-label">Target events</label>
|
|
<div id="demo3TargetEventCheckboxGroup" class="border rounded p-2 bg-body" style="max-height: 220px; overflow-y: auto;">
|
|
<div class="form-check form-check-inline">
|
|
<input id="demo3TargetSwapInput" class="form-check-input" type="checkbox" name="demo3TargetEventInput" value="swap" />
|
|
<label for="demo3TargetSwapInput" class="form-check-label">swap</label>
|
|
</div>
|
|
<div class="form-check form-check-inline">
|
|
<input id="demo3TargetAddLiquidityInput" class="form-check-input" type="checkbox" name="demo3TargetEventInput" value="add_liquidity" />
|
|
<label for="demo3TargetAddLiquidityInput" class="form-check-label">add_liquidity</label>
|
|
</div>
|
|
<div class="form-check form-check-inline">
|
|
<input id="demo3TargetRemoveLiquidityInput" class="form-check-input" type="checkbox" name="demo3TargetEventInput" value="remove_liquidity" />
|
|
<label for="demo3TargetRemoveLiquidityInput" class="form-check-label">remove_liquidity</label>
|
|
</div>
|
|
<div class="form-check form-check-inline">
|
|
<input id="demo3TargetClaimFeeInput" class="form-check-input" type="checkbox" name="demo3TargetEventInput" value="claim_fee" />
|
|
<label for="demo3TargetClaimFeeInput" class="form-check-label">claim_fee</label>
|
|
</div>
|
|
<div class="form-check form-check-inline">
|
|
<input id="demo3TargetClaimRewardInput" class="form-check-input" type="checkbox" name="demo3TargetEventInput" value="claim_reward" />
|
|
<label for="demo3TargetClaimRewardInput" class="form-check-label">claim_reward</label>
|
|
</div>
|
|
<div class="form-check form-check-inline">
|
|
<input id="demo3TargetCreateLockEscrowInput" class="form-check-input" type="checkbox" name="demo3TargetEventInput" value="create_lock_escrow" />
|
|
<label for="demo3TargetCreateLockEscrowInput" class="form-check-label">create_lock_escrow</label>
|
|
</div>
|
|
<div class="form-check form-check-inline">
|
|
<input id="demo3TargetLockLiquidityInput" class="form-check-input" type="checkbox" name="demo3TargetEventInput" value="lock_liquidity" />
|
|
<label for="demo3TargetLockLiquidityInput" class="form-check-label">lock_liquidity</label>
|
|
</div>
|
|
<div class="form-check form-check-inline">
|
|
<input id="demo3TargetPositionOpenInput" class="form-check-input" type="checkbox" name="demo3TargetEventInput" value="position_open" />
|
|
<label for="demo3TargetPositionOpenInput" class="form-check-label">position_open</label>
|
|
</div>
|
|
<div class="form-check form-check-inline">
|
|
<input id="demo3TargetPositionCloseInput" class="form-check-input" type="checkbox" name="demo3TargetEventInput" value="position_close" />
|
|
<label for="demo3TargetPositionCloseInput" class="form-check-label">position_close</label>
|
|
</div>
|
|
<div class="form-check form-check-inline">
|
|
<input id="demo3TargetPoolCreateInput" class="form-check-input" type="checkbox" name="demo3TargetEventInput" value="pool_create" />
|
|
<label for="demo3TargetPoolCreateInput" class="form-check-label">pool_create</label>
|
|
</div>
|
|
<div class="form-check form-check-inline">
|
|
<input id="demo3TargetPoolAdminInput" class="form-check-input" type="checkbox" name="demo3TargetEventInput" value="pool_admin" />
|
|
<label for="demo3TargetPoolAdminInput" class="form-check-label">pool_admin</label>
|
|
</div>
|
|
<div class="form-check form-check-inline">
|
|
<input id="demo3TargetUnknownNonSwapInput" class="form-check-input" type="checkbox" name="demo3TargetEventInput" value="unknown_non_swap" />
|
|
<label for="demo3TargetUnknownNonSwapInput" class="form-check-label">unknown_non_swap</label>
|
|
</div>
|
|
</div>
|
|
<div class="form-text">Leave all unchecked for generic discovery. Check several surfaces to scan once and keep candidates matching any selected target.</div>
|
|
<div class="form-text">Use this to find corpus signatures for non-swap decoders without promoting unverified events.</div>
|
|
</div>
|
|
<div class="col-6">
|
|
<label for="demo3HttpRoleInput" class="form-label">HTTP role</label>
|
|
<input id="demo3HttpRoleInput" type="text" class="form-control" value="history_backfill" />
|
|
</div>
|
|
<div class="col-6">
|
|
<label for="demo3SignatureLimitInput" class="form-label">Signature limit</label>
|
|
<input id="demo3SignatureLimitInput" type="number" min="1" max="1000" class="form-control" value="50" />
|
|
</div>
|
|
<div class="col-6">
|
|
<label for="demo3TransactionLimitInput" class="form-label">Tx fetch limit</label>
|
|
<input id="demo3TransactionLimitInput" type="number" min="1" max="250" class="form-control" value="25" />
|
|
</div>
|
|
<div class="col-6">
|
|
<label for="demo3CandidateLimitInput" class="form-label">Candidate limit</label>
|
|
<input id="demo3CandidateLimitInput" type="number" min="1" max="100" class="form-control" value="25" />
|
|
</div>
|
|
<div class="col-6">
|
|
<div class="form-check mt-2">
|
|
<input id="demo3ExcludeSwapsInput" class="form-check-input" type="checkbox" />
|
|
<label for="demo3ExcludeSwapsInput" class="form-check-label">Exclude tx with swap logs</label>
|
|
</div>
|
|
</div>
|
|
<div class="col-6">
|
|
<div class="form-check mt-2">
|
|
<input id="demo3IncludeFailedInput" class="form-check-input" type="checkbox" checked />
|
|
<label for="demo3IncludeFailedInput" class="form-check-label">Include failed tx</label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="d-flex flex-wrap gap-2 mt-3">
|
|
<button id="demo3DiscoverButton" type="button" class="btn btn-primary">Discover on-chain</button>
|
|
<button id="demo3LocalSearchButton" type="button" class="btn btn-outline-primary">Search local DB</button>
|
|
<button id="demo3ClearFiltersButton" type="button" class="btn btn-outline-secondary">Clear</button>
|
|
<button id="demo3CopyJsonButton" type="button" class="btn btn-outline-secondary">Copy JSON</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card shadow-sm border-0 mb-4">
|
|
<div class="card-body">
|
|
<h2 class="h5 mb-3">Filtres locaux optionnels</h2>
|
|
<div class="mb-3">
|
|
<label for="demo3PairIdInput" class="form-label">Pair id local</label>
|
|
<input id="demo3PairIdInput" type="number" class="form-control" />
|
|
</div>
|
|
<div class="mb-3">
|
|
<label for="demo3PoolAddressInput" class="form-label">Pool address</label>
|
|
<input id="demo3PoolAddressInput" type="text" class="form-control font-monospace" spellcheck="false" />
|
|
</div>
|
|
<div class="mb-3">
|
|
<label for="demo3TokenMintInput" class="form-label">Token mint</label>
|
|
<input id="demo3TokenMintInput" type="text" class="form-control font-monospace" spellcheck="false" />
|
|
</div>
|
|
<div class="mb-3">
|
|
<label for="demo3SignatureInput" class="form-label">Signature</label>
|
|
<input id="demo3SignatureInput" type="text" class="form-control font-monospace" spellcheck="false" />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card shadow-sm border-0 mb-4">
|
|
<div class="card-body">
|
|
<h2 class="h5 mb-3">Résumé</h2>
|
|
<div class="row g-2 small">
|
|
<div class="col-6"><strong>Signatures:</strong> <span id="demo3SummarySignatureCount">0</span></div>
|
|
<div class="col-6"><strong>Unique fetched:</strong> <span id="demo3SummaryUniqueFetchedSignatureCount">0</span></div>
|
|
<div class="col-6"><strong>Pages:</strong> <span id="demo3SummaryFetchedPageCount">0</span></div>
|
|
<div class="col-6"><strong>Unique candidates:</strong> <span id="demo3SummaryUniqueSignatureCount">0</span></div>
|
|
<div class="col-6"><strong>Tx fetched:</strong> <span id="demo3SummaryFetchedTxCount">0</span></div>
|
|
<div class="col-6"><strong>Missing tx:</strong> <span id="demo3SummaryMissingTxCount">0</span></div>
|
|
<div class="col-6"><strong>Failed tx:</strong> <span id="demo3SummaryFailedTxCount">0</span></div>
|
|
<div class="col-6"><strong>Skipped failed:</strong> <span id="demo3SummarySkippedFailedTxCount">0</span></div>
|
|
<div class="col-6"><strong>Skipped swap tx:</strong> <span id="demo3SummarySkippedSwapTxCount">0</span></div>
|
|
<div class="col-6"><strong>Extracted:</strong> <span id="demo3SummaryExtractedCandidateCount">0</span></div>
|
|
<div class="col-6"><strong>Rejected by target:</strong> <span id="demo3SummaryRejectedCandidateCount">0</span></div>
|
|
<div class="col-6"><strong>Candidates:</strong> <span id="demo3SummaryCandidateCount">0</span></div>
|
|
<div class="col-6"><strong>Local pairs:</strong> <span id="demo3SummaryLocalPairCount">0</span></div>
|
|
</div>
|
|
<hr />
|
|
<div class="small text-body-secondary">
|
|
<strong>Target:</strong>
|
|
<span id="demo3TargetText" class="font-monospace">-</span>
|
|
</div>
|
|
<div class="small text-body-secondary mt-2">
|
|
<strong>Backfill signatures:</strong>
|
|
<span id="demo3UniqueSignatureText" class="font-monospace">-</span>
|
|
</div>
|
|
<div class="small text-body-secondary mt-2">
|
|
<strong>Next before cursors:</strong>
|
|
<span id="demo3NextBeforeText" class="font-monospace">-</span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card shadow-sm border-0">
|
|
<div class="card-body">
|
|
<h2 class="h5 mb-3">Logs</h2>
|
|
<textarea id="demo3LogTextarea" class="form-control font-monospace" rows="10" readonly spellcheck="false"></textarea>
|
|
<button id="demo3ClearLogButton" type="button" class="btn btn-sm btn-outline-secondary mt-2">Clear log</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-12 col-xxl-8">
|
|
<div class="card shadow-sm border-0 mb-4">
|
|
<div class="card-body">
|
|
<h2 class="h5 mb-3">Candidats on-chain</h2>
|
|
<div class="table-responsive">
|
|
<table class="table table-sm align-middle mb-0">
|
|
<thead>
|
|
<tr>
|
|
<th>Signature</th>
|
|
<th>Slot</th>
|
|
<th>Kind</th>
|
|
<th>Confidence</th>
|
|
<th>Data prefix</th>
|
|
<th>Verified pool</th>
|
|
<th>Token A</th>
|
|
<th>Token B</th>
|
|
<th>Observed mints</th>
|
|
<th>Token deltas</th>
|
|
<th>Candidate accounts</th>
|
|
<th>Hint</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="demo3OnchainCandidateTableBody">
|
|
<tr>
|
|
<td colspan="12" class="text-body-secondary">No on-chain candidate.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card shadow-sm border-0 mb-4">
|
|
<div class="card-body">
|
|
<h2 class="h5 mb-3">Rejected candidate summary</h2>
|
|
<div class="table-responsive">
|
|
<table class="table table-sm align-middle mb-0">
|
|
<thead>
|
|
<tr>
|
|
<th>Kind</th>
|
|
<th>Prefix</th>
|
|
<th>Instruction</th>
|
|
<th>Reason</th>
|
|
<th>Count</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="demo3RejectedSummaryTableBody">
|
|
<tr>
|
|
<td colspan="5" class="text-body-secondary">No rejected candidate summary.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card shadow-sm border-0 mb-4">
|
|
<div class="card-body">
|
|
<h2 class="h5 mb-3">Recherche locale DB</h2>
|
|
<div class="table-responsive">
|
|
<table class="table table-sm align-middle mb-0">
|
|
<thead>
|
|
<tr>
|
|
<th>DEX</th>
|
|
<th>Pool</th>
|
|
<th>Pair id</th>
|
|
<th>Symbol</th>
|
|
<th>Base</th>
|
|
<th>Quote</th>
|
|
<th>Trades</th>
|
|
<th>Candles</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="demo3LocalPoolPairTableBody">
|
|
<tr>
|
|
<td colspan="8" class="text-body-secondary">No local pool/pair sample.</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="card shadow-sm border-0">
|
|
<div class="card-body">
|
|
<h2 class="h5 mb-3">Raw result JSON</h2>
|
|
<textarea id="demo3JsonTextarea" class="form-control font-monospace" rows="22" readonly spellcheck="false"></textarea>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</main>
|
|
|
|
<footer class="app-footer bg-dark text-light">
|
|
<div class="container h-100 d-flex align-items-center">
|
|
<div class="row flex-grow-1 align-items-center">
|
|
<div class="col-12 text-center text-small my-1 my-md-0">
|
|
© 2026 SASEDEV — Demo3 On-chain DEX Discovery
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</footer>
|
|
|
|
<script type="module" src="ts/demo3.ts" defer></script>
|
|
</body>
|
|
|
|
</html> |