0.7.49
This commit is contained in:
134
docs/reports/RAYDIUM_CLMM_EVENT_COVERAGE_REPORT.md
Normal file
134
docs/reports/RAYDIUM_CLMM_EVENT_COVERAGE_REPORT.md
Normal file
@@ -0,0 +1,134 @@
|
||||
<!-- file: docs/reports/RAYDIUM_CLMM_EVENT_COVERAGE_REPORT.md -->
|
||||
|
||||
# Rapport `0.7.49` — Raydium CLMM event coverage
|
||||
|
||||
## Résumé
|
||||
|
||||
La tranche `0.7.49` clôture la couverture fonctionnelle `raydium_clmm` sur le corpus local validé. Elle reprend CLMM après `0.7.48 raydium_cpmm` et applique la même méthode : inventaire upstream, corpus local, replay forcé, materialization contrôlée, suppression des fallbacks remplacés, validation SQL.
|
||||
|
||||
Validation locale observée après le dernier replay :
|
||||
|
||||
```text
|
||||
local replay: 2197 replayed, 0 decode skipped, 2197 ledger upserts, 1461 unsafe ledger rows, 1217 trades, 111 liquidity, 25 lifecycle, 4868 candle upserts, instructionObservations=19798
|
||||
catalog: 41 tokens, 63 pools, 63 pairs
|
||||
```
|
||||
|
||||
Synthèse coverage :
|
||||
|
||||
```text
|
||||
listed_entry_count = 45
|
||||
decoded_entry_count = 33
|
||||
observed_entry_count = 33
|
||||
materialized_entry_count = 25
|
||||
total_observed_count = 2560
|
||||
total_materialized_count = 1367
|
||||
trade_count = 1186
|
||||
```
|
||||
|
||||
## Entrées couvertes
|
||||
|
||||
La tranche couvre `33` instructions locales CLMM observées et décodées, dont :
|
||||
|
||||
```text
|
||||
swap
|
||||
swap_v2
|
||||
swap_router_base_in
|
||||
open_position
|
||||
open_position_v2
|
||||
open_position_with_token22_nft
|
||||
close_position
|
||||
close_protocol_position
|
||||
increase_liquidity
|
||||
increase_liquidity_v2
|
||||
decrease_liquidity
|
||||
decrease_liquidity_v2
|
||||
create_pool
|
||||
create_customizable_pool
|
||||
create_amm_config
|
||||
create_dynamic_fee_config
|
||||
update_amm_config
|
||||
update_pool_status
|
||||
create_operation_account
|
||||
update_operation_account
|
||||
create_support_mint_associated
|
||||
collect_fund_fee
|
||||
collect_protocol_fee
|
||||
collect_remaining_rewards
|
||||
initialize_reward
|
||||
set_reward_params
|
||||
transfer_reward_owner
|
||||
update_reward_infos
|
||||
open_limit_order
|
||||
increase_limit_order
|
||||
decrease_limit_order
|
||||
close_limit_order
|
||||
settle_limit_order
|
||||
```
|
||||
|
||||
## Matérialisations validées
|
||||
|
||||
Les matérialisations sont limitées aux transactions réussies et aux familles déjà supportées par le modèle DB :
|
||||
|
||||
| Famille | Table | Règle |
|
||||
|---|---|---|
|
||||
| Swaps | `k_sol_trade_events` + candles | Uniquement `raydium_clmm.swap` / `raydium_clmm.swap_v2` quand les montants sont exploitables. |
|
||||
| Liquidity / positions | `k_sol_liquidity_events` | Positions/liquidity prouvées par corpus, sans trade/candle. |
|
||||
| Fees | `k_sol_fee_events` | Fees prouvées par corpus, sans trade/candle. |
|
||||
| Rewards | `k_sol_reward_events` | Rewards prouvées par corpus, sans trade/candle. |
|
||||
| Admin/config | `k_sol_pool_admin_events` | Config/admin prouvés par corpus, sans trade/candle. |
|
||||
| Lifecycle | `k_sol_pool_lifecycle_events` | Pool creation prouvée par corpus, sans trade/candle. |
|
||||
| Limit orders | `k_sol_orderbook_events` | Open/increase/decrease/close/settle matérialisés comme orderbook, jamais trade/candle. |
|
||||
|
||||
## Invariants validés
|
||||
|
||||
Les requêtes SQL finales valident :
|
||||
|
||||
```text
|
||||
raydium_clmm.instruction_audit résiduel = 0
|
||||
upstream_git.instruction_match localement couvert = 0
|
||||
non-swap CLMM avec trade_count > 0 = 0
|
||||
failed tx matérialisées = 0
|
||||
```
|
||||
|
||||
Les fallbacks `upstream_git.instruction_match` localement couverts sont supprimés automatiquement, y compris quand `k_sol_instruction_observations.decoded_event_id` pointait encore vers une ligne fallback.
|
||||
|
||||
## Anchor / Program-data events non observés
|
||||
|
||||
Les `11` Anchor / `Program data` events CLMM ci-dessous restent listés en `upstream_git_unverified`, car aucun corpus local ne les observe encore comme event direct :
|
||||
|
||||
```text
|
||||
collect_personal_fee_event a6ae69c051a15369
|
||||
collect_protocol_fee_event ce57114f2d29d53d
|
||||
config_change_event f7bd07776a705f97
|
||||
create_personal_position_event 641e57f9c4df9ace
|
||||
decrease_liquidity_event 3ade563a44325538
|
||||
increase_liquidity_event 314f69d420221e54
|
||||
liquidity_calculate_event ed7094e63954b4a2
|
||||
liquidity_change_event 7ef0afce9e58996b
|
||||
pool_created_event 195e4b2f7063353f
|
||||
swap_event 40c6cde8260871e2
|
||||
update_reward_infos_event 6d7fba4e724125ec
|
||||
```
|
||||
|
||||
Le code est préparé pour les accueillir comme audit-only lorsqu’ils seront observés dans un corpus local. Ils ne produisent pas de trade/candle par défaut.
|
||||
|
||||
## Sources utilisées
|
||||
|
||||
Les entrées ont été comparées aux sources Raydium CLMM suivantes :
|
||||
|
||||
```text
|
||||
Solscan Program IDL CAMMCzo5YL8w4VFF8KVHrK22GGUsp5VTaW7grrKgrWqK
|
||||
sevenlabs-hq/carbon raydium-clmm-decoder
|
||||
pinax-network/substreams-solana-idls raydium/clmm
|
||||
0xfnzero/sol-parser-sdk idl
|
||||
```
|
||||
|
||||
Les sources upstream restent des indices. La promotion locale dépend du corpus local, du replay et des validations SQL.
|
||||
|
||||
## SQL final
|
||||
|
||||
La validation finale est dans :
|
||||
|
||||
```text
|
||||
validation_sql/SQL_VALIDATION_RAYDIUM_CLMM_0_7_49.sql
|
||||
```
|
||||
130
docs/reports/RAYDIUM_CLMM_UPSTREAM_COVERAGE_REVIEW_PRE19.md
Normal file
130
docs/reports/RAYDIUM_CLMM_UPSTREAM_COVERAGE_REVIEW_PRE19.md
Normal file
@@ -0,0 +1,130 @@
|
||||
# file: docs/reports/RAYDIUM_CLMM_UPSTREAM_COVERAGE_REVIEW_PRE19.md
|
||||
|
||||
# Raydium CLMM upstream coverage review — `0.7.49-pre.19`
|
||||
|
||||
## Scope
|
||||
|
||||
Decoder under review:
|
||||
|
||||
```text
|
||||
raydium_clmm
|
||||
program_id = CAMMCzo5YL8w4VFF8KVHrK22GGUsp5VTaW7grrKgrWqK
|
||||
```
|
||||
|
||||
External sources checked for the local coverage registry:
|
||||
|
||||
```text
|
||||
https://solscan.io/account/CAMMCzo5YL8w4VFF8KVHrK22GGUsp5VTaW7grrKgrWqK#programIdl
|
||||
https://github.com/sevenlabs-hq/carbon/tree/main/decoders/raydium-clmm-decoder
|
||||
https://github.com/pinax-network/substreams-solana-idls/tree/main/src/raydium/clmm
|
||||
https://github.com/0xfnzero/sol-parser-sdk/tree/main/idl
|
||||
```
|
||||
|
||||
Notes:
|
||||
|
||||
- Solscan is used as discovery / IDL cross-check, not as final business proof.
|
||||
- `sol-parser-sdk/idl/raydium_clmm.json` maps to `raydium/amm_v3_with_swapv2.json` and exposes the CLMM program address.
|
||||
- `pinax-network/substreams-solana-idls` exposes Raydium CLMM under `src/raydium/clmm/v3`.
|
||||
- `sevenlabs-hq/carbon` exposes a dedicated `raydium-clmm-decoder` crate.
|
||||
|
||||
## Local registry status
|
||||
|
||||
The local registry now lists:
|
||||
|
||||
```text
|
||||
45 entries total:
|
||||
- 33 instructions
|
||||
- 11 Anchor/program-data events
|
||||
- 1 program row
|
||||
```
|
||||
|
||||
All 33 instruction entries have a `local_event_kind` mapping in `dex_event_coverage.rs`, `instruction_observation_index.rs`, `dex_decode.rs`, and `upstream_registry_generated.rs`.
|
||||
|
||||
The 11 event entries are listed as upstream facts and stay `upstream_git_unverified` until local corpus provides program-data/Anchor event proof.
|
||||
|
||||
## Instruction coverage matrix
|
||||
|
||||
| Entry | Discriminator | Family | Local event kind | Expected target | Status |
|
||||
|---|---|---|---|---|---|
|
||||
| close_limit_order | `4c7c800fd55725fa` | order_cancel | `raydium_clmm.close_limit_order` | `k_sol_orderbook_events` | decoded/materializable |
|
||||
| open_limit_order | `9d20dab7471d1293` | order_place | `raydium_clmm.open_limit_order` | `k_sol_orderbook_events` | decoded/materializable |
|
||||
| increase_limit_order | `b19059ecfaba7d63` | order_place | `raydium_clmm.increase_limit_order` | `k_sol_orderbook_events` | decoded/materializable |
|
||||
| decrease_limit_order | `759d3c674231a300` | order_cancel | `raydium_clmm.decrease_limit_order` | `k_sol_orderbook_events` | decoded/materializable |
|
||||
| close_position | `7b86510031446262` | position_close | `raydium_clmm.close_position` | `k_sol_liquidity_events` | decoded/materializable |
|
||||
| close_protocol_position | `c975989055556cb2` | position_close | `raydium_clmm.close_protocol_position` | `k_sol_liquidity_events` | decoded/materializable |
|
||||
| collect_fund_fee | `a78a4e95dfc2067e` | fee | `raydium_clmm.collect_fund_fee` | `k_sol_fee_events` | decoded/materializable |
|
||||
| collect_protocol_fee | `8888fcddc2427e59` | fee | `raydium_clmm.collect_protocol_fee` | `k_sol_fee_events` | decoded/materializable |
|
||||
| collect_remaining_rewards | `12eda6c52210d590` | reward | `raydium_clmm.collect_remaining_rewards` | `k_sol_reward_events` | decoded/materializable |
|
||||
| create_amm_config | `8934edd4d7756c68` | admin_config | `raydium_clmm.create_amm_config` | `k_sol_pool_admin_events` | decoded/materializable |
|
||||
| create_customizable_pool | `2b44d4a7592fa401` | pool_create | `raydium_clmm.create_customizable_pool` | `k_sol_pool_lifecycle_events` | decoded/materializable |
|
||||
| create_dynamic_fee_config | `bd0eb5785576e33e` | admin_config | `raydium_clmm.create_dynamic_fee_config` | `k_sol_pool_admin_events` | decoded/materializable |
|
||||
| create_operation_account | `3f5794216d230868` | unknown | `raydium_clmm.create_operation_account` | `k_sol_dex_decoded_events_only` | decoded/audit-only unless admin evidence is required |
|
||||
| create_pool | `e992d18ecf6840bc` | pool_create | `raydium_clmm.create_pool` | `k_sol_pool_lifecycle_events` | decoded/materializable |
|
||||
| create_support_mint_associated | `11fb415c88f20ea9` | account_create | `raydium_clmm.create_support_mint_associated` | `k_sol_token_account_events` | decoded; token-account materialization remains a later cross-DEX topic |
|
||||
| decrease_liquidity | `a026d06f685b2c01` | liquidity_remove | `raydium_clmm.decrease_liquidity` | `k_sol_liquidity_events` | decoded/materializable |
|
||||
| decrease_liquidity_v2 | `3a7fbc3e4f52c460` | liquidity_remove | `raydium_clmm.decrease_liquidity_v2` | `k_sol_liquidity_events` | decoded/materializable |
|
||||
| increase_liquidity | `2e9cf3760dcdfbb2` | liquidity_add | `raydium_clmm.increase_liquidity` | `k_sol_liquidity_events` | decoded/materializable |
|
||||
| increase_liquidity_v2 | `851d59df45eeb00a` | liquidity_add | `raydium_clmm.increase_liquidity_v2` | `k_sol_liquidity_events` | decoded/materializable |
|
||||
| initialize_reward | `5f87c0c4f281e644` | reward | `raydium_clmm.initialize_reward` | `k_sol_reward_events` | decoded/materializable |
|
||||
| open_position | `87802f4d0f98f031` | position_open | `raydium_clmm.open_position` | `k_sol_liquidity_events` | decoded/materializable |
|
||||
| open_position_v2 | `4db84ad67056f1c7` | position_open | `raydium_clmm.open_position_v2` | `k_sol_liquidity_events` | decoded/materializable |
|
||||
| open_position_with_token22_nft | `4dffae527d1dc92e` | position_open | `raydium_clmm.open_position_with_token22_nft` | `k_sol_liquidity_events` | decoded/materializable |
|
||||
| set_reward_params | `7034a74b20c9d389` | reward | `raydium_clmm.set_reward_params` | `k_sol_reward_events` | decoded/materializable |
|
||||
| settle_limit_order | `cd4e74215c691a60` | settle_funds | `raydium_clmm.settle_limit_order` | `k_sol_orderbook_events` | decoded/materializable |
|
||||
| swap | `f8c69e91e17587c8` | swap | `raydium_clmm.swap` | `k_sol_trade_events` | decoded/materializable as trade |
|
||||
| swap_router_base_in | `457d73daf5baf2c4` | swap | `raydium_clmm.swap_router_base_in` | `k_sol_trade_events` | decoded; observed but not promoted to trade without corpus proof |
|
||||
| swap_v2 | `2b04ed0b1ac91e62` | swap | `raydium_clmm.swap_v2` | `k_sol_trade_events` | decoded/materializable as trade |
|
||||
| transfer_reward_owner | `07160c53f22b3079` | reward | `raydium_clmm.transfer_reward_owner` | `k_sol_reward_events` | decoded/materializable |
|
||||
| update_amm_config | `313cae889a1c74c8` | admin_config | `raydium_clmm.update_amm_config` | `k_sol_pool_admin_events` | decoded/materializable |
|
||||
| update_operation_account | `7f467728bce33d07` | unknown | `raydium_clmm.update_operation_account` | `k_sol_dex_decoded_events_only` | decoded/audit-only unless admin evidence is required |
|
||||
| update_pool_status | `82576c062ee0757b` | admin_config | `raydium_clmm.update_pool_status` | `k_sol_pool_admin_events` | decoded/materializable |
|
||||
| update_reward_infos | `a3ace0340b9a6adf` | reward | `raydium_clmm.update_reward_infos` | `k_sol_reward_events` | decoded/materializable |
|
||||
|
||||
## Anchor/program-data event entries
|
||||
|
||||
These entries remain listed, but no local corpus row has observed them as direct CLMM decoded events in the current replay corpus:
|
||||
|
||||
| Event entry | Discriminator | Family | Expected target | Status |
|
||||
|---|---|---|---|---|
|
||||
| collect_personal_fee_event | `a6ae69c051a15369` | fee | `k_sol_fee_events` | upstream listed, local corpus unobserved |
|
||||
| collect_protocol_fee_event | `ce57114f2d29d53d` | fee | `k_sol_fee_events` | upstream listed, local corpus unobserved |
|
||||
| config_change_event | `f7bd07776a705f97` | admin_config | `k_sol_pool_admin_events` | upstream listed, local corpus unobserved |
|
||||
| create_personal_position_event | `641e57f9c4df9ace` | unknown | `k_sol_dex_decoded_events_only` | upstream listed, local corpus unobserved |
|
||||
| decrease_liquidity_event | `3ade563a44325538` | liquidity_remove | `k_sol_liquidity_events` | upstream listed, local corpus unobserved |
|
||||
| increase_liquidity_event | `314f69d420221e54` | liquidity_add | `k_sol_liquidity_events` | upstream listed, local corpus unobserved |
|
||||
| liquidity_calculate_event | `ed7094e63954b4a2` | unknown | `k_sol_dex_decoded_events_only` | upstream listed, local corpus unobserved |
|
||||
| liquidity_change_event | `7ef0afce9e58996b` | unknown | `k_sol_dex_decoded_events_only` | upstream listed, local corpus unobserved |
|
||||
| pool_created_event | `195e4b2f7063353f` | unknown | `k_sol_dex_decoded_events_only` | upstream listed, local corpus unobserved |
|
||||
| swap_event | `40c6cde8260871e2` | swap | `k_sol_trade_events` | upstream listed, local corpus unobserved |
|
||||
| update_reward_infos_event | `6d7fba4e724125ec` | reward | `k_sol_reward_events` | upstream listed, local corpus unobserved |
|
||||
|
||||
## Patch `pre.19`
|
||||
|
||||
Patch goal:
|
||||
|
||||
```text
|
||||
Stop replay/backfill from leaving `upstream_git.instruction_match` rows when a local specialized decoder already covers the same upstream decoder + entry + discriminator.
|
||||
```
|
||||
|
||||
New DB query:
|
||||
|
||||
```text
|
||||
query_dex_decoded_events_delete_locally_covered_upstream_instruction_matches(database, upstream_decoder_code)
|
||||
```
|
||||
|
||||
Called from:
|
||||
|
||||
```text
|
||||
local_pipeline_replay.rs::refresh_event_coverage_best_effort
|
||||
token_backfill.rs::refresh_event_coverage_best_effort
|
||||
```
|
||||
|
||||
Expected validation after replay:
|
||||
|
||||
```text
|
||||
raydium_clmm.instruction_audit residual query -> empty
|
||||
upstream_git.instruction_match where upstreamDecoderCode = raydium_clmm -> empty
|
||||
non-swap CLMM trade_count -> empty
|
||||
failed CLMM materialization query -> empty
|
||||
coverage summary remains populated around 45 listed / 33 decoded / 33 observed
|
||||
```
|
||||
204
docs/reports/RAYDIUM_CPMM_EVENT_COVERAGE_REPORT.md
Normal file
204
docs/reports/RAYDIUM_CPMM_EVENT_COVERAGE_REPORT.md
Normal file
@@ -0,0 +1,204 @@
|
||||
# Rapport `0.7.48` — Raydium CPMM event coverage
|
||||
|
||||
## Scope
|
||||
|
||||
Tranche : `0.7.48`.
|
||||
Decoder local : `raydium_cpmm`.
|
||||
Programme : `CPMMoo8L3F4NbTegBCKVNunggL7H1ZpdTHKxQB5qKP1C`.
|
||||
|
||||
Objectif : couvrir Raydium CPMM au-delà des swaps, avec preuve locale par backfill/replay SQL, sans modifier les règles trade/candle existantes et sans promouvoir de table métier transversale non nécessaire.
|
||||
|
||||
## Sources utilisées
|
||||
|
||||
Sources principales :
|
||||
|
||||
- Carbon `carbon-raydium-cpmm-decoder` ;
|
||||
- fnzero `solana-streamer` / `sol-parser-sdk` IDL `raydium_cpmm.json` ;
|
||||
- Raydium CP-Swap officiel ;
|
||||
- Solscan page programme / Program IDL comme accélérateur de recherche de signatures, notamment via `instruction=<discriminator>`.
|
||||
|
||||
Règle retenue : Git/IDL/Solscan sont des indices de recherche. La preuve métier reste le corpus local backfillé puis rejoué.
|
||||
|
||||
## Entrées CPMM inventoriées
|
||||
|
||||
| Kind | Entrée | Discriminant | État final `0.7.48` |
|
||||
|---|---|---|---|
|
||||
| instruction | `close_permission_pda` | `9c5420764587467b` | connu upstream, non observé localement |
|
||||
| instruction | `collect_creator_fee` | `1416567bc61cdb84` | décodé + matérialisé fee |
|
||||
| instruction | `collect_fund_fee` | `a78a4e95dfc2067e` | décodé + matérialisé fee |
|
||||
| instruction | `collect_protocol_fee` | `8888fcddc2427e59` | décodé + matérialisé fee |
|
||||
| instruction | `create_amm_config` | `8934edd4d7756c68` | décodé + matérialisé admin/config |
|
||||
| instruction | `create_permission_pda` | `878802d889a9b5ca` | décodé + matérialisé admin/config |
|
||||
| instruction | `deposit` | `f223c68952e1f2b6` | décodé + matérialisé liquidity add |
|
||||
| instruction | `initialize` | `afaf6d1f0d989bed` | décodé + matérialisé lifecycle |
|
||||
| instruction | `initialize_with_permission` | `3f37fe4131b25979` | décodé + matérialisé lifecycle only |
|
||||
| event | `lp_change_event` | `79a3cdc939da753c` | décodé + matérialisé liquidity bidirectionnelle |
|
||||
| instruction | `swap_base_input` | `8fbe5adac41e33de` | décodé + trade matérialisé quand transaction OK |
|
||||
| instruction | `swap_base_output` | `37d96256a34ab4ad` | décodé + trade matérialisé quand transaction OK |
|
||||
| event | `swap_event` | `40c6cde8260871e2` | décodé audit-only, pas trade/candle |
|
||||
| instruction | `update_amm_config` | `313cae889a1c74c8` | décodé + matérialisé admin/config |
|
||||
| instruction | `update_pool_status` | `82576c062ee0757b` | connu upstream, non observé localement |
|
||||
| instruction | `withdraw` | `b712469c946da122` | décodé + matérialisé liquidity remove |
|
||||
|
||||
## Décodage ajouté ou stabilisé
|
||||
|
||||
Le decoder spécialisé `raydium_cpmm` couvre maintenant :
|
||||
|
||||
- les swaps instruction-scoped `swap_base_input` / `swap_base_output` ;
|
||||
- les events `Program data:` / Anchor CPI `swap_event` et `lp_change_event` ;
|
||||
- les instructions lifecycle `initialize` / `initialize_with_permission` ;
|
||||
- les instructions liquidity `deposit` / `withdraw` ;
|
||||
- les fees `collect_creator_fee`, `collect_fund_fee`, `collect_protocol_fee` ;
|
||||
- les instructions admin/config `create_amm_config`, `create_permission_pda`, `update_amm_config` ;
|
||||
- les instructions connues mais non observées `close_permission_pda`, `update_pool_status` restent listées sans promotion métier.
|
||||
|
||||
Le fallback `upstream_git.instruction_match` ne doit plus apparaître pour les instructions CPMM couvertes localement.
|
||||
|
||||
## Matérialisation finale validée
|
||||
|
||||
Rejeu local validé après backfills ciblés Solscan + Demo Pipeline 2 :
|
||||
|
||||
| Event kind | Decoded | Table métier | Materialized | Trade count | Statut |
|
||||
|---|---:|---|---:|---:|---|
|
||||
| `raydium_cpmm.collect_creator_fee` | 4 | `k_sol_fee_events` | 4 | 0 | fee materialized |
|
||||
| `raydium_cpmm.collect_fund_fee` | 7 | `k_sol_fee_events` | 7 | 0 | fee materialized |
|
||||
| `raydium_cpmm.collect_protocol_fee` | 15 | `k_sol_fee_events` | 15 | 0 | fee materialized |
|
||||
| `raydium_cpmm.create_amm_config` | 6 | `k_sol_pool_admin_events` | 6 | 0 | admin materialized |
|
||||
| `raydium_cpmm.create_permission_pda` | 4 | `k_sol_pool_admin_events` | 4 | 0 | admin materialized |
|
||||
| `raydium_cpmm.deposit` | 11 | `k_sol_liquidity_events` | 11 | 0 | liquidity add materialized |
|
||||
| `raydium_cpmm.initialize` | 5 | `k_sol_pool_lifecycle_events` | 5 | 0 | lifecycle materialized |
|
||||
| `raydium_cpmm.initialize_with_permission` | 4 | `k_sol_pool_lifecycle_events` | 4 | 0 | lifecycle only |
|
||||
| `raydium_cpmm.lp_change_event` | 25 | `k_sol_liquidity_events` | 25 | 0 | liquidity materialized, `changeType` bidirectionnel |
|
||||
| `raydium_cpmm.swap_base_input` | 750 | `k_sol_trade_events` | 482 | 482 | trade materialized for OK/actionable tx |
|
||||
| `raydium_cpmm.swap_base_output` | 25 | `k_sol_trade_events` | 17 | 17 | trade materialized for OK/actionable tx |
|
||||
| `raydium_cpmm.swap_event` | 529 | `k_sol_dex_decoded_events_only` | 0 | 0 | audit-only, no duplicate trade |
|
||||
| `raydium_cpmm.update_amm_config` | 13 | `k_sol_pool_admin_events` | 13 | 0 | admin materialized |
|
||||
| `raydium_cpmm.withdraw` | 14 | `k_sol_liquidity_events` | 14 | 0 | liquidity remove materialized |
|
||||
| `raydium_cpmm.instruction_audit` | 3 | `k_sol_dex_decoded_events_only` | 0 | 0 | unknown audit-only |
|
||||
|
||||
Replay final observé :
|
||||
|
||||
```text
|
||||
1124 replayed
|
||||
561 trades
|
||||
50 liquidity
|
||||
9 lifecycle
|
||||
2224 candle upserts
|
||||
```
|
||||
|
||||
Le total liquidity correspond à :
|
||||
|
||||
```text
|
||||
deposit 11
|
||||
withdraw 14
|
||||
lp_change_event 25
|
||||
-------------------
|
||||
total 50
|
||||
```
|
||||
|
||||
## `lp_change_event`
|
||||
|
||||
`lp_change_event` est un event bidirectionnel :
|
||||
|
||||
- `changeType = 0` : add/deposit liquidity ;
|
||||
- `changeType = 1` : remove/withdraw liquidity.
|
||||
|
||||
La coverage statique utilise donc `event_family = liquidity`, pas `liquidity_add`. La matérialisation résout le sens au niveau payload. Les events qui ne contiennent pas directement les mints sont enrichis via le contexte pool/pair local ou via le sibling `deposit` / `withdraw` déjà matérialisé dans la même transaction/replay.
|
||||
|
||||
Validation finale :
|
||||
|
||||
```text
|
||||
changeType 0 -> 11 decoded / 11 liquidity / 0 trade
|
||||
changeType 1 -> 14 decoded / 14 liquidity / 0 trade
|
||||
```
|
||||
|
||||
## `initialize_with_permission`
|
||||
|
||||
`initialize_with_permission` est traité comme pool lifecycle only.
|
||||
|
||||
Validation finale :
|
||||
|
||||
```text
|
||||
raydium_cpmm.initialize 5 decoded / 5 lifecycle / 0 admin / 0 trade
|
||||
raydium_cpmm.initialize_with_permission 4 decoded / 4 lifecycle / 0 admin / 0 trade
|
||||
```
|
||||
|
||||
Le cleanup de matérialisation supprime les anciennes lignes admin dérivées si elles existent déjà dans la base.
|
||||
|
||||
## Entrées non observées
|
||||
|
||||
Solscan avec filtre `instruction=` n'a pas retourné de transaction locale utile pour :
|
||||
|
||||
- `close_permission_pda` / `9c5420764587467b` ;
|
||||
- `update_pool_status` / `82576c062ee0757b`.
|
||||
|
||||
Ces entrées restent donc :
|
||||
|
||||
```text
|
||||
upstream_git_mapped_unverified
|
||||
```
|
||||
|
||||
Absence Solscan ne signifie pas absence on-chain absolue, surtout si l'index UI ne couvre pas tout l'historique. Cela suffit cependant pour ne pas les promouvoir sans corpus local.
|
||||
|
||||
## Instruction audit inconnue
|
||||
|
||||
Le discriminator suivant a été observé localement :
|
||||
|
||||
```text
|
||||
40f4bc78a7e9690a
|
||||
```
|
||||
|
||||
Il produit actuellement `raydium_cpmm.instruction_audit` avec `tradeCandidate=false` / `candleCandidate=false`. Il n'est pas nommé dans la tranche `0.7.48`, faute de preuve upstream/corpus suffisante.
|
||||
|
||||
## Recherche Solscan retenue
|
||||
|
||||
La page programme Solscan et l'onglet Program IDL sont utiles pour accélérer la recherche :
|
||||
|
||||
```text
|
||||
https://solscan.io/account/CPMMoo8L3F4NbTegBCKVNunggL7H1ZpdTHKxQB5qKP1C#programIdl
|
||||
```
|
||||
|
||||
Le filtre `instruction=<discriminator>` est documenté comme méthode pratique de découverte de signatures à backfiller localement, par exemple :
|
||||
|
||||
```text
|
||||
https://solscan.io/account/CPMMoo8L3F4NbTegBCKVNunggL7H1ZpdTHKxQB5qKP1C?instruction=f223c68952e1f2b6&instruction=b712469c946da122&hide_spam=true&hide_failed=true&show_related=false&sort=desc
|
||||
```
|
||||
|
||||
Solscan reste une aide de recherche, pas une source de vérité métier.
|
||||
|
||||
## Table technique ajoutée
|
||||
|
||||
`k_sol_instruction_observations` est ajoutée comme table technique d'index local. Elle permet de retrouver les signatures observées par `decoder_code`, `instruction_name` et `discriminator_hex`, sans créer de nouvelle table métier.
|
||||
|
||||
Exemple :
|
||||
|
||||
```sql
|
||||
SELECT
|
||||
instruction_name,
|
||||
discriminator_hex,
|
||||
COUNT(*) AS observed_count,
|
||||
COUNT(DISTINCT signature) AS tx_count
|
||||
FROM k_sol_instruction_observations
|
||||
WHERE decoder_code = 'raydium_cpmm'
|
||||
GROUP BY instruction_name, discriminator_hex
|
||||
ORDER BY observed_count DESC;
|
||||
```
|
||||
|
||||
## Invariants validés
|
||||
|
||||
- `swap_event` ne produit aucun trade/candle.
|
||||
- `deposit`, `withdraw`, `lp_change_event`, fees, admin/config et lifecycle gardent `trade_count=0`.
|
||||
- Les transactions failed restent non matérialisées en trade/candle.
|
||||
- Les side effects SPL Token / Token-2022 (`burn`, `transfer`, `transferChecked`, `closeAccount`) restent hors decoder métier CPMM direct et devront passer par une future table transversale si plusieurs DEX le justifient.
|
||||
- Aucun program id n'est promu sans corpus local.
|
||||
|
||||
## État de clôture
|
||||
|
||||
`0.7.48 raydium_cpmm` est clôturable avec deux entrées connues mais non observées :
|
||||
|
||||
```text
|
||||
close_permission_pda
|
||||
update_pool_status
|
||||
```
|
||||
|
||||
La prochaine tranche fonctionnelle est `0.7.49 raydium_clmm`.
|
||||
72
docs/reports/RAYDIUM_CPMM_UPSTREAM_COVERAGE_REVIEW_PRE22.md
Normal file
72
docs/reports/RAYDIUM_CPMM_UPSTREAM_COVERAGE_REVIEW_PRE22.md
Normal file
@@ -0,0 +1,72 @@
|
||||
# Raydium CPMM upstream coverage review — 0.7.49-pre.22
|
||||
|
||||
## Scope
|
||||
|
||||
Compared local `raydium_cpmm` coverage against the currently referenced upstream surfaces:
|
||||
|
||||
- Solscan program IDL for `CPMMoo8L3F4NbTegBCKVNunggL7H1ZpdTHKxQB5qKP1C`.
|
||||
- `sevenlabs-hq/carbon` `raydium-cpmm-decoder`.
|
||||
- `0xfnzero/sol-parser-sdk` `idl/raydium_cpmm.json`.
|
||||
- `pinax-network/substreams-solana-idls` `src/raydium/cpmm`.
|
||||
- Raydium official `raydium-cp-swap` source.
|
||||
|
||||
## Local CPMM coverage entries
|
||||
|
||||
Local registry currently lists 16 `raydium_cpmm` entries:
|
||||
|
||||
### Instructions
|
||||
|
||||
- `close_permission_pda` — `9c5420764587467b`
|
||||
- `collect_creator_fee` — `1416567bc61cdb84`
|
||||
- `collect_fund_fee` — `a78a4e95dfc2067e`
|
||||
- `collect_protocol_fee` — `8888fcddc2427e59`
|
||||
- `create_amm_config` — `8934edd4d7756c68`
|
||||
- `create_permission_pda` — `878802d889a9b5ca`
|
||||
- `deposit` — `f223c68952e1f2b6`
|
||||
- `initialize` — `afaf6d1f0d989bed`
|
||||
- `initialize_with_permission` — `3f37fe4131b25979`
|
||||
- `swap_base_input` — `8fbe5adac41e33de`
|
||||
- `swap_base_output` — `37d96256a34ab4ad`
|
||||
- `update_amm_config` — `313cae889a1c74c8`
|
||||
- `update_pool_status` — `82576c062ee0757b`
|
||||
- `withdraw` — `b712469c946da122`
|
||||
|
||||
### Anchor / Program-data events
|
||||
|
||||
- `lp_change_event` — `79a3cdc939da753c`
|
||||
- `swap_event` — `40c6cde8260871e2`
|
||||
|
||||
## Upstream comparison
|
||||
|
||||
Carbon `raydium-cpmm-decoder` exposes the same 14 instruction modules and the two event-like discriminator entries, `lp_change_event` and `swap_event`.
|
||||
|
||||
`sol-parser-sdk` `idl/raydium_cpmm.json` exposes the core CPMM instruction set (`createAmmConfig`, `updateAmmConfig`, `updatePoolStatus`, `collectProtocolFee`, `collectFundFee`, `initialize`, `deposit`, `withdraw`, `swapBaseInput`, `swapBaseOutput`) and IDL events `LpChangeEvent` and `SwapEvent`. The local registry also includes the permission and creator-fee entries present in Carbon / Raydium source.
|
||||
|
||||
The official Raydium `raydium-cp-swap` source lists the CPMM program ID and the main program instructions including admin/config, fee collection, permission PDA, initialize, initialize with permission, deposit, withdraw, swap base input, and swap base output.
|
||||
|
||||
## Finding
|
||||
|
||||
No missing CPMM instruction/event discriminator was identified relative to the reviewed Carbon / Raydium / fnzero / Pinax surfaces available during this check.
|
||||
|
||||
## Current local caveat
|
||||
|
||||
CPMM remains covered by the earlier 0.7.48 tranche. The useful final validation remains DB-side:
|
||||
|
||||
```sql
|
||||
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 = 'raydium_cpmm'
|
||||
ORDER BY entry_kind, entry_name, discriminator_hex;
|
||||
```
|
||||
|
||||
Any future upstream addition should appear as a new entry in Carbon/Solscan/IDL and should be added to `upstream_registry_generated.rs`, `known_local_event_kind` only after local decoder support exists, and then validated with local corpus evidence.
|
||||
Reference in New Issue
Block a user