-
Notifications
You must be signed in to change notification settings - Fork 15
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: cf_pool_swap_rate_v3
with broker fee and DCA support
#5386
Conversation
and affiliate fees as well as DCA. WIP: Need to write tests
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #5386 +/- ##
======================================
- Coverage 72% 71% -0%
======================================
Files 486 486
Lines 85863 85806 -57
Branches 85863 85806 -57
======================================
- Hits 61515 61331 -184
- Misses 21533 21612 +79
- Partials 2815 2863 +48 ☔ View full report in Codecov by Sentry. |
Used `try_execute_without_violations` instead of `swap_with_network_fee` to estimate swap result.
* origin/main: feat: add version and affiliates to UTXO encoding (#5385) chore: bump all versions to 1.8.0 and remove old migrations. (#5327) feat: update custom_rpc, runtime_api and broker api for broker level screening (#5341) tests: Bouncer test for broker level screening (#5377) Feat: Private Broker Channel Witnessing (#5383) # Conflicts: # state-chain/runtime/src/lib.rs
Should we explicitly deprecate |
I'm making some changes. Going to version the runtime rpc. |
} | ||
|
||
#[derive(Serialize, Deserialize, Clone)] | ||
pub struct RpcSwapOutputV3 { |
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.
I removed this type because it just adds a new field, which is considered a non-breaking change in the json api.
// READ THIS BEFORE UPDATING THIS TRAIT: | ||
// | ||
// ## When changing an existing method: | ||
// - Bump the api_version of the trait, for example from #[api_version(2)] to #[api_version(3)]. | ||
// - Annotate the old method with #[changed_in($VERSION)] where $VERSION is the *new* api_version, | ||
// for example #[changed_in(3)]. | ||
// - Handle the old method in the custom rpc implementation using runtime_api().api_version(). | ||
// | ||
// ## When adding a new method: | ||
// - Bump the api_version of the trait, for example from #[api_version(2)] to #[api_version(3)]. | ||
// - Create a dummy method with the same name, but no args and no return value. | ||
// - Annotate the dummy method with #[changed_in($VERSION)] where $VERSION is the *new* | ||
// api_version. | ||
// - Handle the dummy method gracefully in the custom rpc implementation using | ||
// runtime_api().api_version(). |
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.
I've been meaning to add this - now seems like a good time.
#[changed_in(2)] | ||
fn cf_pool_simulate_swap( |
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.
I think we can remove this entirely after the next release.
cf_pool_swap_rate_v3
with broker fee and DCA supportcf_pool_swap_rate_v3
with broker fee and DCA support
* Add a V3 for `cf_pool_swap_rate_v3` call that will consider broker and affiliate fees as well as DCA. WIP: Need to write tests * Removed Affiliate fees Used `try_execute_without_violations` instead of `swap_with_network_fee` to estimate swap result. * fix: - remove v3 types/methods - add versioning to runtime api - avoid clone --------- Co-authored-by: Daniel <daniel@chainflip.io>
* Add a V3 for `cf_pool_swap_rate_v3` call that will consider broker and affiliate fees as well as DCA. WIP: Need to write tests * Removed Affiliate fees Used `try_execute_without_violations` instead of `swap_with_network_fee` to estimate swap result. * fix: - remove v3 types/methods - add versioning to runtime api - avoid clone --------- Co-authored-by: Daniel <daniel@chainflip.io>
Pull Request
Closes: PRO-1690
Checklist
Please conduct a thorough self-review before opening the PR.
Summary
Add a V3 for
cf_pool_swap_rate_v3
call that will consider broker and affiliate fees as well as DCA.