Giter Club home page Giter Club logo

order-book's Introduction

Permaweb Order Book

This repository is built on top of the Universal Content Marketplace (UCM) protocol to allow the buying and selling of atomic assets on Arweave.

order-book's People

Contributors

nickj202 avatar vincejuliano avatar jshaw-ar avatar twilson63 avatar jajablinky avatar afisher3578 avatar

Stargazers

Vedant Chainani avatar  avatar

Watchers

 avatar DMac avatar Sam Williams avatar  avatar

order-book's Issues

feat(contract): add contributor rewards algorithm

contributors will receive 10% of the total supply of the UCM token over a period of 4 years.

the groups of contributors are broken into 4 level

  • black
  • platnium
  • gold
  • silver

in each level there will be members, and percent properties, the members will be a object containing records where the key is the wallet address and the value is an object with the amount of units that member has in that level and the lastMint height when the member last minted their rewards.

Members can exist in multiple levels

Any member at any time can choose to mint their contribution rewards, when a mint function is run, the difference from the last minted height and the current height is determined for the contributor, then the reward is calculated by the reward unit for that level using the reward supply and percent of level. This will create a unit reward that can be multiplied with block range to calculate the reward for that level, then it calls the distributeAllocation function that takes a set of members and the reward to allocate the rewards between the members in the level. Finally we grab the reward for the caller and credit their balance in the Universal Content Marketplace, then update their lastMint prop for that member

Here is an example of the data structure:

{
  ... contractData,
  contributors: {
    black: {
      members: {
        core1: {
           amount: 10,
           lastMint: 0
       },
       core2: {
          amount: 10,
          lastMint: 5
       },
     },
     percent: 50
    },
    platinum: {
       members: {},
       percent: 30
    } 
  }
  percent: 10,
  period: 1051200,
}

feat: Add Mint Reward Daily Process

This daily process runs every 720 heights and takes ? amount of BazAR Token and mints it to the following addresses:

100% - Based on the current streaks balances

I should be able to use the streaks object to get the list of addresses that had activity since the last time the reward was processed. Then create a two objects to distribute rewards too.

Orderbook SDK Thoughts

  • It would be nice to call the sdk folder sdk instead of lib makes it easier to find.
  • Also, if possible, it would be nice to make OrderBook.init a constructor instead of a promise, this way it can be initialized when app instance is initialized.
import { OrderBook } from 'permaweb-orderbook'

const orderbook = OrderBook.init({...})

async function main() {
  ...do async stuff
}

feat(contract): Ultrasound Fee

As each trade happens:

Internally transfer $U to the contract for a fee, then create a buy order of $zAR for the market price $U <> $zAR

feat: Add Streak Tracking

Streaks will be measured on how to distribute mint rewards, these streaks, track how often users interact with the bazAR exchange.

Track (up to 30) days an address has interacted with the contract.
If a user is on a streak, and has an interaction between 720 and 1440 heights, then the streak continues
unless the streak is at thirty and it resets back to 1.

The first day of the streak is equal to 1 point, each additional day is plus .1 with a max of 4 points for 30 days.

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.