<aside> 📜 TABLE OF CONTENTS

Wrap-up

</aside>

Vertex Version: 1.0.0 Date: 2025-04-27

Usage 🪄

In this section, we'll explore how to Indexing in Vertex đź’».

User Interface

Dashboard Overview

In Vertex side 2 to side

IDL

Now a days, IDL is very common for builder, developer in Solana if they using anchor as framework to build Smart Contract, each program famous in Solana like Raydium, Orca, Kamino, … already publish their IDL. IDL act as the interface , struct about the PDA data on chain, helps us reduce the time to write the borsh shema to decode the byte data to object data.

đź““ Recommend: If you want to index data of what program, PDA that already publish their IDL so choose that to reduce the time write script index, if no you need to write borsh schema inside the script

INDEXER

Indexer is where you can view the structure of table that index data on chain, where you can handle your index data. Firstly create your own Indexer


Index data

This is the main part when you index data by Vertex.

Table

This is where your actual data is store when you index, you must choose what the structure of table you want to create.

Trigger & Transformer

Traditionally, when developers index data in Solana, they need two key components:

Vertex is same, developer must specific what thing they want, vertex reduce the time build the infra for listen event change from on chain, let developers focus 100% to handle the transformer. Go to the step create Indexer, you see that you can choose use IDL or not, because of that when your write the “transformer” is have different part with no IDL and have IDL

Firstly take a look of how to create a Trigger and Transformer

Screenshot 2025-04-27 at 23.15.48.png

Transformer

The next important that is the script transformer, in here is the core logic when you index data. The transformer script have a interface that developer must follow to use

Inside the transformer scripts user MUST have the function name execute, below is the interface of this execute function developer must handle

interface Context {
	pdaParser?: any;
  pdaBuffer: Buffer;
}

export interface ITransformResult {
  action: 'INSERT' | 'UPDATE' | 'DELETE';
  data?: ObjectType;
  where?: ObjectType;
}

function execute(context): Promise<ITransformResult[]> {
  // Handle Core Logic in here

	// Sample data return
  return [{
    action: 'UPDATE',
    data: {
      advertiser: 'update advertiser',
    },
    where: {
      campaign_id: Number(parser.campaignId),
    }
  }]
}

The execute function receive one param with the structure is object had 2 field:

The return data must be follow the interface ITransformResult where:

Vertex will action the result transformer in the order so must be specific what thing you want to do first.

Advance