Flashblocks usage
How the KIMP app uses GIWA Flashblocks preconfirmations through the pending tag, what is and is not final, and the preconfirmed, included and finalized UI states.
GIWA produces a block every second. Flashblocks split each block into sub-block increments and stream them from the sequencer, so a transaction's status can be seen in roughly 200 ms instead of waiting for the full block. Flashblocks do not make blocks faster and do not change finality. They give an earlier view of what the sequencer has ordered.
KIMP uses that earlier view for feedback only. Every economic rule in the contracts is evaluated when the transaction executes on-chain, never on the basis of a preconfirmation.
How the app reads preconfirmed state#
A Flashblocks-aware RPC exposes preconfirmed state through the pending block tag. The app keeps two clients: one on the standard RPC for confirmed state, and one on the Flashblocks RPC for preconfirmed state.
| Call | Tag or method | Used for |
|---|---|---|
eth_call | pending | Latest index value, position equity, pool NAV, as the next block will see them |
eth_estimateGas | pending | Gas estimates against preconfirmed state, so a trade that depends on a just-sent deposit estimates correctly |
eth_getTransactionReceipt | Flashblocks RPC | Receipt of a preconfirmed transaction, with logs, before the block closes |
eth_getBlockByNumber | pending | Current Flashblock, to show the newest index update |
eth_getTransactionCount | pending | Nonce management for rapid successive orders |
import { createPublicClient, http } from "viem";import { giwaSepolia } from "./chains";const flash = createPublicClient({ chain: giwaSepolia, transport: http("https://sepolia-rpc-flashblocks.giwa.io"),});const [bps, timestamp] = await flash.readContract({ address: KIMP_INDEX, abi: kimpIndexAbi, functionName: "latest", args: [BTC], blockTag: "pending",});const receipt = await flash.waitForTransactionReceipt({ hash, pollingInterval: 200 });The Flashblocks endpoint above is the GIWA Sepolia testnet endpoint. It is rate-limited and not for production. Mainnet endpoints are published by GIWA at mainnet. See Testnet parameters.
Two meanings of finalized#
The docs use "finalized" in two distinct senses. Keep them apart.
- Epoch-finalized refers to the Kimp Index. An epoch value is finalized when
KimpIndexhas computed the median of valid reports with quorum. Entry and mark prices always use the latest epoch-finalized value. A preconfirmation lets the app show that value about 200 ms after the finalizing transaction is sequenced. - Chain-finalized refers to GIWA's settlement on Ethereum. A GIWA block becomes final when the batch containing it is posted to Ethereum and that Ethereum block is finalized.
What is and is not final#
| Stage | Source | Typical delay | Can it be reversed |
|---|---|---|---|
| Preconfirmed | Flashblock from the sequencer | Up to about 200 ms | Yes, in rare cases such as a sequencer fault or restart |
| Included | 1-second GIWA block | About 1 second | Only by an L2 reorganization, which is unlikely |
| Safe | Batch posted to Ethereum | Minutes | Only by an Ethereum reorganization |
| Finalized | Ethereum finality over the batch | Longer, per Ethereum finality | No |
UI states#
The app shows one of three states for every transaction.
| State | Meaning shown to the user | What the app allows |
|---|---|---|
| Preconfirmed | Order accepted by the sequencer. Position shown with a provisional marker. | Viewing. Follow-up actions are enabled but estimated against pending state. |
| Included | Transaction is in a GIWA block. Position shown as open. | All actions. |
| Finalized | Block is final on Ethereum. | All actions. Used for records and exports. |
If a preconfirmed transaction does not appear in a block, the app reverts the provisional display, marks the order as dropped, and re-reads state from the standard RPC. It never shows a preconfirmed payout as withdrawable balance.
Where preconfirmations help#
- Traders see their entry value and fill within about 200 ms of sending an order.
- Liquidation keepers can watch pending index updates and submit
liquidatein the same block the index moves. - LPs see their kLP mint immediately after a deposit.
- The live index preview updates as each epoch is sequenced, not a block later.
Preconfirmations change none of the rules. Margin, caps and the Verified Lane check are enforced at execution, and settlement uses epoch-finalized samples. See Settlement TWAP.