Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
5c1b874
PR08: seam implementations and a single auction cycle
squadgazzz Aug 19, 2026
760fcae
PR09: settlement observation over execution windows
squadgazzz Aug 19, 2026
875dacf
PR10: binary wiring, liveness, and the metrics server
squadgazzz Aug 19, 2026
89c07e4
PR14: wire the indexer binary
squadgazzz Aug 19, 2026
604a333
PR15: settlement decode updates order fill state
squadgazzz Aug 19, 2026
d796441
PR15.6: adopt cow-solana-rpc in the indexer
squadgazzz Aug 19, 2026
c71fa72
Reject zero competition parameters at config load and panic when a su…
squadgazzz Aug 19, 2026
1e84f50
Use the shared database pool config in the autopilot
squadgazzz Aug 19, 2026
558bff1
Merge remote-tracking branch 'origin/main' into solana-indexer/PR15-f…
squadgazzz Aug 19, 2026
0839c15
Merge branch 'solana-indexer/PR15-fill-state' into solana-indexer/PR1…
squadgazzz Aug 19, 2026
dc194bc
Make the solve budget a wall-clock duration like the EVM autopilot
squadgazzz Aug 20, 2026
25db78c
Merge branch 'ilya/be-184-pr08-seam-implementations-single-auction-cy…
squadgazzz Aug 20, 2026
c413b06
Configure the solve deadline as a duration
squadgazzz Aug 20, 2026
6e3eb7b
Carry a wall-clock solve deadline and a settle submission deadline sl…
squadgazzz Aug 20, 2026
8520615
Merge branch 'ilya/be-184-pr08-seam-implementations-single-auction-cy…
squadgazzz Aug 20, 2026
7509fc2
Merge branch 'ilya/be-185-pr09-settlement-observation' into ilya/be-1…
squadgazzz Aug 20, 2026
fcb2ddd
Drop the auction tip field, the wall-clock deadline removed its last …
squadgazzz Aug 20, 2026
29a1041
Merge branch 'ilya/be-184-pr08-seam-implementations-single-auction-cy…
squadgazzz Aug 20, 2026
e30f76f
Merge branch 'ilya/be-185-pr09-settlement-observation' into ilya/be-1…
squadgazzz Aug 20, 2026
cb6dff6
Keep top-level config keys above the database section in the example
squadgazzz Aug 20, 2026
a17ad06
Re-pin the settlement interface to the released cow-settlement-interf…
squadgazzz Aug 20, 2026
c49b871
Drop the mutable account borrows the shared-slice parse API no longer…
squadgazzz Aug 20, 2026
63d3126
Default the settlement program id to the official deployment the inte…
squadgazzz Aug 20, 2026
cbaed36
Update the buffer decode doc to the typed accounts API
squadgazzz Aug 20, 2026
31ce889
Let the example exercise the default settlement program id
squadgazzz Aug 20, 2026
ccde2a0
Merge remote-tracking branch 'origin/main' into ilya/be-185-pr09-sett…
squadgazzz Aug 20, 2026
021a443
Merge branch 'ilya/be-185-pr09-settlement-observation' into ilya/be-1…
squadgazzz Aug 20, 2026
d8c06b6
Name the window operations after what they do
squadgazzz Aug 20, 2026
9b79c2b
Merge branch 'ilya/be-185-pr09-settlement-observation' into ilya/be-1…
squadgazzz Aug 20, 2026
bd1b3fd
Write order events for status tracking
squadgazzz Aug 21, 2026
1006c69
Merge remote-tracking branch 'origin/main' into ilya/be-185-pr09-sett…
squadgazzz Aug 21, 2026
81cc46e
Merge branch 'ilya/be-185-pr09-settlement-observation' into ilya/be-1…
squadgazzz Aug 21, 2026
181b675
Merge branch 'ilya/be-186-pr10-wiring-liveness-devnet-runbook' into s…
squadgazzz Aug 21, 2026
f737a8f
Ship the order events migration with the writer
squadgazzz Aug 21, 2026
73b2ed4
Write event labels through the shared enum
squadgazzz Aug 21, 2026
0662cff
Keep the traded write best effort and fix the test race
squadgazzz Aug 21, 2026
b541eff
Trim comments to essence
squadgazzz Aug 21, 2026
64a5999
Trim the Competition doc to essence
squadgazzz Aug 24, 2026
750f397
Merge branch 'ilya/be-186-pr10-wiring-liveness-devnet-runbook' into s…
squadgazzz Aug 24, 2026
63fb2c7
Write created and traded order events with their rows
squadgazzz Aug 24, 2026
081b065
Leave the traded events to the indexer
squadgazzz Aug 24, 2026
734ca4f
Merge remote-tracking branch 'origin/main' into solana-indexer/PR15-f…
squadgazzz Aug 24, 2026
c5afd6d
Merge branch 'solana-indexer/PR15-fill-state' into solana-indexer/PR1…
squadgazzz Aug 24, 2026
843b79a
Merge branch 'solana-indexer/PR15.6-adopt-cow-solana-rpc' into solana…
squadgazzz Aug 24, 2026
d3b28b9
Merge branch 'solana-indexer/be-218-repin-cow-settlement-interface' i…
squadgazzz Aug 24, 2026
e05748e
Skip repeated event labels like EVM does
squadgazzz Aug 24, 2026
ba35862
Own the order event label enum in the solana schema
squadgazzz Aug 24, 2026
82644e3
Merge remote-tracking branch 'origin/main' into solana-indexer/PR15.6…
squadgazzz Aug 24, 2026
f7ec2a7
Merge branch 'solana-indexer/PR15.6-adopt-cow-solana-rpc' into solana…
squadgazzz Aug 24, 2026
f97e23d
Merge branch 'solana-indexer/be-218-repin-cow-settlement-interface' i…
squadgazzz Aug 24, 2026
61e2f0b
Merge remote-tracking branch 'origin/main' into solana-indexer/be-218…
squadgazzz Aug 24, 2026
391a21e
Merge branch 'solana-indexer/be-218-repin-cow-settlement-interface' i…
squadgazzz Aug 24, 2026
9b8ebef
Write the settlement outcomes as literals
squadgazzz Aug 24, 2026
5348b84
Merge branch 'ilya/be-185-pr09-settlement-observation' into ilya/be-1…
squadgazzz Aug 24, 2026
2554deb
Merge branch 'ilya/be-186-pr10-wiring-liveness-devnet-runbook' into s…
squadgazzz Aug 24, 2026
bc786bd
State the settlement attribution constraint
squadgazzz Aug 24, 2026
65112e0
Merge branch 'ilya/be-185-pr09-settlement-observation' into ilya/be-1…
squadgazzz Aug 24, 2026
e8f9ca9
Merge branch 'ilya/be-186-pr10-wiring-liveness-devnet-runbook' into s…
squadgazzz Aug 24, 2026
6df9bcd
Move the settlement window queries into the db layer
squadgazzz Aug 24, 2026
4e6b299
Merge branch 'ilya/be-185-pr09-settlement-observation' into ilya/be-1…
squadgazzz Aug 24, 2026
ff84a22
Drop the settlement read the single-query close replaced
squadgazzz Aug 24, 2026
ff9b940
Merge branch 'ilya/be-185-pr09-settlement-observation' into ilya/be-1…
squadgazzz Aug 24, 2026
60f74fb
Merge branch 'ilya/be-186-pr10-wiring-liveness-devnet-runbook' into s…
squadgazzz Aug 24, 2026
b7d40da
Fold the settlement window types into one
squadgazzz Aug 24, 2026
cf362a0
Connect the crate's tests through one helper
squadgazzz Aug 24, 2026
6330161
Merge branch 'ilya/be-185-pr09-settlement-observation' into ilya/be-1…
squadgazzz Aug 24, 2026
29aaefe
Merge branch 'ilya/be-186-pr10-wiring-liveness-devnet-runbook' into s…
squadgazzz Aug 24, 2026
a115d96
Own the cycle loop and the submission deadline in the run loop
squadgazzz Aug 25, 2026
4516063
Merge branch 'ilya/be-186-pr10-wiring-liveness-devnet-runbook' into s…
squadgazzz Aug 25, 2026
31614ec
Configure the metrics port and group the on-chain addresses
squadgazzz Aug 25, 2026
228114e
Merge branch 'ilya/be-186-pr10-wiring-liveness-devnet-runbook' into s…
squadgazzz Aug 25, 2026
4fc8670
Store order events without blocking the cycle
squadgazzz Aug 25, 2026
2536d43
Serialize and dedupe the order event insert
squadgazzz Aug 25, 2026
0f58691
Name the advisory lock like the leader lock does
squadgazzz Aug 25, 2026
9852b66
Trim comments to essence
squadgazzz Aug 25, 2026
507cd79
Wait for the detached order event writes in the cycle test
squadgazzz Aug 25, 2026
4d44bf5
Merge remote-tracking branch 'origin/main' into ilya/be-185-pr09-sett…
squadgazzz Aug 25, 2026
b9c8eee
Merge branch 'ilya/be-185-pr09-settlement-observation' into ilya/be-1…
squadgazzz Aug 25, 2026
af23f59
Merge branch 'ilya/be-186-pr10-wiring-liveness-devnet-runbook' into s…
squadgazzz Aug 25, 2026
a89e73a
Merge branch 'solana-autopilot/be-232-order-events' into solana-index…
squadgazzz Aug 25, 2026
36bdeae
Bind the order event label as the solana-owned enum
squadgazzz Aug 25, 2026
3191c07
Merge branch 'solana-autopilot/be-232-order-events' into solana-index…
squadgazzz Aug 25, 2026
7195ba6
Take the order event label as the typed enum
squadgazzz Aug 25, 2026
1028865
Merge remote-tracking branch 'origin/main' into solana-indexer/be-242…
squadgazzz Aug 25, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 40 additions & 1 deletion crates/solana-indexer/src/persistence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use {
slot::Slot,
},
bigdecimal::BigDecimal,
database::solana::OrderEventLabel,
solana_sdk::pubkey::Pubkey,
sqlx::{PgPool, PgTransaction},
std::collections::HashMap,
Expand Down Expand Up @@ -146,7 +147,7 @@ ON CONFLICT (order_uid) DO NOTHING
};
// creation_timestamp is the indexing time, the stream carries no
// block time.
sqlx::query(
let inserted = sqlx::query(
r#"
INSERT INTO solana.orders (uid, owner, sell_token, buy_token, sell_token_account,
buy_token_account, sell_amount, buy_amount, valid_to, kind,
Expand All @@ -172,6 +173,27 @@ ON CONFLICT (uid) DO NOTHING
.bind(order.app_data.to_vec())
.bind(order.order_pda.to_bytes())
.execute(&mut **tx)
.await?
.rows_affected();
if inserted > 0 {
Self::insert_order_event(tx, order.order_uid.0, OrderEventLabel::Created).await?;
}
Ok(())
}

/// Append one auction-progress event, in the caller's transaction so the
/// event lands atomically with the row that caused it.
async fn insert_order_event(
tx: &mut PgTransaction<'_>,
order_uid: [u8; 32],
label: OrderEventLabel,
) -> Result<(), PersistenceError> {
sqlx::query(
"INSERT INTO solana.order_events (order_uid, timestamp, label) VALUES ($1, now(), $2)",
)
.bind(order_uid)
.bind(label)
.execute(&mut **tx)
.await?;
Ok(())
Comment thread
squadgazzz marked this conversation as resolved.
}
Expand Down Expand Up @@ -254,6 +276,7 @@ ON CONFLICT DO NOTHING
if inserted == 0 {
return Ok(());
}
Self::insert_order_event(tx, order_uid, OrderEventLabel::Traded).await?;
let updated = sqlx::query(
r#"
UPDATE solana.order_pda
Expand Down Expand Up @@ -620,6 +643,22 @@ VALUES ($1, $2, $2, $2, $2, $2, $3, $4, $5, $6, false, $2, now(), $7)
.unwrap();
assert_eq!((settlements, trade_uids), (2, vec![uid.to_vec()]));
assert_eq!(postgres.last_indexed_slot().await.unwrap(), Some(Slot(20)));

// One event per actually-inserted row, stable under the replay: the
// fresh order was created, the seeded order (whose insert the
// conflict skipped) only traded.
let events: Vec<(Vec<u8>, String)> =
sqlx::query_as("SELECT order_uid, label::text FROM solana.order_events ORDER BY label")
.fetch_all(&pool)
.await
.unwrap();
assert_eq!(
events,
vec![
(fresh_uid.to_vec(), "created".to_string()),
(uid.to_vec(), "traded".to_string()),
]
);
}

#[tokio::test]
Expand Down
1 change: 1 addition & 0 deletions crates/solana-indexer/src/test_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ pub(crate) async fn wipe(pool: &PgPool) {
"solana.settlements",
"solana.order_pda",
"solana.orders",
"solana.order_events",
"solana.dead_letter",
"solana.indexer_state",
] {
Expand Down
Loading