[runtime/simplex]]: add phantom order support for passive price and liquidity indexing#983
Draft
dharjeezy wants to merge 1 commit into
Draft
[runtime/simplex]]: add phantom order support for passive price and liquidity indexing#983dharjeezy wants to merge 1 commit into
dharjeezy wants to merge 1 commit into
Conversation
Wizdave97
reviewed
Jun 22, 2026
| /// registered phantom order. Called by the intent coprocessor service. | ||
| #[pallet::call_index(7)] | ||
| #[pallet::weight(T::WeightInfo::register_phantom_order())] | ||
| pub fn register_phantom_order( |
Member
There was a problem hiding this comment.
This is not correct, the phantom order should be generated by the runtime in the pallet hooks
Wizdave97
reviewed
Jun 22, 2026
|
|
||
| Ok(()) | ||
| } | ||
|
|
Member
There was a problem hiding this comment.
There's no extrinsic to setup the phantom order details, like token pairs, chain for the order?
Wizdave97
reviewed
Jun 22, 2026
| import { timestampToDate } from "@/utils/date.helpers" | ||
| import { PhantomOrder } from "@/configs/src/types" | ||
|
|
||
| export const handlePhantomOrderRegistered = wrap(async (event: SubstrateEvent): Promise<void> => { |
Member
There was a problem hiding this comment.
There's no need to index the phantom order
Wizdave97
reviewed
Jun 22, 2026
| * one reverts, and `null` when the simulation could not be run (e.g. RPC error, | ||
| * unsupported node). | ||
| */ | ||
| async function simulateTokenTransfers( |
Member
There was a problem hiding this comment.
This is not correct, simulate the bid as is, don't change the solver's balance, only state override needed is the block number so the order is not expired when simulating
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adds phantom order price and liquidity indexing to the intent coprocessor. The pallet gains two new extrinsics — register_phantom_order (permissionless) and set_phantom_bid_window (governance) — along with the CurrentPhantomOrder and PhantomBidWindow storage items and a phantom_bid_window() helper that mirrors the existing storage_deposit_fee() fallback pattern.
The SubQuery indexer is extended with
handlePhantomOrderRegisteredandhandlePhantomBidPlacedhandlers that decode each filler's user operation, extract proposed output amounts, and run a lightweight ERC-20 transfer simulation via state overrides to produce a simulationSuccess signal indexed alongside each bid.closes #977