-
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: new lp interface (PRO-760 PRO-743 PRO-686) #3886
Conversation
e3d9aa4
to
df9ca15
Compare
Codecov Report
@@ Coverage Diff @@
## main #3886 +/- ##
======================================
- Coverage 73% 72% -0%
======================================
Files 367 366 -1
Lines 56037 56698 +661
Branches 56037 56698 +661
======================================
+ Hits 40631 40855 +224
- Misses 13345 13757 +412
- Partials 2061 2086 +25
... and 5 files with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
@@ -105,7 +297,7 @@ pub mod pallet { | |||
/// The STABLE_ASSET is always PoolSide::Asset1 |
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.
This is no longer true, but will show up as the documentation for this storage item.
46d7f30
to
258ba49
Compare
pool_info and pools functions
PRO-760 Check range order before burn
Now that we have getRangeOrders, we can re-implement the check that makes sure we have the required liquidity before sending the burn extrinsic. Also we need to fix a mistake where the PRO-686 [LP-API] `burn_all_limit_orders` and `burn_all_range_orders`
It should be possible for an LP to burn all their orders instead of having to explicitly burn each one. PRO-743 Move LP queries into runtime rpc
We should move anything that accesses storage directly (via As part of this, we should use dedicated rpc return types instead of defining serialize/deserialize on the amm's Pool types. |
f7be24e
to
33081bb
Compare
* Revert "feat: RPC call for amount_to_liquidity (#3835)" This reverts commit dbfe96a. * rename collected structures * Add PositionInfo squash * cut out inner_liquidity_to_amounts squash squash * cut out inner_amounts_to_liquidity * amm range orders mint and burn by Size * output operation liquidity delta * remove unneeded trait impls * move sqrt_price_to_price * current_price rpc * add nicer swap and position functions * remove pool rpcs * remove deser and ser impls * amm pool new function * current_price doesn't use traits * make private/hide unneeded interfaces * pub amount in PositionInfo * cutout error translation functions * desired -> maximum * rename RangeOrderSize to OldRangeOrderSize * new interfaces * new implementations * handle order ids * spelling and add safe mode checks * update bouncer for new lp-interface * bouncer linting * fix range_order bouncer command * bouncer linting * lp api returns * required asset ratio rpc * lp rpc * Use "order" not "position" * use u256 * utilities squash squash * use new utilities * pools function pool_info and pools functions * pool_orders * pool_range_order_liquidity_value * rpcs * _asset * fix * move debit down * bought_amount * LiquidityTooLarge * remove old test * remove range_order iszero check * basic comments --------- Co-authored-by: Roy Yang <roy@chainflip.io> Co-authored-by: Martin Rieke <martin@chainflip.io>
* Revert "feat: RPC call for amount_to_liquidity (#3835)" This reverts commit dbfe96a. * rename collected structures * Add PositionInfo squash * cut out inner_liquidity_to_amounts squash squash * cut out inner_amounts_to_liquidity * amm range orders mint and burn by Size * output operation liquidity delta * remove unneeded trait impls * move sqrt_price_to_price * current_price rpc * add nicer swap and position functions * remove pool rpcs * remove deser and ser impls * amm pool new function * current_price doesn't use traits * make private/hide unneeded interfaces * pub amount in PositionInfo * cutout error translation functions * desired -> maximum * rename RangeOrderSize to OldRangeOrderSize * new interfaces * new implementations * handle order ids * spelling and add safe mode checks * update bouncer for new lp-interface * bouncer linting * fix range_order bouncer command * bouncer linting * lp api returns * required asset ratio rpc * lp rpc * Use "order" not "position" * use u256 * utilities squash squash * use new utilities * pools function pool_info and pools functions * pool_orders * pool_range_order_liquidity_value * rpcs * _asset * fix * move debit down * bought_amount * LiquidityTooLarge * remove old test * remove range_order iszero check * basic comments --------- Co-authored-by: Roy Yang <roy@chainflip.io> Co-authored-by: Martin Rieke <martin@chainflip.io>
…on-integration * origin/main: fix: scale encoding skip phantom data (#3967) chore: make platform team code owner of CI settings.toml and localnet (#3957) fix: prefer finalize_signed_extrinsic in engine (#3956) fix: CanonicalAssetPair encoding issue (#3958) chore(bouncer): Update sdk to 0.0.40 (#3945) fix: tweak cli generate-keys output (#3943) chore: add `preinst` script unit tests 🧪 (#3942) Better LP/Broker API RPC Errors (#3931) fix: update substrate ref to use Kademlia fix (#3941) doc: update funding readme with redemption restrictions (#3914) feat: PRO-474 broadcast safe mode (#3902) feat: more forgiving dot address parsing (#3938) fix: duplicate logging (#3939) feat: new lp interface (#3886) # Conflicts: # Cargo.lock # state-chain/cf-integration-tests/Cargo.toml # state-chain/cf-integration-tests/src/authorities.rs
Replaces the burn and mint functions with update and set position functions and adds order ids.
Bouncer has not yet being updated to use the new functions and so will fail.
I have removed some existing rpcs, I intend to replace them with improved versions.
Also need to add auto sweeping although this is not hard any longer.