Reading From Indexes/External Tables
Learn how Zephyr programs can access publicly indexed data.
Zephyr tables are by default shareable across programs.
Note that when pricing kicks off creators of certain tables will be able to manage how their tables are accessed with custom rules.
This functionality allows any program or Custom Dashboardsto access already indexer + live-updated data on Mercury!
Let's make things practical and jump straight to an example. This code returns all indexed Blend Mainnet borrowed operations for a given pool:
The key here is the attribute
Which tells the compiler (and then the ZephyrVM) that you're reading from the borrowed
table created by id 8 (in this case, blend's Mainnet deployment).
This function can be easily called through:
To access public tables you need to get the name of the table as well as the id of the user who created it. These data as a general rule are made available by the creator itself.
As you can see here, we are accessing some data that we have not indexed ourselves quite easily, and this can be done from every point of your Zephyr program.
Last updated