-
Notifications
You must be signed in to change notification settings - Fork 131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
0.7.0
Release
#255
base: main
Are you sure you want to change the base?
0.7.0
Release
#255
Conversation
Update Uv2 sync to use batch contracts
…estry/pamms-rs into 0xkitsune/discovery-sync
Osiris/balancer
docs(amm): Adding an AMM
feat(amms): Add `Token` type instead of specifying `token_address` and `token_decimals` directly on pool.
Implement `From<Address>` for `Token`
function liquidity() external view returns (uint128); | ||
} | ||
|
||
// /** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this code be removed now?
/// @title Pool state that can change | ||
/// @notice These methods compose the pool's state, and can change with any frequency including multiple times | ||
/// per transaction | ||
interface IUniswapV3PoolState { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dedupe interface?
} | ||
} | ||
|
||
pub fn q64_to_float(num: u128) -> Result<f64, AMMError> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dedupe with utils in src/amms/float.rs
?
self.state.keys().cloned().collect() | ||
} | ||
|
||
/// Calculates a f64 representation of base token price in the AMM. This is a "tax inclusive" spot approximation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It appears that the other pools don't include fees in this method. I think either approach is ok, but should probably be consistent and specified in the trait doc.
|
||
current_state.amount_calculated -= I256::from_raw(step.amount_out); | ||
|
||
// TODO: adjust for fee protocol |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does protocol fee matter for us? My understanding is that comes out of the fees already paid.
.cloned() | ||
.map(|amm| { | ||
let pool_address = amm.address(); | ||
// TODO FIXME: Need to update this when we have balancer/v3 support |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems unfinished
Ref #235