Skip to content

FedererKK/vyper-core

 
 

Repository files navigation

Vyper Protocol

Currently Vyper Core works as a set of smart contract which can take any SPL token and a custom payoff function, and redistribute the tokens to match the payoff upon certain conditions. For example, people can deposit Orca LP tokens, which after some time (e.g. a week) are redistributed to reflect the the impermanent loss vs fees generated.

Currently there are three main smart contracts:

  • Vyper Core: manages tranches (position IOUs) creation and redemption, accepts only fungible tokens (e.g. LP tokens or cTokens). It redistributes collateral deposited consuming data from the rate calculator and redeem logic contracts
  • Rate Calculator: updates the fair price of the collateral deposited (e.g. USD value of LP token)
  • Redeem Logic: payoff formula which specifies how collateral should be distributed, based on initial collateral deposited, initial fair price, and final fair price

Repository Structure

Following the Vyper suite

Solana Programs

Name Type Version Path
Vyper Core Core Primitive 0.1.0 programs/vyper-core
Rate Mock Rate Plugin 0.1.0 programs/rate-mock
Redeem Logic Lending Redeem Logic Plugin 0.1.0 programs/redeem-logic-lending
Redeem Logic Lending Fee Redeem Logic Plugin 0.1.0 programs/redeem-logic-lending-fee

Rust Libraries

Name Version Path
Vyper Math 0.1.0 libs/vyper-math
Vyper Utils 0.1.0 libs/vyper-utils
Vyper Macros 0.1.0 libs/vyper-macros

Typescript SDK

We're currently working on a typescript sdk for frontend integrations. This is still a WIP, but it's available at the path /sdk.

Once finished it'll be published as a npm module.

Setup, Build, and Test

First, install dependencies:

$ yarn install

And install Anchor by following the instructions here.

Build the program:

$ anchor build

Finally, run the tests:

$ cargo test
$ anchor test

Documentation

General Vyper documentation can be found here.

Getting Help

Join our Discord channel and post a message

About

🐍 Core primitive for tranching on Solana

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 61.5%
  • TypeScript 38.2%
  • JavaScript 0.3%