Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
13 changes: 13 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ console-subscriber = "0.5.0"
const_format = "0.2.32"
const-hex = "1.17.0"
contracts = { path = "contracts/generated/contracts-facade" }
cow-settlement-client = "0.2"
cow-settlement-interface = "0.2"
cow-solana-rpc = { path = "crates/cow-solana-rpc" }
dashmap = "6.1.0"
database = { path = "crates/database" }
Expand Down Expand Up @@ -127,6 +129,7 @@ signature-validator = { path = "crates/signature-validator" }
simulator = { path = "crates/simulator" }
solana-client = "4"
solana-commitment-config = "3"
solana-compute-budget-interface = "3"
solana-driver = { path = "crates/solana-driver" }
solana-indexer = { path = "crates/solana-indexer" }
solana-rpc-client = "4"
Expand All @@ -136,6 +139,7 @@ solana-testlib = { path = "crates/solana-testlib" }
solver = { path = "crates/solver" }
solvers = { path = "crates/solvers" }
solvers-dto = { path = "crates/solvers-dto" }
spl-associated-token-account-interface = "2"
spl-token-2022-interface = "2"
spl-token-interface = "2"
sqlx = {
Expand Down
3 changes: 3 additions & 0 deletions crates/solana-driver/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ chrono = { workspace = true, default-features = false, features = ["clock"] }
clap = { workspace = true }
configs = { workspace = true }
const-hex = { workspace = true }
cow-settlement-client = { workspace = true }
cow-settlement-interface = { workspace = true }
cow-solana-rpc = { workspace = true }
futures = { workspace = true }
humantime-serde = { workspace = true }
Expand All @@ -30,6 +32,7 @@ serde = { workspace = true }
serde-ext = { workspace = true }
serde_json = { workspace = true }
serde_with = { workspace = true }
solana-compute-budget-interface = { workspace = true }
solana-sdk = { workspace = true }
thiserror = { workspace = true }
tikv-jemallocator = { workspace = true }
Expand Down
4 changes: 2 additions & 2 deletions crates/solana-driver/example.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Example configuration for the Solana driver.

[chain]
# Placeholder — replace with the CoW Settlement program id.
settlement-program-id = "MooohhPEAAHwAwEozL7JPEmnDvaahuUpccYN4Yb8ccK"
# The CoW Settlement program id (v0.2.0, stable mainnet address).
settlement-program-id = "J516Mv7YvvvJyMvNEca8tWNTJyDHbFpzwDZD96BNfR3w"

[rpc]
endpoint = "https://api.mainnet-beta.solana.com"
Expand Down
4 changes: 2 additions & 2 deletions crates/solana-driver/src/domain/auction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ pub struct Auction {
}

/// One order available for solvers to fill.
#[derive(Clone, Debug)]
#[derive(Clone, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct Order {
pub uid: OrderUid,
pub owner: Pubkey,
Expand All @@ -80,7 +80,7 @@ pub struct Order {
}

/// Direction of the trade.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, Serialize)]
#[serde(rename_all = "camelCase")]
pub enum Side {
Sell,
Expand Down
2 changes: 2 additions & 0 deletions crates/solana-driver/src/domain/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
pub mod auction;
pub mod competition;
pub mod order_uid;
pub mod settlement;
pub mod slot;
pub mod solution;

pub use self::{
auction::{Auction, Id, Order, Side},
competition::Competition,
settlement::Settlement,
slot::Slot,
solution::{Solution, Trade},
};
2 changes: 1 addition & 1 deletion crates/solana-driver/src/domain/order_uid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use std::{fmt, str::FromStr};

/// A 32-byte CoW Protocol order identifier, equal to `hash(intent)`, serialized
/// as a `0x`-prefixed hex string on the wire.
#[derive(Clone, Copy, PartialEq, Eq, Hash)]
#[derive(Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct OrderUid(pub [u8; 32]);

impl fmt::Display for OrderUid {
Expand Down
Loading
Loading