A Technical Deep Dive into Developer Portal By SolanaFM

Imagine you are playing a classic Nokia 2D Snake Game. How would you explain it to a 5-year-old? You would describe that there would be a snake in a rectangular grid, which needs to consume the food spread across the grid and lengthens itself as it consumes this food. And the game will be over if the snake intersects itself.
Now let us abstract the high-level variables and methods to convert this description into a visualization.
//Variables used
let snakeLength;
let gridX;
let gridY;
//Methods used
didConsume();
didIntersect();
So a high-level overview makes the most probably used functions and variables pretty obvious, right?
Now what if we extend this same logic to another classic game like a Super Mario or a GTA vice city? How many data parameters and complex functions would they generate to spawn cars, weapons, graphics, etc?
The most important question is CAN WE BUILD A LOGICAL INTERFACE as we built for the above 2D Snake game? No, because there are simply too many complex situations and objects to deal with!
Enter Anchor IDL 💪
Blockchain dApps with complex user transactions are dealing with the same problem, and as the codebase increases, the computational power required to manually organize this data and create an INTERFACE with which other applications can interact with this data independently becomes cumbersome.
Anchor aims to solve the same problem as mentioned above, it aims to create a common interface between various dApps and their public transaction data.

This is done using the proposed "Anchor IDL". This IDL is a generic interface file that can be used to define the methods with which an external dApp can interact with the transactional data of another dApp.
Apart from the IDL, Anchor is a Solana Sealevel Runtime Framework, which can abstract the complexity that developers face in various phases of Solana Development, Anchor can be used to start a new project or can be integrated into an existing project easily.
Anchor IDL is one such utility provided by the Anchor Framework, which can be used to build a generic Interface file called an IDL. This can be generated by using the following command in the dApp root folder:
#Initializing IDL
anchor idl init -f <target/idl/program.json> <program-id>
#Fetching an existing IDL
anchor idl fetch -o <out-file.json> <program-id>
#Upgrading an IDL
anchor idl upgrade <program-id> -f <target/idl/program.json>

The above image represents a typical IDL file representation, the above IDL file is of "Zeta", a DeFi derivatives platform built on Solana. As you can see from the image on left, there are over 80 Instructions, 19 Accounts, 41 Data types, and 7 events on their Solana Program, which other dApps and programs can interact with.
But as you can see in the right image, all the methods, accounts and events are stored in a JSON format and interacting with these endpoints is a whole new complex task. So can developers use the programs and IDL of other dApps to:
Index their on-chain transactional data
To listen to events
To query their historical data
This requires a serious amount of processing and infrastructure, and SolanaFM has come forward to tackle this problem head-on with their new platform called Developer Portal! Let us Deep Dive into the Developer Portal!
Developer Portal: Features ✨
SolanaFM is a Solana Blockchain explorer, built to create a user-friendly experience. Their dashboards visualize many aspects of the current state of the blockchain, like the number of blocks produced till now, the transaction volume, the latest blocks, and a lot more. These features of SolanaFM are used to analyze the state of the blockchain itself and track the transactions, as shown in the below image.

To extend this user-friendly analysis of data to "Programs" or "Smart Contracts" of the Solana Blockchain world, SolanaFM came up with a "Developer-Friendly" data indexing, querying, and subscribing platform called Developer Portal.
Even before this new venture, SolanaFM is always oriented toward helping users interact with the on-chain Solana programs and their IDLs, this was done by creating an "IDL Executable" tab on each compatible program's homepage, as shown below.

In the above image, SolanaFM is trying to generate an interface for users and developers to understand and try things out with the methods available on each deployed program's IDL.
This is great, but it is not suitable for a large-scale on-chain data indexing model, especially for developers. To solve this problem the Developer Portal is being developed as a separate platform by the SolanaFM team.

Developer Portal as a platform acts as a one-stop solution to work with all of the on-chain data on Solana. This portal has covered most of the day-to-day data management solutions needed by a developer to give a web2-esque data processing experience with the on-chain web3 data. A few of the main features offered by the platform are:
On-chain data indexing: In traditional web2 database management, developers try to minimize the disk reads and maximize the query performance, this is done by indexing the data in an organized and logical manner. The developer portal does the same to the Solana on-chain data. The Portal indexes the on-chain data which the user wants and makes it ready for used-defined queries on that program's data. This efficient organization and logical querying of data are done by the Developer Portal using the Anchor IDL of the program which leverages the Anchor Framework to generate an interactive generalized model of the program.
Webhooks: Webhooks enable developers to introduce event-driven actions into their dApps. This enables developers to keep track of the on-chain events and trigger actions based on the on-chain data. This service in particular has a wide range of practical use cases like Real-time web3 applications that depend on on-chain events, enable Data synchronization in DeFi and Financial service, and low-latency automation platforms on web3. Webhooks can also be used in building Analytics and Dashboards on top of dApp programs and their data.
API Queries: API queries are critical in developing any full-stack application. Web2 developers write API queries to communicate with the backend and database. But on-chain data is different, and to deal with that messy transaction logs, the Developer portal cleans it up and organizes the data, and provides API keys to the developers which can be used to query the blockchain which is processed and returned in an organized JSON format.
Historical Indexing (Backfill): The Developer Portal also allows developers to query the historical transactions of a particular program just by entering the block range which the developer wants to query between. This allows applications to analyze trends and improve their analytics.
Devnet Support: Developer Portal supports developers to run their webhooks, API queries, and indexed data on the Devnet itself, to try and make sure everything is all set, before moving to the Mainnet.
All these features seem to be fundamental in web2, but coming to web3 this fundamental indexing infrastructure is still immature, which is restricting the usage of valuable public transactional data to make better dApps.
SolanaFM's team is trying to solve the exact same problem, by enabling developers to extract all the useful data stored on-chain on the Solana Blockchain Ecosystem.
Trying out Developer Portal Features ⚗️
On-chain Data Indexing:
To try out the Developer Portal, visit https://portal.solana.fm/ and connect with your favourite Solana wallet. Going into the Indexers tab on the left pane users can see the following input option as shown below. Here the users can drag or upload the public IDL files of the programs deployed on Solana that they want to index and query on.

But how do we know if that particular program has an IDL file published? Because just over 8% of the total 7600+ Solana Programs deployed on the Mainnet have their IDL published. There are two options to find if the required Program has an IDL deployed:
Search for the required program on the SolanaFM homepage, and check if there are Anchor IDL and Anchor Executable tabs present in the Program Overview.
Else one can use the registry shown in the below image, at soldev/registry this is a registry of Solana Programs that have their IDL data published, and this is being constantly updated with new dApps and Programs that deploy their IDLs.

And then the users can fill in the required details like the ProgramID, Name and Upload the downloaded IDL file, this allows Developer Portal, to parse all the transactional data and index it to make it ready for querying.

Once everything is ready users can see the indexed Data Model that is created and ready to be started. This model will be continuously updated with the recent on-chain data, and this can be stopped or deleted whenever needed.
API Queries:
Developers can generate API keys based on their account plan and set expiry date. These keys are required to query the indexed data stored by the portal.

Users can configure the API parameters from the API query section and request a GET request of the indexed data, as shown in the below image.

Webhooks:

Webhooks can be set to subscribe to on-chain events that act as triggers that cause an Action in return. From the above image, we can see that a webhook subscription is set to listen to 15 instructions and 1 event, to detect a new liquidation. And the Action parameter is set to the Discord webhook API, which is pinging the user whenever there is a new Liquidation via the Solana Program under the webhook.
Brainstorming a dApp on Developer Portal 📐

Let us assume Bob is building something cool for the upcoming Solana Grizzlython Hackathon called "DUBER", a decentralized UBER! Let's get a brief look at how he can leverage the Developer Portal to his advantage. So from the above diagram, we can see there are a lot of users using the DUBER platform.
To confirm a trip, they need to submit a transaction to the Solana Blockchain, and this transaction is in the following form.
//txn stucture
[
{
"start":"Big Ben tower, Lodon"
},
{
"destination":"London Eye, Lodon"
},
{
"price": "10 euros"
},
{
"tip": "2 euros"
},
{
"sos": false
}
]
Once the developers from the DUBER team, upload the DUBER Program's IDL and set up the API Keys, they can start querying from the data indexed by the developer portal, they can configure the schema and access the database of transaction parameters to do many things off-chain, like:
Build intelligent analytics and dashboards to review the common start and destination points used by their users on the DUBER application.
Build financial estimations and revenue calculations based on the price database indexed from the transaction data.
And if there is an SOS button in the DUBER dApp, they can actively listen to the SOS event by subscribing to the webhook and alerting the concerned authorities.
These are just a few features that a web3 application can leverage from a real-time indexing platform like Developer Portal and a blazing-fast blockchain like Solana.
Potential dApps on Developer Portal 🌱
Development Portal can be used by any project being built on Solana that requires an API layer, pretty much everything, huh 😂? Yes, because there is a wide array of potential dApps that can be built using the Developer Portal as the primary API layer to read on-chain data, this ranges from:
DEXs: Decentralized Exchanges are becoming wildly popular these days, even more after the sad FTX collapse. This incident proved the need for decentralization, and to operate DEXs like OpenbookDEX or Raydium, etc, they need constant consumption of on-chain market data to precisely update the crypto prices using AMMs and Liquidity Pools.
Decentralized Oracles like Switchboard or Pyth need to read on-chain data pretty much every time, and this requires efficient indexed data to read from and a logical webhook system to alert the oracle about a mismatch and proceed with a timely penalization of a node for the wrong data.
DeFi dApps: DeFi applications have grown exponentially in popularity in recent years, and an on-chain data indexing solution on Solana like the Developer Portal could be used to provide users with real-time data on interest rates, loan-to-value ratios, and other important metrics.
Web3 Gaming: Gaming on web3 requires real-time data reading capabilities to show player stats and scores from the latest game as soon as possible and with minimum latency, and an indexed on-chain data solution is very much needed to handle a large number of API calls.
Web3 Social Networks: Social networks are synonymous with real-time data transfer, and this requires readily available indexed data to load the historical on-chain data and newly pushed data as seamlessly as possible
Feature Drops and Improvements 📑
- DECENTRALIZING THE API LAYER
One of the main improvements would be moving towards a decentralized on-chain data indexing strategy. Because storing data on a semi-central infrastructure could lead to reducing the value added by the decentralized network. So hosting an infrastructure that could handle queries and return the data in a decentralized fashion would be the next ideal step for this already amazing API infrastructure.
- SCOPE FOR IMPROVING THE CUSTOMIZABILITY OF THE API
There is a scope to improve the customizability of the API call and make it more user-friendly by adding more filters to process and get exactly what the developer wants.
- GO CROSS-CHAIN
Going cross-chain would always reduce the web3 market's fragmented liquidity and complement each other chain's strengths to build together. Data and API are too important layers to miss out on! There is a huge potential for platforms like Developer Portal to gain market across chains!
My Thoughts and Conclusion 💌
Developer Portal by SolanaFM is surely a step on the right path to squeeze the complete value out of currently miserably used and understood on-chain data. This can ease the creation of:
Analytics and Dashboards
Social Networks
Machine learning models to optimize the programs and dApps based on the data analysis
Web3 Gaming, And many more new fields.
It was a great learning experience to go through all the efforts being done by the SolanaFM team to push the boundaries in the Solana ecosystem.
Also thank you all for reading this article till the very end, if you got a crisp understanding of how important an API layer for on-chain data is and how Developer Portal is solving the problem, share this article with other web3 frens and comment your thoughts on this topic! ❤️
Thank you,
Rohit Kumar Varma
References
SolanaFM Twitter: https://twitter.com/solanafm
SolanaFM website: https://solana.fm/
SolanaFM Docs: https://docs.solana.fm/
Developer Portal Website: https://portal.solana.fm/
Developer Portal Docs: https://protodocs.solana.fm/
SolDev Registry: https://www.soldev.app/registry
Anchor Framework Website: https://www.anchor-lang.com/