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
Following the Vyper suite
| 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 |
| 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 |
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.
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
General Vyper documentation can be found here.
Join our Discord channel and post a message