0.7.55
This commit is contained in:
@@ -87,3 +87,4 @@
|
|||||||
0.7.52 - Raydium Stable Swap event coverage clôturé : decoder legacy 1 octet pour la surface locale `00..0d`, matérialisation lifecycle/liquidity/admin/fee/orderbook selon contexte, swaps `swap_base_in/out` matérialisés uniquement depuis deltas de vaults exacts (`stable_swap_vault_balance_delta`), conservation des bornes d’instruction comme audit-only, failed transactions decoded-only avec skip reasons, validation locale 407 tests et clippy `-D warnings` OK.
|
0.7.52 - Raydium Stable Swap event coverage clôturé : decoder legacy 1 octet pour la surface locale `00..0d`, matérialisation lifecycle/liquidity/admin/fee/orderbook selon contexte, swaps `swap_base_in/out` matérialisés uniquement depuis deltas de vaults exacts (`stable_swap_vault_balance_delta`), conservation des bornes d’instruction comme audit-only, failed transactions decoded-only avec skip reasons, validation locale 407 tests et clippy `-D warnings` OK.
|
||||||
0.7.53 - Clôture PumpSwap : décodage transaction/log complet, matérialisation `buy/sell/buy_exact_quote_in` depuis sources exactes, events Anchor audit-only, tests synthétiques IDL, validation globale coverage SQL et non-régression Raydium.
|
0.7.53 - Clôture PumpSwap : décodage transaction/log complet, matérialisation `buy/sell/buy_exact_quote_in` depuis sources exactes, events Anchor audit-only, tests synthétiques IDL, validation globale coverage SQL et non-régression Raydium.
|
||||||
0.7.54 - Clôture Pump.fun : decoder maximal local depuis IDL Solscan/upstream, décodage des 40 instructions et 23 events Anchor connus, matérialisation validée des trades `buy/sell/buy_exact_sol_in` et `trade_event` v2/exact sans double-count, non-trades launch/fee/reward/admin selon contexte, validation SQL Pump.fun propre et ouverture de `0.7.55 pump_fees`.
|
0.7.54 - Clôture Pump.fun : decoder maximal local depuis IDL Solscan/upstream, décodage des 40 instructions et 23 events Anchor connus, matérialisation validée des trades `buy/sell/buy_exact_sol_in` et `trade_event` v2/exact sans double-count, non-trades launch/fee/reward/admin selon contexte, validation SQL Pump.fun propre et ouverture de `0.7.55 pump_fees`.
|
||||||
|
0.7.55 - Clôture Pump Fees : decoder local maximal `pump_fees` depuis l'IDL locale, `29` instructions et `20` events Anchor couverts, tests synthétiques des Anchor IDL non observés, matérialisation prudente fee/reward/admin/lifecycle, `get_fees` decoded-only, transactions failed audit-only, aucun trade/candle direct et SQL de validation Pump Fees propre.
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ members = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
[workspace.package]
|
[workspace.package]
|
||||||
version = "0.7.54"
|
version = "0.7.55"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
repository = "https://git.sasedev.com/Sasedev/khadhroony-bobobot"
|
repository = "https://git.sasedev.com/Sasedev/khadhroony-bobobot"
|
||||||
|
|||||||
69
README.md
69
README.md
@@ -3,6 +3,53 @@
|
|||||||
# khadhroony-bobobot
|
# khadhroony-bobobot
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## État final validé `0.7.55` — `pump_fees`
|
||||||
|
|
||||||
|
La tranche `0.7.55 pump_fees` est clôturée côté decoder local maximal, coverage, tests synthétiques, matérialisation prudente et validation SQL. Le programme `pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ` est traité comme surface fee/config/accounting : `get_fees` reste decoded-only, les claims social fee alimentent `k_sol_reward_events`, les donation/buyback alimentent `k_sol_fee_events`, les authority/config/tier/update alimentent `k_sol_pool_admin_events`, les créations/init/extend alimentent `k_sol_pool_lifecycle_events`, et aucun trade/candle direct n'est produit.
|
||||||
|
|
||||||
|
Source IDL locale prioritaire :
|
||||||
|
|
||||||
|
```text
|
||||||
|
idls/pump_fees.pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ.json
|
||||||
|
```
|
||||||
|
|
||||||
|
Surface couverte : `29` instructions, `20` events Anchor, `9` accounts et `34` types. Les discriminators Solscan hors IDL locale `revoke_fee_sharing_authority_event` (`7217653c0ebe993e`) et `transfer_fee_sharing_authority_event` (`7c8fc6f54db808ec`) restent conservés en coverage comme surfaces futures `upstream_git_mapped_unverified`.
|
||||||
|
|
||||||
|
Validation locale finale rapportée :
|
||||||
|
|
||||||
|
```text
|
||||||
|
cargo test -p kb_lib -> 431 passed / 0 failed
|
||||||
|
cargo clippy -p kb_lib --all-targets -- -D warnings -> OK
|
||||||
|
127 replayed
|
||||||
|
0 decode skipped
|
||||||
|
150 ledger upserts
|
||||||
|
125 unsafe ledger rows
|
||||||
|
4 trades
|
||||||
|
0 liquidity
|
||||||
|
115 lifecycle
|
||||||
|
0 tokenAccount
|
||||||
|
16 candle upserts
|
||||||
|
instructionObservations = 2234
|
||||||
|
resetDeleted = 1644
|
||||||
|
catalog = 11 tokens / 10 pools / 10 pairs
|
||||||
|
```
|
||||||
|
|
||||||
|
Checks de fermeture Pump Fees :
|
||||||
|
|
||||||
|
- fallback `upstream_git` `pump_fees` : vide ;
|
||||||
|
- `instruction_name` `pump_fees` vide : vide ;
|
||||||
|
- `event_family = unknown` ou vide pour instruction/event : vide ;
|
||||||
|
- decoded `pump_fees` sans coverage : vide ;
|
||||||
|
- fallback résiduel pour entrées couvertes localement : vide ;
|
||||||
|
- successful non-materialized sans skip/policy : vide ;
|
||||||
|
- failed transaction avec business materialization : vide ;
|
||||||
|
- multi-target materialization : vide ;
|
||||||
|
- anti-trade/candle direct `pump_fees` : vide ;
|
||||||
|
- watchlist globale : plus aucun `pump_fees`, reste seulement `jupiter_swap.route_v2` observé ponctuellement.
|
||||||
|
|
||||||
|
Le SQL de validation propre et exécutable reste `validation_sql/SQL_VALIDATION_PUMP_FEES_0_7_55.sql`.
|
||||||
|
|
||||||
## État final validé `0.7.54` — `pump_fun`
|
## État final validé `0.7.54` — `pump_fun`
|
||||||
|
|
||||||
La tranche `0.7.54 pump_fun` est clôturée côté coverage, décodage local maximal, matérialisation métier prudente et validation SQL. Elle ferme la surface Pump.fun principale avant l'ouverture de `0.7.55 pump_fees`.
|
La tranche `0.7.54 pump_fun` est clôturée côté coverage, décodage local maximal, matérialisation métier prudente et validation SQL. Elle ferme la surface Pump.fun principale avant l'ouverture de `0.7.55 pump_fees`.
|
||||||
@@ -66,9 +113,8 @@ Checks de fermeture :
|
|||||||
- failed transaction avec business materialization : vide ;
|
- failed transaction avec business materialization : vide ;
|
||||||
- multi-target materialization : vide ;
|
- multi-target materialization : vide ;
|
||||||
- trade candidates Pump.fun sans matérialisation ni skip : vide ;
|
- trade candidates Pump.fun sans matérialisation ni skip : vide ;
|
||||||
- watchlist globale : plus aucun `pump_fun`, backlog restant principalement `pump_fees`, puis `jupiter_swap` et `dflow_aggregator_v4`.
|
- watchlist globale : plus aucun `pump_fun` ; la surface suivante `pump_fees` a été traitée en `0.7.55`.
|
||||||
|
|
||||||
La suite immédiate est `0.7.55 pump_fees` sur nouvelle base SQLite, avec politique identique : tout ce qui peut être décodé doit l'être, et tout ce qui peut être matérialisé de manière fiable doit l'être.
|
|
||||||
|
|
||||||
## État final validé `0.7.53` — `pump_swap`
|
## État final validé `0.7.53` — `pump_swap`
|
||||||
|
|
||||||
@@ -555,14 +601,14 @@ Si une requête DB est ajoutée ou modifiée, mettre à jour les re-exports dans
|
|||||||
|
|
||||||
## 8. Priorité immédiate
|
## 8. Priorité immédiate
|
||||||
|
|
||||||
La priorité immédiate après la clôture `0.7.54 pump_fun` est la suivante :
|
La priorité immédiate après la clôture `0.7.55 pump_fees` est la suivante :
|
||||||
|
|
||||||
1. ouvrir `0.7.55 pump_fees` sur une base SQLite neuve ;
|
1. ouvrir `0.7.56 meteora_dbc` sur une base SQLite neuve ;
|
||||||
2. décoder toutes les instructions et tous les events connus de `idls/pump_fees.pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ.json` ;
|
2. décoder toutes les instructions/events DBC connus par l'IDL locale et les sources Git ;
|
||||||
3. matérialiser tout ce qui est prouvable : fee accounting, fee sharing, social/donation fee PDA, buyback, config/admin, rewards éventuelles ;
|
3. matérialiser uniquement ce qui est prouvable : launch/bonding, swaps fiables, migration, liquidity, fees/admin/config ;
|
||||||
4. ne créer aucun trade/candle direct pour `pump_fees` sauf preuve transactionnelle forte d'un swap économique autonome ;
|
4. ne créer aucun trade/candle DBC sans montants, sens économique, pool/pair et mints fiables ;
|
||||||
5. maintenir les checks Pump.fun/PumpSwap/Raydium en non-régression ;
|
5. maintenir les checks Pump.fun/PumpSwap/Pump Fees/Raydium en non-régression ;
|
||||||
6. reporter Meteora/Jupiter/dFlow aux tranches prévues sauf si une dépendance stricte apparaît pendant l'analyse `pump_fees`.
|
6. garder `jupiter_swap.route_v2` en watchlist résiduelle sans ouvrir Jupiter avant phasage dédié.
|
||||||
|
|
||||||
Garde-fous constants :
|
Garde-fous constants :
|
||||||
|
|
||||||
@@ -674,8 +720,9 @@ La suite fonctionnelle reprend par Raydium avant Meteora :
|
|||||||
5. `0.7.52` — `raydium_stable_swap` — clôturé ;
|
5. `0.7.52` — `raydium_stable_swap` — clôturé ;
|
||||||
6. `0.7.53` — `pump_swap` — clôturé ;
|
6. `0.7.53` — `pump_swap` — clôturé ;
|
||||||
7. `0.7.54` — `pump_fun` ;
|
7. `0.7.54` — `pump_fun` ;
|
||||||
8. `0.7.55` — `pump_fees` ;
|
8. `0.7.55` — `pump_fees` — clôturé ;
|
||||||
9. `0.7.56+` — Meteora, routers/agrégateurs, Phoenix/OpenBook, Orca puis les autres DEX/surfaces.
|
9. `0.7.56` — `meteora_dbc` ;
|
||||||
|
10. `0.7.57+` — Meteora restants, routers/agrégateurs, Phoenix/OpenBook, Orca puis les autres DEX/surfaces.
|
||||||
|
|
||||||
`raydium_pool_v4.json` reste repoussé en audit conditionnel tardif, pas une tranche bloquante.
|
`raydium_pool_v4.json` reste repoussé en audit conditionnel tardif, pas une tranche bloquante.
|
||||||
|
|
||||||
|
|||||||
41
ROADMAP.md
41
ROADMAP.md
@@ -2,30 +2,37 @@
|
|||||||
|
|
||||||
# khadhroony-bobobot — Roadmap
|
# khadhroony-bobobot — Roadmap
|
||||||
|
|
||||||
## État courant — clôture `0.7.54 pump_fun` et ouverture `0.7.55 pump_fees`
|
### `0.7.55 pump_fees` — clôturé
|
||||||
|
|
||||||
`0.7.54 pump_fun` est clos pour la surface Pump.fun principale. La tranche a transformé l'ouverture documentaire en decoder local maximal : inventaire des `40` instructions et `23` events Anchor de l'IDL locale, coverage local, décodage Anchor/self-CPI/log, tests synthétiques, routes catalogue et matérialisation prudente.
|
- Decoder local `pump_fees` clôturé pour les `29` instructions et `20` events Anchor de l'IDL locale.
|
||||||
|
- Registre enrichi avec les entrées locales absentes du decoder Carbon partiel et conservation de deux discriminators Solscan hors IDL comme surfaces futures.
|
||||||
|
- Classification validée : `get_fees` decoded-only, social fee claim vers reward, donation/buyback vers fee, config/authority/tier/admin vers admin/lifecycle.
|
||||||
|
- Tests synthétiques ajoutés pour les Anchor events IDL non observés dans le corpus.
|
||||||
|
- Invariants propres : aucun fallback `pump_fees`, aucun decoded sans coverage, aucune failed tx matérialisée, aucun multi-target, aucun trade/candle direct.
|
||||||
|
- Dernier replay : `127 replayed`, `150 ledger upserts`, `125 unsafe`, `115 lifecycle`, `2234 instructionObservations`, catalogue `11 tokens / 10 pools / 10 pairs`.
|
||||||
|
|
||||||
Décisions de clôture Pump.fun :
|
## État courant — clôture `0.7.55 pump_fees` et ouverture `0.7.56 meteora_dbc`
|
||||||
|
|
||||||
- `pump_fun.buy` et `pump_fun.sell` restent matérialisés directement quand les montants sont fiables ;
|
`0.7.55 pump_fees` est clos pour la surface Pump Fees. La tranche couvre les `29` instructions et `20` events Anchor de l'IDL locale, avec tests synthétiques pour les Anchor events non observés. `get_fees` reste decoded-only, les rewards/fees/admin/lifecycle sont matérialisés uniquement sur transactions réussies et données fiables, les failed tx restent audit-only, et aucun trade/candle direct `pump_fees` n'est créé.
|
||||||
- `pump_fun.buy_exact_sol_in` est matérialisé directement, y compris quand un `Program data` tronqué permet d'extraire les montants exacts ;
|
|
||||||
- `pump_fun.buy_v2`, `pump_fun.sell_v2` et `pump_fun.buy_exact_quote_in_v2` sont decoded/audit/routing, mais ne sont pas matérialisés directement ;
|
|
||||||
- `pump_fun.trade_event` devient la source canonique des montants exécutés pour les v2/exact quand il est corrélé à l'instruction sans ambiguïté ;
|
|
||||||
- les `trade_event` déjà couverts par un trade direct reçoivent un skip explicite pour empêcher le double-count ;
|
|
||||||
- les non-trades Pump.fun sont matérialisés seulement vers `launch`, `fee`, `reward`, `admin` ou `lifecycle` quand le contexte est fiable ; sinon ils restent decoded-only/audit-only avec skip reason ;
|
|
||||||
- les validations `Q00`, `Q04`, `Q05`, `Q06`, `Q07`, `Q08`, `Q11` sont propres ; la watchlist globale ne contient plus de `pump_fun`.
|
|
||||||
|
|
||||||
Replay final rapporté : `1679 replayed`, `89 trades`, `10 lifecycle`, `348 candle upserts`, `13905 instructionObservations`, catalogue `52 tokens / 50 pools / 50 pairs`.
|
Décisions de clôture Pump Fees :
|
||||||
|
|
||||||
### Phasage immédiat après `0.7.54`
|
- `pump_fees.get_fees` est decoded-only et ne représente pas une fee payée ;
|
||||||
|
- `claim_social_fee_pda*` et `social_fee_pda_claimed` alimentent `k_sol_reward_events` quand la transaction réussit ;
|
||||||
|
- `crank_donation_fee_pda`, `donation_fee_pda_cranked`, `sweep_buyback` et `sweep_buyback_event` alimentent `k_sol_fee_events` quand les montants sont fiables ;
|
||||||
|
- fee sharing/config/authority/tier/update alimentent `k_sol_pool_admin_events` ou `k_sol_pool_lifecycle_events` selon le contexte ;
|
||||||
|
- les discriminators Solscan `revoke_fee_sharing_authority_event` et `transfer_fee_sharing_authority_event` restent conservés en coverage comme surfaces futures non observées ;
|
||||||
|
- les validations fallback, decoded sans coverage, failed materialization, multi-target, successful non-materialized, anti-trade/candle et watchlist `pump_fees` sont propres.
|
||||||
|
|
||||||
|
Replay final rapporté : `127 replayed`, `0 decode skipped`, `150 ledger upserts`, `125 unsafe`, `115 lifecycle`, `2234 instructionObservations`, catalogue `11 tokens / 10 pools / 10 pairs`. Tests : `431 passed`, clippy OK.
|
||||||
|
|
||||||
|
### Phasage immédiat après `0.7.55`
|
||||||
|
|
||||||
| Priorité | Tranche | Surface | Raison |
|
| Priorité | Tranche | Surface | Raison |
|
||||||
|---:|---|---|---|
|
|---:|---|---|---|
|
||||||
| 1 | `0.7.55` | `pump_fees` | Backlog global restant : `get_fees`, `create_fee_sharing_config`, `update_fee_shares`; programme fee associé à Pump. Tout décoder et tout matérialiser si fiable. |
|
| 1 | `0.7.56` | `meteora_dbc` | Prochaine tranche programmée : launch/bonding, swaps exploitables, migration, fees/admin/config depuis corpus neuf. |
|
||||||
| 2 | `0.7.56+` | `meteora_*` | Corriger les gaps locaux Meteora reportés volontairement. |
|
| 2 | `0.7.57+` | `meteora_*` | Corriger les gaps locaux Meteora reportés volontairement, surface par surface. |
|
||||||
| 3 | ultérieur | `jupiter_swap` / agrégateurs | Routes et comptes auxiliaires à traiter sans double-count des DEX effectifs. |
|
| 3 | ultérieur | `jupiter_swap` / agrégateurs | `jupiter_swap.route_v2` reste en watchlist résiduelle ; traiter sans double-count des DEX effectifs. |
|
||||||
|
|
||||||
|
|
||||||
## 0.7.47-1FE5 — Décision de planification : ne plus viser “tous les events en une session”
|
## 0.7.47-1FE5 — Décision de planification : ne plus viser “tous les events en une session”
|
||||||
|
|
||||||
@@ -64,7 +71,7 @@ Exceptions : les comptes non-programmes (`platform_config`, token authority, com
|
|||||||
|---|---|---|---|---|
|
|---|---|---|---|---|
|
||||||
| `0.7.53` | `pump_swap` | `pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA` | Pump / AMM | **Clos** : `buy/sell/buy_exact_quote_in` matérialisés seulement depuis sources exactes ; events Anchor audit-only ; tests synthétiques IDL ; SQL global. |
|
| `0.7.53` | `pump_swap` | `pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA` | Pump / AMM | **Clos** : `buy/sell/buy_exact_quote_in` matérialisés seulement depuis sources exactes ; events Anchor audit-only ; tests synthétiques IDL ; SQL global. |
|
||||||
| `0.7.54` | `pump_fun` | `6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P` | Pump / launch-bonding | **Clos** : decoder maximal IDL/local, trades directs `buy/sell/buy_exact_sol_in`, v2/exact via `trade_event`, non-trades matérialisés selon contexte, validations Pump.fun propres. |
|
| `0.7.54` | `pump_fun` | `6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P` | Pump / launch-bonding | **Clos** : decoder maximal IDL/local, trades directs `buy/sell/buy_exact_sol_in`, v2/exact via `trade_event`, non-trades matérialisés selon contexte, validations Pump.fun propres. |
|
||||||
| `0.7.55` | `pump_fees` | `pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ` | Pump / fee | Couvrir fee accounting/claim/config observés ; aucun trade/candle direct. |
|
| `0.7.55` | `pump_fees` | `pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ` | Pump / fee | **Clos** : `29` instructions, `20` events Anchor, fee/reward/admin/lifecycle, `get_fees` decoded-only, failed tx audit-only, aucun trade/candle direct. |
|
||||||
| `0.7.56` | `meteora_dbc` | `dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN` | Meteora / DBC | Compléter launch/bonding, swaps exploitables, migration, fees/admin/config. |
|
| `0.7.56` | `meteora_dbc` | `dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN` | Meteora / DBC | Compléter launch/bonding, swaps exploitables, migration, fees/admin/config. |
|
||||||
| `0.7.57` | `meteora_dlmm` | `LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo` | Meteora / DLMM | Parité upstream finale : swaps, bins, positions, liquidity, fees/rewards/admin. |
|
| `0.7.57` | `meteora_dlmm` | `LBUZKhRxPF3XUpBCjp4YzTKgLccjZhTSDM9YuVaPwxo` | Meteora / DLMM | Parité upstream finale : swaps, bins, positions, liquidity, fees/rewards/admin. |
|
||||||
| `0.7.58` | `meteora_damm_v1` | `Eo7WjKq67rjJQSZxS6z3YkapzY3eMj6Xy8X5EQVn5UaB` | Meteora / DAMM v1 | Parité upstream finale : pools, swaps, liquidity, lock, fees/admin. |
|
| `0.7.58` | `meteora_damm_v1` | `Eo7WjKq67rjJQSZxS6z3YkapzY3eMj6Xy8X5EQVn5UaB` | Meteora / DAMM v1 | Parité upstream finale : pools, swaps, liquidity, lock, fees/admin. |
|
||||||
|
|||||||
@@ -1,9 +1,17 @@
|
|||||||
<!-- file: docs/DEX_DECODER_MATRIX.md -->
|
<!-- file: docs/DEX_DECODER_MATRIX.md -->
|
||||||
|
|
||||||
# DEX Decoder Matrix — `khadhroony-bobobot` `0.7.54 pump_fun closed`
|
# DEX Decoder Matrix — `khadhroony-bobobot` `0.7.55 pump_fees closed`
|
||||||
|
|
||||||
|
|
||||||
## Note `0.7.54 closed` — Pump.fun clos, Pump Fees ensuite
|
## Note `0.7.55 closed` — Pump Fees clôturé, Meteora DBC ensuite
|
||||||
|
|
||||||
|
La tranche `0.7.55` ferme `pump_fees` comme surface fee/config/accounting. Le decoder local couvre les `29` instructions et `20` events Anchor de l'IDL locale, avec tests synthétiques pour les Anchor events IDL non observés. Les transactions failed restent audit-only, `get_fees` reste decoded-only, et aucun trade/candle direct n'est créé.
|
||||||
|
|
||||||
|
Deux discriminators Solscan non présents dans l'IDL locale restent conservés en coverage comme surfaces futures : `revoke_fee_sharing_authority_event` (`7217653c0ebe993e`) et `transfer_fee_sharing_authority_event` (`7c8fc6f54db808ec`).
|
||||||
|
|
||||||
|
La prochaine tranche programmée est `0.7.56 meteora_dbc`.
|
||||||
|
|
||||||
|
## Note `0.7.54 closed` — Pump.fun clôturé
|
||||||
|
|
||||||
La tranche `0.7.54` ferme `pump_fun` avant `pump_fees`. La surface Pump.fun principale est couverte depuis le code local, l'IDL Solscan locale `idls/pump_fun.6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P.json`, le registre upstream et le corpus SQLite.
|
La tranche `0.7.54` ferme `pump_fun` avant `pump_fees`. La surface Pump.fun principale est couverte depuis le code local, l'IDL Solscan locale `idls/pump_fun.6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P.json`, le registre upstream et le corpus SQLite.
|
||||||
|
|
||||||
@@ -16,7 +24,7 @@ Décisions structurantes :
|
|||||||
- `pump_fun.trade_event` matérialise les v2/exact quand les montants exécutés et la corrélation instruction sont prouvés ;
|
- `pump_fun.trade_event` matérialise les v2/exact quand les montants exécutés et la corrélation instruction sont prouvés ;
|
||||||
- les non-trades Pump.fun alimentent uniquement les tables business adaptées ou restent audit-only avec skip reason.
|
- les non-trades Pump.fun alimentent uniquement les tables business adaptées ou restent audit-only avec skip reason.
|
||||||
|
|
||||||
La prochaine tranche est `0.7.55 pump_fees`.
|
`pump_fees` est clôturé en `0.7.55`; la prochaine tranche est `0.7.56 meteora_dbc`.
|
||||||
|
|
||||||
## Note `0.7.53 final` — PumpSwap clôturé et sources IDL locales
|
## Note `0.7.53 final` — PumpSwap clôturé et sources IDL locales
|
||||||
|
|
||||||
@@ -59,18 +67,19 @@ Cette matrice complète `kb_lib/src/dex_support_matrix.rs`. Elle documente **ce
|
|||||||
| 5 | `raydium_stable_swap` | `supported / 0.7.52 closed` | Decoder legacy 1 octet, surface `00..0d`, swaps matérialisés depuis deltas vault exacts. | Surveiller seulement de nouveaux discriminants ou `swap_event` observé. |
|
| 5 | `raydium_stable_swap` | `supported / 0.7.52 closed` | Decoder legacy 1 octet, surface `00..0d`, swaps matérialisés depuis deltas vault exacts. | Surveiller seulement de nouveaux discriminants ou `swap_event` observé. |
|
||||||
| 6 | `raydium_pool_v4` | `to_verify / late-phase conditional audit` | IDL annexe mentionnée par fnzero, non présente dans l'archive locale, pas de program id/rôle confirmé ici. | Ne pas promouvoir tant que program id distinct, rôle exact et corpus exploitable ne sont pas confirmés. |
|
| 6 | `raydium_pool_v4` | `to_verify / late-phase conditional audit` | IDL annexe mentionnée par fnzero, non présente dans l'archive locale, pas de program id/rôle confirmé ici. | Ne pas promouvoir tant que program id distinct, rôle exact et corpus exploitable ne sont pas confirmés. |
|
||||||
| 7 | `pump_swap` | `supported / 0.7.53 closed` | `buy`, `sell` + `buy_exact_quote_in` matérialisable via `BuyEvent` exact ; instructions non-trade spécialisées : liquidity, fee/creator fee, admin/config, cashback/token incentives, volume accumulator ; events Anchor autonomes audit-only. | Trades/candles uniquement depuis montants exacts ; failed tx decoded-only ; `instruction_bounds_only` reste decoded-only ; tests synthétiques IDL et SQL global ajoutés. |
|
| 7 | `pump_swap` | `supported / 0.7.53 closed` | `buy`, `sell` + `buy_exact_quote_in` matérialisable via `BuyEvent` exact ; instructions non-trade spécialisées : liquidity, fee/creator fee, admin/config, cashback/token incentives, volume accumulator ; events Anchor autonomes audit-only. | Trades/candles uniquement depuis montants exacts ; failed tx decoded-only ; `instruction_bounds_only` reste decoded-only ; tests synthétiques IDL et SQL global ajoutés. |
|
||||||
| 8 | `pump_fun` | `supported / 0.7.54 closed` | Surface launch/bonding/migration Pump.fun couverte localement ; trades directs et `trade_event` canonique validés. | Ne rouvrir que pour bug prouvé ou changement externe ; `pump_fees` suit en `0.7.55`. |
|
| 8 | `pump_fun` | `supported / 0.7.54 closed` | Surface launch/bonding/migration Pump.fun couverte localement ; trades directs et `trade_event` canonique validés. | Ne rouvrir que pour bug prouvé ou changement externe. |
|
||||||
| 9 | `meteora_dbc` | `partial / 0.7.56 planned` | Swaps/instruction audits observés ; Demo3 donne du corpus. | Couverture complète DBC : launch/bonding curve, swap, migration, config/admin, fees ; matérialiser seulement ce qui est prouvé. |
|
| 9 | `pump_fees` | `supported / 0.7.55 closed` | Surface fee/config/accounting couverte localement : `29` instructions, `20` events Anchor, fee/reward/admin/lifecycle, tests synthétiques Anchor IDL non observés, failed tx audit-only. | Aucun trade/candle direct ; conserver les deux discriminators Solscan hors IDL comme futures surfaces non observées. |
|
||||||
| 10 | `meteora_dlmm` | `supported / 0.7.57 parity` | Couverture avancée validée en `0.7.45` : swaps, liquidity, positions, lifecycle, fees ; non-trade matérialisé. | Résoudre les audits résiduels non mappés ; comparer Carbon/IDL pour events rewards/admin restants ; revalidation base neuve. |
|
| 10 | `meteora_dbc` | `partial / 0.7.56 planned` | Swaps/instruction audits observés ; Demo3 donne du corpus. | Couverture complète DBC : launch/bonding curve, swap, migration, config/admin, fees ; matérialiser seulement ce qui est prouvé. |
|
||||||
| 11 | `meteora_damm_v1` | `supported / 0.7.58 parity` | Couverture `0.7.46` : swap, create_pool, add/remove liquidity, claim_fee, create_lock_escrow, lock_liquidity. | Vérifier les surfaces upstream non observées ; améliorer rattachement pool/pair pour remove_liquidity non matérialisés ; revalidation stricte. |
|
| 11 | `meteora_dlmm` | `supported / 0.7.57 parity` | Couverture avancée validée en `0.7.45` : swaps, liquidity, positions, lifecycle, fees ; non-trade matérialisé. | Résoudre les audits résiduels non mappés ; comparer Carbon/IDL pour events rewards/admin restants ; revalidation base neuve. |
|
||||||
| 12 | `meteora_damm_v2` | `partial / 0.7.59 planned` | `swap`, `instruction_audit`, registry/discriminants et corpus Demo3 existent. | Couvrir tous les events Carbon/source : create pool, liquidity, fees, dynamic config, admin ; déterminer actionability des swaps ; matérialiser si montants fiables. |
|
| 12 | `meteora_damm_v1` | `supported / 0.7.58 parity` | Couverture `0.7.46` : swap, create_pool, add/remove liquidity, claim_fee, create_lock_escrow, lock_liquidity. | Vérifier les surfaces upstream non observées ; améliorer rattachement pool/pair pour remove_liquidity non matérialisés ; revalidation stricte. |
|
||||||
| 13 | `phoenix_v1` | `audit-only / 0.7.60 planned` | Decoder local audit-only ; `log_audit`, order place/cancel, withdraw ; parsing strict `0x0f`; events `Reduce`, `Place`, `TimeInForce` observés ; `trade_count=0`. | Terminer tous les events Git : `Fill`, `FillSummary`, `Fee`, `Evict`, `ExpiredOrder`, etc. ; ajouter counts/flags audit ; seulement ensuite étudier trade materialization. |
|
| 13 | `meteora_damm_v2` | `partial / 0.7.59 planned` | `swap`, `instruction_audit`, registry/discriminants et corpus Demo3 existent. | Couvrir tous les events Carbon/source : create pool, liquidity, fees, dynamic config, admin ; déterminer actionability des swaps ; matérialiser si montants fiables. |
|
||||||
| 14 | `openbook_v2` | `audit-only / 0.7.61 planned` | Decoder local audit-only ; instructions order/cancel/consume/settle ; `Program data` mappé : `FillLog`, `OpenOrdersPositionLog`, `TotalOrderFillEvent`, `SettleFundsLog`; `trade_count=0`. | Vérifier layouts fill/out et sens maker/taker/base/quote ; ajouter table audit éventuelle ; ne matérialiser trades qu’après validation du sens économique. |
|
| 14 | `phoenix_v1` | `audit-only / 0.7.60 planned` | Decoder local audit-only ; `log_audit`, order place/cancel, withdraw ; parsing strict `0x0f`; events `Reduce`, `Place`, `TimeInForce` observés ; `trade_count=0`. | Terminer tous les events Git : `Fill`, `FillSummary`, `Fee`, `Evict`, `ExpiredOrder`, etc. ; ajouter counts/flags audit ; seulement ensuite étudier trade materialization. |
|
||||||
| 15 | `orca_whirlpools` | `partial / 0.7.62 planned` | Premier decoder historique présent ; swaps/create_pool partiels. | Comparer Carbon/IDL complet ; couvrir liquidity, positions, fees/rewards, tick arrays ; valider swaps exploitables et non-trades. |
|
| 15 | `openbook_v2` | `audit-only / 0.7.61 planned` | Decoder local audit-only ; instructions order/cancel/consume/settle ; `Program data` mappé : `FillLog`, `OpenOrdersPositionLog`, `TotalOrderFillEvent`, `SettleFundsLog`; `trade_count=0`. | Vérifier layouts fill/out et sens maker/taker/base/quote ; ajouter table audit éventuelle ; ne matérialiser trades qu’après validation du sens économique. |
|
||||||
| 16 | `legacy_launch_candidates` | `planned launch` | Anciennes entrées launch à réévaluer après `raydium_launchpad`. | Ne pas confondre Launchpad, LaunchLab, CPMM/CLMM/AMM v4 ; rattacher aux pools tradables seulement après corpus. |
|
| 16 | `orca_whirlpools` | `partial / 0.7.62 planned` | Premier decoder historique présent ; swaps/create_pool partiels. | Comparer Carbon/IDL complet ; couvrir liquidity, positions, fees/rewards, tick arrays ; valider swaps exploitables et non-trades. |
|
||||||
| 17 | `meteora_vault` | `to_verify` | Présent comme indice upstream / compte associé. | Corpus direct obligatoire ; decoder séparé si events vault réels ; aucune promotion via DAMM indirect. |
|
| 17 | `legacy_launch_candidates` | `planned launch` | Anciennes entrées launch à réévaluer après `raydium_launchpad`. | Ne pas confondre Launchpad, LaunchLab, CPMM/CLMM/AMM v4 ; rattacher aux pools tradables seulement après corpus. |
|
||||||
| 18 | `fluxbeam` | `partial/to_verify` | Decoder initial existant ; Demo3 peut produire des candidats. | Vérifier source/IDL ; compléter swap, pool, liquidity, fees/admin ; matérialisation uniquement après corpus. |
|
| 18 | `meteora_vault` | `to_verify` | Présent comme indice upstream / compte associé. | Corpus direct obligatoire ; decoder séparé si events vault réels ; aucune promotion via DAMM indirect. |
|
||||||
| 19 | `dexlab` | `partial/to_verify` | Decoder initial historique ; ancienne entrée beta supprimée. | Reconfirmer program id/source ; décoder events disponibles ; distinguer DexLab natif et liens OpenBook/market. |
|
| 19 | `fluxbeam` | `partial/to_verify` | Decoder initial existant ; Demo3 peut produire des candidats. | Vérifier source/IDL ; compléter swap, pool, liquidity, fees/admin ; matérialisation uniquement après corpus. |
|
||||||
|
| 20 | `dexlab` | `partial/to_verify` | Decoder initial historique ; ancienne entrée beta supprimée. | Reconfirmer program id/source ; décoder events disponibles ; distinguer DexLab natif et liens OpenBook/market. |
|
||||||
| 19 | `lifinity_v2` | `to_verify` | Program id listé par sources externes/Vybe ; pas de corpus concluant. | Trouver IDL/source ; Demo3 par program/market ; audit-only d’abord. |
|
| 19 | `lifinity_v2` | `to_verify` | Program id listé par sources externes/Vybe ; pas de corpus concluant. | Trouver IDL/source ; Demo3 par program/market ; audit-only d’abord. |
|
||||||
| 20 | `stabble_stable_swap` / `stabble_weighted_swap` | `to_verify` | Program ids/indices via sources externes ; candidats Demo3 observables. | Source/IDL + corpus + decoder audit-only ; déterminer surface AMM et montants exploitables. |
|
| 20 | `stabble_stable_swap` / `stabble_weighted_swap` | `to_verify` | Program ids/indices via sources externes ; candidats Demo3 observables. | Source/IDL + corpus + decoder audit-only ; déterminer surface AMM et montants exploitables. |
|
||||||
| 21 | `bonkswap` | `to_verify` | Program id/Carbon/Vybe selon registre ; swaps candidats possibles. | Vérifier program id, source et corpus ; décoder tous events ; pas de trade sans montants. |
|
| 21 | `bonkswap` | `to_verify` | Program id/Carbon/Vybe selon registre ; swaps candidats possibles. | Vérifier program id, source et corpus ; décoder tous events ; pas de trade sans montants. |
|
||||||
@@ -151,7 +160,7 @@ Un event peut devenir `materialized` uniquement si :
|
|||||||
| `launchbeam` | `launch_surface` | `launch` | `unknown` | non | non | non | `planned` | program_id_to_verify |
|
| `launchbeam` | `launch_surface` | `launch` | `unknown` | non | non | non | `planned` | program_id_to_verify |
|
||||||
| `heaven` | `launch_surface` | `launch` | `to_verify` | non | non | non | `planned` | program_id_to_verify |
|
| `heaven` | `launch_surface` | `launch` | `to_verify` | non | non | non | `planned` | program_id_to_verify |
|
||||||
| `gavel` | `to_verify` | `auction` | `to_verify` | non | non | non | `to_verify` | upstream_git_program_id_requires_local_corpus_verification |
|
| `gavel` | `to_verify` | `auction` | `to_verify` | non | non | non | `to_verify` | upstream_git_program_id_requires_local_corpus_verification |
|
||||||
| `pump_fees` | `to_verify` | `fee_program` | `to_verify` | non | non | non | `to_verify` | upstream_git_program_id_requires_local_corpus_verification |
|
| `pump_fees` | `supported` | `fee_program` | `pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ` | non | non | non | `0.7.55 closed` | fee/reward/admin/lifecycle only ; no trade/candle |
|
||||||
| `meteora_pools` | `dex_effective` | `AMM` | `alias_of_meteora_damm_v1` | non | non | non | `to_verify` | program_id_alias_held_by_meteora_damm_v1 |
|
| `meteora_pools` | `dex_effective` | `AMM` | `alias_of_meteora_damm_v1` | non | non | non | `to_verify` | program_id_alias_held_by_meteora_damm_v1 |
|
||||||
| `dflow_aggregator_v4` | `aggregator_router` | `aggregator` | `to_verify` | non | non | non | `to_verify` | upstream_git_program_id_requires_local_corpus_verification |
|
| `dflow_aggregator_v4` | `aggregator_router` | `aggregator` | `to_verify` | non | non | non | `to_verify` | upstream_git_program_id_requires_local_corpus_verification |
|
||||||
| `drift_v2` | `to_verify` | `perps` | `to_verify` | non | non | non | `to_verify` | upstream_git_program_id_requires_local_corpus_verification |
|
| `drift_v2` | `to_verify` | `perps` | `to_verify` | non | non | non | `to_verify` | upstream_git_program_id_requires_local_corpus_verification |
|
||||||
@@ -310,3 +319,9 @@ La tranche a été validée sur base SQLite dédiée : tous les discriminants `0
|
|||||||
|---|---|---:|---|---|---|
|
|---|---|---:|---|---|---|
|
||||||
| `pump_swap` | `pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA` | supported / 0.7.53 closed | upstream registry + `idls/pump_swap.pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA.json` + corpus Demo3/replay | instructions : `buy`, `sell`, `buy_exact_quote_in`, `deposit`, `withdraw`, `create_pool`, `create_config`, `update_fee_config`, creator-fee, cashback, token incentives, volume accumulator, admin/config ; events Anchor autonomes audit-only | `buy_exact_quote_in` trade uniquement avec `pump_swap_anchor_buy_event`; aucun non-swap en trade/candle ; failed tx decoded-only ; `buy_event`/`sell_event` Program-data audit-only ; `transfer_creator_fees_to_pump_v2` et `update_buyback_config` confirmés par Solscan IDL ; `set_reserved_fee_recipient` conservé sur preuve log locale |
|
| `pump_swap` | `pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA` | supported / 0.7.53 closed | upstream registry + `idls/pump_swap.pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA.json` + corpus Demo3/replay | instructions : `buy`, `sell`, `buy_exact_quote_in`, `deposit`, `withdraw`, `create_pool`, `create_config`, `update_fee_config`, creator-fee, cashback, token incentives, volume accumulator, admin/config ; events Anchor autonomes audit-only | `buy_exact_quote_in` trade uniquement avec `pump_swap_anchor_buy_event`; aucun non-swap en trade/candle ; failed tx decoded-only ; `buy_event`/`sell_event` Program-data audit-only ; `transfer_creator_fees_to_pump_v2` et `update_buyback_config` confirmés par Solscan IDL ; `set_reserved_fee_recipient` conservé sur preuve log locale |
|
||||||
|
|
||||||
|
|
||||||
|
## 0.7.55 — Pump Fees
|
||||||
|
|
||||||
|
| Decoder | Program id | Statut | Source discriminants | Couverture locale | Règles métier |
|
||||||
|
|---|---|---:|---|---|---|
|
||||||
|
| `pump_fees` | `pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ` | supported / `0.7.55 closed` | `idls/pump_fees.pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ.json` + Carbon partiel + Solscan discriminators | `29` instructions et `20` events Anchor couverts ; tests synthétiques pour les Anchor events IDL non observés ; replay final propre ; watchlist `pump_fees` vide | Aucun trade/candle direct ; `get_fees` decoded-only ; social claim vers reward ; donation/buyback vers fee ; config/authority/tier/admin vers admin/lifecycle ; failed tx audit-only ; deux events Solscan hors IDL conservés non observés. |
|
||||||
|
|||||||
@@ -280,5 +280,32 @@ Program id unique : `pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA`.
|
|||||||
- `pump_swap` ne présente plus de decoded event local sans coverage dans le corpus de clôture.
|
- `pump_swap` ne présente plus de decoded event local sans coverage dans le corpus de clôture.
|
||||||
- `buy_exact_quote_in` est matérialisé seulement quand le `BuyEvent` Anchor donne les montants exacts ; les bornes d’instruction seules restent non actionnables.
|
- `buy_exact_quote_in` est matérialisé seulement quand le `BuyEvent` Anchor donne les montants exacts ; les bornes d’instruction seules restent non actionnables.
|
||||||
- Les events Anchor `*_event` sont décodés en audit-only pour éviter les doublons, sauf exception matérialisable explicitement testée.
|
- Les events Anchor `*_event` sont décodés en audit-only pour éviter les doublons, sauf exception matérialisable explicitement testée.
|
||||||
- Les gaps globaux restants sont classés comme backlog upstream (`pump_fun`, puis `pump_fees`, `jupiter_swap`, agrégateurs), gaps Meteora reportés, ou observations non attribuées.
|
- Les gaps globaux Pump.fun/PumpSwap/Pump Fees sont fermés ; la watchlist résiduelle courante ne contient plus `pump_fees` et garde seulement `jupiter_swap.route_v2` comme observation ponctuelle.
|
||||||
- Les checks Raydium AMM v4 / CLMM / CPMM normalisés sont vides ; aucune correction Raydium n’est incluse dans cette clôture.
|
- Les checks Raydium AMM v4 / CLMM / CPMM normalisés sont vides ; aucune correction Raydium n’est incluse dans cette clôture.
|
||||||
|
|
||||||
|
## 0.7.55 — Pump Fees
|
||||||
|
|
||||||
|
| Entry group | Discriminants | Famille | Target attendu | Local event kind | Notes |
|
||||||
|
|---|---:|---|---|---|---|
|
||||||
|
| `get_fees` | `e7257e55cf5b3f34` | audit | decoded-only | `pump_fees.get_fees` | Calcul/preview de fees ; ne pas matérialiser comme fee payé sans transfert réalisé. |
|
||||||
|
| social fee claim/create | IDL locale | reward / lifecycle | `k_sol_reward_events` ou `k_sol_pool_lifecycle_events` | `pump_fees.claim_social_fee_pda*`, `pump_fees.social_fee_pda_*` | Claim matérialisable seulement avec montant/acteur/mint fiables et transaction OK. |
|
||||||
|
| donation fee PDA | IDL locale | fee / lifecycle | `k_sol_fee_events` ou `k_sol_pool_lifecycle_events` | `pump_fees.*donation_fee_pda*` | Crank avec montant fiable vers fee ; création de PDA vers lifecycle. |
|
||||||
|
| buyback | IDL locale | fee / admin/lifecycle | `k_sol_fee_events`, `k_sol_pool_admin_events` ou lifecycle | `pump_fees.*buyback*` | Sweep matérialisable comme fee si montant fiable ; init/update comme lifecycle/admin. |
|
||||||
|
| fee sharing/config/authority/tier | IDL locale + Carbon partiel | admin_config / lifecycle | `k_sol_pool_admin_events` ou `k_sol_pool_lifecycle_events` | `pump_fees.*config*`, `pump_fees.*authority*`, `pump_fees.*tier*`, `pump_fees.update_fee_shares*` | Aucun trade/candle ; decoded-only/audit-only si données métier insuffisantes. |
|
||||||
|
|
||||||
|
## 0.7.55 Pump Fees — clôture
|
||||||
|
|
||||||
|
Programme : `pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ`. Source locale prioritaire : `idls/pump_fees.pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ.json`.
|
||||||
|
|
||||||
|
| Famille | Entrées | Target | Statut | Notes |
|
||||||
|
|---|---|---|---|---|
|
||||||
|
| fee calculation | `get_fees` / `e7257e55cf5b3f34` | `k_sol_dex_decoded_events_only` | decoded-only validé | Calcul/preview ; ne représente pas une fee payée. |
|
||||||
|
| reward/social fee | `claim_social_fee_pda`, `claim_social_fee_pda_v2`, `social_fee_pda_claimed` | `k_sol_reward_events` | matérialisé si tx OK | Écarts expliqués par failed tx. |
|
||||||
|
| donation fee | `create_donation_fee_pda`, `crank_donation_fee_pda`, events associés | lifecycle / `k_sol_fee_events` | matérialisé si tx OK | Création PDA vers lifecycle ; crank vers fee. |
|
||||||
|
| buyback | `initialize_buyback`, `sweep_buyback`, authority/rate-limit | lifecycle / fee / admin | matérialisé si tx OK | `sweep_buyback` et `sweep_buyback_event` alimentent fee. |
|
||||||
|
| fee sharing/config/authority/tier | config/reset/transfer/revoke/update/upsert | `k_sol_pool_admin_events` ou lifecycle | matérialisé si tx OK | Aucun trade/candle ; failed tx audit-only. |
|
||||||
|
| Anchor IDL non observés | `SetAuthorityEvent`, `SetClaimRateLimitEvent`, `SetDisableFlagsEvent`, `SetSocialClaimAuthorityEvent` | admin/audit | tests synthétiques | Aucun corpus Solscan au moment de clôture ; decoder conservé pour transactions futures. |
|
||||||
|
| Solscan hors IDL locale | `revoke_fee_sharing_authority_event`, `transfer_fee_sharing_authority_event` | admin | mapped_unverified | Discriminators trouvés via Solscan ; conservés comme surfaces futures. |
|
||||||
|
|
||||||
|
Invariants propres : fallback `pump_fees` vide, decoded sans coverage vide, successful non-materialized sans skip/policy vide, failed tx matérialisée vide, multi-target vide, anti-trade/candle direct vide, watchlist globale sans `pump_fees`.
|
||||||
|
|
||||||
|
|||||||
216
docs/prompts/PROMPT_0_7_56_METEORA_DBC.md
Normal file
216
docs/prompts/PROMPT_0_7_56_METEORA_DBC.md
Normal file
@@ -0,0 +1,216 @@
|
|||||||
|
# Prompt de reprise — khadhroony-bobobot 0.7.56 — meteora_dbc
|
||||||
|
|
||||||
|
Tu reprends le workspace Rust/Tauri `khadhroony-bobobot` après clôture technique de `0.7.55 pump_fees`.
|
||||||
|
|
||||||
|
## 1. Archive et fichiers à fournir
|
||||||
|
|
||||||
|
Utiliser l'archive la plus récente après clôture `0.7.55 pump_fees`.
|
||||||
|
|
||||||
|
À considérer comme sources locales de savoir :
|
||||||
|
|
||||||
|
- code Rust du workspace ;
|
||||||
|
- `README.md`, `ROADMAP.md`, `CHANGELOG.md` ;
|
||||||
|
- `docs/DEX_DECODER_MATRIX.md` ;
|
||||||
|
- `docs/DEX_EVENT_COVERAGE_MATRIX.md` ;
|
||||||
|
- `docs/reports/PUMP_FEES_EVENT_COVERAGE_REPORT.md` ;
|
||||||
|
- `validation_sql/SQL_VALIDATION_PUMP_FEES_0_7_55.sql` ;
|
||||||
|
- `idls/**`, en particulier `idls/meteora_dbc.dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN.json` ;
|
||||||
|
- les logs/requêtes SQL collés pendant la session.
|
||||||
|
|
||||||
|
Ne pas supposer que la documentation est parfaite : vérifier contre le code, l'IDL locale, les sources Git et le corpus SQLite.
|
||||||
|
|
||||||
|
## 2. État validé avant cette version
|
||||||
|
|
||||||
|
`0.7.55 pump_fees` est clos.
|
||||||
|
|
||||||
|
Replay final rapporté :
|
||||||
|
|
||||||
|
```text
|
||||||
|
127 replayed
|
||||||
|
0 decode skipped
|
||||||
|
150 ledger upserts
|
||||||
|
125 unsafe ledger rows
|
||||||
|
4 trades
|
||||||
|
0 liquidity
|
||||||
|
115 lifecycle
|
||||||
|
0 tokenAccount
|
||||||
|
16 candle upserts
|
||||||
|
instructionObservations = 2234
|
||||||
|
resetDeleted = 1644
|
||||||
|
catalog = 11 tokens / 10 pools / 10 pairs
|
||||||
|
```
|
||||||
|
|
||||||
|
Validation build :
|
||||||
|
|
||||||
|
```text
|
||||||
|
cargo test -p kb_lib -> 431 passed / 0 failed
|
||||||
|
cargo clippy -p kb_lib --all-targets -- -D warnings -> OK
|
||||||
|
```
|
||||||
|
|
||||||
|
Checks de fermeture Pump Fees :
|
||||||
|
|
||||||
|
- fallback `upstream_git` `pump_fees` : vide ;
|
||||||
|
- `instruction_name` vide : vide ;
|
||||||
|
- `event_family = unknown` ou vide pour instruction/event : vide ;
|
||||||
|
- decoded `pump_fees` sans coverage : vide ;
|
||||||
|
- successful non-materialized sans skip/policy : vide ;
|
||||||
|
- failed transaction materialization safety : vide ;
|
||||||
|
- multi-target materialization safety : vide ;
|
||||||
|
- anti-trade/candle direct `pump_fees` : vide ;
|
||||||
|
- watchlist globale : plus aucun `pump_fees`, seulement `jupiter_swap.route_v2` ponctuel.
|
||||||
|
|
||||||
|
Décisions Pump Fees à préserver :
|
||||||
|
|
||||||
|
- `get_fees` est decoded-only ;
|
||||||
|
- claims social fee vers `k_sol_reward_events` seulement si succès et montant fiable ;
|
||||||
|
- donation/buyback vers `k_sol_fee_events` seulement si succès et montant fiable ;
|
||||||
|
- config/authority/tier/update vers `k_sol_pool_admin_events` ;
|
||||||
|
- create/init/extend vers `k_sol_pool_lifecycle_events` ;
|
||||||
|
- aucun trade/candle direct ;
|
||||||
|
- failed tx audit-only ;
|
||||||
|
- les discriminators Solscan `revoke_fee_sharing_authority_event` et `transfer_fee_sharing_authority_event` restent conservés comme futures surfaces non observées.
|
||||||
|
|
||||||
|
Ne pas rouvrir `pump_fees`, `pump_fun`, `pump_swap` ou Raydium sauf bug prouvé par SQL/code.
|
||||||
|
|
||||||
|
## 3. Objectif de `0.7.56 meteora_dbc`
|
||||||
|
|
||||||
|
Ouvrir et clôturer la surface `meteora_dbc`.
|
||||||
|
|
||||||
|
Program id cible :
|
||||||
|
|
||||||
|
```text
|
||||||
|
dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN
|
||||||
|
```
|
||||||
|
|
||||||
|
IDL locale prioritaire :
|
||||||
|
|
||||||
|
```text
|
||||||
|
idls/meteora_dbc.dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN.json
|
||||||
|
```
|
||||||
|
|
||||||
|
Règle forte :
|
||||||
|
|
||||||
|
> Tout ce qui peut être décodé doit être décodé. Tout ce qui peut être matérialisé de façon fiable doit être matérialisé. Ce qui ne peut pas être matérialisé doit rester decoded-only/audit-only avec `skip*Reason` explicite.
|
||||||
|
|
||||||
|
La surface DBC doit couvrir launch/bonding curve, pool/config lifecycle, swaps exploitables, migration, fees/admin/config, et events Anchor associés.
|
||||||
|
|
||||||
|
## 4. Méthode obligatoire : nouvelle base SQLite
|
||||||
|
|
||||||
|
Créer une nouvelle DB dédiée à `0.7.56 meteora_dbc`.
|
||||||
|
|
||||||
|
Ne pas réutiliser l'ancienne DB de validation Pump Fees sauf pour lire des signatures de départ.
|
||||||
|
|
||||||
|
Après chaque backfill ou patch decoder :
|
||||||
|
|
||||||
|
```text
|
||||||
|
skipDexDecode=no
|
||||||
|
forceDexDecode=yes
|
||||||
|
deferInstructionObservations=yes
|
||||||
|
```
|
||||||
|
|
||||||
|
Puis :
|
||||||
|
|
||||||
|
- refresh catalog ;
|
||||||
|
- replay local ;
|
||||||
|
- relancer SQL de validation ;
|
||||||
|
- noter les compteurs replay.
|
||||||
|
|
||||||
|
## 5. Corpus et backfills
|
||||||
|
|
||||||
|
Construire le corpus local à partir de :
|
||||||
|
|
||||||
|
1. signatures `sample_signature` de la watchlist globale et des coverage gaps ;
|
||||||
|
2. filtres Solscan.io par program id + instruction/discriminator quand disponibles ;
|
||||||
|
3. Demo3 discovery multi-source/multi-target ;
|
||||||
|
4. batch backfill par groupes de signatures ;
|
||||||
|
5. program/signature backfill ciblé si nécessaire ;
|
||||||
|
6. signatures issues des requêtes SQL `instruction_observations`, fallback upstream et decoded-only résiduels.
|
||||||
|
|
||||||
|
Inclure explicitement les transactions failed dans le corpus d'audit, mais ne jamais les matérialiser métier.
|
||||||
|
|
||||||
|
## 6. Sources à comparer
|
||||||
|
|
||||||
|
Comparer au minimum :
|
||||||
|
|
||||||
|
- `idls/meteora_dbc.dbcij3LWUppWqq96dh6gJWwBifmcGfLSB5D4DuSMaqN.json` ;
|
||||||
|
- Carbon `meteora-dbc-decoder` ;
|
||||||
|
- Pinax/Substreams Solana IDLs si disponibles ;
|
||||||
|
- Solana Streamer / sol-parser-sdk si des layouts Meteora DBC y apparaissent ;
|
||||||
|
- code local existant `kb_lib/src/dex/*meteora*` ;
|
||||||
|
- `upstream_registry_generated.rs` ;
|
||||||
|
- corpus SQLite neuf.
|
||||||
|
|
||||||
|
## 7. Matérialisation attendue
|
||||||
|
|
||||||
|
Ne pas se contenter de decoded-only si une matérialisation fiable est possible.
|
||||||
|
|
||||||
|
Cibles probables :
|
||||||
|
|
||||||
|
- swaps exploitables -> `k_sol_trade_events` + candles si montants, sens, mint base/quote et pool/pair sont fiables ;
|
||||||
|
- pool/config/create -> `k_sol_pool_lifecycle_events` et catalog/pool/pair si comptes fiables ;
|
||||||
|
- liquidity/deposit/withdraw -> `k_sol_liquidity_events` si montants et pool fiables ;
|
||||||
|
- migration -> lifecycle/admin selon sémantique exacte ;
|
||||||
|
- fees/creator fees/admin/config -> `k_sol_fee_events` ou `k_sol_pool_admin_events` ;
|
||||||
|
- events sans contexte suffisant -> decoded-only/audit-only avec skip reason.
|
||||||
|
|
||||||
|
Transactions failed : decoded-only/audit-only, jamais business matérialisées.
|
||||||
|
|
||||||
|
## 8. SQL de validation attendu
|
||||||
|
|
||||||
|
Créer :
|
||||||
|
|
||||||
|
```text
|
||||||
|
validation_sql/SQL_VALIDATION_METEORA_DBC_0_7_56.sql
|
||||||
|
```
|
||||||
|
|
||||||
|
Requêtes minimales :
|
||||||
|
|
||||||
|
1. upstream fallback samples `meteora_dbc` ;
|
||||||
|
2. local instruction observations `meteora_dbc` ;
|
||||||
|
3. coverage `meteora_dbc` ;
|
||||||
|
4. decoded events `meteora_dbc` sans coverage ;
|
||||||
|
5. residual upstream fallback pour entrées couvertes ;
|
||||||
|
6. successful non-materialized sans skip reason ;
|
||||||
|
7. failed transaction materialization safety ;
|
||||||
|
8. multi-target materialization safety ;
|
||||||
|
9. materialization summary par table, avec colonnes successful/failed ;
|
||||||
|
10. instruction observation versus coverage ;
|
||||||
|
11. anti-faux trade/candle pour events non swap ;
|
||||||
|
12. global watchlist après replay.
|
||||||
|
|
||||||
|
## 9. Invariants de fermeture
|
||||||
|
|
||||||
|
La tranche `0.7.56` ne doit être considérée close que si :
|
||||||
|
|
||||||
|
- aucun fallback `upstream_git` `meteora_dbc` ne reste pour les entrées couvertes localement ;
|
||||||
|
- aucun decoded event `meteora_dbc` local sans coverage ;
|
||||||
|
- aucune transaction failed n'alimente une table métier ;
|
||||||
|
- aucun event multi-target incohérent ;
|
||||||
|
- aucune ligne successful non-materialized sans `skip*Reason` ;
|
||||||
|
- aucun faux trade/candle sur event non swap ;
|
||||||
|
- toutes les instructions/events de l'IDL locale sont soit décodés/matérialisés, soit audit-only, soit non observés mais couverts par tests synthétiques ;
|
||||||
|
- la watchlist globale ne contient plus de `meteora_dbc` comme backlog dominant.
|
||||||
|
|
||||||
|
## 10. Documentation à mettre à jour en fin de tranche
|
||||||
|
|
||||||
|
Mettre à jour :
|
||||||
|
|
||||||
|
- `CHANGELOG.md` ;
|
||||||
|
- `README.md` ;
|
||||||
|
- `ROADMAP.md` ;
|
||||||
|
- `docs/DEX_DECODER_MATRIX.md` ;
|
||||||
|
- `docs/DEX_EVENT_COVERAGE_MATRIX.md` ;
|
||||||
|
- créer `docs/reports/METEORA_DBC_EVENT_COVERAGE_REPORT.md` ;
|
||||||
|
- créer `validation_sql/SQL_VALIDATION_METEORA_DBC_0_7_56.sql`.
|
||||||
|
|
||||||
|
## 11. Format de livraison attendu
|
||||||
|
|
||||||
|
Fournir un delta zip contenant uniquement les fichiers modifiés/ajoutés.
|
||||||
|
|
||||||
|
Nom recommandé :
|
||||||
|
|
||||||
|
```text
|
||||||
|
khadhroony-bobobot-v0.7.56-meteora_dbc-delta-N-files.zip
|
||||||
|
```
|
||||||
|
|
||||||
|
Inclure dans chaque livraison : résumé des changements, liste exacte des fichiers modifiés, commandes `cargo fmt`, `cargo test -p kb_lib`, `cargo clippy -p kb_lib --all-targets -- -D warnings`, replay recommandé, SQL à exécuter et résultats attendus.
|
||||||
134
docs/reports/PUMP_FEES_EVENT_COVERAGE_REPORT.md
Normal file
134
docs/reports/PUMP_FEES_EVENT_COVERAGE_REPORT.md
Normal file
@@ -0,0 +1,134 @@
|
|||||||
|
<!-- file: docs/reports/PUMP_FEES_EVENT_COVERAGE_REPORT.md -->
|
||||||
|
|
||||||
|
# Pump Fees event coverage report — 0.7.55 final
|
||||||
|
|
||||||
|
## Portée
|
||||||
|
|
||||||
|
Programme cible : `pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ`.
|
||||||
|
|
||||||
|
Source locale prioritaire : `idls/pump_fees.pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ.json`.
|
||||||
|
|
||||||
|
L'IDL locale couvre `29` instructions, `20` events Anchor, `9` accounts et `34` types. La tranche ajoute un decoder local maximal `pump_fees` depuis l'IDL locale, le registre Carbon partiel et les discriminators observés via Solscan/corpus.
|
||||||
|
|
||||||
|
## Décisions métier
|
||||||
|
|
||||||
|
- `pump_fees` est traité comme programme fee/config/accounting.
|
||||||
|
- Aucun `k_sol_trade_events` ni candle ne doit être créé pour `pump_fees` sans preuve transactionnelle stricte d'un swap autonome.
|
||||||
|
- `get_fees` reste decoded-only : il décrit un calcul/preview de fees, pas un paiement réalisé.
|
||||||
|
- Les claims social fee alimentent `k_sol_reward_events` seulement si transaction OK et montant/acteur/mint exploitables.
|
||||||
|
- Les flux donation/buyback alimentent `k_sol_fee_events` seulement si transaction OK et montant fiable.
|
||||||
|
- Les créations/configurations/autorités/tiers alimentent `k_sol_pool_lifecycle_events` ou `k_sol_pool_admin_events` selon classification.
|
||||||
|
- Les transactions failed restent decoded-only/audit-only.
|
||||||
|
|
||||||
|
## Résultat build/test
|
||||||
|
|
||||||
|
```text
|
||||||
|
cargo test -p kb_lib -> 431 passed / 0 failed
|
||||||
|
cargo clippy -p kb_lib --all-targets -- -D warnings -> OK
|
||||||
|
```
|
||||||
|
|
||||||
|
## Replay final rapporté
|
||||||
|
|
||||||
|
```text
|
||||||
|
127 replayed
|
||||||
|
0 decode skipped
|
||||||
|
150 ledger upserts
|
||||||
|
125 unsafe ledger rows
|
||||||
|
4 trades
|
||||||
|
0 liquidity
|
||||||
|
115 lifecycle
|
||||||
|
0 tokenAccount
|
||||||
|
16 candle upserts
|
||||||
|
instructionObservations = 2234
|
||||||
|
resetDeleted = 1644
|
||||||
|
catalog = 11 tokens / 10 pools / 10 pairs
|
||||||
|
```
|
||||||
|
|
||||||
|
Les `4 trades` et `16 candle upserts` du replay proviennent d'autres surfaces du corpus local ; le contrôle anti-trade `pump_fees` est vide.
|
||||||
|
|
||||||
|
## Coverage local
|
||||||
|
|
||||||
|
### Instructions observées et couvertes
|
||||||
|
|
||||||
|
| Instruction | Discriminator | Observation principale | Matérialisation |
|
||||||
|
|---|---:|---:|---|
|
||||||
|
| `sweep_buyback` | `8a21cc26cfa19fe2` | `96` | `k_sol_fee_events` |
|
||||||
|
| `create_fee_sharing_config` | `c34e564c6f34fbd5` | `42` observations / `36` decoded | `k_sol_pool_lifecycle_events` |
|
||||||
|
| `update_fee_shares` | `bd0d8863bba4ed23` | `26` observations / `16` decoded | `k_sol_pool_admin_events` |
|
||||||
|
| `claim_social_fee_pda_v2` | `114df0863abc3595` | `25` | `k_sol_reward_events` |
|
||||||
|
| `update_fee_shares_v2` | `6ffb31064e4e6a12` | `19` | `k_sol_pool_admin_events` |
|
||||||
|
| `claim_social_fee_pda` | `e115fb85a11ec7e2` | `15` observations / `10` decoded | `k_sol_reward_events` |
|
||||||
|
| `crank_donation_fee_pda` | `dc0abda7a9111945` | `14` | `k_sol_fee_events` |
|
||||||
|
| `get_fees` | `e7257e55cf5b3f34` | `13` observations / `5` decoded | decoded-only |
|
||||||
|
| `transfer_fee_sharing_authority` | `ca0a4bc8a422d260` | `12` | `k_sol_pool_admin_events` |
|
||||||
|
| `initialize_fee_program_global` | `23d78254e9387ca7` | `1` | `k_sol_pool_lifecycle_events` |
|
||||||
|
|
||||||
|
Le discriminator `e445a52e51cb9a1d` est classé comme `pump_fees.anchor_self_cpi_log` transport Anchor self-CPI : `271` observations / `119` tx.
|
||||||
|
|
||||||
|
### Instructions IDL non observées mais programmées
|
||||||
|
|
||||||
|
Ces entrées n'ont pas de signature Solscan/corpus au moment de la clôture, mais restent décodables si des transactions futures apparaissent :
|
||||||
|
|
||||||
|
| Instruction | Discriminator | Classification | Target prévu |
|
||||||
|
|---|---:|---|---|
|
||||||
|
| `reset_fee_sharing_config_v2` | `a9f511d15e5bf880` | admin_config | `k_sol_pool_admin_events` |
|
||||||
|
| `set_authority` | `85fa25156ea31a79` | admin_config | `k_sol_pool_admin_events` |
|
||||||
|
| `set_claim_rate_limit` | `b9d39faed4315804` | audit | decoded-only |
|
||||||
|
| `set_disable_flags` | `c2d9702372de33be` | admin_config | `k_sol_pool_admin_events` |
|
||||||
|
| `set_social_claim_authority` | `9336b89a88edb999` | admin_config | `k_sol_pool_admin_events` |
|
||||||
|
|
||||||
|
### Anchor events IDL non observés mais testés synthétiquement
|
||||||
|
|
||||||
|
| Event Anchor | Discriminator | Statut |
|
||||||
|
|---|---:|---|
|
||||||
|
| `SetAuthorityEvent` | `12af8442d0c957f2` | decoder + test synthétique |
|
||||||
|
| `SetClaimRateLimitEvent` | `0d8f8febb5133328` | decoder + test synthétique |
|
||||||
|
| `SetDisableFlagsEvent` | `0508b3413137917e` | decoder + test synthétique |
|
||||||
|
| `SetSocialClaimAuthorityEvent` | `3c767f84ef34fe0e` | decoder + test synthétique |
|
||||||
|
|
||||||
|
### Discriminators Solscan hors IDL locale
|
||||||
|
|
||||||
|
Ces discriminators ont été trouvés par filtres Solscan, mais ne sont pas observés dans le corpus local final et ne sont pas dans l'IDL locale fournie. Ils restent conservés en coverage comme surfaces futures :
|
||||||
|
|
||||||
|
| Event | Discriminator | Statut |
|
||||||
|
|---|---:|---|
|
||||||
|
| `revoke_fee_sharing_authority_event` | `7217653c0ebe993e` | `upstream_git_mapped_unverified` |
|
||||||
|
| `transfer_fee_sharing_authority_event` | `7c8fc6f54db808ec` | `upstream_git_mapped_unverified` |
|
||||||
|
|
||||||
|
## Écarts observed/materialized
|
||||||
|
|
||||||
|
Les écarts `observed_count > materialized_count` sont expliqués par des transactions failed ou par une politique decoded-only. La requête `09b` documente notamment :
|
||||||
|
|
||||||
|
| Entrée | Observed | Materialized | Explication |
|
||||||
|
|---|---:|---:|---|
|
||||||
|
| `get_fees` | `5` | `0` | decoded-only volontaire |
|
||||||
|
| `claim_social_fee_pda_v2` | `25` | `21` | `4` failed decoded |
|
||||||
|
| `create_fee_sharing_config` | `36` | `33` | `3` failed decoded |
|
||||||
|
| `initialize_fee_config` | `5` | `2` | `3` failed decoded |
|
||||||
|
| `social_fee_pda_claimed` | `17` | `15` | `2` failed decoded |
|
||||||
|
| `crank_donation_fee_pda` | `14` | `12` | `2` failed decoded |
|
||||||
|
| `update_fee_shares_v2` | `19` | `17` | `2` failed decoded |
|
||||||
|
| `revoke_fee_sharing_authority` | `6` | `5` | `1` failed decoded |
|
||||||
|
|
||||||
|
La requête `06` confirme qu'il n'existe aucun successful non-materialized sans skip/policy explicite.
|
||||||
|
|
||||||
|
## Checks de fermeture
|
||||||
|
|
||||||
|
SQL dédié : `validation_sql/SQL_VALIDATION_PUMP_FEES_0_7_55.sql`.
|
||||||
|
|
||||||
|
Résultats de fermeture rapportés :
|
||||||
|
|
||||||
|
- fallback `upstream_git` `pump_fees` : vide ;
|
||||||
|
- `instruction_name` `pump_fees` vide : vide ;
|
||||||
|
- `event_family = unknown` ou vide pour instruction/event : vide ;
|
||||||
|
- decoded `pump_fees` sans coverage : vide ;
|
||||||
|
- fallback résiduel pour entrées couvertes localement : vide ;
|
||||||
|
- successful non-materialized sans skip/policy : vide ;
|
||||||
|
- failed transaction avec business materialization : vide ;
|
||||||
|
- multi-target materialization : vide ;
|
||||||
|
- anti-trade/candle direct `pump_fees` : vide ;
|
||||||
|
- watchlist globale : plus aucun `pump_fees`, reste seulement `jupiter_swap.route_v2` comme backlog ponctuel.
|
||||||
|
|
||||||
|
## Statut final
|
||||||
|
|
||||||
|
`0.7.55 pump_fees` est clôturé techniquement. Ne pas rouvrir `pump_fees`, `pump_fun`, `pump_swap` ou Raydium sans bug prouvé par SQL/code ou apparition d'un nouveau discriminant/corpus externe exploitable.
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "kb-demo-app",
|
"name": "kb-demo-app",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "0.7.54",
|
"version": "0.7.55",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"$schema": "https://schema.tauri.app/config/2",
|
"$schema": "https://schema.tauri.app/config/2",
|
||||||
"productName": "kb-demo-app",
|
"productName": "kb-demo-app",
|
||||||
"version": "0.7.54",
|
"version": "0.7.55",
|
||||||
"identifier": "com.sasedev.kb-demo-app",
|
"identifier": "com.sasedev.kb-demo-app",
|
||||||
"build": {
|
"build": {
|
||||||
"beforeDevCommand": "npm run dev",
|
"beforeDevCommand": "npm run dev",
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ WHERE decoded_event_id IN (
|
|||||||
WHERE transaction_id = ?
|
WHERE transaction_id = ?
|
||||||
AND protocol_name IN (
|
AND protocol_name IN (
|
||||||
'raydium_amm_v4', 'raydium_cpmm', 'raydium_clmm', 'raydium_launchpad',
|
'raydium_amm_v4', 'raydium_cpmm', 'raydium_clmm', 'raydium_launchpad',
|
||||||
'pump_fun', 'pump_swap', 'meteora_dbc', 'meteora_dlmm', 'meteora_damm_v1',
|
'pump_fun', 'pump_fees', 'pump_swap', 'meteora_dbc', 'meteora_dlmm', 'meteora_damm_v1',
|
||||||
'meteora_damm_v2', 'orca_whirlpools', 'fluxbeam', 'dexlab', 'openbook_v2',
|
'meteora_damm_v2', 'orca_whirlpools', 'fluxbeam', 'dexlab', 'openbook_v2',
|
||||||
'phoenix_v1'
|
'phoenix_v1'
|
||||||
)
|
)
|
||||||
@@ -160,7 +160,7 @@ DELETE FROM k_sol_dex_decoded_events
|
|||||||
WHERE transaction_id = ?
|
WHERE transaction_id = ?
|
||||||
AND protocol_name IN (
|
AND protocol_name IN (
|
||||||
'raydium_amm_v4', 'raydium_cpmm', 'raydium_clmm', 'raydium_launchpad',
|
'raydium_amm_v4', 'raydium_cpmm', 'raydium_clmm', 'raydium_launchpad',
|
||||||
'pump_fun', 'pump_swap', 'meteora_dbc', 'meteora_dlmm', 'meteora_damm_v1',
|
'pump_fun', 'pump_fees', 'pump_swap', 'meteora_dbc', 'meteora_dlmm', 'meteora_damm_v1',
|
||||||
'meteora_damm_v2', 'orca_whirlpools', 'fluxbeam', 'dexlab', 'openbook_v2',
|
'meteora_damm_v2', 'orca_whirlpools', 'fluxbeam', 'dexlab', 'openbook_v2',
|
||||||
'phoenix_v1'
|
'phoenix_v1'
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ mod meteora_dlmm;
|
|||||||
mod openbook_v2;
|
mod openbook_v2;
|
||||||
mod orca_whirlpools;
|
mod orca_whirlpools;
|
||||||
mod phoenix_v1;
|
mod phoenix_v1;
|
||||||
|
mod pump_fees;
|
||||||
mod pump_fun;
|
mod pump_fun;
|
||||||
mod pump_swap;
|
mod pump_swap;
|
||||||
mod raydium_amm_v4;
|
mod raydium_amm_v4;
|
||||||
@@ -61,14 +62,17 @@ pub use orca_whirlpools::OrcaWhirlpoolsSwapDecoded;
|
|||||||
pub use phoenix_v1::PhoenixV1AuditDecoded;
|
pub use phoenix_v1::PhoenixV1AuditDecoded;
|
||||||
pub use phoenix_v1::PhoenixV1DecodedEvent;
|
pub use phoenix_v1::PhoenixV1DecodedEvent;
|
||||||
pub use phoenix_v1::PhoenixV1Decoder;
|
pub use phoenix_v1::PhoenixV1Decoder;
|
||||||
|
pub use pump_fees::PumpFeesDecodedEvent;
|
||||||
|
pub use pump_fees::PumpFeesDecoder;
|
||||||
|
pub use pump_fees::PumpFeesInstructionDecoded;
|
||||||
pub use pump_fun::PumpFunCreateV2TokenDecoded;
|
pub use pump_fun::PumpFunCreateV2TokenDecoded;
|
||||||
pub use pump_fun::PumpFunInstructionAuditDecoded;
|
|
||||||
pub use pump_fun::PumpFunDecodedEvent;
|
pub use pump_fun::PumpFunDecodedEvent;
|
||||||
pub use pump_fun::PumpFunDecoder;
|
pub use pump_fun::PumpFunDecoder;
|
||||||
|
pub use pump_fun::PumpFunInstructionAuditDecoded;
|
||||||
pub use pump_fun::PumpFunTradeDecoded;
|
pub use pump_fun::PumpFunTradeDecoded;
|
||||||
pub use pump_swap::PumpSwapDecodedEvent;
|
pub use pump_swap::PumpSwapDecodedEvent;
|
||||||
pub use pump_swap::PumpSwapInstructionDecoded;
|
|
||||||
pub use pump_swap::PumpSwapDecoder;
|
pub use pump_swap::PumpSwapDecoder;
|
||||||
|
pub use pump_swap::PumpSwapInstructionDecoded;
|
||||||
pub use pump_swap::PumpSwapTradeDecoded;
|
pub use pump_swap::PumpSwapTradeDecoded;
|
||||||
pub use raydium_amm_v4::RaydiumAmmV4DecodedEvent;
|
pub use raydium_amm_v4::RaydiumAmmV4DecodedEvent;
|
||||||
pub use raydium_amm_v4::RaydiumAmmV4Decoder;
|
pub use raydium_amm_v4::RaydiumAmmV4Decoder;
|
||||||
|
|||||||
2447
kb_lib/src/dex/pump_fees.rs
Normal file
2447
kb_lib/src/dex/pump_fees.rs
Normal file
File diff suppressed because it is too large
Load Diff
@@ -13,6 +13,7 @@ pub struct DexDecodeService {
|
|||||||
raydium_clmm_decoder: crate::RaydiumClmmDecoder,
|
raydium_clmm_decoder: crate::RaydiumClmmDecoder,
|
||||||
raydium_stable_swap_decoder: crate::RaydiumStableSwapDecoder,
|
raydium_stable_swap_decoder: crate::RaydiumStableSwapDecoder,
|
||||||
pump_fun_decoder: crate::PumpFunDecoder,
|
pump_fun_decoder: crate::PumpFunDecoder,
|
||||||
|
pump_fees_decoder: crate::PumpFeesDecoder,
|
||||||
pump_swap_decoder: crate::PumpSwapDecoder,
|
pump_swap_decoder: crate::PumpSwapDecoder,
|
||||||
orca_whirlpools_decoder: crate::OrcaWhirlpoolsDecoder,
|
orca_whirlpools_decoder: crate::OrcaWhirlpoolsDecoder,
|
||||||
meteora_dbc_decoder: crate::MeteoraDbcDecoder,
|
meteora_dbc_decoder: crate::MeteoraDbcDecoder,
|
||||||
@@ -36,6 +37,7 @@ impl DexDecodeService {
|
|||||||
raydium_clmm_decoder: crate::RaydiumClmmDecoder::new(),
|
raydium_clmm_decoder: crate::RaydiumClmmDecoder::new(),
|
||||||
raydium_stable_swap_decoder: crate::RaydiumStableSwapDecoder::new(),
|
raydium_stable_swap_decoder: crate::RaydiumStableSwapDecoder::new(),
|
||||||
pump_fun_decoder: crate::PumpFunDecoder::new(),
|
pump_fun_decoder: crate::PumpFunDecoder::new(),
|
||||||
|
pump_fees_decoder: crate::PumpFeesDecoder::new(),
|
||||||
pump_swap_decoder: crate::PumpSwapDecoder::new(),
|
pump_swap_decoder: crate::PumpSwapDecoder::new(),
|
||||||
orca_whirlpools_decoder: crate::OrcaWhirlpoolsDecoder::new(),
|
orca_whirlpools_decoder: crate::OrcaWhirlpoolsDecoder::new(),
|
||||||
meteora_dbc_decoder: crate::MeteoraDbcDecoder::new(),
|
meteora_dbc_decoder: crate::MeteoraDbcDecoder::new(),
|
||||||
@@ -133,6 +135,13 @@ impl DexDecodeService {
|
|||||||
if let Err(error) = append_result {
|
if let Err(error) = append_result {
|
||||||
return Err(error);
|
return Err(error);
|
||||||
}
|
}
|
||||||
|
let append_result = append_persisted_events_result(
|
||||||
|
&mut persisted,
|
||||||
|
self.decode_and_persist_pump_fees_events(&transaction, &instructions).await,
|
||||||
|
);
|
||||||
|
if let Err(error) = append_result {
|
||||||
|
return Err(error);
|
||||||
|
}
|
||||||
let append_result = append_persisted_events_result(
|
let append_result = append_persisted_events_result(
|
||||||
&mut persisted,
|
&mut persisted,
|
||||||
self.decode_and_persist_meteora_dbc_events(&transaction, &instructions).await,
|
self.decode_and_persist_meteora_dbc_events(&transaction, &instructions).await,
|
||||||
@@ -1679,7 +1688,6 @@ impl DexDecodeService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
fn pump_fun_payload_string(
|
fn pump_fun_payload_string(
|
||||||
payload: &serde_json::Value,
|
payload: &serde_json::Value,
|
||||||
keys: &[&str],
|
keys: &[&str],
|
||||||
@@ -1739,6 +1747,44 @@ fn pump_fun_payload_string(
|
|||||||
.await;
|
.await;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async fn persist_pump_fees_event(
|
||||||
|
&self,
|
||||||
|
transaction: &crate::ChainTransactionDto,
|
||||||
|
decoded_event: &crate::PumpFeesDecodedEvent,
|
||||||
|
) -> Result<crate::DexDecodedEventDto, crate::Error> {
|
||||||
|
match decoded_event {
|
||||||
|
crate::PumpFeesDecodedEvent::Instruction(event) => {
|
||||||
|
return self.persist_pump_fees_instruction_event(transaction, event).await;
|
||||||
|
},
|
||||||
|
crate::PumpFeesDecodedEvent::AnchorEvent(event) => {
|
||||||
|
return self.persist_pump_fees_instruction_event(transaction, event).await;
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async fn persist_pump_fees_instruction_event(
|
||||||
|
&self,
|
||||||
|
transaction: &crate::ChainTransactionDto,
|
||||||
|
event: &crate::PumpFeesInstructionDecoded,
|
||||||
|
) -> Result<crate::DexDecodedEventDto, crate::Error> {
|
||||||
|
return self
|
||||||
|
.materialize_named_dex_event(
|
||||||
|
transaction,
|
||||||
|
event.transaction_id,
|
||||||
|
event.instruction_id,
|
||||||
|
"pump_fees",
|
||||||
|
event.program_id.clone(),
|
||||||
|
event.event_kind.as_str(),
|
||||||
|
event.pool_account.clone(),
|
||||||
|
None,
|
||||||
|
event.token_a_mint.clone(),
|
||||||
|
event.token_b_mint.clone(),
|
||||||
|
event.lp_mint.clone(),
|
||||||
|
event.payload_json.clone(),
|
||||||
|
)
|
||||||
|
.await;
|
||||||
|
}
|
||||||
|
|
||||||
async fn persist_pump_swap_event(
|
async fn persist_pump_swap_event(
|
||||||
&self,
|
&self,
|
||||||
transaction: &crate::ChainTransactionDto,
|
transaction: &crate::ChainTransactionDto,
|
||||||
@@ -2392,6 +2438,28 @@ fn pump_fun_payload_string(
|
|||||||
return Ok(persisted);
|
return Ok(persisted);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async fn decode_and_persist_pump_fees_events(
|
||||||
|
&self,
|
||||||
|
transaction: &crate::ChainTransactionDto,
|
||||||
|
instructions: &[crate::ChainInstructionDto],
|
||||||
|
) -> Result<std::vec::Vec<crate::DexDecodedEventDto>, crate::Error> {
|
||||||
|
let decoded_result = self.pump_fees_decoder.decode_transaction(transaction, instructions);
|
||||||
|
let decoded_events = match decoded_result {
|
||||||
|
Ok(decoded_events) => decoded_events,
|
||||||
|
Err(error) => return Err(error),
|
||||||
|
};
|
||||||
|
let mut persisted = std::vec::Vec::new();
|
||||||
|
for decoded_event in &decoded_events {
|
||||||
|
let persist_result = self.persist_pump_fees_event(transaction, decoded_event).await;
|
||||||
|
let persisted_event = match persist_result {
|
||||||
|
Ok(persisted_event) => persisted_event,
|
||||||
|
Err(error) => return Err(error),
|
||||||
|
};
|
||||||
|
persisted.push(persisted_event);
|
||||||
|
}
|
||||||
|
return Ok(persisted);
|
||||||
|
}
|
||||||
|
|
||||||
async fn decode_and_persist_meteora_dbc_events(
|
async fn decode_and_persist_meteora_dbc_events(
|
||||||
&self,
|
&self,
|
||||||
transaction: &crate::ChainTransactionDto,
|
transaction: &crate::ChainTransactionDto,
|
||||||
@@ -4404,7 +4472,6 @@ fn dex_decode_extract_first_amount_string(
|
|||||||
return dex_decode_extract_first_number_as_string(value, candidate_keys);
|
return dex_decode_extract_first_number_as_string(value, candidate_keys);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
fn pump_fun_enrich_trade_events_with_instruction_context(
|
fn pump_fun_enrich_trade_events_with_instruction_context(
|
||||||
decoded_events: std::vec::Vec<crate::PumpFunDecodedEvent>,
|
decoded_events: std::vec::Vec<crate::PumpFunDecodedEvent>,
|
||||||
) -> std::vec::Vec<crate::PumpFunDecodedEvent> {
|
) -> std::vec::Vec<crate::PumpFunDecodedEvent> {
|
||||||
@@ -4439,18 +4506,12 @@ fn pump_fun_merge_matching_instruction_context_into_trade_event(
|
|||||||
trade_event: &mut crate::PumpFunInstructionAuditDecoded,
|
trade_event: &mut crate::PumpFunInstructionAuditDecoded,
|
||||||
) {
|
) {
|
||||||
let trade_payload = trade_event.payload_json.clone();
|
let trade_payload = trade_event.payload_json.clone();
|
||||||
let trade_instruction_id = dex_decode_extract_first_i64(
|
let trade_instruction_id =
|
||||||
&trade_payload,
|
dex_decode_extract_first_i64(&trade_payload, &["instructionId", "instruction_id"]);
|
||||||
&["instructionId", "instruction_id"],
|
let trade_mint =
|
||||||
);
|
dex_decode_extract_first_string(&trade_payload, &["mint", "tokenMint", "tokenAMint"]);
|
||||||
let trade_mint = dex_decode_extract_first_string(
|
let trade_actor =
|
||||||
&trade_payload,
|
dex_decode_extract_first_string(&trade_payload, &["user", "actorWallet", "userWallet"]);
|
||||||
&["mint", "tokenMint", "tokenAMint"],
|
|
||||||
);
|
|
||||||
let trade_actor = dex_decode_extract_first_string(
|
|
||||||
&trade_payload,
|
|
||||||
&["user", "actorWallet", "userWallet"],
|
|
||||||
);
|
|
||||||
for sibling in decoded_events {
|
for sibling in decoded_events {
|
||||||
let sibling_event = match sibling {
|
let sibling_event = match sibling {
|
||||||
crate::PumpFunDecodedEvent::InstructionAudit(sibling_event) => sibling_event,
|
crate::PumpFunDecodedEvent::InstructionAudit(sibling_event) => sibling_event,
|
||||||
@@ -4506,18 +4567,12 @@ fn pump_fun_mark_trade_event_duplicate_when_direct_instruction_exists(
|
|||||||
trade_event: &mut crate::PumpFunInstructionAuditDecoded,
|
trade_event: &mut crate::PumpFunInstructionAuditDecoded,
|
||||||
) {
|
) {
|
||||||
let trade_payload = trade_event.payload_json.clone();
|
let trade_payload = trade_event.payload_json.clone();
|
||||||
let trade_instruction_id = dex_decode_extract_first_i64(
|
let trade_instruction_id =
|
||||||
&trade_payload,
|
dex_decode_extract_first_i64(&trade_payload, &["instructionId", "instruction_id"]);
|
||||||
&["instructionId", "instruction_id"],
|
let trade_mint =
|
||||||
);
|
dex_decode_extract_first_string(&trade_payload, &["mint", "tokenMint", "tokenAMint"]);
|
||||||
let trade_mint = dex_decode_extract_first_string(
|
let trade_actor =
|
||||||
&trade_payload,
|
dex_decode_extract_first_string(&trade_payload, &["user", "actorWallet", "userWallet"]);
|
||||||
&["mint", "tokenMint", "tokenAMint"],
|
|
||||||
);
|
|
||||||
let trade_actor = dex_decode_extract_first_string(
|
|
||||||
&trade_payload,
|
|
||||||
&["user", "actorWallet", "userWallet"],
|
|
||||||
);
|
|
||||||
for sibling in decoded_events {
|
for sibling in decoded_events {
|
||||||
let direct_match = match sibling {
|
let direct_match = match sibling {
|
||||||
crate::PumpFunDecodedEvent::BuyTrade(event) => {
|
crate::PumpFunDecodedEvent::BuyTrade(event) => {
|
||||||
@@ -4613,7 +4668,6 @@ fn pump_fun_direct_trade_matches_anchor_trade_event(
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
fn pump_fun_merge_instruction_context_payload(
|
fn pump_fun_merge_instruction_context_payload(
|
||||||
instruction_payload: &serde_json::Value,
|
instruction_payload: &serde_json::Value,
|
||||||
trade_payload: &mut serde_json::Value,
|
trade_payload: &mut serde_json::Value,
|
||||||
|
|||||||
@@ -294,6 +294,9 @@ pub fn is_dex_informational_event_kind(event_kind: &str) -> bool {
|
|||||||
if event_kind == crate::UPSTREAM_REGISTRY_INSTRUCTION_MATCH_EVENT_KIND {
|
if event_kind == crate::UPSTREAM_REGISTRY_INSTRUCTION_MATCH_EVENT_KIND {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
if event_kind == "pump_fees.get_fees" {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
if event_kind.contains(".instruction_audit") {
|
if event_kind.contains(".instruction_audit") {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -487,6 +490,13 @@ pub fn is_dex_position_close_event_kind(event_kind: &str) -> bool {
|
|||||||
|
|
||||||
/// Returns true for fee collection events.
|
/// Returns true for fee collection events.
|
||||||
pub fn is_dex_fee_event_kind(event_kind: &str) -> bool {
|
pub fn is_dex_fee_event_kind(event_kind: &str) -> bool {
|
||||||
|
if event_kind.starts_with("pump_fees.")
|
||||||
|
&& (event_kind.contains("donation_fee_pda_cranked")
|
||||||
|
|| event_kind.contains("sweep_buyback")
|
||||||
|
|| event_kind.contains("crank_donation_fee_pda"))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
if event_kind.contains("claim_creator_fee") {
|
if event_kind.contains("claim_creator_fee") {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -543,6 +553,12 @@ pub fn is_dex_fee_event_kind(event_kind: &str) -> bool {
|
|||||||
|
|
||||||
/// Returns true for reward or incentive events.
|
/// Returns true for reward or incentive events.
|
||||||
pub fn is_dex_reward_event_kind(event_kind: &str) -> bool {
|
pub fn is_dex_reward_event_kind(event_kind: &str) -> bool {
|
||||||
|
if event_kind.starts_with("pump_fees.")
|
||||||
|
&& (event_kind.contains("social_fee_pda_claimed")
|
||||||
|
|| event_kind.contains("claim_social_fee_pda"))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
if event_kind.contains("reward") {
|
if event_kind.contains("reward") {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -607,6 +623,19 @@ pub fn is_dex_orderbook_event_kind(event_kind: &str) -> bool {
|
|||||||
|
|
||||||
/// Returns true for pool, pair, launch, mint, burn or migration lifecycle events.
|
/// Returns true for pool, pair, launch, mint, burn or migration lifecycle events.
|
||||||
pub fn is_dex_pool_lifecycle_event_kind(event_kind: &str) -> bool {
|
pub fn is_dex_pool_lifecycle_event_kind(event_kind: &str) -> bool {
|
||||||
|
if event_kind.starts_with("pump_fees.")
|
||||||
|
&& (event_kind.contains("create_fee_sharing_config")
|
||||||
|
|| event_kind.contains("create_social_fee_pda")
|
||||||
|
|| event_kind.contains("create_donation_fee_pda")
|
||||||
|
|| event_kind.contains("social_fee_pda_created")
|
||||||
|
|| event_kind.contains("donation_fee_pda_created")
|
||||||
|
|| event_kind.contains("initialize_fee_config")
|
||||||
|
|| event_kind.contains("initialize_fee_program_global")
|
||||||
|
|| event_kind.contains("initialize_buyback")
|
||||||
|
|| event_kind.contains("extend_fee_config"))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
if event_kind == "raydium_amm_v4.pre_initialize" {
|
if event_kind == "raydium_amm_v4.pre_initialize" {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -795,6 +824,19 @@ pub fn is_dex_token_account_close_event_kind(event_kind: &str) -> bool {
|
|||||||
|
|
||||||
/// Returns true for admin, configuration or permission changes.
|
/// Returns true for admin, configuration or permission changes.
|
||||||
pub fn is_dex_admin_event_kind(event_kind: &str) -> bool {
|
pub fn is_dex_admin_event_kind(event_kind: &str) -> bool {
|
||||||
|
if event_kind.starts_with("pump_fees.")
|
||||||
|
&& (event_kind.contains("authority")
|
||||||
|
|| event_kind.contains("admin")
|
||||||
|
|| event_kind.contains("config")
|
||||||
|
|| event_kind.contains("tier")
|
||||||
|
|| event_kind.contains("disable")
|
||||||
|
|| event_kind.contains("reset_fee_sharing")
|
||||||
|
|| event_kind.contains("update_fee_shares")
|
||||||
|
|| event_kind.contains("set_claim_rate_limit")
|
||||||
|
|| event_kind.contains("buyback_claim_rate_limit"))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
if event_kind.contains(".admin_cancel_orders") {
|
if event_kind.contains(".admin_cancel_orders") {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -1233,9 +1275,7 @@ mod tests {
|
|||||||
super::classify_dex_event_category_code("pump_swap.migrate_pool_coin_creator"),
|
super::classify_dex_event_category_code("pump_swap.migrate_pool_coin_creator"),
|
||||||
"admin"
|
"admin"
|
||||||
);
|
);
|
||||||
assert!(!super::is_dex_pool_lifecycle_event_kind(
|
assert!(!super::is_dex_pool_lifecycle_event_kind("pump_swap.migrate_pool_coin_creator"));
|
||||||
"pump_swap.migrate_pool_coin_creator"
|
|
||||||
));
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
super::classify_dex_event_category_code("raydium_clmm.increase_liquidity_v2"),
|
super::classify_dex_event_category_code("raydium_clmm.increase_liquidity_v2"),
|
||||||
"liquidity"
|
"liquidity"
|
||||||
|
|||||||
@@ -321,6 +321,9 @@ fn infer_expected_db_target_for_entry(
|
|||||||
if decoder_code == "pump_fun" {
|
if decoder_code == "pump_fun" {
|
||||||
return infer_pump_fun_expected_db_target(entry_name, entry_kind);
|
return infer_pump_fun_expected_db_target(entry_name, entry_kind);
|
||||||
}
|
}
|
||||||
|
if decoder_code == "pump_fees" {
|
||||||
|
return infer_pump_fees_expected_db_target(entry_name, entry_kind);
|
||||||
|
}
|
||||||
if decoder_code == "raydium_cpmm"
|
if decoder_code == "raydium_cpmm"
|
||||||
&& (entry_name == "swap_event" || entry_name == "anchor_idl_instruction")
|
&& (entry_name == "swap_event" || entry_name == "anchor_idl_instruction")
|
||||||
{
|
{
|
||||||
@@ -527,6 +530,51 @@ fn infer_expected_db_target(
|
|||||||
return Some(target.to_string());
|
return Some(target.to_string());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn infer_pump_fees_expected_db_target(
|
||||||
|
entry_name: &str,
|
||||||
|
entry_kind: &str,
|
||||||
|
) -> std::option::Option<std::string::String> {
|
||||||
|
if entry_kind == crate::ENTRY_KIND_PROGRAM || entry_kind == crate::ENTRY_KIND_ACCOUNT {
|
||||||
|
return None;
|
||||||
|
}
|
||||||
|
if entry_name == "get_fees" {
|
||||||
|
return Some(crate::DexEventCoverageEntryDto::DB_TARGET_DECODED_EVENTS_ONLY.to_string());
|
||||||
|
}
|
||||||
|
if entry_name == "claim_social_fee_pda"
|
||||||
|
|| entry_name == "claim_social_fee_pda_v2"
|
||||||
|
|| entry_name == "social_fee_pda_claimed"
|
||||||
|
{
|
||||||
|
return Some(crate::DexEventCoverageEntryDto::DB_TARGET_REWARD_EVENTS.to_string());
|
||||||
|
}
|
||||||
|
if entry_name == "crank_donation_fee_pda"
|
||||||
|
|| entry_name == "donation_fee_pda_cranked"
|
||||||
|
|| entry_name == "sweep_buyback"
|
||||||
|
|| entry_name == "sweep_buyback_event"
|
||||||
|
{
|
||||||
|
return Some(crate::DexEventCoverageEntryDto::DB_TARGET_FEE_EVENTS.to_string());
|
||||||
|
}
|
||||||
|
if entry_name.contains("create_")
|
||||||
|
|| entry_name.contains("created")
|
||||||
|
|| entry_name.contains("initialize_")
|
||||||
|
|| entry_name == "extend_fee_config"
|
||||||
|
|| entry_name == "extend_fee_config_event"
|
||||||
|
{
|
||||||
|
return Some(crate::DexEventCoverageEntryDto::DB_TARGET_POOL_LIFECYCLE_EVENTS.to_string());
|
||||||
|
}
|
||||||
|
if entry_name.contains("config")
|
||||||
|
|| entry_name.contains("authority")
|
||||||
|
|| entry_name.contains("admin")
|
||||||
|
|| entry_name.contains("tier")
|
||||||
|
|| entry_name.contains("disable")
|
||||||
|
|| entry_name.contains("reset_fee_sharing")
|
||||||
|
|| entry_name.contains("update_fee_shares")
|
||||||
|
|| entry_name.contains("buyback_claim_rate_limit")
|
||||||
|
{
|
||||||
|
return Some(crate::DexEventCoverageEntryDto::DB_TARGET_POOL_ADMIN_EVENTS.to_string());
|
||||||
|
}
|
||||||
|
return Some(crate::DexEventCoverageEntryDto::DB_TARGET_DECODED_EVENTS_ONLY.to_string());
|
||||||
|
}
|
||||||
|
|
||||||
fn infer_pump_fun_expected_db_target(
|
fn infer_pump_fun_expected_db_target(
|
||||||
entry_name: &str,
|
entry_name: &str,
|
||||||
entry_kind: &str,
|
entry_kind: &str,
|
||||||
@@ -555,9 +603,7 @@ fn infer_pump_fun_expected_db_target(
|
|||||||
return Some(crate::DexEventCoverageEntryDto::DB_TARGET_LAUNCH_EVENTS.to_string());
|
return Some(crate::DexEventCoverageEntryDto::DB_TARGET_LAUNCH_EVENTS.to_string());
|
||||||
}
|
}
|
||||||
if entry_name == "initialize" {
|
if entry_name == "initialize" {
|
||||||
return Some(
|
return Some(crate::DexEventCoverageEntryDto::DB_TARGET_POOL_LIFECYCLE_EVENTS.to_string());
|
||||||
crate::DexEventCoverageEntryDto::DB_TARGET_POOL_LIFECYCLE_EVENTS.to_string(),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
if entry_name == "migrate"
|
if entry_name == "migrate"
|
||||||
|| entry_name == "migrate_v2"
|
|| entry_name == "migrate_v2"
|
||||||
@@ -755,6 +801,58 @@ fn infer_pump_swap_event_family(
|
|||||||
return infer_event_family(entry_name, entry_kind);
|
return infer_event_family(entry_name, entry_kind);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn infer_pump_fees_event_family(
|
||||||
|
entry_name: &str,
|
||||||
|
entry_kind: &str,
|
||||||
|
) -> std::option::Option<std::string::String> {
|
||||||
|
if entry_kind == crate::ENTRY_KIND_PROGRAM || entry_kind == crate::ENTRY_KIND_ACCOUNT {
|
||||||
|
return None;
|
||||||
|
}
|
||||||
|
if entry_name == "get_fees" {
|
||||||
|
return Some("audit".to_string());
|
||||||
|
}
|
||||||
|
if entry_name == "claim_social_fee_pda"
|
||||||
|
|| entry_name == "claim_social_fee_pda_v2"
|
||||||
|
|| entry_name == "social_fee_pda_claimed"
|
||||||
|
{
|
||||||
|
return Some("reward".to_string());
|
||||||
|
}
|
||||||
|
if entry_name == "crank_donation_fee_pda"
|
||||||
|
|| entry_name == "donation_fee_pda_cranked"
|
||||||
|
|| entry_name == "sweep_buyback"
|
||||||
|
|| entry_name == "sweep_buyback_event"
|
||||||
|
{
|
||||||
|
return Some("fee".to_string());
|
||||||
|
}
|
||||||
|
if entry_name.contains("create_")
|
||||||
|
|| entry_name.contains("created")
|
||||||
|
|| entry_name.contains("initialize_")
|
||||||
|
|| entry_name == "extend_fee_config"
|
||||||
|
|| entry_name == "extend_fee_config_event"
|
||||||
|
{
|
||||||
|
return Some("pool_create".to_string());
|
||||||
|
}
|
||||||
|
if entry_name.contains("config")
|
||||||
|
|| entry_name.contains("authority")
|
||||||
|
|| entry_name.contains("admin")
|
||||||
|
|| entry_name.contains("tier")
|
||||||
|
|| entry_name.contains("disable")
|
||||||
|
|| entry_name.contains("reset_fee_sharing")
|
||||||
|
|| entry_name.contains("update_fee_shares")
|
||||||
|
|| entry_name.contains("buyback_claim_rate_limit")
|
||||||
|
{
|
||||||
|
return Some("admin_config".to_string());
|
||||||
|
}
|
||||||
|
return Some("audit".to_string());
|
||||||
|
}
|
||||||
|
|
||||||
|
fn pump_fees_local_event_kind(entry_name: &str) -> std::option::Option<std::string::String> {
|
||||||
|
if entry_name == "program" || entry_name == "program_alias" {
|
||||||
|
return None;
|
||||||
|
}
|
||||||
|
return Some(format!("pump_fees.{}", entry_name));
|
||||||
|
}
|
||||||
|
|
||||||
fn infer_pump_fun_event_family(
|
fn infer_pump_fun_event_family(
|
||||||
entry_name: &str,
|
entry_name: &str,
|
||||||
entry_kind: &str,
|
entry_kind: &str,
|
||||||
@@ -975,6 +1073,9 @@ fn infer_event_family_for_entry(
|
|||||||
if decoder_code == "pump_fun" {
|
if decoder_code == "pump_fun" {
|
||||||
return infer_pump_fun_event_family(entry_name, entry_kind);
|
return infer_pump_fun_event_family(entry_name, entry_kind);
|
||||||
}
|
}
|
||||||
|
if decoder_code == "pump_fees" {
|
||||||
|
return infer_pump_fees_event_family(entry_name, entry_kind);
|
||||||
|
}
|
||||||
if decoder_code == "pump_swap" {
|
if decoder_code == "pump_swap" {
|
||||||
return infer_pump_swap_event_family(entry_name, entry_kind);
|
return infer_pump_swap_event_family(entry_name, entry_kind);
|
||||||
}
|
}
|
||||||
@@ -1268,7 +1369,7 @@ fn infer_event_family(
|
|||||||
if normalized.contains("stake") {
|
if normalized.contains("stake") {
|
||||||
return Some("stake".to_string());
|
return Some("stake".to_string());
|
||||||
}
|
}
|
||||||
return Some("unknown".to_string());
|
return Some("audit".to_string());
|
||||||
}
|
}
|
||||||
|
|
||||||
fn contains_any(value: &str, needles: &[&str]) -> bool {
|
fn contains_any(value: &str, needles: &[&str]) -> bool {
|
||||||
@@ -1372,6 +1473,9 @@ pub(crate) fn known_local_event_kind(
|
|||||||
if decoder_code == "pump_fun" {
|
if decoder_code == "pump_fun" {
|
||||||
return pump_fun_local_event_kind(entry_name);
|
return pump_fun_local_event_kind(entry_name);
|
||||||
}
|
}
|
||||||
|
if decoder_code == "pump_fees" {
|
||||||
|
return pump_fees_local_event_kind(entry_name);
|
||||||
|
}
|
||||||
if decoder_code == "pump_swap" {
|
if decoder_code == "pump_swap" {
|
||||||
return pump_swap_local_event_kind(entry_name);
|
return pump_swap_local_event_kind(entry_name);
|
||||||
}
|
}
|
||||||
@@ -1590,6 +1694,26 @@ mod tests {
|
|||||||
return std::sync::Arc::new(database);
|
return std::sync::Arc::new(database);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn generic_event_family_fallback_is_audit_not_unknown() {
|
||||||
|
assert_eq!(
|
||||||
|
super::infer_event_family("non_matching_entry", crate::ENTRY_KIND_INSTRUCTION),
|
||||||
|
Some("audit".to_string())
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn pump_fees_event_family_fallback_is_audit() {
|
||||||
|
assert_eq!(
|
||||||
|
super::infer_event_family_for_entry(
|
||||||
|
"pump_fees",
|
||||||
|
"non_matching_entry",
|
||||||
|
crate::ENTRY_KIND_INSTRUCTION
|
||||||
|
),
|
||||||
|
Some("audit".to_string())
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn event_family_inference_covers_raydium_cpmm_core_entries() {
|
fn event_family_inference_covers_raydium_cpmm_core_entries() {
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
@@ -1777,7 +1901,11 @@ mod tests {
|
|||||||
Some("pump_fun.claim_cashback_event".to_string())
|
Some("pump_fun.claim_cashback_event".to_string())
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
super::infer_event_family_for_entry("pump_fun", "create_event", crate::ENTRY_KIND_EVENT),
|
super::infer_event_family_for_entry(
|
||||||
|
"pump_fun",
|
||||||
|
"create_event",
|
||||||
|
crate::ENTRY_KIND_EVENT
|
||||||
|
),
|
||||||
Some("launch".to_string())
|
Some("launch".to_string())
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
@@ -1797,7 +1925,11 @@ mod tests {
|
|||||||
Some("reward".to_string())
|
Some("reward".to_string())
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
super::infer_event_family_for_entry("pump_fun", "buy_v2", crate::ENTRY_KIND_INSTRUCTION),
|
super::infer_event_family_for_entry(
|
||||||
|
"pump_fun",
|
||||||
|
"buy_v2",
|
||||||
|
crate::ENTRY_KIND_INSTRUCTION
|
||||||
|
),
|
||||||
Some("swap".to_string())
|
Some("swap".to_string())
|
||||||
);
|
);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
|
|||||||
@@ -319,6 +319,42 @@ fn resolve_instruction_name(
|
|||||||
};
|
};
|
||||||
return Some(format!("raydium_launchpad.{}", layout.instruction_name));
|
return Some(format!("raydium_launchpad.{}", layout.instruction_name));
|
||||||
}
|
}
|
||||||
|
if program_id == crate::PUMP_FEES_PROGRAM_ID || decoder_code == Some("pump_fees") {
|
||||||
|
let name = match discriminator_hex {
|
||||||
|
"e445a52e51cb9a1d" => "anchor_self_cpi_log",
|
||||||
|
"e115fb85a11ec7e2" => "claim_social_fee_pda",
|
||||||
|
"114df0863abc3595" => "claim_social_fee_pda_v2",
|
||||||
|
"dc0abda7a9111945" => "crank_donation_fee_pda",
|
||||||
|
"f48b10580eff7a1a" => "create_donation_fee_pda",
|
||||||
|
"c34e564c6f34fbd5" => "create_fee_sharing_config",
|
||||||
|
"90e03bd34ef8cadc" => "create_social_fee_pda",
|
||||||
|
"44b3f45aad3811d9" => "extend_fee_config",
|
||||||
|
"e7257e55cf5b3f34" => "get_fees",
|
||||||
|
"fa81eca0e3246786" => "initialize_buyback",
|
||||||
|
"3ea214857941911b" => "initialize_fee_config",
|
||||||
|
"23d78254e9387ca7" => "initialize_fee_program_global",
|
||||||
|
"0a02b65f107f81ba" => "reset_fee_sharing_config",
|
||||||
|
"a9f511d15e5bf880" => "reset_fee_sharing_config_v2",
|
||||||
|
"12e99e27b9cf3a68" => "revoke_fee_sharing_authority",
|
||||||
|
"85fa25156ea31a79" => "set_authority",
|
||||||
|
"b9d39faed4315804" => "set_claim_rate_limit",
|
||||||
|
"c2d9702372de33be" => "set_disable_flags",
|
||||||
|
"9336b89a88edb999" => "set_social_claim_authority",
|
||||||
|
"8a21cc26cfa19fe2" => "sweep_buyback",
|
||||||
|
"ca0a4bc8a422d260" => "transfer_fee_sharing_authority",
|
||||||
|
"a1b028d53cb8b3e4" => "update_admin",
|
||||||
|
"426271ca7925db6b" => "update_buyback_authority",
|
||||||
|
"ba5f87beffc789aa" => "update_buyback_claim_rate_limit",
|
||||||
|
"68b867f258976b14" => "update_fee_config",
|
||||||
|
"bd0d8863bba4ed23" => "update_fee_shares",
|
||||||
|
"6ffb31064e4e6a12" => "update_fee_shares_v2",
|
||||||
|
"6ba964b3869b92dd" => "update_stable_fee_config",
|
||||||
|
"e317960c4d565e04" => "upsert_fee_tiers",
|
||||||
|
"b5a0a2fc4a4ce0dd" => "upsert_stable_fee_tiers",
|
||||||
|
_ => return None,
|
||||||
|
};
|
||||||
|
return Some(format!("pump_fees.{}", name));
|
||||||
|
}
|
||||||
if program_id == crate::PUMP_FUN_PROGRAM_ID || decoder_code == Some("pump_fun") {
|
if program_id == crate::PUMP_FUN_PROGRAM_ID || decoder_code == Some("pump_fun") {
|
||||||
let name = match discriminator_hex {
|
let name = match discriminator_hex {
|
||||||
"e445a52e51cb9a1d" => "anchor_self_cpi_log",
|
"e445a52e51cb9a1d" => "anchor_self_cpi_log",
|
||||||
|
|||||||
@@ -1171,6 +1171,12 @@ pub use dex::PhoenixV1AuditDecoded;
|
|||||||
pub use dex::PhoenixV1DecodedEvent;
|
pub use dex::PhoenixV1DecodedEvent;
|
||||||
/// Phoenix v1 audit-only decoder.
|
/// Phoenix v1 audit-only decoder.
|
||||||
pub use dex::PhoenixV1Decoder;
|
pub use dex::PhoenixV1Decoder;
|
||||||
|
/// Decoded Pump Fees event.
|
||||||
|
pub use dex::PumpFeesDecodedEvent;
|
||||||
|
/// Pump Fees decoder.
|
||||||
|
pub use dex::PumpFeesDecoder;
|
||||||
|
/// Decoded Pump Fees instruction or Anchor event.
|
||||||
|
pub use dex::PumpFeesInstructionDecoded;
|
||||||
/// Decoded Pump.fun `create_v2` token event.
|
/// Decoded Pump.fun `create_v2` token event.
|
||||||
pub use dex::PumpFunCreateV2TokenDecoded;
|
pub use dex::PumpFunCreateV2TokenDecoded;
|
||||||
/// Decoded Pump.fun event.
|
/// Decoded Pump.fun event.
|
||||||
|
|||||||
@@ -16,6 +16,35 @@ const RAYDIUM_IDL_SOURCE_REPO: &str = "raydium-io/raydium-idl";
|
|||||||
const MANUAL_SOLSCAN_SOURCE_REPO: &str = "manual-solscan";
|
const MANUAL_SOLSCAN_SOURCE_REPO: &str = "manual-solscan";
|
||||||
const RAYDIUM_IDL_DISCRIMINATOR_NOTES: &str = "entry name and discriminator extracted from Raydium official IDL snapshot; not corpus-verified; no trade/candle/materialization proof";
|
const RAYDIUM_IDL_DISCRIMINATOR_NOTES: &str = "entry name and discriminator extracted from Raydium official IDL snapshot; not corpus-verified; no trade/candle/materialization proof";
|
||||||
const MANUAL_SOLSCAN_DISCRIMINATOR_NOTES: &str = "entry name and discriminator derived from manual Solscan program IDL or Solscan transaction-log inspection; no trade/candle/materialization proof";
|
const MANUAL_SOLSCAN_DISCRIMINATOR_NOTES: &str = "entry name and discriminator derived from manual Solscan program IDL or Solscan transaction-log inspection; no trade/candle/materialization proof";
|
||||||
|
const LOCAL_IDL_SOURCE_REPO: &str = "local-idl";
|
||||||
|
const LOCAL_IDL_DISCRIMINATOR_NOTES: &str = "entry name and discriminator extracted from local IDL snapshot; not corpus-verified; no trade/candle/materialization proof";
|
||||||
|
|
||||||
|
const fn local_idl_discriminator_entry(
|
||||||
|
decoder_code: &'static str,
|
||||||
|
program_id: std::option::Option<&'static str>,
|
||||||
|
program_family: &'static str,
|
||||||
|
surface_kind: &'static str,
|
||||||
|
entry_kind: &'static str,
|
||||||
|
entry_name: &'static str,
|
||||||
|
discriminator_hex: &'static str,
|
||||||
|
discriminator_len: u16,
|
||||||
|
source_path: &'static str,
|
||||||
|
) -> crate::UpstreamRegistryEntry {
|
||||||
|
return crate::UpstreamRegistryEntry {
|
||||||
|
source_repo: Some(LOCAL_IDL_SOURCE_REPO),
|
||||||
|
source_path: Some(source_path),
|
||||||
|
decoder_code,
|
||||||
|
program_id,
|
||||||
|
program_family,
|
||||||
|
surface_kind,
|
||||||
|
entry_kind,
|
||||||
|
entry_name,
|
||||||
|
discriminator_hex: Some(discriminator_hex),
|
||||||
|
discriminator_len: Some(discriminator_len),
|
||||||
|
proof_status: crate::PROOF_STATUS_UPSTREAM_GIT_UNVERIFIED,
|
||||||
|
notes: LOCAL_IDL_DISCRIMINATOR_NOTES,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
const fn manual_solscan_discriminator_entry(
|
const fn manual_solscan_discriminator_entry(
|
||||||
decoder_code: &'static str,
|
decoder_code: &'static str,
|
||||||
@@ -10459,6 +10488,204 @@ pub(crate) const UPSTREAM_REGISTRY_ENTRIES: &[crate::UpstreamRegistryEntry] = &[
|
|||||||
8,
|
8,
|
||||||
"decoders/pump-fees-decoder/src/events/upsert_fee_tiers_event.rs",
|
"decoders/pump-fees-decoder/src/events/upsert_fee_tiers_event.rs",
|
||||||
),
|
),
|
||||||
|
local_idl_discriminator_entry(
|
||||||
|
"pump_fees",
|
||||||
|
Some(crate::PUMP_FEES_PROGRAM_ID),
|
||||||
|
"pump",
|
||||||
|
"fee_program",
|
||||||
|
crate::ENTRY_KIND_INSTRUCTION,
|
||||||
|
"claim_social_fee_pda_v2",
|
||||||
|
"114df0863abc3595",
|
||||||
|
8,
|
||||||
|
"idls/pump_fees.pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ.json",
|
||||||
|
),
|
||||||
|
local_idl_discriminator_entry(
|
||||||
|
"pump_fees",
|
||||||
|
Some(crate::PUMP_FEES_PROGRAM_ID),
|
||||||
|
"pump",
|
||||||
|
"fee_program",
|
||||||
|
crate::ENTRY_KIND_INSTRUCTION,
|
||||||
|
"crank_donation_fee_pda",
|
||||||
|
"dc0abda7a9111945",
|
||||||
|
8,
|
||||||
|
"idls/pump_fees.pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ.json",
|
||||||
|
),
|
||||||
|
local_idl_discriminator_entry(
|
||||||
|
"pump_fees",
|
||||||
|
Some(crate::PUMP_FEES_PROGRAM_ID),
|
||||||
|
"pump",
|
||||||
|
"fee_program",
|
||||||
|
crate::ENTRY_KIND_INSTRUCTION,
|
||||||
|
"create_donation_fee_pda",
|
||||||
|
"f48b10580eff7a1a",
|
||||||
|
8,
|
||||||
|
"idls/pump_fees.pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ.json",
|
||||||
|
),
|
||||||
|
local_idl_discriminator_entry(
|
||||||
|
"pump_fees",
|
||||||
|
Some(crate::PUMP_FEES_PROGRAM_ID),
|
||||||
|
"pump",
|
||||||
|
"fee_program",
|
||||||
|
crate::ENTRY_KIND_INSTRUCTION,
|
||||||
|
"extend_fee_config",
|
||||||
|
"44b3f45aad3811d9",
|
||||||
|
8,
|
||||||
|
"idls/pump_fees.pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ.json",
|
||||||
|
),
|
||||||
|
local_idl_discriminator_entry(
|
||||||
|
"pump_fees",
|
||||||
|
Some(crate::PUMP_FEES_PROGRAM_ID),
|
||||||
|
"pump",
|
||||||
|
"fee_program",
|
||||||
|
crate::ENTRY_KIND_INSTRUCTION,
|
||||||
|
"initialize_buyback",
|
||||||
|
"fa81eca0e3246786",
|
||||||
|
8,
|
||||||
|
"idls/pump_fees.pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ.json",
|
||||||
|
),
|
||||||
|
local_idl_discriminator_entry(
|
||||||
|
"pump_fees",
|
||||||
|
Some(crate::PUMP_FEES_PROGRAM_ID),
|
||||||
|
"pump",
|
||||||
|
"fee_program",
|
||||||
|
crate::ENTRY_KIND_INSTRUCTION,
|
||||||
|
"reset_fee_sharing_config_v2",
|
||||||
|
"a9f511d15e5bf880",
|
||||||
|
8,
|
||||||
|
"idls/pump_fees.pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ.json",
|
||||||
|
),
|
||||||
|
local_idl_discriminator_entry(
|
||||||
|
"pump_fees",
|
||||||
|
Some(crate::PUMP_FEES_PROGRAM_ID),
|
||||||
|
"pump",
|
||||||
|
"fee_program",
|
||||||
|
crate::ENTRY_KIND_INSTRUCTION,
|
||||||
|
"sweep_buyback",
|
||||||
|
"8a21cc26cfa19fe2",
|
||||||
|
8,
|
||||||
|
"idls/pump_fees.pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ.json",
|
||||||
|
),
|
||||||
|
local_idl_discriminator_entry(
|
||||||
|
"pump_fees",
|
||||||
|
Some(crate::PUMP_FEES_PROGRAM_ID),
|
||||||
|
"pump",
|
||||||
|
"fee_program",
|
||||||
|
crate::ENTRY_KIND_INSTRUCTION,
|
||||||
|
"update_buyback_authority",
|
||||||
|
"426271ca7925db6b",
|
||||||
|
8,
|
||||||
|
"idls/pump_fees.pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ.json",
|
||||||
|
),
|
||||||
|
local_idl_discriminator_entry(
|
||||||
|
"pump_fees",
|
||||||
|
Some(crate::PUMP_FEES_PROGRAM_ID),
|
||||||
|
"pump",
|
||||||
|
"fee_program",
|
||||||
|
crate::ENTRY_KIND_INSTRUCTION,
|
||||||
|
"update_buyback_claim_rate_limit",
|
||||||
|
"ba5f87beffc789aa",
|
||||||
|
8,
|
||||||
|
"idls/pump_fees.pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ.json",
|
||||||
|
),
|
||||||
|
local_idl_discriminator_entry(
|
||||||
|
"pump_fees",
|
||||||
|
Some(crate::PUMP_FEES_PROGRAM_ID),
|
||||||
|
"pump",
|
||||||
|
"fee_program",
|
||||||
|
crate::ENTRY_KIND_INSTRUCTION,
|
||||||
|
"update_fee_shares_v2",
|
||||||
|
"6ffb31064e4e6a12",
|
||||||
|
8,
|
||||||
|
"idls/pump_fees.pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ.json",
|
||||||
|
),
|
||||||
|
local_idl_discriminator_entry(
|
||||||
|
"pump_fees",
|
||||||
|
Some(crate::PUMP_FEES_PROGRAM_ID),
|
||||||
|
"pump",
|
||||||
|
"fee_program",
|
||||||
|
crate::ENTRY_KIND_INSTRUCTION,
|
||||||
|
"update_stable_fee_config",
|
||||||
|
"6ba964b3869b92dd",
|
||||||
|
8,
|
||||||
|
"idls/pump_fees.pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ.json",
|
||||||
|
),
|
||||||
|
local_idl_discriminator_entry(
|
||||||
|
"pump_fees",
|
||||||
|
Some(crate::PUMP_FEES_PROGRAM_ID),
|
||||||
|
"pump",
|
||||||
|
"fee_program",
|
||||||
|
crate::ENTRY_KIND_INSTRUCTION,
|
||||||
|
"upsert_stable_fee_tiers",
|
||||||
|
"b5a0a2fc4a4ce0dd",
|
||||||
|
8,
|
||||||
|
"idls/pump_fees.pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ.json",
|
||||||
|
),
|
||||||
|
local_idl_discriminator_entry(
|
||||||
|
"pump_fees",
|
||||||
|
Some(crate::PUMP_FEES_PROGRAM_ID),
|
||||||
|
"pump",
|
||||||
|
"fee_program",
|
||||||
|
crate::ENTRY_KIND_EVENT,
|
||||||
|
"donation_fee_pda_cranked",
|
||||||
|
"1ed06b5db100df4e",
|
||||||
|
8,
|
||||||
|
"idls/pump_fees.pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ.json",
|
||||||
|
),
|
||||||
|
local_idl_discriminator_entry(
|
||||||
|
"pump_fees",
|
||||||
|
Some(crate::PUMP_FEES_PROGRAM_ID),
|
||||||
|
"pump",
|
||||||
|
"fee_program",
|
||||||
|
crate::ENTRY_KIND_EVENT,
|
||||||
|
"donation_fee_pda_created",
|
||||||
|
"5e1489ef234de1eb",
|
||||||
|
8,
|
||||||
|
"idls/pump_fees.pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ.json",
|
||||||
|
),
|
||||||
|
local_idl_discriminator_entry(
|
||||||
|
"pump_fees",
|
||||||
|
Some(crate::PUMP_FEES_PROGRAM_ID),
|
||||||
|
"pump",
|
||||||
|
"fee_program",
|
||||||
|
crate::ENTRY_KIND_EVENT,
|
||||||
|
"extend_fee_config_event",
|
||||||
|
"e2cbe023990a5833",
|
||||||
|
8,
|
||||||
|
"idls/pump_fees.pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ.json",
|
||||||
|
),
|
||||||
|
local_idl_discriminator_entry(
|
||||||
|
"pump_fees",
|
||||||
|
Some(crate::PUMP_FEES_PROGRAM_ID),
|
||||||
|
"pump",
|
||||||
|
"fee_program",
|
||||||
|
crate::ENTRY_KIND_EVENT,
|
||||||
|
"sweep_buyback_event",
|
||||||
|
"2b382ad69939a689",
|
||||||
|
8,
|
||||||
|
"idls/pump_fees.pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ.json",
|
||||||
|
),
|
||||||
|
local_idl_discriminator_entry(
|
||||||
|
"pump_fees",
|
||||||
|
Some(crate::PUMP_FEES_PROGRAM_ID),
|
||||||
|
"pump",
|
||||||
|
"fee_program",
|
||||||
|
crate::ENTRY_KIND_EVENT,
|
||||||
|
"update_stable_fee_config_event",
|
||||||
|
"5e052bed6793e8f5",
|
||||||
|
8,
|
||||||
|
"idls/pump_fees.pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ.json",
|
||||||
|
),
|
||||||
|
local_idl_discriminator_entry(
|
||||||
|
"pump_fees",
|
||||||
|
Some(crate::PUMP_FEES_PROGRAM_ID),
|
||||||
|
"pump",
|
||||||
|
"fee_program",
|
||||||
|
crate::ENTRY_KIND_EVENT,
|
||||||
|
"upsert_stable_fee_tiers_event",
|
||||||
|
"e8eded34629249f3",
|
||||||
|
8,
|
||||||
|
"idls/pump_fees.pfeeUxB6jkeY1Hxd7CsFCAjcbHA9rWtchMGdZ6VojVZ.json",
|
||||||
|
),
|
||||||
upstream_git_discriminator_entry(
|
upstream_git_discriminator_entry(
|
||||||
"pump_swap",
|
"pump_swap",
|
||||||
Some(crate::PUMP_SWAP_PROGRAM_ID),
|
Some(crate::PUMP_SWAP_PROGRAM_ID),
|
||||||
|
|||||||
615
validation_sql/SQL_VALIDATION_PUMP_FEES_0_7_55.sql
Normal file
615
validation_sql/SQL_VALIDATION_PUMP_FEES_0_7_55.sql
Normal file
@@ -0,0 +1,615 @@
|
|||||||
|
-- file: validation_sql/SQL_VALIDATION_PUMP_FEES_0_7_55.sql
|
||||||
|
|
||||||
|
-- 0.7.55 pump_fees validation and corpus-seed checklist.
|
||||||
|
-- Run on a dedicated fresh SQLite database for the Pump Fees tranche.
|
||||||
|
-- Recommended replay settings after each backfill group:
|
||||||
|
-- skipDexDecode=no, forceDexDecode=yes, deferInstructionObservations=yes.
|
||||||
|
-- This file is intentionally read-only: it never mutates the database.
|
||||||
|
|
||||||
|
-- 00. Corpus seed: upstream fallback samples to backfill first.
|
||||||
|
SELECT
|
||||||
|
json_extract(de.payload_json, '$.upstreamEntryName') AS upstream_entry_name,
|
||||||
|
json_extract(de.payload_json, '$.upstreamDiscriminatorHex') AS upstream_discriminator_hex,
|
||||||
|
COUNT(*) AS fallback_count,
|
||||||
|
COUNT(DISTINCT de.transaction_id) AS tx_count,
|
||||||
|
MIN(tx.signature) AS sample_signature
|
||||||
|
FROM k_sol_dex_decoded_events de
|
||||||
|
LEFT JOIN k_sol_chain_transactions tx
|
||||||
|
ON tx.id = de.transaction_id
|
||||||
|
WHERE de.protocol_name = 'upstream_git'
|
||||||
|
AND de.event_kind = 'upstream_git.instruction_match'
|
||||||
|
AND json_extract(de.payload_json, '$.upstreamDecoderCode') = 'pump_fees'
|
||||||
|
GROUP BY upstream_entry_name, upstream_discriminator_hex
|
||||||
|
ORDER BY fallback_count DESC, upstream_entry_name, upstream_discriminator_hex;
|
||||||
|
|
||||||
|
-- 01. Corpus seed: local instruction observations.
|
||||||
|
SELECT
|
||||||
|
instruction_name,
|
||||||
|
discriminator_hex,
|
||||||
|
COUNT(*) AS observed_count,
|
||||||
|
COUNT(DISTINCT signature) AS tx_count,
|
||||||
|
MIN(signature) AS sample_signature
|
||||||
|
FROM k_sol_instruction_observations
|
||||||
|
WHERE decoder_code = 'pump_fees'
|
||||||
|
GROUP BY instruction_name, discriminator_hex
|
||||||
|
ORDER BY observed_count DESC, instruction_name, discriminator_hex;
|
||||||
|
|
||||||
|
|
||||||
|
-- 01b. Local instruction observations with missing Pump Fees instruction name.
|
||||||
|
-- Target after closure: empty, including the Anchor self-CPI log discriminator.
|
||||||
|
SELECT
|
||||||
|
decoder_code,
|
||||||
|
discriminator_hex,
|
||||||
|
COUNT(*) AS observed_count,
|
||||||
|
COUNT(DISTINCT signature) AS tx_count,
|
||||||
|
MIN(signature) AS sample_signature
|
||||||
|
FROM k_sol_instruction_observations
|
||||||
|
WHERE decoder_code = 'pump_fees'
|
||||||
|
AND (
|
||||||
|
instruction_name IS NULL
|
||||||
|
OR TRIM(instruction_name) = ''
|
||||||
|
)
|
||||||
|
GROUP BY decoder_code, discriminator_hex
|
||||||
|
ORDER BY observed_count DESC, discriminator_hex;
|
||||||
|
|
||||||
|
-- 02. Coverage pump_fees.
|
||||||
|
SELECT
|
||||||
|
entry_name,
|
||||||
|
entry_kind,
|
||||||
|
event_family,
|
||||||
|
expected_db_target,
|
||||||
|
proof_status,
|
||||||
|
local_event_kind,
|
||||||
|
discriminator_hex,
|
||||||
|
observed_count,
|
||||||
|
materialized_count,
|
||||||
|
trade_count
|
||||||
|
FROM k_sol_dex_event_coverage_entries
|
||||||
|
WHERE decoder_code = 'pump_fees'
|
||||||
|
ORDER BY entry_kind, entry_name, discriminator_hex;
|
||||||
|
|
||||||
|
|
||||||
|
-- 02b. Coverage rows with unknown or blank event_family.
|
||||||
|
-- Target after closure: empty for pump_fees. Program/account rows may be NULL, but must not be unknown.
|
||||||
|
SELECT
|
||||||
|
entry_name,
|
||||||
|
entry_kind,
|
||||||
|
event_family,
|
||||||
|
expected_db_target,
|
||||||
|
proof_status,
|
||||||
|
local_event_kind,
|
||||||
|
discriminator_hex
|
||||||
|
FROM k_sol_dex_event_coverage_entries
|
||||||
|
WHERE decoder_code = 'pump_fees'
|
||||||
|
AND (
|
||||||
|
LOWER(COALESCE(TRIM(event_family), '')) = 'unknown'
|
||||||
|
OR (entry_kind NOT IN ('program', 'account') AND COALESCE(TRIM(event_family), '') = '')
|
||||||
|
)
|
||||||
|
ORDER BY entry_kind, entry_name, discriminator_hex;
|
||||||
|
|
||||||
|
-- 03. Decoded events summary.
|
||||||
|
SELECT
|
||||||
|
de.event_kind,
|
||||||
|
COUNT(*) AS decoded_count,
|
||||||
|
COUNT(DISTINCT de.transaction_id) AS tx_count,
|
||||||
|
MIN(tx.signature) AS sample_signature
|
||||||
|
FROM k_sol_dex_decoded_events de
|
||||||
|
LEFT JOIN k_sol_chain_transactions tx
|
||||||
|
ON tx.id = de.transaction_id
|
||||||
|
WHERE de.protocol_name = 'pump_fees'
|
||||||
|
GROUP BY de.event_kind
|
||||||
|
ORDER BY decoded_count DESC, de.event_kind;
|
||||||
|
|
||||||
|
-- 04. Decoded pump_fees events without coverage.
|
||||||
|
-- Target after closure: empty for all locally decoded pump_fees rows.
|
||||||
|
SELECT
|
||||||
|
de.event_kind,
|
||||||
|
COUNT(*) AS decoded_count,
|
||||||
|
COUNT(DISTINCT de.transaction_id) AS tx_count,
|
||||||
|
MIN(tx.signature) AS sample_signature
|
||||||
|
FROM k_sol_dex_decoded_events de
|
||||||
|
LEFT JOIN k_sol_chain_transactions tx
|
||||||
|
ON tx.id = de.transaction_id
|
||||||
|
LEFT JOIN k_sol_dex_event_coverage_entries ce
|
||||||
|
ON ce.decoder_code = 'pump_fees'
|
||||||
|
AND ce.local_event_kind = de.event_kind
|
||||||
|
WHERE de.protocol_name = 'pump_fees'
|
||||||
|
AND ce.id IS NULL
|
||||||
|
GROUP BY de.event_kind
|
||||||
|
ORDER BY decoded_count DESC, de.event_kind;
|
||||||
|
|
||||||
|
-- 05. Residual upstream fallback for covered local entries.
|
||||||
|
-- Target after local promotion: empty for every entry that has a local_event_kind.
|
||||||
|
SELECT
|
||||||
|
json_extract(ug.payload_json, '$.upstreamEntryName') AS upstream_entry_name,
|
||||||
|
json_extract(ug.payload_json, '$.upstreamDiscriminatorHex') AS upstream_discriminator_hex,
|
||||||
|
json_extract(ug.payload_json, '$.upstreamSourceRepo') AS source_repo,
|
||||||
|
ce.local_event_kind,
|
||||||
|
ce.expected_db_target,
|
||||||
|
ce.proof_status,
|
||||||
|
COUNT(*) AS fallback_count,
|
||||||
|
COUNT(DISTINCT ug.transaction_id) AS tx_count,
|
||||||
|
MIN(tx.signature) AS sample_signature
|
||||||
|
FROM k_sol_dex_decoded_events ug
|
||||||
|
LEFT JOIN k_sol_chain_transactions tx
|
||||||
|
ON tx.id = ug.transaction_id
|
||||||
|
JOIN k_sol_dex_event_coverage_entries ce
|
||||||
|
ON ce.decoder_code = json_extract(ug.payload_json, '$.upstreamDecoderCode')
|
||||||
|
AND ce.entry_name = json_extract(ug.payload_json, '$.upstreamEntryName')
|
||||||
|
AND ce.discriminator_hex = json_extract(ug.payload_json, '$.upstreamDiscriminatorHex')
|
||||||
|
AND ce.local_event_kind IS NOT NULL
|
||||||
|
AND ce.local_event_kind <> ''
|
||||||
|
WHERE ug.protocol_name = 'upstream_git'
|
||||||
|
AND ug.event_kind = 'upstream_git.instruction_match'
|
||||||
|
AND json_extract(ug.payload_json, '$.upstreamDecoderCode') = 'pump_fees'
|
||||||
|
GROUP BY upstream_entry_name, upstream_discriminator_hex, source_repo, ce.local_event_kind, ce.expected_db_target, ce.proof_status
|
||||||
|
ORDER BY fallback_count DESC, upstream_entry_name;
|
||||||
|
|
||||||
|
-- 06. Successful non-materialized events without explicit skip reason.
|
||||||
|
-- Target after closure: empty, except decoded-only/audit-only rows with informational policy.
|
||||||
|
SELECT
|
||||||
|
de.event_kind,
|
||||||
|
json_extract(de.payload_json, '$.pumpFeesMaterializationPolicy') AS pump_fees_policy,
|
||||||
|
COUNT(*) AS unexplained_count,
|
||||||
|
MIN(tx.signature) AS sample_signature
|
||||||
|
FROM k_sol_dex_decoded_events de
|
||||||
|
JOIN k_sol_chain_transactions tx
|
||||||
|
ON tx.id = de.transaction_id
|
||||||
|
LEFT JOIN k_sol_trade_events te
|
||||||
|
ON te.decoded_event_id = de.id
|
||||||
|
LEFT JOIN k_sol_launch_events lae
|
||||||
|
ON lae.decoded_event_id = de.id
|
||||||
|
LEFT JOIN k_sol_liquidity_events lie
|
||||||
|
ON lie.decoded_event_id = de.id
|
||||||
|
LEFT JOIN k_sol_pool_lifecycle_events ple
|
||||||
|
ON ple.decoded_event_id = de.id
|
||||||
|
LEFT JOIN k_sol_fee_events fee
|
||||||
|
ON fee.decoded_event_id = de.id
|
||||||
|
LEFT JOIN k_sol_reward_events rew
|
||||||
|
ON rew.decoded_event_id = de.id
|
||||||
|
LEFT JOIN k_sol_pool_admin_events adm
|
||||||
|
ON adm.decoded_event_id = de.id
|
||||||
|
LEFT JOIN k_sol_orderbook_events obe
|
||||||
|
ON obe.decoded_event_id = de.id
|
||||||
|
LEFT JOIN k_sol_token_account_events tae
|
||||||
|
ON tae.decoded_event_id = de.id
|
||||||
|
WHERE de.protocol_name = 'pump_fees'
|
||||||
|
AND (
|
||||||
|
tx.err_json IS NULL
|
||||||
|
OR tx.err_json = ''
|
||||||
|
OR tx.err_json = 'null'
|
||||||
|
)
|
||||||
|
AND COALESCE(json_extract(de.payload_json, '$.eventActionability'), '') <> 'informational'
|
||||||
|
AND COALESCE(json_extract(de.payload_json, '$.pumpFeesMaterializationPolicy'), '') NOT IN (
|
||||||
|
'decoded_only_fee_calculation',
|
||||||
|
'decoded_only_audit'
|
||||||
|
)
|
||||||
|
AND te.id IS NULL
|
||||||
|
AND lae.id IS NULL
|
||||||
|
AND lie.id IS NULL
|
||||||
|
AND ple.id IS NULL
|
||||||
|
AND fee.id IS NULL
|
||||||
|
AND rew.id IS NULL
|
||||||
|
AND adm.id IS NULL
|
||||||
|
AND obe.id IS NULL
|
||||||
|
AND tae.id IS NULL
|
||||||
|
AND COALESCE(TRIM(json_extract(de.payload_json, '$.skipTradeReason')), '') = ''
|
||||||
|
AND COALESCE(TRIM(json_extract(de.payload_json, '$.skipCandleReason')), '') = ''
|
||||||
|
AND COALESCE(TRIM(json_extract(de.payload_json, '$.skipLiquidityReason')), '') = ''
|
||||||
|
AND COALESCE(TRIM(json_extract(de.payload_json, '$.skipLifecycleReason')), '') = ''
|
||||||
|
AND COALESCE(TRIM(json_extract(de.payload_json, '$.skipCatalogReason')), '') = ''
|
||||||
|
GROUP BY de.event_kind, pump_fees_policy
|
||||||
|
ORDER BY unexplained_count DESC, de.event_kind;
|
||||||
|
|
||||||
|
-- 07. Failed transaction materialization safety.
|
||||||
|
-- Target after closure: empty. Failed transactions may be decoded for audit, but must not be business-materialized.
|
||||||
|
SELECT
|
||||||
|
de.event_kind,
|
||||||
|
COUNT(DISTINCT de.id) AS decoded_failed_count,
|
||||||
|
COUNT(DISTINCT te.id) AS trade_count,
|
||||||
|
COUNT(DISTINCT lae.id) AS launch_count,
|
||||||
|
COUNT(DISTINCT lie.id) AS liquidity_count,
|
||||||
|
COUNT(DISTINCT ple.id) AS lifecycle_count,
|
||||||
|
COUNT(DISTINCT fee.id) AS fee_count,
|
||||||
|
COUNT(DISTINCT rew.id) AS reward_count,
|
||||||
|
COUNT(DISTINCT adm.id) AS admin_count,
|
||||||
|
COUNT(DISTINCT obe.id) AS orderbook_count,
|
||||||
|
COUNT(DISTINCT tae.id) AS token_account_count,
|
||||||
|
MIN(tx.signature) AS sample_signature
|
||||||
|
FROM k_sol_dex_decoded_events de
|
||||||
|
JOIN k_sol_chain_transactions tx
|
||||||
|
ON tx.id = de.transaction_id
|
||||||
|
LEFT JOIN k_sol_trade_events te
|
||||||
|
ON te.decoded_event_id = de.id
|
||||||
|
LEFT JOIN k_sol_launch_events lae
|
||||||
|
ON lae.decoded_event_id = de.id
|
||||||
|
LEFT JOIN k_sol_liquidity_events lie
|
||||||
|
ON lie.decoded_event_id = de.id
|
||||||
|
LEFT JOIN k_sol_pool_lifecycle_events ple
|
||||||
|
ON ple.decoded_event_id = de.id
|
||||||
|
LEFT JOIN k_sol_fee_events fee
|
||||||
|
ON fee.decoded_event_id = de.id
|
||||||
|
LEFT JOIN k_sol_reward_events rew
|
||||||
|
ON rew.decoded_event_id = de.id
|
||||||
|
LEFT JOIN k_sol_pool_admin_events adm
|
||||||
|
ON adm.decoded_event_id = de.id
|
||||||
|
LEFT JOIN k_sol_orderbook_events obe
|
||||||
|
ON obe.decoded_event_id = de.id
|
||||||
|
LEFT JOIN k_sol_token_account_events tae
|
||||||
|
ON tae.decoded_event_id = de.id
|
||||||
|
WHERE de.protocol_name = 'pump_fees'
|
||||||
|
AND tx.err_json IS NOT NULL
|
||||||
|
AND tx.err_json <> ''
|
||||||
|
AND tx.err_json <> 'null'
|
||||||
|
GROUP BY de.event_kind
|
||||||
|
HAVING trade_count > 0
|
||||||
|
OR launch_count > 0
|
||||||
|
OR liquidity_count > 0
|
||||||
|
OR lifecycle_count > 0
|
||||||
|
OR fee_count > 0
|
||||||
|
OR reward_count > 0
|
||||||
|
OR admin_count > 0
|
||||||
|
OR orderbook_count > 0
|
||||||
|
OR token_account_count > 0
|
||||||
|
ORDER BY de.event_kind;
|
||||||
|
|
||||||
|
-- 08. Multi-target materialization safety.
|
||||||
|
-- Target after closure: empty. One decoded event must not feed multiple business targets.
|
||||||
|
SELECT
|
||||||
|
de.event_kind,
|
||||||
|
COUNT(DISTINCT de.id) AS decoded_count,
|
||||||
|
COUNT(DISTINCT te.id) AS trade_count,
|
||||||
|
COUNT(DISTINCT lae.id) AS launch_count,
|
||||||
|
COUNT(DISTINCT lie.id) AS liquidity_count,
|
||||||
|
COUNT(DISTINCT ple.id) AS lifecycle_count,
|
||||||
|
COUNT(DISTINCT fee.id) AS fee_count,
|
||||||
|
COUNT(DISTINCT rew.id) AS reward_count,
|
||||||
|
COUNT(DISTINCT adm.id) AS admin_count,
|
||||||
|
COUNT(DISTINCT obe.id) AS orderbook_count,
|
||||||
|
COUNT(DISTINCT tae.id) AS token_account_count,
|
||||||
|
(
|
||||||
|
CASE WHEN COUNT(DISTINCT te.id) > 0 THEN 1 ELSE 0 END
|
||||||
|
+ CASE WHEN COUNT(DISTINCT lae.id) > 0 THEN 1 ELSE 0 END
|
||||||
|
+ CASE WHEN COUNT(DISTINCT lie.id) > 0 THEN 1 ELSE 0 END
|
||||||
|
+ CASE WHEN COUNT(DISTINCT ple.id) > 0 THEN 1 ELSE 0 END
|
||||||
|
+ CASE WHEN COUNT(DISTINCT fee.id) > 0 THEN 1 ELSE 0 END
|
||||||
|
+ CASE WHEN COUNT(DISTINCT rew.id) > 0 THEN 1 ELSE 0 END
|
||||||
|
+ CASE WHEN COUNT(DISTINCT adm.id) > 0 THEN 1 ELSE 0 END
|
||||||
|
+ CASE WHEN COUNT(DISTINCT obe.id) > 0 THEN 1 ELSE 0 END
|
||||||
|
+ CASE WHEN COUNT(DISTINCT tae.id) > 0 THEN 1 ELSE 0 END
|
||||||
|
) AS materialized_target_count
|
||||||
|
FROM k_sol_dex_decoded_events de
|
||||||
|
LEFT JOIN k_sol_trade_events te
|
||||||
|
ON te.decoded_event_id = de.id
|
||||||
|
LEFT JOIN k_sol_launch_events lae
|
||||||
|
ON lae.decoded_event_id = de.id
|
||||||
|
LEFT JOIN k_sol_liquidity_events lie
|
||||||
|
ON lie.decoded_event_id = de.id
|
||||||
|
LEFT JOIN k_sol_pool_lifecycle_events ple
|
||||||
|
ON ple.decoded_event_id = de.id
|
||||||
|
LEFT JOIN k_sol_fee_events fee
|
||||||
|
ON fee.decoded_event_id = de.id
|
||||||
|
LEFT JOIN k_sol_reward_events rew
|
||||||
|
ON rew.decoded_event_id = de.id
|
||||||
|
LEFT JOIN k_sol_pool_admin_events adm
|
||||||
|
ON adm.decoded_event_id = de.id
|
||||||
|
LEFT JOIN k_sol_orderbook_events obe
|
||||||
|
ON obe.decoded_event_id = de.id
|
||||||
|
LEFT JOIN k_sol_token_account_events tae
|
||||||
|
ON tae.decoded_event_id = de.id
|
||||||
|
WHERE de.protocol_name = 'pump_fees'
|
||||||
|
GROUP BY de.event_kind
|
||||||
|
HAVING materialized_target_count > 1
|
||||||
|
ORDER BY materialized_target_count DESC, de.event_kind;
|
||||||
|
|
||||||
|
-- 09. Materialization summary by table.
|
||||||
|
-- Failed transaction columns explain observed/materialized gaps without reopening failed-tx rows.
|
||||||
|
SELECT
|
||||||
|
de.event_kind,
|
||||||
|
COUNT(DISTINCT de.id) AS decoded_count,
|
||||||
|
COUNT(DISTINCT CASE
|
||||||
|
WHEN tx.err_json IS NULL OR tx.err_json = '' OR tx.err_json = 'null'
|
||||||
|
THEN de.transaction_id
|
||||||
|
END) AS successful_tx_count,
|
||||||
|
COUNT(DISTINCT CASE
|
||||||
|
WHEN tx.err_json IS NOT NULL AND tx.err_json <> '' AND tx.err_json <> 'null'
|
||||||
|
THEN de.transaction_id
|
||||||
|
END) AS failed_tx_count,
|
||||||
|
COUNT(DISTINCT te.id) AS trade_count,
|
||||||
|
COUNT(DISTINCT lae.id) AS launch_count,
|
||||||
|
COUNT(DISTINCT lie.id) AS liquidity_count,
|
||||||
|
COUNT(DISTINCT ple.id) AS lifecycle_count,
|
||||||
|
COUNT(DISTINCT fee.id) AS fee_count,
|
||||||
|
COUNT(DISTINCT rew.id) AS reward_count,
|
||||||
|
COUNT(DISTINCT adm.id) AS admin_count,
|
||||||
|
COUNT(DISTINCT obe.id) AS orderbook_count,
|
||||||
|
COUNT(DISTINCT tae.id) AS token_account_count,
|
||||||
|
COUNT(DISTINCT CASE
|
||||||
|
WHEN te.id IS NOT NULL
|
||||||
|
OR lae.id IS NOT NULL
|
||||||
|
OR lie.id IS NOT NULL
|
||||||
|
OR ple.id IS NOT NULL
|
||||||
|
OR fee.id IS NOT NULL
|
||||||
|
OR rew.id IS NOT NULL
|
||||||
|
OR adm.id IS NOT NULL
|
||||||
|
OR obe.id IS NOT NULL
|
||||||
|
OR tae.id IS NOT NULL
|
||||||
|
THEN de.id
|
||||||
|
END) AS business_materialized_count,
|
||||||
|
COUNT(DISTINCT CASE
|
||||||
|
WHEN (tx.err_json IS NULL OR tx.err_json = '' OR tx.err_json = 'null')
|
||||||
|
AND te.id IS NULL
|
||||||
|
AND lae.id IS NULL
|
||||||
|
AND lie.id IS NULL
|
||||||
|
AND ple.id IS NULL
|
||||||
|
AND fee.id IS NULL
|
||||||
|
AND rew.id IS NULL
|
||||||
|
AND adm.id IS NULL
|
||||||
|
AND obe.id IS NULL
|
||||||
|
AND tae.id IS NULL
|
||||||
|
THEN de.id
|
||||||
|
END) AS successful_non_materialized_count,
|
||||||
|
COUNT(DISTINCT CASE
|
||||||
|
WHEN tx.err_json IS NOT NULL AND tx.err_json <> '' AND tx.err_json <> 'null'
|
||||||
|
AND te.id IS NULL
|
||||||
|
AND lae.id IS NULL
|
||||||
|
AND lie.id IS NULL
|
||||||
|
AND ple.id IS NULL
|
||||||
|
AND fee.id IS NULL
|
||||||
|
AND rew.id IS NULL
|
||||||
|
AND adm.id IS NULL
|
||||||
|
AND obe.id IS NULL
|
||||||
|
AND tae.id IS NULL
|
||||||
|
THEN de.id
|
||||||
|
END) AS failed_non_materialized_count
|
||||||
|
FROM k_sol_dex_decoded_events de
|
||||||
|
JOIN k_sol_chain_transactions tx
|
||||||
|
ON tx.id = de.transaction_id
|
||||||
|
LEFT JOIN k_sol_trade_events te
|
||||||
|
ON te.decoded_event_id = de.id
|
||||||
|
LEFT JOIN k_sol_launch_events lae
|
||||||
|
ON lae.decoded_event_id = de.id
|
||||||
|
LEFT JOIN k_sol_liquidity_events lie
|
||||||
|
ON lie.decoded_event_id = de.id
|
||||||
|
LEFT JOIN k_sol_pool_lifecycle_events ple
|
||||||
|
ON ple.decoded_event_id = de.id
|
||||||
|
LEFT JOIN k_sol_fee_events fee
|
||||||
|
ON fee.decoded_event_id = de.id
|
||||||
|
LEFT JOIN k_sol_reward_events rew
|
||||||
|
ON rew.decoded_event_id = de.id
|
||||||
|
LEFT JOIN k_sol_pool_admin_events adm
|
||||||
|
ON adm.decoded_event_id = de.id
|
||||||
|
LEFT JOIN k_sol_orderbook_events obe
|
||||||
|
ON obe.decoded_event_id = de.id
|
||||||
|
LEFT JOIN k_sol_token_account_events tae
|
||||||
|
ON tae.decoded_event_id = de.id
|
||||||
|
WHERE de.protocol_name = 'pump_fees'
|
||||||
|
GROUP BY de.event_kind
|
||||||
|
ORDER BY de.event_kind;
|
||||||
|
|
||||||
|
-- 09b. Coverage rows with observed/materialized gaps explained by failed transactions.
|
||||||
|
-- Target after closure: any remaining successful_non_materialized_count is policy/skip-explained by query 06.
|
||||||
|
SELECT
|
||||||
|
ce.entry_name,
|
||||||
|
ce.entry_kind,
|
||||||
|
ce.local_event_kind,
|
||||||
|
ce.expected_db_target,
|
||||||
|
ce.proof_status,
|
||||||
|
ce.observed_count AS coverage_observed_count,
|
||||||
|
ce.materialized_count AS coverage_materialized_count,
|
||||||
|
COUNT(DISTINCT de.id) AS decoded_count,
|
||||||
|
COUNT(DISTINCT CASE
|
||||||
|
WHEN tx.err_json IS NULL OR tx.err_json = '' OR tx.err_json = 'null'
|
||||||
|
THEN de.id
|
||||||
|
END) AS successful_decoded_count,
|
||||||
|
COUNT(DISTINCT CASE
|
||||||
|
WHEN tx.err_json IS NOT NULL AND tx.err_json <> '' AND tx.err_json <> 'null'
|
||||||
|
THEN de.id
|
||||||
|
END) AS failed_decoded_count,
|
||||||
|
COUNT(DISTINCT CASE
|
||||||
|
WHEN te.id IS NOT NULL
|
||||||
|
OR lae.id IS NOT NULL
|
||||||
|
OR lie.id IS NOT NULL
|
||||||
|
OR ple.id IS NOT NULL
|
||||||
|
OR fee.id IS NOT NULL
|
||||||
|
OR rew.id IS NOT NULL
|
||||||
|
OR adm.id IS NOT NULL
|
||||||
|
OR obe.id IS NOT NULL
|
||||||
|
OR tae.id IS NOT NULL
|
||||||
|
THEN de.id
|
||||||
|
END) AS business_materialized_count,
|
||||||
|
COUNT(DISTINCT CASE
|
||||||
|
WHEN (tx.err_json IS NULL OR tx.err_json = '' OR tx.err_json = 'null')
|
||||||
|
AND te.id IS NULL
|
||||||
|
AND lae.id IS NULL
|
||||||
|
AND lie.id IS NULL
|
||||||
|
AND ple.id IS NULL
|
||||||
|
AND fee.id IS NULL
|
||||||
|
AND rew.id IS NULL
|
||||||
|
AND adm.id IS NULL
|
||||||
|
AND obe.id IS NULL
|
||||||
|
AND tae.id IS NULL
|
||||||
|
THEN de.id
|
||||||
|
END) AS successful_non_materialized_count,
|
||||||
|
MIN(tx.signature) AS sample_signature
|
||||||
|
FROM k_sol_dex_event_coverage_entries ce
|
||||||
|
LEFT JOIN k_sol_dex_decoded_events de
|
||||||
|
ON de.protocol_name = 'pump_fees'
|
||||||
|
AND de.event_kind = ce.local_event_kind
|
||||||
|
LEFT JOIN k_sol_chain_transactions tx
|
||||||
|
ON tx.id = de.transaction_id
|
||||||
|
LEFT JOIN k_sol_trade_events te
|
||||||
|
ON te.decoded_event_id = de.id
|
||||||
|
LEFT JOIN k_sol_launch_events lae
|
||||||
|
ON lae.decoded_event_id = de.id
|
||||||
|
LEFT JOIN k_sol_liquidity_events lie
|
||||||
|
ON lie.decoded_event_id = de.id
|
||||||
|
LEFT JOIN k_sol_pool_lifecycle_events ple
|
||||||
|
ON ple.decoded_event_id = de.id
|
||||||
|
LEFT JOIN k_sol_fee_events fee
|
||||||
|
ON fee.decoded_event_id = de.id
|
||||||
|
LEFT JOIN k_sol_reward_events rew
|
||||||
|
ON rew.decoded_event_id = de.id
|
||||||
|
LEFT JOIN k_sol_pool_admin_events adm
|
||||||
|
ON adm.decoded_event_id = de.id
|
||||||
|
LEFT JOIN k_sol_orderbook_events obe
|
||||||
|
ON obe.decoded_event_id = de.id
|
||||||
|
LEFT JOIN k_sol_token_account_events tae
|
||||||
|
ON tae.decoded_event_id = de.id
|
||||||
|
WHERE ce.decoder_code = 'pump_fees'
|
||||||
|
AND ce.entry_kind IN ('instruction', 'event')
|
||||||
|
AND ce.local_event_kind IS NOT NULL
|
||||||
|
AND ce.local_event_kind <> ''
|
||||||
|
GROUP BY
|
||||||
|
ce.entry_name,
|
||||||
|
ce.entry_kind,
|
||||||
|
ce.local_event_kind,
|
||||||
|
ce.expected_db_target,
|
||||||
|
ce.proof_status,
|
||||||
|
ce.observed_count,
|
||||||
|
ce.materialized_count
|
||||||
|
HAVING coverage_observed_count <> coverage_materialized_count
|
||||||
|
OR successful_non_materialized_count > 0
|
||||||
|
OR failed_decoded_count > 0
|
||||||
|
ORDER BY successful_non_materialized_count DESC, failed_decoded_count DESC, ce.entry_kind, ce.entry_name;
|
||||||
|
|
||||||
|
-- 10. Instruction observation versus coverage.
|
||||||
|
-- Target after closure: every observed non-transport discriminator is covered or documented.
|
||||||
|
WITH normalized_io AS (
|
||||||
|
SELECT
|
||||||
|
io.decoder_code,
|
||||||
|
io.instruction_name,
|
||||||
|
CASE
|
||||||
|
WHEN io.instruction_name LIKE 'pump_fees.%'
|
||||||
|
THEN SUBSTR(io.instruction_name, LENGTH('pump_fees') + 2)
|
||||||
|
ELSE io.instruction_name
|
||||||
|
END AS normalized_entry_name,
|
||||||
|
io.discriminator_hex,
|
||||||
|
io.signature
|
||||||
|
FROM k_sol_instruction_observations io
|
||||||
|
WHERE io.decoder_code = 'pump_fees'
|
||||||
|
AND io.discriminator_hex IS NOT NULL
|
||||||
|
AND io.discriminator_hex <> ''
|
||||||
|
AND io.discriminator_hex <> 'e445a52e51cb9a1d'
|
||||||
|
)
|
||||||
|
SELECT
|
||||||
|
nio.instruction_name,
|
||||||
|
nio.normalized_entry_name,
|
||||||
|
nio.discriminator_hex,
|
||||||
|
COUNT(*) AS observed_count,
|
||||||
|
COUNT(DISTINCT nio.signature) AS tx_count,
|
||||||
|
MIN(nio.signature) AS sample_signature,
|
||||||
|
CASE
|
||||||
|
WHEN ce.id IS NULL THEN 'coverage_gap'
|
||||||
|
ELSE 'covered'
|
||||||
|
END AS observation_coverage_status,
|
||||||
|
ce.local_event_kind,
|
||||||
|
ce.expected_db_target,
|
||||||
|
ce.proof_status
|
||||||
|
FROM normalized_io nio
|
||||||
|
LEFT JOIN k_sol_dex_event_coverage_entries ce
|
||||||
|
ON ce.decoder_code = 'pump_fees'
|
||||||
|
AND COALESCE(ce.discriminator_hex, '') = COALESCE(nio.discriminator_hex, '')
|
||||||
|
AND (
|
||||||
|
COALESCE(TRIM(nio.instruction_name), '') = ''
|
||||||
|
OR ce.entry_name = nio.instruction_name
|
||||||
|
OR ce.entry_name = nio.normalized_entry_name
|
||||||
|
OR ce.local_event_kind = nio.instruction_name
|
||||||
|
OR ce.local_event_kind = ('pump_fees.' || nio.normalized_entry_name)
|
||||||
|
)
|
||||||
|
GROUP BY
|
||||||
|
nio.instruction_name,
|
||||||
|
nio.normalized_entry_name,
|
||||||
|
nio.discriminator_hex,
|
||||||
|
observation_coverage_status,
|
||||||
|
ce.local_event_kind,
|
||||||
|
ce.expected_db_target,
|
||||||
|
ce.proof_status
|
||||||
|
ORDER BY observed_count DESC, nio.instruction_name, nio.discriminator_hex;
|
||||||
|
|
||||||
|
-- 11. Anti-trade/candle direct pump_fees control.
|
||||||
|
-- Target after closure: empty. pump_fees must not create trade/candle rows without strict proof.
|
||||||
|
SELECT
|
||||||
|
de.event_kind,
|
||||||
|
COUNT(DISTINCT te.id) AS trade_count,
|
||||||
|
MIN(tx.signature) AS sample_signature
|
||||||
|
FROM k_sol_dex_decoded_events de
|
||||||
|
LEFT JOIN k_sol_chain_transactions tx
|
||||||
|
ON tx.id = de.transaction_id
|
||||||
|
LEFT JOIN k_sol_trade_events te
|
||||||
|
ON te.decoded_event_id = de.id
|
||||||
|
WHERE de.protocol_name = 'pump_fees'
|
||||||
|
GROUP BY de.event_kind
|
||||||
|
HAVING trade_count > 0
|
||||||
|
ORDER BY trade_count DESC, de.event_kind;
|
||||||
|
|
||||||
|
-- 12. Global watchlist after pump_fees replay.
|
||||||
|
-- Expected after local promotion: pump_fees rows should no longer dominate this list unless explicitly deferred.
|
||||||
|
SELECT
|
||||||
|
json_extract(de.payload_json, '$.upstreamDecoderCode') AS upstream_decoder_code,
|
||||||
|
json_extract(de.payload_json, '$.upstreamEntryName') AS upstream_entry_name,
|
||||||
|
json_extract(de.payload_json, '$.upstreamDiscriminatorHex') AS upstream_discriminator_hex,
|
||||||
|
COUNT(*) AS decoded_count,
|
||||||
|
COUNT(DISTINCT de.transaction_id) AS tx_count,
|
||||||
|
MIN(tx.signature) AS sample_signature
|
||||||
|
FROM k_sol_dex_decoded_events de
|
||||||
|
LEFT JOIN k_sol_chain_transactions tx
|
||||||
|
ON tx.id = de.transaction_id
|
||||||
|
WHERE de.protocol_name = 'upstream_git'
|
||||||
|
AND de.event_kind = 'upstream_git.instruction_match'
|
||||||
|
GROUP BY upstream_decoder_code, upstream_entry_name, upstream_discriminator_hex
|
||||||
|
ORDER BY decoded_count DESC, upstream_decoder_code, upstream_entry_name;
|
||||||
|
|
||||||
|
-- 13. Local-IDL-only pump_fees entries.
|
||||||
|
-- Target after coverage sync: these local IDL rows are present and mapped to local_event_kind.
|
||||||
|
SELECT
|
||||||
|
ce.entry_name,
|
||||||
|
ce.entry_kind,
|
||||||
|
ce.discriminator_hex,
|
||||||
|
ce.source_repo,
|
||||||
|
ce.source_path,
|
||||||
|
ce.local_event_kind,
|
||||||
|
ce.expected_db_target,
|
||||||
|
ce.proof_status,
|
||||||
|
ce.observed_count,
|
||||||
|
ce.materialized_count,
|
||||||
|
ce.trade_count
|
||||||
|
FROM k_sol_dex_event_coverage_entries ce
|
||||||
|
WHERE ce.decoder_code = 'pump_fees'
|
||||||
|
AND ce.source_repo = 'local-idl'
|
||||||
|
ORDER BY ce.entry_kind, ce.entry_name;
|
||||||
|
|
||||||
|
-- 14. Anchor event coverage local kind check.
|
||||||
|
-- Target after decoder delta: every Pump Fees event registry row has a local_event_kind.
|
||||||
|
SELECT
|
||||||
|
ce.entry_name,
|
||||||
|
ce.discriminator_hex,
|
||||||
|
ce.local_event_kind,
|
||||||
|
ce.expected_db_target,
|
||||||
|
ce.proof_status,
|
||||||
|
ce.observed_count,
|
||||||
|
ce.materialized_count
|
||||||
|
FROM k_sol_dex_event_coverage_entries ce
|
||||||
|
WHERE ce.decoder_code = 'pump_fees'
|
||||||
|
AND ce.entry_kind = 'event'
|
||||||
|
AND (
|
||||||
|
ce.local_event_kind IS NULL
|
||||||
|
OR TRIM(ce.local_event_kind) = ''
|
||||||
|
)
|
||||||
|
ORDER BY ce.entry_name;
|
||||||
|
|
||||||
|
-- 15. Decoded Anchor events summary.
|
||||||
|
SELECT
|
||||||
|
de.event_kind,
|
||||||
|
json_extract(de.payload_json, '$.eventName') AS anchor_event_name,
|
||||||
|
json_extract(de.payload_json, '$.discriminatorHex') AS anchor_event_discriminator_hex,
|
||||||
|
COUNT(*) AS decoded_count,
|
||||||
|
COUNT(DISTINCT de.transaction_id) AS tx_count,
|
||||||
|
MIN(tx.signature) AS sample_signature
|
||||||
|
FROM k_sol_dex_decoded_events de
|
||||||
|
LEFT JOIN k_sol_chain_transactions tx
|
||||||
|
ON tx.id = de.transaction_id
|
||||||
|
WHERE de.protocol_name = 'pump_fees'
|
||||||
|
AND COALESCE(TRIM(json_extract(de.payload_json, '$.eventName')), '') <> ''
|
||||||
|
GROUP BY de.event_kind, anchor_event_name, anchor_event_discriminator_hex
|
||||||
|
ORDER BY decoded_count DESC, de.event_kind;
|
||||||
Reference in New Issue
Block a user