npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@yield-protocol/yieldspace-tv

v0.1.11

Published

Yieldspace for tokenized vaults

Downloads

4

Readme

YieldSpace for Tokenized Vaults

DISCLAIMER: Please do not use in production without taking the appropriate steps to ensure maximum security. This code is provided as-is, with no guarantees of any kind.


yieldspace-tv is a new implementation of Yieldspace that allows for the use of shares in tokenized vaults as base reserves. This is based on concepts and formulas derived in "YieldSpace with Yield Bearing Vaults" by Allan Niemerg which was based on the original "The Yield Protocol: On-Chain Lending With Interest Rate Discovery" written by Dan Robinson and Allan Niemerg.

The pool is an UniV2 style, x/y fixed constant automated market maker used for providing liquidity and trading a pair of "fyToken" and related underlying "base" token as described in the papers noted above. In this new version, the base tokens can now be tokenized vault shares.

The use of tokenized vaults as base allows for a higher yield on the base reserves held by the pool. The main changes in the math come from introducing c and mu into the equation. c represents the current value of the tokenized vault shares. mu is the normalization factor which is the initial c0 at first mint.

This repo also serves as Yield's initial foray into the Foundry development tool ecosystem. Tests are written in Solidity and use Foundry cheatcodes.

This repo includes:

Additional notes:

  • If too many base tokens are sent to the mint functions (mint or mintWithBase), the extra base tokens will be sent back to the to address
  • If too many tokens are sent in to buyFYToken or buyBase, those tokens are not sent back. The user can retrieve them with retrieveFYToken or retrieveBase.
  • The remaining tokens in the buy functions will typically be small rounding differences and not worth the gas to send back. Also, changing the behavior of the buy functions to match the mint functions would be a breaking change. For that reason, we have chosen to leave the current behavior.

As this repo is still under development, these smart contracts have not yet been deployed.

Detailed documentation can be found in the Yield docs.

Install

Pre Requisites

Before running any command, be sure Foundry is installed.

Setup

git clone [email protected]:yieldprotocol/yieldspace-tv.git
cd yieldspace-tv
forge update

Test

Compile and test the smart contracts with Forge:

forge test

If using forking capability, be sure to add MAINNET_RPC to your .env.

Math

In developing this YieldSpace we have used two different libraries for fixed point arithmetic.

Security

In developing the code in this repository we have set the highest bar possible for security. yieldspace-tv has been audited by ABDK Consulting and the report can be found here.

We have also used fuzzing tests for the Pool and YieldMath contracts, allowing us to find edge cases and vulnerabilities that we would have missed otherwise.

Bug Bounty

Yield is offering bounties for bugs disclosed through Immunefi. The bounty reward is up to $500,000, depending on severity. Please include full details of the vulnerability and steps/code to reproduce. We ask that you permit us time to review and remediate any findings before public disclosure.

Contributing

This project doesn't include any governance or upgradability features. If you have a contribution to make, please reach us out on Discord and we will consider it for a future release or product.

Acknowledgements

We would like to thank Dan Robinson (Paradigm), Georgios Konstantopoulos (Paradigm), SamCZSun (Paradigm), Mikhail Vladimirov (ABDK), Gustavo Grieco (Trail of Bits), Martin Lundfall (dAppHub), Noah Zinsmeister (Uniswap), and Transmissions11 (Paradigm) for their feedback and advice. We wouldn't be here without them.