Skip to content
KIMP

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.

CallTag or methodUsed for
eth_callpendingLatest index value, position equity, pool NAV, as the next block will see them
eth_estimateGaspendingGas estimates against preconfirmed state, so a trade that depends on a just-sent deposit estimates correctly
eth_getTransactionReceiptFlashblocks RPCReceipt of a preconfirmed transaction, with logs, before the block closes
eth_getBlockByNumberpendingCurrent Flashblock, to show the newest index update
eth_getTransactionCountpendingNonce management for rapid successive orders
TypeScript
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 KimpIndex has 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#

StageSourceTypical delayCan it be reversed
PreconfirmedFlashblock from the sequencerUp to about 200 msYes, in rare cases such as a sequencer fault or restart
Included1-second GIWA blockAbout 1 secondOnly by an L2 reorganization, which is unlikely
SafeBatch posted to EthereumMinutesOnly by an Ethereum reorganization
FinalizedEthereum finality over the batchLonger, per Ethereum finalityNo

UI states#

The app shows one of three states for every transaction.

StateMeaning shown to the userWhat the app allows
PreconfirmedOrder accepted by the sequencer. Position shown with a provisional marker.Viewing. Follow-up actions are enabled but estimated against pending state.
IncludedTransaction is in a GIWA block. Position shown as open.All actions.
FinalizedBlock 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 liquidate in 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.