You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.
Currently, OrderEvents emitted by Mesh represent the order's net fillability changes introduced by all the transactions within a block. Some use-cases require knowing about all smart contract events that led to this net fillability change.
Example: If an order is filled and cancelled within a block, we only emit a CANCELLED order event (since this is the final state of the order). We do include the transaction hashes of both the fill & cancel transactions, but accessing the underlying smart contract events requires clients to do further Ethereum JSON-RPC calls. Since we already have the parsed smart contract events in Mesh, we could simply include them in the response.
Proposed new OrderEvent type:
// OrderEvent is the order event emitted by Mesh nodes on the "orders" topic
// when calling JSON-RPC method `mesh_subscribe`
type OrderEvent struct {
OrderHash common.Hash `json:"orderHash"`
SignedOrder *SignedOrder `json:"signedOrder"`
Kind OrderEventKind `json:"kind"`
FillableTakerAssetAmount *big.Int `json:"fillableTakerAssetAmount"`
Transactions []Transaction `json:"transactions"`
}
// Transaction is a succinct representation of an Ethereum transaction
type Transaction struct {
TxHash common.Hash `json:"orderHash"`
Logs []ParsedLog `json:"logs"`
}
// ParsedLog represents a parsed smart contract event/log
type ParsedLog struct {
Name string `json:"name"`
Parameters map[string]string `json:"parameters"`
}
The benefit of this approach is a much better developer experience for use-cases that require the smart contract events (e.g., market-makers who need all contract events for trade execution, operations and bookkeeping purposes). The downside is that each event is not larger in size.
The text was updated successfully, but these errors were encountered:
Open question: Are only the Exchange contract's Fill, Cancel and CancelUpTo events important, or also token Transfer, Approval events that impact order fillability?
Currently,
OrderEvents
emitted by Mesh represent the order's net fillability changes introduced by all the transactions within a block. Some use-cases require knowing about all smart contract events that led to this net fillability change.Example: If an order is filled and cancelled within a block, we only emit a
CANCELLED
order event (since this is the final state of the order). We do include the transaction hashes of both the fill & cancel transactions, but accessing the underlying smart contract events requires clients to do further Ethereum JSON-RPC calls. Since we already have the parsed smart contract events in Mesh, we could simply include them in the response.Proposed new OrderEvent type:
Example OrderEvent:
The benefit of this approach is a much better developer experience for use-cases that require the smart contract events (e.g., market-makers who need all contract events for trade execution, operations and bookkeeping purposes). The downside is that each event is not larger in size.
The text was updated successfully, but these errors were encountered: