> For the complete documentation index, see [llms.txt](https://docs.kyberswap.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.kyberswap.com/getting-started/foundational-topics/decentralized-technologies/on-chain-vs-off-chain-data.md).

# On-Chain vs Off-Chain Data

Making Sense Of Data

## Overview

Unlike traditional finance where data is stored in siloed databases, DeFi transactions offers significantly greater transparency as transaction data is stored on the blockchain which can be publicly queried by any user with internet access. Critically, on-chain data is always impartial as it reflects the exact transaction parameters as it occured with no data lag nor any risks of being tampered post-transaction. The storage of data on the blockchain has become known as on-chain data with all other data sources being referred to as off-chain data.

Given that the [DeFi](/getting-started/foundational-topics/decentralized-finance.md) ecosystem is powered by [dapps](/getting-started/foundational-topics/decentralized-technologies/dapps.md) which run on top of permissionless public blockchains, all DeFi actions results in new transaction data being created and logged on the blockchain. Moreover, with improving token standards (i.e. [ERC20](https://ethereum.org/en/developers/docs/standards/tokens/erc-20/)) as well as DeFi smart contract best practices, DeFi transactions also emits standardized event notifications (i.e. [transfer](https://eips.ethereum.org/EIPS/eip-20#transfer-1), [swap](https://github.com/KyberNetwork/ks-classic-sc/blob/master/contracts/DMMPool.sol#L52)) which provides further context for the transaction. Consequently, there is a wealth of raw on-chain data which holds significant value once sorted.

In contrast to on-chain data, off-chain data is usually stored on a private database where access is determined by its operator. This is not inherently a bad thing as there are certain data points which can't be wholly captured by on-chain data (i.e. price, real world asset data, etc.) and such services plugs these gaps. Moreover, off-chain data providers could also provide additional value through processing raw data to uncover additional insights. This ability to make sense of raw data is both its strongest suite as well as its achilles heel as users will have to trust that the data provided is accurate.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.kyberswap.com/getting-started/foundational-topics/decentralized-technologies/on-chain-vs-off-chain-data.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
