LogoLogo
Launch appBuy WOOFollow usAnalytics
  • Docs
  • Dev docs
  • Welcome
  • Guides
    • Integrate WOOFi as a liquidity source on EVM
    • Integrate WOOFi as a liquidity source on Solana
      • Rust SDK
      • TypeScript SDK
      • Architecture
    • Become a WOOFi broker
  • Resources
    • Product Docs
    • The math behind sPMM
    • Smart contract architecture
    • On-chain price feeds
  • References
    • Contract Addresses
      • Solana
      • Arbitrum one
      • Avalanche c-chain
      • Base
      • BNB smart chain
      • Ethereum
      • Linea
      • Mantle
      • OP mainnet
      • Polygon PoS
      • zkSync Era
      • Sonic
    • Data APIs
      • Swap
      • Earn & Stake
    • Audits and bounties
    • GitHub
  • Deprecated docs
    • [v1] sPMM liquidity integration
    • [v1] On-chain price feeds
    • Legacy contracts
Powered by GitBook
On this page
  • Architecture Overview
  • Account Structure
  • WooConfig
  • WooPool
  • WooOracle
  • Fee rate
  • WOOFi's sPMM Rust Environment Setup
  • Requirements
  • Setup
  • Usage
  • Tests

Was this helpful?

  1. Guides
  2. Integrate WOOFi as a liquidity source on Solana

Architecture

PreviousTypeScript SDKNextBecome a WOOFi broker

Last updated 1 month ago

Was this helpful?

Architecture Overview

Account Structure

Here is the structure for WOOFi's Synthetic Proactive Market Making (sPMM) contract on Solana. This repository contains the Rust smart contract as well as the Typescript SDK (@woonetwork/WOOFi_Solana) to interact with a deployed program.

WooConfig

A WooConfig is a config struct to record:

  • authority: Owner of the program

  • paused: Whether the program is paused

  • Woopool's admin authority

  • Wooracle's admin_authority

  • Collect fee authority

  • Guardian set authority

  • Pause program authority

WooPool

A WooPool is a concentrated liquidity pool for a token.

Each WooPool account hosts the necessary information to deal with the accounting of the pool. It also hosts the PDAs to the vaults. Only the WOO sPMM program has the authority to withdraw from the vault.

A WooPool account is hashed by the WooConfig, token mint address and quote token mint address.

WooOracle

A WooOracle is an on-chain price feed in order to simulate the order book from centralized exchanges without sacrificing capital efficiency.

Fee rate

Fee rate settings stored in WooPool's fee_rate param can be updated by set_pool_fee_rate function by the admin.

WOOFi's sPMM Rust Environment Setup

This repository contains the Rust smart contract as well as the Typescript SDK (@woonetwork/WOOFi_Solana) to interact with a deployed program.

Requirements

  • Anchor 0.29.0

  • Solana 1.17.31

  • Rust 1.72.0

Setup

Set up a valid Solana keypair at the path specified in the wallet in Anchor.toml to do local testing with anchor test flows.

$NODE_PATH must be set to the node_modules directory of your global installs. For example, using Node 18.20.4 installed through nvm, the $NODE_PATH is the following:

$ echo $NODE_PATH
/Users/<home_dir>/.nvm/versions/node/v18.20.4/lib/node_modules

Usage

Tests

  • Run "cargo test --lib" to run Rust unit tests

WooFi in Solana uses to check whether Woo oracle's price is valid.

Detailed explanations can be found on the

Install Anchor using instructions found .

Pyth oracle
WooFi Developer Portal
here
WooFi's Overview