💰Onchain P2P System
iExchange offers Traders a decentralized P2P platform to convert crypto to fiat & vice versa using a decentralized wallet. Traders & Merchants settle trades via smart contracts, with validators (settlers) attesting to transaction accuracy.
This will enable seamless crypto conversion to fiat and vice versa, fully decentralized on our exchange.
Features
Onchain P2P (Core feature)
P2P SDK Client (Core feature)
Protocol & Flow
Register Merchant & Settler Flow
Ensure Connect wallet
Initiate Registration
Provide KYC Details
Sign and Send Transaction
Stake Flow
Ensure Connect Wallet
Enter Amount to Stake
Approve contract to transfer erc20 token for stake
Sign and Send Transaction
Create Offer Flow
Ensure Connect Wallet
Enter Offer Details
Approve contract to transfer erc20 token for stake
Sign and Send Transaction
Delete Offer Flow
Ensure Connect Wallet
Select Offer to Delete and Confirm
Sign and Send Transaction
Create Order Flow
An order can either be a buy order or a sell order
Buy Flow (Summary)
Ensure Connect Wallet
The trader will see a list of offers listed from the smart contract.
The trader will place the order to the smart contract. (Sign and Send Transaction)
The seller will confirm the order prompting the trader to send fiat to the seller. They can also decide to cancel. (Sign and Send Transaction)
The trader will confirm they've sent fiat to the smart contract. (Sign and Send Transaction)
The seller will see the order and confirm receipt to the smart contract. (Sign and Send Transaction)
Crypto will be automatically released to the trade.
In case of dispute, several settlers are invited to investigate and vote.
Buy Flow (Contract Specification)
Trader places a buy order by calling
CreateOrder
Tokens are transferred from the Merchant to the Contract
Merchant can see available orders and decide to accept(
acceptOrder
) or cancel(cancelOrder
)If Merchant accepts the buy order(
acceptOrder
), Trader will then be prompted to send fiat. Here, Merchant cannot cannot cancel the order after he has accpeted it.Trader can also decide to cancel order(
cancelOrder
) here after Merchant has accepted it(before Trader pays order), tokens will then be released back to the MerchantAfter Trader has sent fiat, Trader calls
payOrder
prompting Merchant to release tokensFinally, If Merchant confirms fiat has been received,
releaseOrder
is then triggered and tokens are sent to the traders wallet.
Buy Flow Disputes
In a case of a disagreement between a Merchant and a Trader:
A Merchant can open an appeal(
appealOrder
) when he thinks trader did not send fiat but has calledpayOrder
.A Trader can also call for an appeal when he thinks the Merchant did not release tokens after calling
payOrder
Sell Flow (Summary)
Ensure Connect Wallet
The trader will see a list of offers listed from the smart contract.
The trader will place the order by sending crypto to the smart contract. (Sign and Send Transaction) (erc20 token approval needed)
The buyer will see the order and send fiat. They can also decide to cancel.
The buyer will confirm they’ve sent fiat to the smart contract. (Sign and Send Transaction)
The trader will confirm receipt to the smart contract. (Sign and Send Transaction)
Money will be automatically released to the buyer.
In case of dispute, several settlers are invited to investigate and vote.
Sell Flow(Contract Specification)
Trader places a sell order by calling
CreateOrder
and transfers tokens to the ContractMerchant sees a trader's order to sell tokens. Merchant can decide to cancel(
cancelOrder
) or accept the order.If Merchant accepts the order, Merchant must send fiat to the Trader and then call
payOrder
prompting Trader to release token.Trader after confirming fiat will then call
releaseOrder
for contract to release tokens to the Merchant
Sell Flow Disputes
In a case of a disagreement between a Merchant and a Trader:
A Trader can open an appeal(
appealOrder
). When he thinks the Merchant did not send fiat but has calledpayOrder
.A Merchant can also call for an appeal(
appealOrder
) when he thinks the Trader has received fiat but did not release tokens after callingpayOrder
.
Settling Flow (Summary)
In case there is a dispute over whether fiat is sent, either party in the trade can opt for an appeal. A settler will be invited to settle the situation.
After the initial appeal, a settler is invited to oversee the situation.
The settler decides which party is not guilty by voting to either cancel or release the token.
If either party does not agree they can opt for another appeal.
An Appeal can happen 4 times max.
If there is still a misunderstanding it will be open for the entire DAO to also make their decision.
The majority decision of the DAO is final. 70% quorum with 75% majority is required.
Settlers get rewarded. The reward is a fraction of the penalty.
DAO gets rewarded if they end up participating.
Penalty is charged to the guilty party.
Settling Flow (Contract Specifications)
To settle appeals:
A Trader or Merchant first appeals an order (
appealOrder
)A Settler is invited to investigate and cast a vote. A settler can vote for an order to be canceled (
voteCancelOrder
) or an order to be released (voteReleaseOrder
)If both Trader and Merchant agree on the Settler's vote, the order is then canceled (
cancelOrder
) or released (releaseOrder
)In the event of a disagreement, both Trader and Merchant can appeal the voting decision. A new Settler will then be invited to cast new votes. This process can happen a maximum of 4 times.
On the 5th time, the voting will be left for the DAO (
daoVote
) who's decision will be final either to cancel the order (cancelOrder
) or release the order (releaseOrder
)
High Level Overview
Buy and Sell Flow Interactions
Buy, Sell and Settlement Interactions
DAO
The DAO is automatically comprised of all merchants, traders and settlers. All of these actors are eligible to vote on issues as long as the following conditions are met.
Member has completed at least KYC level2
Member has reputation score > 0
The weight of a member's vote is linearly determined by their reputation score and KYC vote
Reputation
Reputation scores can increase or decrease based on the behavior of an actor.
Increase
Successful trade with no appeals both parties are awarded
Correct judging by settler. At the end of the settling process, a correct judge is part of the majority.
Decrease
Guilty party in an appeal is punished by deduction.
Wrong judging by settler. At the end of the settling process, a wrong judge is part of the minority.
Penalty
Settler
If a settler is caught being dishonest, 50% of their stake will be slashed.
Also, a settler must have a stake of at least 20% of the amount on the trade to be able to settle the trade.
For example, if a trade is valued at 1000 usdt, the settler must have a stake of 200 usdt.
A settler can only settle trades involving the tokens they have staked.
Trader
A trader can be a buyer or a seller.
A seller can only sell 90% of the tokens in their possession. The remaining will be used as a stake to be slashed in the event of any dishonest behavior.
A dishonest buyer will only receive 90% of the intended amount to be received.
Depending on the actor in question, the penalty is slashed from different sources. In any case, their reputation is slashed to 0.
Merchant
If a merchant is caught being dishonest, 50% of their stake will be slashed.
Also, a merchant must have a stake of at least 100% of the amount on the trade to be able to settle the trade.
For example, if a trade is valued at 1000 usdt, the merchant must have a stake of 1000 usdt.
A merchant can only trade tokens they have staked.
Entities
Actors
Merchant
Trader
Settler
Abstract
Offer
Order
Payment Method
Payment Details
Appeal
AppealVote
Last updated