-
Notifications
You must be signed in to change notification settings - Fork 69
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
feat: support assets with xyk dot pools as fee asset #852
Conversation
Crate versions that have been updated:
Runtime version has been increased. |
… and use the same amount out for buyfor swap
…icient-asset-in-dca # Conflicts: # pallets/dca/src/tests/on_initialize.rs # pallets/dca/src/weights.rs # runtime/hydradx/src/weights/pallet_dca.rs
…icient-asset-in-dca # Conflicts: # Cargo.lock # integration-tests/Cargo.toml # traits/Cargo.toml
…icient-asset-in-dca # Conflicts: # Cargo.lock # integration-tests/Cargo.toml # pallets/liquidity-mining/Cargo.toml # pallets/xyk/Cargo.toml
.ok_or(ArithmeticError::Overflow)?; | ||
Self::unallocate_amount(schedule_id, schedule, effective_amount_in)?; | ||
|
||
let fee_in_dot = Self::convert_to_polkadot_native_asset(Self::weight_to_fee(weight_to_charge))?; |
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.
do you need to do this again ?
should not this be equal to fee_amount_in_sold_asset?
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.
fee_amount_in_sold_asset
is different from fee_in_dot
.
Because the amount_in
(so DCA fee asset) is not necessarly DOT.
But we need to calculate the fee_in_dot
, so we know how much we should do a buy trade for, within the FeeAsset-DOT xyk pool
This PR is about:
*A non-fee payment asset is any asset whose price is not calculated within the multi-payment pallet. For example we also want to support WUD which is a sufficient asset but not tracked in multi pallets.
TODO:
ExtrinsicBaseWeight
withdraw_fee
(used forExtrinsicBaseWeight
) on reference machine(Benchmark withdraw_fee and check if it is not bigger than
ExtrinsicBaseWeight
. If so, then adjust. "The base weight contains all the shit for validating tx and doing all the on initialize and other stuff for every transaction so we should probably increase it anyway... But there should be a guide on how to bench this from shawn somewhere I think")