DIA Nexus Documentation
  • Nexus Overview
  • Intro to Nexus
    • How it works
    • Nexus vs. Lumina
    • Integrated Chains
  • Data products
    • Token Price Feeds
    • RWA Price Feeds
    • Randomness
    • Fair-value Feeds
  • How-to Guides
    • Fetch Price Data
      • Solidity
      • Vyper
      • Demo Oracles
      • Chain-specific Guide
        • Aleph Zero
        • Alephium
        • Edu Chain
        • Hydration
        • Kadena
        • LUKSO
        • Somnia
        • Stacks
        • Superseed
        • XRP Ledger (XRPL)
    • Generate Randomness
      • Solidity
      • WASM
      • Demo Oracles
      • Chain-specific Guide
        • Alephium
    • Migrate to DIA
    • Fund the Oracle
    • Build a Scraper
      • Development Cluster Stack
      • DIA Test‐Space with Docker Compose
      • DIA Test‐Space with Minikube
      • Add a new exchange scraper
      • Add a new foreign scraper
      • Add a new liquidity scraper
      • Additional notes
  • Request a Custom Oracle
  • Reference
    • Architecture
      • Data sourcing
      • Data computation
      • Data delivery
    • APIs
      • Token prices
        • RestAPI
          • Request Samples
        • GraphQL
          • Request Samples
      • RWA prices
    • Pricing Methodologies
      • IR: Interquartile Range Filter
      • MAIR: Moving Average with Interquartile Range Filter
      • VWAP: Volume Weighted Average Price
      • VWAPIR: Volume Weighted Average Price with Interquartile Range Filter
      • LST fair price
    • Data Sources
      • CEXes Data
      • DEXes Data
    • Smart Contracts
      • DIAOracleV2.sol
      • DIARandomOracle.sol
    • Randomness Protocol
  • Resources
    • Audits
    • Community & Support
    • Security Bounty Program
    • Research
      • Return Rates in Crypto Farming
      • Crypto Volatility Index
      • Compounded Rates
      • Polkadot Medianizer
    • T&C
      • Licence Agreement
      • Contributor Covenant Code of Conduct
      • Disclaimer
Powered by GitBook
On this page
  • Add a new liquidity scraper
  • Liquidity Command
  • Liquidity Test
Export as PDF
  1. How-to Guides
  2. Build a Scraper

Add a new liquidity scraper

Add a new liquidity scraper

Implement LiquidityScraper interface at pkg/dia/scraper/liquidity-scrapers/ScraperInterface.go file

type LiquidityScraper interface {
	Pool() chan dia.Pool
	Done() chan bool
}
  1. Add a scraper implementation, MyLiquidityScraper.go file to pkg/dia/scraper/liquidity-scrapers/ folder implement the functions:

func (scraper *MyLiquidityScraper) Pool() chan dia.Pool {}
func (scraper *MyLiquidityScraper) Done() chan bool {}
  1. Add a constructor for the scraper:

func NewMyLiquidityScraper(exchange dia.Exchange) *MyLiquidityScraper {}

Liquidity Command

go mod tidy -go=1.16 && go mod tidy -go=1.17 && go install && liquidityScraper -exchange=ExchangeName

Liquidity Test

go mod tidy -go=1.16 && go mod tidy -go=1.17 && go install && liquidityScraper -exchange=EXCHANGE_NAME
  • PlatypusFinance: go mod tidy -go=1.16 && go mod tidy -go=1.17 && go install && liquidityScraper -exchange=PlatypusFinance

  • Orca: go mod tidy -go=1.16 && go mod tidy -go=1.17 && go install && SOLANA_URI_REST=https://try-rpc.mainnet.solana.blockdaemon.tech/ liquidityScraper -exchange=Orca

PreviousAdd a new foreign scraperNextAdditional notes