Skip to content

Commit

Permalink
feat - set fee/stable when populating ve33 pools
Browse files Browse the repository at this point in the history
  • Loading branch information
Dvisacker committed Dec 23, 2024
1 parent 6664563 commit baa74ab
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/amm/ve33/batch_request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,15 @@ pub fn populate_ve33_pool_data(
pool.factory = tokens[8]
.as_address()
.ok_or(AMMError::BatchRequestError(pool.address))?;

pool.stable = tokens[9].as_bool().unwrap_or(false);

if pool.stable {
pool.fee = 5; // 0.05%
} else {
pool.fee = 30; // 0.3%
}

Ok(())
}

Expand Down
2 changes: 1 addition & 1 deletion src/amm/ve33/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ impl AutomatedMarketMaker for Ve33Pool {
P: Provider<T, N>,
{
let (reserve_0, reserve_1) = self.get_reserves(provider.clone()).await?;
tracing::info!(?reserve_0, ?reserve_1, address = ?self.address, "UniswapV2 sync");
tracing::info!(?reserve_0, ?reserve_1, address = ?self.address, "Ve33 sync");

self.reserve_0 = reserve_0;
self.reserve_1 = reserve_1;
Expand Down

0 comments on commit baa74ab

Please sign in to comment.