Git Product home page Git Product logo

pendle-core's Introduction

Pendle Core

This repository contains the core smart contracts for the Pendle Protocol.

Introduction

Prominent DeFi protocols have introduced various yield bearing tokens, like Aave's aToken or Compound's cToken, which has shown incredible growth and community acceptance. Pendle Protocol builds on top of this layer, by splitting the yield bearing tokens into two tokens: the Yield Token (YT) that represents the right to receive the yield, and the Ownership Token (OT) that represents the right to the underlying yield bearing tokens. This allows for the trading of yield, which has wide-ranging applications.

On top of yield tokenisation, Pendle Protocol has an AMM specifically designed for the trading of time-decaying assets, which aims to minimise impermanent loss (IL) for liquidity providers.

How it works

  • All current documentations for how Pendle works is at this link

Deployment:

  • To deploy core contracts:
    • set the multisig addresses in .env, similar to .env.example
      • Please note that for networks other than mainnet and kovan, the scripts will use the deploying key as all the multisig.
    • Run: (this runs scripts/deploy/deploy.ts)
    yarn deploy:core --network <network>
    
    • This will save the deployed contracts to deployments/<network>.json
    • If we want to reset the instance, put RESET=true:
    RESET=true yarn deploy:core --network <network>
    
  • To deploy test instances of contracts (yield contracts, markets, liquidity mining) for an expiry: (this runs scripts/manage/seed_test_contracts.ts)
    EXPIRY=<expiry_to_seed> yarn deploy:seed --network <network>
    
    • This will save the new yield contracts to deployments/<network>.json as well
  • To verify contracts that have been deployed in deployments/<network>.json:
    • First, install tenderly link
    • Then, tenderly login
    • Run: (which runs scripts/manage/verify_tenderly.ts)
    yarn verify --network <network>
    

Testing:

  • Create a .env file containing the following properties:
    ALCHEMY_KEY=<insert your ALCHEMY_KEY key here>
    
  • Run test:
    yarn test
    
  • Run test coverage:
    yarn coverage:all
    

Setup for UI development environment (forking mainnet)

  • In a separate terminal:
yarn hardhat node
  • Mint tokens to alice, bob, charlie and let alice tokeniseYield, add liquidity and stake:
yarn dev
  • Teleport by 1 week
yarn teleport

Note on naming

  • In the contracts and tests, Yield Token (YT) are referred to as XYT. XYT and YT refer to the same thing.

Licensing

The primary license for Pendle Core is the Business Source License 1.1 (BUSL-1.1), see LICENSE.

Exceptions

  • All files in contracts/interfaces/, contracts/governance/ and contracts/mock are licensed under MIT (as indicated in their SPDX headers)
  • contracts/periphery/Timelock.sol and contracts/tokens/PENDLE.sol are also licensed under MIT (as indicated in their SPDX header)
  • All files in contracts/libraries/ are licensed under GPL-2.0-or-later (as indicated in their SPDX headers), see contracts/libraries/LICENSE

pendle-core's People

Contributors

unclegrandpa925 avatar mrenoon avatar xrobotm avatar ayobuenavista avatar engwarrior avatar josephsaw avatar ngfam avatar steffenix avatar theblockchaindeveloper avatar 0xngmi avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.