Code Monkey home page Code Monkey logo

synthetic-trading-bots's Introduction

Tradegen Protocol

Purpose

Implementation of a decentralized asset management system on the Celo blockchain.

Overview

Users can invest in pools of assets (decentralized hedge funds) that are managed by other users or external projects. When users invest in a pool, they receive tokens that represent their share of the assets in the pool. These tokens fluctuate in value based on the price of the pool's underlying assets and lifetime performance. To withdraw from a pool, users can burn their pool tokens and pay a performance fee to the pool manager (if they are withdrawing for a profit). Users receive their share of the pool’s assets when they withdraw.

Pools are represented by smart contracts that pool managers can interact with using the platform’s UI. These contracts send transactions to whitelisted DeFi projects on the pool’s behalf, eliminating the possibility of pool managers withdrawing other users’ investments into their own account or calling unsupported contracts.

In addition to pools, users can also invest in ‘NFT pools’ with a capped supply of pool tokens (each of which is an NFT) and different levels of scarcity (represented by four classes of tokens). These tokens can be traded on the platform’s marketplace or deposited into farms to earn yield while staying invested in the pool. Since there’s a max supply of pool tokens, tokens on the marketplace may trade above mint price based on factors such as pool’s past performance, token class, farm yield, and pool manager’s reputation.

Disclaimer

This protocol is deprecated. For the latest version of the asset management protocol, visit https://github.com/Tradegen/protocol-v2.

System Design

Smart Contracts

  • ERC20Verifier - Checks if an ERC20 token is valid.
  • UbeswapLPVerifier - Checks if a LP token created by Ubeswap is valid.
  • UbeswapFarmVerifier - Checks if a pool's call to a Ubeswap farm contract is valid.
  • UbeswapRouterVerifier - Checks if a pool's call to the Ubeswap router contract is valid.
  • AddressResolver - Stores the address of each contract in the protocol.
  • AssetHandler - Tracks whitelisted assets and handles price calculations.
  • BaseUbeswapAdapter - Makes calls to the Ubeswap router and farm contracts. Used for calculating price and checking if an address is valid.
  • ERC20PriceAggregator - Calculates the price of an ERC20 token.
  • Marketplace - Used for buying/selling NFT Pool tokens.
  • NFTPool - A pool with a fixed number of tokens, each of which is an NFT.
  • NFTPoolFactory - Creates NFTPool contracts.
  • Ownable - Provides authorization control for contracts.
  • Pool - A decentralized hedge fund. Stores a collection of assets and is managed by a user or an external contract.
  • PoolFactory - Creates Pool contracts.
  • Settings - Tracks the parameters used throughout the protocol.
  • TradegenLPStakingEscrow - An escrow that holds tokens for the liquidity mining rewards program.
  • TradegenLPStakingRewards - Implements the liquidity mining rewards program.
  • TradegenStakingEscrow - An escrow that holds tokens for the staking program.
  • TradegenStakingRewards - Implements the staking rewards program.
  • UbeswapLPTokenPriceAggregator - Calculates the price of a Ubeswap LP token.
  • UbeswapPathManager - Stores the optimal path for swapping to/from each whitelisted asset.

Repository Structure

.
├── addresses  ## Address of each deployed contract, organized by network.
├── audits  ## Audit reports.
├── build/abi  ## Generated ABIs that developers can use to interact with the system.
├── contracts  ## All source code.
│   ├── interfaces  ## Interfaces used for defining/calling contracts.
│   ├── libraries  ## Libraries storing helper functions.
│   ├── openzeppelin-solidity  ## Helper contracts provided by OpenZeppelin.
│   ├── test  ## Mock contracts used for testing main contracts.
│   ├── verifiers  ## Contracts for verifying external protocols.
├── test ## Source code for testing code in //contracts.

Documentation

To learn more about the Tradegen project, visit the docs at https://docs.tradegen.io.

To learn more about Celo, visit their home page: https://celo.org/.

License

MIT

synthetic-trading-bots's People

Contributors

cangshu888 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.