Skip to content

vyper-protocol/vyper-core

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Vyper Protocol

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 farming LP tokens, which after some time (e.g. a week) are redistributed to reflect the the impermanent loss vs fees generated.

There are three main smart contracts:

  • Vyper Core: manages 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). Supports up to 10 different underlyings for sophisticated payoffs
  • Redeem Logic: payoff formula which specifies how collateral should be distributed, based on initial collateral deposited, initial prices, final prices, and other parameters (e.g. strike, duration)

Repository Structure

Following the Vyper suite

Solana Programs

Name Type Version Path
Vyper Core Core Primitive 0.1.0 programs/vyper-core
Rate Switchboard Rate Plugin 0.1.0 programs/rate-switchboard
Rate Pyth Rate Plugin 0.1.0 programs/rate-pyth
Rate Mock Rate Plugin 0.1.0 programs/rate-mock
Redeem Logic Lending Redeem Logic Plugin 1.0.0 programs/redeem-logic-lending
Redeem Logic Lending Fee Redeem Logic Plugin 1.0.0 programs/redeem-logic-lending-fee
Redeem Logic Farming Redeem Logic Plugin 2.0.0 programs/redeem-logic-farming
Redeem Logic Vanilla Option Redeem Logic Plugin 2.0.0 programs/redeem-logic-vanilla-option
Redeem Logic Forward Redeem Logic Plugin 1.0.0 programs/redeem-logic-forward
Redeem Logic Settled Forward Redeem Logic Plugin 1.0.0 programs/redeem-logic-settled-forward
Redeem Logic Fila Redeem Logic Plugin 1.0.0 programs/redeem-logic-fila
Redeem Logic Digital Redeem Logic Plugin 1.0.0 programs/redeem-logic-digital

Rust Libraries

Name Version Path
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