Skip to content
Open
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
f8e40c2
Liquorice protocol initial implementation
markin-io Jan 29, 2026
986be40
Set up liquorice client in rfq_quickstart
markin-io Jan 30, 2026
96bb0b6
Fix min amount filtration
markin-io Jan 30, 2026
f623c73
Cleanup and fixes
markin-io Feb 17, 2026
ec1dee3
Formatting
markin-io Feb 17, 2026
c6b950e
Merge branch 'main' into feat/liquorice-protocol-integration
markin-io Feb 17, 2026
7c7daa8
Fix clippy
markin-io Feb 18, 2026
eff8696
rfq_quickstart cleanup
markin-io Feb 18, 2026
e8a1233
fix: provide all price levels for the component
markin-io Feb 18, 2026
24def48
Update pricing and amount calculations in state
markin-io Feb 18, 2026
9cb755e
Formatting
markin-io Feb 18, 2026
6fec9ad
Fine-tune firm quote level picking
markin-io Feb 19, 2026
15141d3
Fmt
markin-io Feb 19, 2026
81d4d88
Naming refactoring
markin-io Feb 23, 2026
6eb6e47
Optimize price component creation
markin-io Feb 23, 2026
d51ee19
Remove redundant tests and add tests for process quote response
markin-io Feb 23, 2026
39a633c
Refactor price related code
markin-io Feb 23, 2026
6e1ac90
Increase max gas in rfq_quickstart
markin-io Feb 23, 2026
2ad58b6
Clippy and formatting
markin-io Feb 23, 2026
388a8d7
Merge branch 'main' into feat/liquorice-protocol-integration
markin-io Feb 23, 2026
6864060
Cleanup
markin-io Feb 23, 2026
758a4ed
Increase gas limit for execution
markin-io Feb 23, 2026
1029e00
Merge branch 'main' into feat/liquorice-protocol-integration
markin-io Mar 2, 2026
e72a195
Merge branch 'main' into feat/liquorice-protocol-integration
markin-io Mar 2, 2026
0b2a390
Merge branch 'main' into feat/liquorice-protocol-integration
markin-io Mar 3, 2026
e57ec1f
Merge branch 'main' into feat/liquorice-protocol-integration
markin-io Mar 5, 2026
f745b5d
Fix PR comments
markin-io Mar 10, 2026
5274dc1
Add Liquorice to RFQ stream processor
markin-io Mar 10, 2026
1342732
Update integration test
markin-io Mar 10, 2026
63814bc
fmt
markin-io Mar 10, 2026
40c2046
Merge branch 'feat/liquorice-protocol-integration' of github.com:mark…
markin-io Mar 10, 2026
5b79811
Merge branch 'main' into feat/liquorice-protocol-integration
markin-io Mar 10, 2026
cd3dc00
Fix compilation
markin-io Mar 10, 2026
1ab2f7c
Merge branch 'main' into feat/liquorice-protocol-integration
markin-io Mar 19, 2026
946cc67
Merge branch 'main' into feat/liquorice-protocol-integration
markin-io Mar 31, 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
22 changes: 18 additions & 4 deletions examples/rfq_quickstart/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ use tycho_simulation::{
protocols::{
bebop::{client_builder::BebopClientBuilder, state::BebopState},
hashflow::{client_builder::HashflowClientBuilder, state::HashflowState},
liquorice::{client_builder::LiquoriceClientBuilder, state::LiquoriceState},
},
stream::RFQStreamBuilder,
},
Expand Down Expand Up @@ -114,10 +115,13 @@ async fn main() {
let (bebop_user, bebop_key) = (env::var("BEBOP_USER").ok(), env::var("BEBOP_KEY").ok());
let (hashflow_user, hashflow_key) =
(env::var("HASHFLOW_USER").ok(), env::var("HASHFLOW_KEY").ok());
let (liquorice_user, liquorice_key) =
(env::var("LIQUORICE_USER").ok(), env::var("LIQUORICE_KEY").ok());
if (bebop_user.is_none() || bebop_key.is_none()) &&
(hashflow_user.is_none() || hashflow_key.is_none())
(hashflow_user.is_none() || hashflow_key.is_none()) &&
(liquorice_user.is_none() || liquorice_key.is_none())
{
panic!("No RFQ credentials found. Please set BEBOP_USER and BEBOP_KEY or HASHFLOW_USER and HASHFLOW_KEY environment variables.");
panic!("No RFQ credentials found. Please set BEBOP_USER and BEBOP_KEY, HASHFLOW_USER and HASHFLOW_KEY, or LIQUORICE_USER and LIQUORICE_KEY environment variables.");
}

println!("Loading tokens from Tycho... {url}", url = tycho_url.as_str());
Expand Down Expand Up @@ -195,14 +199,24 @@ async fn main() {
if let (Some(user), Some(key)) = (hashflow_user, hashflow_key) {
println!("Setting up Hashflow RFQ client...\n");
let hashflow_client = HashflowClientBuilder::new(chain, user, key)
.tokens(rfq_tokens)
.tokens(rfq_tokens.clone())
.tvl_threshold(cli.tvl_threshold)
.poll_time(Duration::from_secs(5))
.build()
.expect("Failed to create Hashflow RFQ client");
rfq_stream_builder =
rfq_stream_builder.add_client::<HashflowState>("hashflow", Box::new(hashflow_client))
}
if let (Some(user), Some(key)) = (liquorice_user, liquorice_key) {
println!("Setting up Liquorice RFQ client...\n");
let liquorice_client = LiquoriceClientBuilder::new(chain, user, key)
.tokens(rfq_tokens.clone())
.tvl_threshold(cli.tvl_threshold)
.build()
.expect("Failed to create Liquorice RFQ client");
rfq_stream_builder =
rfq_stream_builder.add_client::<LiquoriceState>("liquorice", Box::new(liquorice_client))
}

// Start the RFQ stream in a background task
let (tx, mut rx) = mpsc::channel::<Update>(100);
Expand Down Expand Up @@ -441,7 +455,7 @@ async fn main() {
input: Some(AlloyBytes::from(tx.data)),
data: None,
},
gas: Some(800_000u64),
gas: Some(1_000_000u64),
Copy link
Copy Markdown
Author

@markin-io markin-io Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Increased max gas here because of the heavy quotes that use lending pools

chain_id: Some(chain.id()),
max_fee_per_gas: Some(max_fee_per_gas.into()),
max_priority_fee_per_gas: Some(max_priority_fee_per_gas.into()),
Expand Down
20 changes: 20 additions & 0 deletions src/rfq/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,26 @@ pub fn get_hashflow_auth() -> Result<HashflowAuth, RFQError> {
Ok(HashflowAuth { user, key })
}

/// Liquorice authentication configuration
pub struct LiquoriceAuth {
pub solver: String,
pub key: String,
}

/// Read Liquorice authentication from environment variables
/// Returns the LIQUORICE_USER and LIQUORICE_KEY environment variables
pub fn get_liquorice_auth() -> Result<LiquoriceAuth, RFQError> {
let solver = env::var("LIQUORICE_USER").map_err(|_| {
RFQError::InvalidInput("LIQUORICE_USER environment variable is required".into())
})?;

let key = env::var("LIQUORICE_KEY").map_err(|_| {
RFQError::InvalidInput("LIQUORICE_KEY environment variable is required".into())
})?;

Ok(LiquoriceAuth { solver, key })
}

/// Read Bebop authentication from environment variables
/// Returns the BEBOP_USER and BEBOP_KEY environment variables
pub fn get_bebop_auth() -> Result<BebopAuth, RFQError> {
Expand Down
Loading