Skip to main content

Get Up and Running

This quickstart will help you run your first Points Adapter and understand the output. We’ll use the Sonic adapter as an example.
1

Clone the Repository

First, clone the Points Adapters repository:
git clone https://github.com/0xPortalLabs/points-adapters.git
cd points-adapters
2

Install Dependencies

Install dependencies using Deno:
deno install
Make sure you have Deno installed. See the Installation page for details.
3

Run Your First Adapter

Test an adapter with a wallet address:
deno run -A test.ts adapters/sonic.ts 0x3c2573b002cf51e64ab6d051814648eb3a305363
This command:
  • Runs the test script with all permissions (-A)
  • Loads the Sonic adapter (adapters/sonic.ts)
  • Queries points for the specified address
4

Understanding the Output

You’ll see detailed output including:Points Breakdown Table:
┌─────────────────────────────────┬────────┐
│ User Activity Last Detected     │ ...    │
│ Sonic Points                    │ 1234.5 │
│ Loyalty Multiplier              │ 1.2    │
│ Ecosystem Points                │ 500.0  │
│ Passive Liquidity Points        │ 300.0  │
│ Activity Points                 │ 434.5  │
│ Rank                            │ 1523   │
└─────────────────────────────────┴────────┘
Total Points:
1234.5
User Rank:
User Rank: 1523rd
CORS Status:
Does the adapter work in the browser?
Is this a good CORS URL?
✓ URL is CORS-compatible

Try More Adapters

Now that you’ve run your first adapter, try testing other protocols:
deno run -A test.ts adapters/etherfi.ts 0x3c2573b002cf51e64ab6d051814648eb3a305363
The Jumper Exchange adapter supports both EVM and Solana addresses. Try it with a Solana address too!

Using an Adapter in Your Code

Here’s how to import and use an adapter programmatically:
import { runAdapter } from "./utils/adapter.ts";
import sonicAdapter from "./adapters/sonic.ts";

// Run the adapter
const address = "0x3c2573b002cf51e64ab6d051814648eb3a305363";
const result = await runAdapter(sonicAdapter, address);

// Access the normalized data
console.log("Total Points:", result.total);
console.log("User Rank:", result.rank);
console.log("Detailed Data:", result.data);

// Check if rewards are claimable
if (result.claimable) {
  console.log("You have claimable rewards!");
}

Result Structure

The runAdapter function returns a standardized result:
{
  // Raw data from the API (for debugging)
  __data: { /* ... */ },
  
  // Normalized detailed breakdown
  data: {
    "Sonic Points": 1234.5,
    "Loyalty Multiplier": 1.2,
    "Ecosystem Points": 500.0,
    // ...
  },
  
  // Aggregate total (can be a number or labeled object)
  total: 1234.5,
  
  // User's rank in the leaderboard
  rank: 1523,
  
  // Whether rewards are claimable
  claimable: false,
  
  // Supported address types
  supportedAddressTypes: ["evm"]
}

Working with Different Result Types

Some adapters return labeled points instead of a single number:
import { runAdapter } from "./utils/adapter.ts";
import etherfiAdapter from "./adapters/etherfi.ts";

const result = await runAdapter(etherfiAdapter, "0x...");

// ether.fi returns grouped data
console.log(result.data);
/*
{
  "All Time Points": {
    "Loyalty Points": 1000,
    "Liquid Points": 500,
    // ...
  },
  "Current Points": {
    "Loyalty Points": 800,
    "Liquid Points": 400,
  }
}
*/

// Total is also a simple number for ether.fi
console.log(result.total); // 1200

Custom Point Terminology

Some protocols use different terminology (e.g., “Minerals” instead of “Points”):
import { runAdapter } from "./utils/adapter.ts";
import dolomiteAdapter from "./adapters/dolomite.ts";

const result = await runAdapter(dolomiteAdapter, "0x...");

// Dolomite uses "Minerals"
console.log(result.total);
/*
{
  Minerals: 5000
}
*/

console.log(result.data);
/*
{
  Minerals: {
    "Airdrop Amount": 5000,
    "Level Snapshot": 3
  }
}
*/

Testing Multiple Addresses

You can test all adapters with multiple addresses using the health check script:
1

Configure Addresses

Edit config.json in the root directory:
{
  "addresses": [
    "0x3c2573b002cf51e64ab6d051814648eb3a305363",
    "0xYourOtherAddress..."
  ],
  "disabledAdapters": [],
  "timeout": 30000
}
2

Run Health Check

deno run -A check-adapters.ts
This will test all adapters with your configured addresses and report any failures.

Next Steps

Creating Adapters

Learn how to build adapters for new protocols

API Reference

Explore the complete API documentation

Address Types

Understand EVM and Solana address support

CORS Configuration

Configure CORS proxy for browser usage

Build docs developers (and LLMs) love