This repository was archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Asset Conversion pallet #12984
Merged
Merged
Asset Conversion pallet #12984
Changes from 1 commit
Commits
Show all changes
232 commits
Select commit
Hold shift + click to select a range
e8b13b6
Add pallet dex
afc2836
Fmt
1205c76
Add RPC endpoint
ceff65c
Fix RPC
8a9e330
Fix the build
cc98057
Some more fixes
bdbcfec
Add a method to topup pallet's account
106bfab
Add support for multi-currency into Uniques
0fd70fb
Fix the build
b9491ee
Add [transactional] + setup() + fix balances
f5e71e9
Improve tests
04ea005
Fix price quotation
7124090
Code clean up
e5d8a4d
Validate swaps
94cabb4
Fmt
3c8fb00
Update README
00a09b7
add test
gilescope 99c18ec
mint LP assets in a different instance
gilescope 0883485
remove transactional as now the default
gilescope ab04ad3
Merge pull request #1 from paritytech/giles-more
1b28af3
merge master
gilescope 0aabfef
Merge pull request #2 from paritytech/giles-more
69b21d6
Revert "Merge master"
b4f6ea9
Merge pull request #4 from jsidorenko/revert-2-giles-more
2b4696c
Merge branch 'master' into update-master
gilescope eac18b3
Merge pull request #5 from paritytech/update-master
f406417
fix tests post merge.
gilescope a969f85
Merge pull request #6 from paritytech/giles-fix-tests
ccd34ad
attempt to set create origin
gilescope 7c704ad
Internally allocate lp asset id.
gilescope 279327f
Merge pull request #7 from paritytech/giles-set-create-origin
6bc91c8
Simplify
gilescope d73137f
Merge pull request #8 from paritytech/giles-set-create-origin
0289b6d
Merge remote-tracking branch 'origin/master' into giles-set-create-or…
gilescope 5ebb52d
Bump to be in line
gilescope 7700b25
additional bumps to make compile
gilescope fabb0fd
fix compile
gilescope 21a2ac1
Merge pull request #9 from paritytech/giles-set-create-origin
e829cf4
Merge branch 'paritytech:master' into master
jsidorenko a6618f1
less bounds
gilescope aadad92
Merge pull request #10 from jsidorenko/giles-less-bounds
ac650c8
use fungible crates
gilescope eec3dd5
Merge pull request #11 from jsidorenko/giles-currency-to-fungable
3872184
multiasset enum
gilescope 97936d6
only allow native currency pairs
gilescope 68251e9
added slippage tests
gilescope 0a17ab5
transfer into separate method
gilescope 6d78fef
Merge pull request #13 from jsidorenko/giles-multi-asset-enum
f8ee5cc
Add benchmarks + weights
b6b860d
Typos
a97e46a
Clean up
ac091f7
Merge pull request #14 from jsidorenko/js-add-benchmarks
jsidorenko 3cf6239
More tests,
gilescope 236bef4
tighten up naming
gilescope 20ccea2
Merge pull request #15 from jsidorenko/giles-more-tests
7800d10
Default, zero, square root traits not needed
gilescope 4cebb9b
Merge pull request #16 from jsidorenko/giles-more-tests
9ec3871
add keep-alive param
gilescope 36f830f
add insufficient liquidity test
gilescope a482298
Merge pull request #17 from jsidorenko/keep-alive
5b98910
Fix quote() to support u64
514332d
Avoid recording balances twice
gilescope a25f989
cargo fmt
gilescope 1685cfc
Didn't mean to change error type
gilescope 2d29613
temp
gilescope 899045e
Less
gilescope b11b5f5
Rework get_amount_in/get_amount_out
abcc619
Convert other places
2e93e69
Rework the last piece
7009fc1
Merge pull request #18 from jsidorenko/js-check-u64
jsidorenko a386c58
Merge branch 'master' into giles-remove-balances
d6e5ee3
Merge pull request #19 from jsidorenko/giles-remove-balances
45099c9
Typo
22dcf91
Fix benchmarks
38498a9
use hash trait
gilescope a9a291c
Extract a native asset check into the runtime setting
34c9adf
Don't set the metadata
5d959ba
Merge pull request #22 from jsidorenko/js-extract-native-asset-check
jsidorenko 7b0d909
Merge pull request #23 from jsidorenko/js-remove-metadata-creation
jsidorenko e154075
Merge pull request #21 from jsidorenko/giles-hash-trait
b4b99b3
Merge pull request #20 from jsidorenko/js-fix-benchmarks
9c8bd5e
Remove spec file
bb12ad6
Enable multi-assets swaps by default
a4704ee
Refactor conversion into u128
027c7a5
Merge pull request #25 from jsidorenko/js-improve-u128-support
jsidorenko 0c6a515
Merge pull request #24 from jsidorenko/js-enable-multi-assets-swaps
jsidorenko dbcacff
Add path param to swap_token_for_exact_tokens
1e5a054
Fix typo + a bit of refactoring
9df535e
Implement path param for swap_exact_tokens_for_tokens()
66f27f0
Deref
f4ef006
Minor fixes
b7fb31d
Add test with sensible scale values
gilescope 759eb91
Use .windows()
dbf9f12
Fix benchmarks
b974f23
update docs
gilescope c6061b3
Merge pull request #28 from jsidorenko/giles-update-docs
49ca641
Merge pull request #27 from jsidorenko/add-realistic-test
fe926c4
Fix everything :)
72c238a
Merge branch 'master' into js-multi-swaps
92f5486
Chore
9cb0779
Revert
318d488
Merge pull request #26 from jsidorenko/js-multi-swaps
jsidorenko 6958800
Chore
e79d443
prev way of creating sub accounts lead to collisions
gilescope b7608cf
Update frame/dex/src/lib.rs
d9c3d99
Update frame/dex/src/lib.rs
c1ab888
Merge pull request #29 from jsidorenko/giles-truncated
09e1dbc
Chore
15a6969
Fmt fix on Uniques
a4ac2d4
Merge remote-tracking branch 'jeger/master' into dex-pallet
gilescope 331c4e9
add call_index
gilescope 4e146ca
revert readme changes
gilescope 7a2e142
add cr
gilescope f984658
revert uniques changes
gilescope 23866c5
reducing noise
gilescope 20f1672
no need for deadline (#12990)
gilescope d75b442
fix kitchen sink (#12991)
gilescope d7ad301
add BenchmarkHelper for second instance (#12998)
gilescope 9bd3d21
update mock to latest master
gilescope 97a0992
less indirections (#13012)
gilescope e8c2c4f
remove dex PR's custom RPC (#13050)
gilescope 5dfcb56
no longer a need to upgrade rpc version (#13053)
gilescope b00004a
Merge branch 'master' into dex-pallet
gilescope cd41d6b
add CallbackHadle
gilescope 5a8da1e
quote bugfix (#13191)
gilescope 8db89ab
Merge branch 'master' into dex-pallet
gilescope 9fc0a35
merging in dex specific changes due to pay by dex
gilescope fed34ba
update lock file
gilescope 1b64115
merging in kitchen sink changes
gilescope 121ee7d
Merge remote-tracking branch 'origin/master' into dex-pallet
fcbbd34
Merge branch 'master' into dex-pallet
gilescope 81f0e38
Merge remote-tracking branch 'origin/master' into dex-pallet
8ff6179
Add get_reserves() api method
3cdc595
Partial updating of the benchmarks
gilescope ffe2953
Merge branch 'dex-pallet' of github.com:paritytech/substrate into dex…
gilescope 47d3537
Merge branch 'master' into dex-pallet
bbe81ba
Fix tests
a1edec0
clippy
67711a7
Temp fix weights
63add87
Fix benchmarks
0c78cfe
Add pool setup fee
386e424
Money upfront
80602cc
Address some comments
458eda8
Use u128 in mock
f325993
Fix benchmarks
d84ac9a
Change error message
3adf116
Update comments
d06ce8a
Change error names
437392c
Implement PartialOrd for NativeOrAssetId
e2e24a2
add note
923193b
Update errors
4c7ee70
More tests for assets sorting
f8b7a85
Merge branch 'master' of https://github.com/paritytech/substrate into…
c657b58
".git/.scripts/commands/bench/bench.sh" pallet dev pallet_dex
73daaa2
Change the way we generate pool accounts
cf0f790
Improve the liquidity removal method
3023cc3
Extract MintMinLiquidity to config, rework all tests
9229802
Add comments
89e1e41
Validate provided amount
c8c5aa6
Rename to asset-conversion
ca3b8d6
Validate ED
6828602
Improve handling the ED related errors
cfc9b30
typos
edf4b12
Try to fix benchmarks
c79eb8d
Merge branch 'master' into dex-pallet
60e1707
Another try
852f297
Another day, another try
74f26e1
Fix benchmarks
69fcf71
Expose fee related params
f553104
Validate token's minimal amount the same way as ED
a93f6d6
fix typo
gilescope 8d48599
Merge branch 'master' into dex-pallet
gilescope 7a1638a
Use longer path for swaps in benchmarks
c2220b5
Merge branch 'dex-pallet' of https://github.com/paritytech/substrate …
gilescope 305a7eb
need to ref sp_std's vec.
gilescope 732df43
Remove From<u32> requirement when benchmarking
gilescope bbf7d41
impl BenchmarkHelper for ()
gilescope fb5a946
only for runtime benchmarks
gilescope e608d9c
MultiLocation: !MaybeDisplay
gilescope 82f6be6
Update frame/asset-conversion/src/lib.rs
gilescope ccccaa8
Update frame/asset-conversion/src/lib.rs
gilescope b4f7a63
Merge branch 'master' into dex-pallet
gilescope e4e6844
Add documentation links
gilescope bb84701
add collision test
gilescope bcd826c
Revert "[Enhancement] Throw an error when there are too many pallets …
gilescope 70bdfae
[Enhancement] Throw an error when there are too many pallets (#13763)
ruseinov f1efb7d
Merge branch 'master' into dex-pallet
gilescope a51e6da
add benchmark helper
gilescope 9bcaacf
cargo fmt
gilescope cdf673a
Fix adding liquidity to non-empty pool
a2870a7
Fix compilation error
661075b
Fix params ordering issue
5a2d97d
additional docs
gilescope 18db17f
The swap path elements should be unique
17aff58
Fix account collision
gilescope f263147
Merge branch 'dex-pallet' of https://github.com/paritytech/substrate …
gilescope fa22694
Validate all the pool in a swap path are unique
1d60e4e
Merge branch 'master' into dex-pallet
gilescope c7c9422
Change the way we add liquidity to empty pools
96f4872
Merge branch 'master' into dex-pallet
gilescope 270647a
Merge branch 'master' into dex-pallet
gilescope a467107
Improve docs
gilescope ef01a2b
remove unnessisary Display impl
gilescope dcee96a
cargo fmt
gilescope fb52368
remove unused imports
gilescope 68ae5d2
Make api consistent
c5f8acd
Chore
c8b7e28
Merge remote-tracking branch 'origin/master' into dex-pallet
5f74237
Touch the pool account so it could hold the pair tokens
82b925c
Check the balance before touching the pool's account
2937574
Introduce liquidity provision fee
4004628
Touch the pool acc one more time
ffcf6b0
Merge remote-tracking branch 'origin/master' into dex-pallet
419b9be
Apply suggestions from code review
jsidorenko d9cf0ae
Update frame/asset-conversion/README.md
jsidorenko 4df34e2
Use ContainsPair instead of the balance checker
5456e3f
Merge branch 'master' into dex-pallet
gilescope ae6a18c
Remove old Currency trait
5c486c1
Add liquidity withdrawal fee
4ae0d1b
Update docs
9577f67
Use 0 withdrawal fee in mock
41b07e7
Rename vars
124c84b
Merge branch 'master' into dex-pallet
gilescope 7ec75e0
Merge branch 'master' into dex-pallet
gilescope d9b0296
asset id not clone
gilescope 6bf0efd
fix: shadow var was being used
gilescope 12472e1
correct tests
gilescope e261f11
fix benches
gilescope bbe2de8
Merge branch 'master' into dex-pallet
gilescope 602c976
merge master
gilescope ac1812f
neater
gilescope eceafb8
Merge branch 'master' into dex-pallet
gilescope File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Rename to asset-conversion
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,12 @@ | ||
| [package] | ||
| name = "pallet-dex" | ||
| name = "pallet-asset-conversion" | ||
| version = "4.0.0-dev" | ||
| authors = ["Parity Technologies <[email protected]>"] | ||
| edition = "2021" | ||
| license = "Apache-2.0" | ||
| homepage = "https://substrate.io" | ||
| repository = "https://github.com/paritytech/substrate/" | ||
| description = "FRAME DEX AMM pallet" | ||
| description = "FRAME asset conversion pallet" | ||
| readme = "README.md" | ||
|
|
||
| [package.metadata.docs.rs] | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.