Skip to content

noodles-fun/subgraph

Repository files navigation

Noodles.Fun — Feed Your KOLs! 🍜

Noodles.Fun turns Twitter (X) accounts into special bonding curve tokens. Trade these tokens and use them to pay for promotion services on X, such as shoutouts or pinned tweets. A fun way to support and engage with KOLs!

How It Works

  1. Every Twitter Account Has a Token: Each token represents a unique bonding curve for a Twitter (X) account.
  2. Trade Instantly: Use a bonding curve to buy or sell tokens. No need for liquidity pools or order books.
  3. Spend Tokens for Promotions: The X account owner can accept tokens as payment for services, such as tweets or pinned posts.

Subgraphs

Query example

{

  #### Profile view #######

  users {
    id # userAddress

    # holdings 
    balances {
      visibility {
        visibilityId
        creator {
          id
        }
        metadata
        totalSupply
      }
      balance
    }

    # as a creator 
    visibilities {
      visibilityId
      metadata
      trades {
        creatorFee # all creator fees
      }
    }
    claimedCreatorEarnings {
      amount # claimed creator fees
    }

   # as a referral 
   partner {
    id 
   }
   referralTradesEarnings {
      referrerFee
   }    

    # as a partner 
    referrersAsPartner {
      id # referrer addresses 
    }
    partnerTradesEarnings {
      partnerFee
    }
  }
  
  #### Visibility view #######
  
  visibilities {
    visibilityId
    metadata
    creator {
      id # userAddress
    }
    currentPrice
    totalSupply
  }
  visibilityBalances(orderBy: balance orderDirection: desc) {    
    visibility {
      visibilityId
    }
    user {
      id #userAddress
    }
    balance
  }
  creditsTrades {
    user {
      id # userAddress
    }
    referrer {
      id # referrerAddress, can be null
    }
    partner {
      id # partnerAddress, can be null
    }
    visibility {
      visibilityId
      totalSupply # newTotalSupply
      currentPrice # newcurrentPrice
    }
    amount
    isBuy
    buyCost # total paid by the user (include fees), if isBuy == true
    sellReimbursement # sent to the user (fees deducted), if isBuy == false
  }
}

Development

Setup

  1. Create your subgraph with The Graph Studio

  2. Install packages:

    npm install -g @graphprotocol/graph-cli
    npm install
  3. Authenticate

    graph auth xxxxxx # auth key from The Graph Studio
  4. Build

    npm run build

Deploy

The Graph Studio

graph deploy --node https://api.studio.thegraph.com/deploy/ noodles-subgraph-testnet # replace noodles-subgraph-testnet by your subgraph slug

Goldsky

 goldsky subgraph deploy noodles-subgraph-testnet/0.0.9 --path . # replace noodles-subgraph-testnet/0.0.9 by the slug and version you want

Testing

  1. Install Docker (if not already installed)

  2. Run tests:

    npm run test

About

Feed your KOLs with Noodles.Fun - Spend creators tokens to promote on socials

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published