Skip to content

dMarket Smart Contract#102

Open
ali-h wants to merge 9 commits intohive-engine:hive-enginefrom
ali-h:hive-engine
Open

dMarket Smart Contract#102
ali-h wants to merge 9 commits intohive-engine:hive-enginefrom
ali-h:hive-engine

Conversation

@ali-h
Copy link

@ali-h ali-h commented Sep 21, 2021

dMarket Smart Contract

Dynamic Market Smart Contract allows users to trade tokens with different quote tokens other than SWAP.HIVE (the original market contract). A global quote token means every token is allowed to be traded for it, only Hive Engine team can create a global quote token. There are two global quote tokens allowed by default (SWAP.BTC & BEE). More quote tokens can be added by users for 500 BEE per base token in a pair. It allows tribes and other projects to allow tokens to be traded for their native tokens (ex. DEC:PAL, ORB:PAL, BEE:PAL, SWAP.DOGE:PAL, etc..).

Transactions are similar to the original market contract with the addition of a "quoteToken" parameter.

Example: To buy BEE tokens for SWAP.BTC

{
    "contractName": "dmarket",
    "contractAction": "buy",
    "contractPayload": {
        "symbol": "BEE",
        "quoteToken": "SWAP.BTC",
        "quantity": "150",
        "price": "0.00000912"
    }
}

Complete Documentation: Here

@Rishi556
Copy link

Rishi556 commented Sep 27, 2021

only Hive Engine team can create a global pair

Why not let the witnesses decide? If a majority of top witnesses(11/20 right now) are voting for a particular token to be global, then it should be.

I say this because right now we are too dependent on the engine team and I'd like to slowly start transitioning away from that wherever possible.

@ali-h
Copy link
Author

ali-h commented Sep 29, 2021

only Hive Engine team can create a global pair

Why not let the witnesses decide? If a majority of top witnesses(11/20 right now) are voting for a particular token to be global, then it should be.

I say this because right now we are too dependent on the engine team and I'd like to slowly start transitioning away from that wherever possible.

Yes, this is absolutely better fit. not very familiar with the witness contract yet, will have a peak. Perhaps a proposal kind-of system requiring vote between top 20 witnesses.

@Rishi556
Copy link

I think every witness should vote(sort of how hive witnesses vote for stuff like account creation fee/price feed) and as long as more than 50% of the top active witnesses are voting for that particular token to be a global token then it is. It's a big thing, since witness voting isn't something implemented yet, so releasing this and then updating later is always a choice. Probably will need to add a "witnessVote" action or something to the witnesses contract requiring the name of what they are voting on and the value(an array of tokens here).

My biggest goal with this is to prevent centralization to the engine team. Letting witnesses decide this helps reduce that centralization.

@ali-h ali-h requested a review from eonwarped October 11, 2021 07:59
Copy link
Contributor

@eonwarped eonwarped left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Index comments to resolve, otherwise LGTM

@ali-h ali-h requested a review from eonwarped October 14, 2021 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants