Skip to content

Kuiper is an asset management protocol that bundles ERC20 tokens into baskets and mints an ERC20 token representing the basket.

Notifications You must be signed in to change notification settings

kuiperfinance/contracts

Repository files navigation

Kuiper Finance

Introduction

Kuiper is an asset management protocol that bundles ERC20 tokens into baskets and mints an ERC20 token representing the basket.

Each basket has a publisher who can propose basket weights and composition, a license streaming fee on the basket, as well as update the publisher of that basket. All of these actions are subject to a 24 hour timelock. Baskets are created through the Factory contract which also creates an Auction contract for each basket.

Basket Tokens are standardized to 18 decimals.

When a new weighting proposal for a basket passes the timelock, a rebalancing auction is started where anyone can bond a portion of the basket token supply and settle the auction by rebalancing the basket.

Token weights are defined as the amount of that token in one basket token, multiplied by the current ibRatio (Index to Basket Ratio).

The amounts needed to rebalance the basket are determined by the new weights as well as how long it takes for the auction to become settled. If an auction has not been settled after being bonded within 24 hours, the bond can be burned and the auction will need to be started again. Bounties can also be added to the auction that are claimed by the auction settler to incentivize rebalances.

Streaming fees for a basket are split between the publisher as well as the protocol owner if the protocol fee is turned on. They are calculated and handled on each mint or burn of the basket. The protocol owner fee split must be less than 20% of the basket's license fee.

The protocol owner can change auction parameters, such as the auction multiplier, the min amount needed to bond, how much the auction decrements, as well as settings related to the protocol fee (fee split and receiving address).

The protocol is designed for standard ERC20 tokens, it is not currently concerned with the potential effects of rebasing or non-standard ERC20 implementations.

Learn more about Kuiper Finance:

Sample Hardhat Project

This project demonstrates a basic Hardhat use case.

Run mocha tests on Auction, Basket and Factory contracts:

npx hardhat test

Sample Result:

❯ npx hardhat test
...
Auction
  ✓ should allow bonding by one user when there is an auction ongoing
  ✓ should allow burning the bond if an auction hasn't been settled in 24 hours
1799200000000000000
  ✓ should allow settling an auction w/o bond
  ✓ should allow settling an auction by the auction bonder
  ✓ should allow ending an auction
  ✓ should not allow ending an auction if bonded

Basket
  ✓ should allow minting if user has all needed balances and approvals
  ✓ should allow burning if user has basket tokens
10000002851927903
990099007105256450
  ✓ should collect fees

Factory
  ✓ should add a valid proposal
  ✓ should revert on duplicate tokens
  ✓ should revert on < minLicenseFee
  ✓ should revert on zero values
  ✓ should revert on mismatched arrays
  ✓ should create a valid basket and mint 1 basket token to sender
  ✓ should fail basket creation if creator doesn't have enough tokens or not approved
...
  16 passing (9s)

Try running some of the following tasks:

npx hardhat accounts # Lists accounts generated by Hardhat
npx hardhat clean    # Clears the cache and deletes all artifacts
npx hardhat compile  # Compiles the entire project, building all artifacts
npx hardhat help     # Displays usage and available tasks
npx hardhat node     # Start a JSON-RPC server on top of Hardhat EVM
npx hardhat test     # Runs mocha tests

Contributing

If you are interested in contributing to Kuiper Finance or have any questions, please ping us on Discord.

Contract Addresses

Contract Mainnet Address
Factory 0xe3247faecbb97261167f8bf1d333689c22f9414b
Basket 0xb6ff112b2449151076c56c14742247087692b55d
Auction 0xF50c5f544Cfb8c07F8a1f08b582eb55149a540CE

Audits

About

Kuiper is an asset management protocol that bundles ERC20 tokens into baskets and mints an ERC20 token representing the basket.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published