univ3-adapter

Deploy and Host univ3-adapter with Railway

Deploy univ3-adapter

absinthelabs/absinthe-uniswapv3:latest

absinthelabs/absinthe-uniswapv3:latest

Just deployed

Redis

bitnami/redis:7.2.5

Just deployed

/bitnami

Postgres

railwayapp-templates/postgres-ssl:16

Just deployed

/var/lib/postgresql/data

Demos Processor

A high-performance blockchain data processor for Demos that tracks function code (0xa4760a9e) and provides real-time analytics.

Features

  • Real-time Event Processing: Handles Initialize, Mint, Burn, and Swap events
  • Transactions Tracking: Track each function call as a Transaction Event

📊 What It Tracks

Fucntions

  • userVerify: 0xa4760a9e

Features

  • Real-time Indexing: Captures blockchain data as it happens with minimal latency
  • Data Persistence: Data stored with pre-configured local database

Quick Start

Preconfigured:

RPC_URL_MAINNET=https://eth.llamarpc.com
RPC_URL_HEMI=https://rpc.hemi.network/rpc
ABS_CONFIG='{"balanceFlushIntervalHours":6,"dexProtocols":[{"type":"uniswap-v2","chainId":1,"toBlock":0,"protocols":[{"name":"PEPE/WETH Pool","contractAddress":"0xa43fe16908251ee70ef74718545e4fe6c5ccec9f","fromBlock":17046833,"pricingStrategy":"coingecko","token0":{"coingeckoId":"pepe","decimals":18},"token1":{"coingeckoId":"weth","decimals":18},"preferredTokenCoingeckoId":"token1"}]},{"type":"izumi","chainId":42161,"toBlock":0,"protocols":[{"name":"WETH/ hemiBTC Pool","contractAddress":"0xa43fe16908251ee70ef74718545e4fe6c5ccec9f","fromBlock":1276815,"pricingStrategy":"coingecko","token0":{"coingeckoId":"weth","decimals":18},"token1":{"coingeckoId":"btc","decimals":8},"preferredTokenCoingeckoId":"token1"},{"name":"VUSD/ WETH","contractAddress":"0xa43fe16908251ee70ef74718545e4fe6c5ccec9f","fromBlock":1274620,"pricingStrategy":"coingecko","token0":{"coingeckoId":"vesper-vdollar","decimals":18},"token1":{"coingeckoId":"weth","decimals":18},"preferredTokenCoingeckoId":"token1"}]}],"bondingCurveProtocols":[{"type":"printr","name":"Printr Base","contractAddress":"0xbdc9a5b600e9a10609b0613b860b660342a6d4c0","chainId":8453,"toBlock":0,"fromBlock":30000000},{"type":"vusd-mint","name":"VUSDMint","contractAddress":"0xFd22Bcf90d63748288913336Cd38BBC0e681e298","chainId":1,"toBlock":0,"fromBlock":22017054},{"type":"demos","name":"Demos","contractAddress":"0x70468f06cf32b776130e2da4c0d7dd08983282ec","chainId":43111,"toBlock":0,"fromBlock":1993447},{"type":"voucher","name":"Voucher","contractAddress":"0xa26b04b41162b0d7c2e1e2f9a33b752e28304a49","chainId":1,"toBlock":0,"fromBlock":21557766}],"stakingProtocols":[{"type":"hemi","name":"Hemi Staking","contractAddress":"0x4f5e928763cbfaf5ffd8907ebbb0dabd5f78ba83","chainId":43111,"toBlock":0,"fromBlock":1220463},{"type":"vusd-bridge","name":"VUSDBridge","contractAddress":"0x5eaa10F99e7e6D177eF9F74E519E319aa49f191e","chainId":1,"toBlock":0,"fromBlock":22695105}],"univ3Protocols":[{"type":"uniswap-v3","chainId":1,"factoryAddress":"0x1f98431c8ad98523631ae4a59f267346ea31f984","factoryDeployedAt":17046833,"positionsAddress":"0xc36442b4a4522e871399cd717abdd847ab11fe88","toBlock":17051833,"poolDiscovery":true,"trackPositions":true,"trackSwaps":true,"pools":[{"name":"pepe/weth 0.3% pool","contractAddress":"0x11950d141ecb863f01007add7d1a342041227b58","fromBlock":17046833,"feeTier":3000,"pricingStrategy":"internal-twap","token0":{"symbol":"PEPE","decimals":18},"token1":{"symbol":"WETH","decimals":18},"preferredTokenCoingeckoId":"token1"},{"name":"wepe/weth 0.3% pool","contractAddress":"0xa3c2076eb97d573cc8842f1db1ecdf7b6f77ba27","fromBlock":17000000,"feeTier":3000,"pricingStrategy":"internal-twap","token0":{"symbol":"WEPE","decimals":18},"token1":{"symbol":"WETH","decimals":18},"preferredTokenCoingeckoId":"token1"},{"name":"usdc/weth 0.3% pool","contractAddress":"0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640","fromBlock":1620250931,"feeTier":3000,"pricingStrategy":"internal-twap","token0":{"symbol":"USDC","decimals":6},"token1":{"symbol":"WETH","decimals":18},"preferredTokenCoingeckoId":"token1"}]}]}'
ABSINTHE_API_URL=https://adapters.absinthe.network
ABSINTHE_API_KEY=api_key_2

Fill these details :

COINGECKO_API_KEY=
(Optional) RPC_URL_BASE=

Environment Variables Configuration

ABS_CONFIG

{
  "balanceFlushIntervalHours": Number,      // hours between balance-flush runs
  "dexProtocols": [
    {
      "type": String,                       // e.g., "uniswap-v2"
      "chainId": Number,                    // chain numeric ID
      "toBlock": Number,                    // block to stop indexing (0 = latest)
      "protocols": [
        {
          "name": String,                   // e.g., "PEPE/WETH Pool" or your template name
          "contractAddress": String,        // on-chain contract address
          "fromBlock": Number,              // starting block
          "pricingStrategy": String,        // "coingecko" or "internal-twap"
          "token0": {
            "coingeckoId"?: String,         // required if pricingStrategy = "coingecko"
            "symbol"?: String,              // required if pricingStrategy = "internal-twap"
            "decimals": Number
          },
          "token1": {
            "coingeckoId"?: String,
            "symbol"?: String,
            "decimals": Number
          },
          "preferredTokenCoingeckoId"?: String
        }
      ]
    }
  ],
  // …repeat similar structures for:
  // "bondingCurveProtocols", "stakingProtocols", "univ3Protocols", etc.
}

String to JSON Conversion

Railway environment variables must be strings, so wrap the entire object:

export ABS_CONFIG='{
  "balanceFlushIntervalHours": 6,
  "dexProtocols": [ … ],
  "bondingCurveProtocols": [ … ],
  "stakingProtocols": [ … ],
  "univ3Protocols": [ … ]
}'

Railway CLI will inject this string; your adapter should parse it at startup:

const config = JSON.parse(process.env.ABS_CONFIG);

Customizing for Your Template:

Template Name Field: adjust the name property in each protocol to match your adapter, e.g., for Demos use:

"bondingCurveProtocols":[
  {
    "type":"demos",
    "name":"demos",
    "contractAddress":"0x...",
    "chainId":43111,
    "fromBlock":1993447
  }
]

Common Build Errors

AdapterErrorDescriptionResolution
AnySchema mismatchABS_CONFIG JSON doesn’t match expected schema.- Verify keys/types in your JSON
- Run JSON Schema validator:
AnyRPC timeoutIndexer can’t reach a JSON-RPC endpoint.- Check RPC_URL_* values
- Increase timeout or retry count in config
AnyCoinGecko API keyInvalid, missing, or expired CoinGecko API key.- Obtain a valid key from CoinGecko
- Set COINGECKO_API_KEY in env
- Ensure your key or plan supports the required request volume

Deploy and Host

About Hosting

Each adapter requires a reliable hosting environment to ensure uninterrupted data indexing. Choose between cloud providers, self-hosted servers, or managed container platforms based on your performance, scalability, and maintenance preferences.

Why Deploy

One-Click Deployment Rationale

We’ve chosen a one-click deployment model because each adapter is essentially a continuously running indexer service. This approach:

  • Simplifies onboarding: Users—both technical and non-technical—can deploy without writing custom scripts.
  • Ensures consistency: This template sets up the service and its PostgreSQL database in one go.
  • Reduces operational overhead: No manual server provisioning or database wiring required.

Hosting Considerations

  • Local vs. Self-Hosted: While Railway spins up both the adapter container and a managed Postgres instance by default, you can easily switch to your own self-hosted Postgres by overriding DB_URL.
  • Continuous Operation: Indexers must run 24/7 to maintain up-to-date data synchronization. One-click deployment abstracts away restarts, health checks, and reconnections.

Common Use Cases

  • Ease of Use: Designed so that anyone—regardless of technical background—can run the indexer with minimal effort
  • Rapid Prototyping: Quickly spin up an environment to test new contracts or data pipelines without complex infrastructure.
  • Production Readiness: Out-of-the-box metrics, health endpoints, and automated restarts ensure reliability in real workloads.

Dependencies for

Deployment Dependencies

Docker Image: All adapters reference the same base repo/image on GitHub Container Registry:

ghcr.io/absinthelabs/absinthe-demos:demos

This image bundles your indexer code and its runtime dependencies, ensuring consistency across environments.


Template Content

absinthelabs/absinthe-uniswapv3:latest

ghcr.io/absinthelabs/absinthe-uniswapv3:latest

More templates in this category

View Template
Foundry Virtual Tabletop
A Self-Hosted & Modern Roleplaying Platform

View Template
(v1) Simple Medusa Backend
Deploy an ecommerce backend and admin using Medusa

View Template
peppermint
Docker-compose port for peppermint.sh