Skip to content

limit order support in precompile #2678

@open-junius

Description

@open-junius

problem description

EVM need support limit order via precompile.

limit orders, like limitBuy, limitStopLoss, limitTakeProfit are supported in the limit-order pallet in #2554.

The flow is:
Users sign the off-chain orders (any of the above)
Relayers has a validation engine that checks if a specific order will pass, and submit those orders on-chain.
The pallet validates orders (signature verification + order condition) and execute them either in sequence - execute_orders or in batch: execute_batched_orders.

Describe the solution you'd like

The possible solution will be provided later. Current blockers as follows:

  • rate limiting on (hotkey, coldkey, netuid), so there is no way to do several operations from the batch.
  • intermediary address - for now how pallet is doing it, it can balance sells and buys to redistribute funds across across orders in batch.
  • off-chain signatures - we need to validate user's signature and be able to do the staking operation on user's behalf, we have transferStakeFrom that enforce to submit on-chain transaction before the actual order.
  • use MEV shield on top of it.

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions