BlockChain區塊鏈
  • 本書簡介
  • 區塊鏈運作原理
  • Bitcoin介紹
    • 簡介
    • Bitcoin其他知識
  • Bitcoin原理與實作
  • BitcoinJS
    • BTC 地址格式種類
    • 從 Mnemonic 轉為地址
  • Serverless 架構實作
  • Docker常用指令
  • ethereum初探
    • ethereum歷史
    • EVM
  • ethereum PoS 節點架設
  • ethereum(Docker)
  • ethereum(Geth)
    • Parity
  • ethereum(智能合約)
    • 合約測試 Unit Test
    • DAO
    • 可升級合約
    • 使用合約進行 multiswap
    • 合約安全
    • 開發工具
    • Hardhat 教學
      • Hardhat 寫測試
    • ERC-721 範例
      • 白名單機制
    • OpenZeppelin 合約 library
    • Truffle
    • 合約部屬
    • solidity 教學
  • ethereum(Dapp)
    • 相關 SDK
    • Multicall
    • Ethers.js 使用
    • Remix IDE
    • web3.js 使用
    • 在網頁上使用 web3 並操作區塊鏈
      • solidity筆記
  • Hyperledger Fabric
  • blockchainDB
  • 挖礦程式使用教學
    • 門羅幣/Monero (XMR)
  • Bitfinex API 使用
  • FTX API
  • CCXT 通用交易所 API
  • Solana 教學
  • Ethereum BigQuery
  • The Graph
    • yaml 定義
    • mapping 語法
    • Schema 定義
    • Query 範例
    • Unit test
  • DeFi 筆記
    • MEV 相關
    • Dex 聚合
    • Yearn
    • Curve
    • Uniswap
      • Swap 互動
    • AAVE、Compound
      • Compound 原理
      • AAVE 合約開發
Powered by GitBook
On this page

Was this helpful?

  1. DeFi 筆記

Curve

https://curve.readthedocs.io/

PreviousYearnNextUniswap

Last updated 3 years ago

Was this helpful?

Admin fee v.s fee

Pools 種類 (Plain pools, Lending pools, Metapools)

DAO contracts

Gauge

Each pool has an individual liquidity gauge. Curve incentivizes liquidity providers with the CRV. All of the inflation is distributed to Curve liquidity providers, according to measurements taken by the gauges. Gauge 可想像為 staking 對應池子 LP token 的地方。

獲得 CRV

於 curve 的任意池子提供流動性均會獲得。在 Ypool 可同時獲得 CRV 與 YFI

Subgraph 相關 Query

LpToken amount

透過 addLiquidityEvents 與 RemoveLiquidityEvent 來做計算獲得 user 當前 lptoken amount

{
  addLiquidityEvents(
    where: {
      provider: "0xbdfa4f4492dd7b7cf211209c4791af8d52bf5c50",
    },
    orderBy: block,
    orderDirection: desc
  ) 
  {
    block
    tokenAmounts
    timestamp
    transaction
    invariant
    pool {
      name
      assetType
      adminFee
      virtualPrice
      isMeta
      coins {
        token {
          name
        }
      }
    }
  }	
}

https://thegraph.com/explorer/subgraph?id=0x2382ab6c2099474cf424560a370ed1b1fdb65253-0&view=Playground
https://github.com/curvefi/curve-subgraph/issues/5
[Discussion] Introduction of an Admin Fee to Incentivise Protocol GovernanceCurve.fi Governance
Logo
Curve StableSwap: Pools — Curve 1.0.0 documentation
Logo
GitHub - curvefi/curve-dao-contracts: Vyper contracts to be used by Curve DAOGitHub
The Curve DAO: Liquidity Gauges and Minting CRV — Curve 1.0.0 documentation
Logo
Logo