This repository contains a live preview and example usage of the Yearn SDK
Explore this codebase to learn how to start interacting with the Yearn protocol in your own app!
-
git clone https://github.com/turtlemoji/yearn-sdk-examples.git
to download the latest version -
yarn install
to install dependencies with yarn -
Create an Alchemy account and put the key in src/constants.js
-
yarn start
to run the developer environment
-
src/index.js -> Boostraps React (enables StrictMode) and imports the main component from
src/App.jsx
-
src/App.jsx -> Boostraps the examples homepage and setups the routing code for each example page found at
src/examples/
-
src/examples/Balance.jsx -> Example page for using the SDK to list balances of tokens from a wallet
-
src/examples/Vaults.jsx -> Example page for using the SDK to list Yearn Vaults and get detailed information from a single vault
-
src/examples/Deposit.jsx -> Example page for using the SDK to deposit a token at a Yearn Vault
-
src/examples/Withdraw.jsx -> Example page for using the SDK to withdraw a token at a Yearn Vault
-
src/Home.jsx -> Initial page loaded when no example is selected
-
src/styles.scss -> CSS file to create styling for components
-
public/index.html -> HTML file where React will inject the export from `src/index.js``
-
src/sdk.js -> SDK initialization code
-
src/wallet.js -> Browser Wallet connection initialization code
-
src/constants.js -> API Keys and fixed addresses used
- Yearn SDK Stack: https://docs.yearn.finance/vaults/yearn-sdk/yearn-stack
- Yearn SDK Repository: https://github.com/yearn/yearn-sdk
- Yearn SDK Documentation: https://yearn.github.io/yearn-sdk/
- Yearn API: https://docs.yearn.finance/vaults/yearn-api
- Yearn Protocol Documentation: https://docs.yearn.finance/
- Yearn Partner Documentation: https://docs.yearn.finance/partners/introduction
- What are Vaults and Strategies?: https://medium.com/iearn/yearn-finance-explained-what-are-vaults-and-strategies-96970560432