Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Build Your Own Adapter – Absinthe Docs
Skip to content

Build Your Own Adapter

Total time: ~2-4 hours

Time Breakdown

PhaseTimeWhat You'll Do
1. Learn the System~30 minUnderstand mental model, config structure
2. Study Existing Adapters~45 minFind similar adapter, study code
3. Implement Your Adapter~1-2 hoursCopy, modify, customize
4. Test Locally~30 minVerify CSV output, cross-check on-chain
5. Deploy & Verify~30 minDeploy to Railway, confirm in Absinthe

Phase 1: Learn the System (~30 min)

Start here. Don't skip this.

Read: Getting Started

You'll learn:

  • Mental model: trackables, positions vs actions
  • Config structure: config.absinthe.json
  • Repository layout
  • Common patterns

Phase 2: Study Existing Adapters (~45 min)

Find the adapter most similar to your protocol:

Your Protocol TypeBase AdapterTrackables
Token balanceserc20-holdingstoken (position)
AMM with fungible LPuniswap-v2swap (action), lp (position)
AMM with NFT positionsuniswap-v3swap (action), lp (position)
Lending marketsmorphomarketsmorphoblue (position)
ERC4626 vaultsmorphov1vaultsvaults (position)
Updated vaultsmorphov2vaultsvaults (position)

Read: Adapter Reference

Study the code and config examples for your chosen base adapter.


Phase 3: Implement Your Adapter (~1-2 hours)

3.1 Clone the Repository

git clone https://github.com/absinthelabs/absinthe-adapters.git
cd absinthe-adapters
pnpm install

3.2 Copy an Existing Adapter

# Copy the adapter most similar to your protocol
cp -r adapters/uniswap-v2 adapters/my-protocol

3.3 Update the Manifest

Edit adapters/my-protocol/index.ts:

  • Update adapter name
  • Update version

3.4 Update Metadata

Edit adapters/my-protocol/metadata.ts:

  • Update protocol name
  • Update descriptions

3.5 Modify Event Handlers (if needed)

If your protocol has different events:

  • Update ABI files
  • Modify handler functions
  • Adjust data transformations

3.6 Create Test Config

Create adapters/my-protocol/tests/config/test.absinthe.json:

  • Add your contract addresses
  • Set your chain ID
  • Configure fromBlock

Phase 4: Test Locally (~30 min)

Read: Testing Guide

4.1 Run Your Adapter

pnpm run dev -- --config adapters/my-protocol/tests/config/test.absinthe.json

4.2 Verify CSV Output

  • Check that CSV files are generated
  • Verify data format matches expected schema
  • Cross-reference 2-3 transactions with block explorer

4.3 Common Issues

IssueLikely CauseFix
No CSV outputWrong event signaturesCheck ABI matches your contract
Missing datafromBlock too recentSet earlier fromBlock
Wrong valuesHandler logic errorDebug handler functions

Phase 5: Deploy & Verify (~30 min)

Once your adapter works locally, deploy it.

Follow: Deploy on Railway

After deployment:

  1. Check Railway logs for "Indexer started"
  2. Verify adapter appears in Absinthe "My Adapters"
  3. Confirm events are being received

Summary Checklist

PhaseTimeStatus
1. Learn the System~30 min
2. Study Existing Adapters~45 min
3. Implement Your Adapter~1-2 hours
4. Test Locally~30 min
5. Deploy & Verify~30 min
Total~2-4 hours

Quick Reference

Useful Links

ResourceLink
Adapters Repositorygithub.com/absinthelabs/absinthe-adapters
Example Configsadapters/*/tests/config/ in repo
Deploy GuideDeploy on Railway

Getting Help

  • Slack: Absinthe Community
  • Issues: Open a GitHub issue
  • Examples: Check existing adapter configs

Next Steps

Once deployed and verified:

  1. Return to the Absinthe App
  2. Your adapter will appear in "My Adapters"
  3. CMO can now configure point distribution rules