Skip to content

[indexer]: track fill userop hashes, actual delivered amounts, and placeOrder fee token #1104

Description

@seunlanlege

The IntentGatewayV3 indexer (sdk/packages/indexer) is missing three pieces of data that consumers (SDK order status streams, dashboards, solvers) need.

1. Userop hash for fills / partial fills

Solvers fill orders through the ERC-4337 SolverAccount (evm/src/apps/intentsv2/SolverAccount.sol), so the transactionHash currently stored on IOrderV3Fill / IOrderV3PartialFill is the bundler's EntryPoint transaction — not the userop the solver submitted and tracks on their side.

  • Add a nullable userOpHash field to IOrderV3Fill and IOrderV3PartialFill in sdk/packages/indexer/src/configs/schema.graphql.
  • In orderFilledV3.event.handler.ts / partialFilledV3.event.handler.ts, resolve it from the fill transaction's receipt: find the EntryPoint UserOperationEvent whose sender matches the filler address and record its userOpHash. Leave null for plain EOA fills.

2. Actual amount received by the user in a fill

The fill handlers record output amounts straight from the OrderFilled / PartialFill event args, but ExtrinsicIntents.fill() emits outputFills[i].amount = totalRequired — the order's promised amount (evm/src/apps/intentsv2/ExtrinsicIntents.sol:134). When a solver overfills, the beneficiary actually receives totalRequired + beneficiaryShare from the surplus split, and the solver's actual delivered amount (solverAmount) never appears in the event at all.

  • Add an amountReceived field (alongside the existing promised amount) to IOrderV3FillOutputAsset and IOrderV3PartialFillOutputAsset.
  • The solver transfers output assets directly to the user, so the actual delivered amount can be read from the Transfer logs (filler → beneficiary) in the fill transaction receipt.

3. Fee amount and fee token for placeOrder

IOrderV3.fees already records the fees value from the OrderPlaced event, but not the token it is denominated in. Fees are paid in the host's fee token (IDispatcher(host()).feeToken()), which differs per chain — so consumers can't display or price the fee without hardcoding per-chain knowledge.

  • Add a feeToken: String! field to IOrderV3 in the schema.
  • Populate it in orderPlacedV3.event.handler.ts by reading feeToken() from the host contract (the value is static per chain, so cache it per chain rather than calling on every order).

All three are schema additions plus handler changes in sdk/packages/indexer/src/handlers/events/intentGatewayV3/; no reindex-incompatible changes expected beyond the new nullable/derivable fields.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions