Equiteez
  • Introduction
    • What is Equiteez?
    • Our Mission and Vision
  • Platform
    • What are RWAs?
      • Understanding Tokenization
    • Secondary Markets
      • Equiteez’s Proactive Market Maker (PMM) and Liquidity Pools
      • Technical Overview of the PMM
      • RWA Orderbook DEX
      • Technical Overview of the RWA Orderbook DEX
      • Equiteez OTC Markets
    • How to Buy on Equiteez
      • Step-By-Step Guide
      • Payment Methods
    • How to Sell on Equiteez
      • Selling Options
      • Liquidity Considerations
    • Earning Returns
      • Dividend Distributions
      • Asset Appreciation
    • Revenue Share Tokens
    • RWA Loans
      • Maven Finance Integration
      • Borrowing Against your Assets
    • (Self) Custody
      • Self-Custody Model
      • Importance of Wallet Security
  • FAQs
    • Frequently Asked Questions
Powered by GitBook
On this page
  1. Platform
  2. Secondary Markets

Technical Overview of the RWA Orderbook DEX

Technical Overview of Entry Points and Contract Functions

Below are the key entry points and their corresponding functionalities within the RWA Orderbook contract.

A) SuperAdmin Entry Points

  • Description: Sets a new SuperAdmin contract address.

  • Description: Allows the newly set SuperAdmin to claim control of the contract.

  • Description: Sets the KYC (Know Your Customer) address for verifying user compliance.

  • Parameters: updateMetadataParams : updateMetadataType

  • Description: Allows the Admin to update contract metadata.

  • Description:

  • Description: Admins can transfer tokens that were mistakenly sent to the contract.

%setSuperAdmin

Parameters: newSuperAdminAddress : address

Entrypoint that can only be called by the superAdmin contract to set a new superAdmin contract.

%claimSuperAdmin

Parameters: none

Entrypoint that can only be called by a new superAdmin contract that had previously been set.

B) Admin Entry Points

%setKycAddress

Parameters: newKycAddress : address

Entrypoint that can only be called by a new superAdmin contract that had previously been set.

%updateMetadata

Parameters: updateMetadataParams : updateMetadataType

type updateMetadataType is [@layout:comb] record [

metadataKey : string;

metadataHash : bytes;

]

Admin can update the contract metadata

%updateConfig

Parameters: updateConfigParams : updateConfigActionType

// config

type rwaOrderbookConfigType is [@layout:comb] record [

minExpiryTime : nat; //

minTimeBeforeClosingOrder : nat; // prevent spam e.g. 1mins

minBuyOrderAmount : nat; // prevent spam - rwa token amount

minBuyOrderValue : nat; // prevent spam - value of rwa token amount to buy

minSellOrderAmount : nat; // prevent spam - rwa token amount

minSellOrderValue : nat; // prevent spam - value of rwa token amount to sell

buyOrderFee : nat; // 4 decimals

sellOrderFee : nat; // 4 decimals

]

Admin can update the config of the RWA Orderbook contract

%mistakenTransfer

Parameters: mistakenTransferParams : transferActionType

Admin can transfer mav or tokens that had mistakenly been sent to the contract

C) Pause/Break Glass Entry Points

%togglePauseEntrypoint

Parameters: togglePauseEntrypointParams : rwaOrderbookTogglePauseEntrypointType

type rwaOrderbookPausableEntrypointType is

PlaceBuyOrder of bool

| PlaceSellOrder of bool

| CancelOrder of bool

type rwaOrderbookTogglePauseEntrypointType is [@layout:comb] record [

targetEntrypoint : rwaOrderbookPausableEntrypointType;

empty : unit

];

Admin can pause or unpause entrypoints on the RWA Orderbook contract

D) Orderbook Admin Entry Points

%setCurrency

Parameters: setCurrencyAction : setCurrencyActionType

type setCurrencyActionType is [@layout:comb] record [

actionType : string;

name : string;

decimals : nat;

token : currencyTokenType;

]

Admin can set the valid currencies (e.g. USDT/USDC token) to be used on the RWA Orderbook contract

%transferFees

Parameters: transferFeesAction : transferFeesActionType

type transferFeesActionType is [@layout:comb] record [

receiver : address;

currencySet : set(string);

]

Admin can transfer accumulated trading fees on the RWA Orderbook contract to a specified address

%adminCancelOrders

Parameters: adminCancelOrdersParams : list(orderIdAndTypeSingle)

type orderIdAndTypeSingle is [@layout:comb] record [

orderId : nat;

orderType : string;

]

type adminCancelOrdersActionType is list(orderIdAndTypeSingle)

Admin can cancel a list of buy or sell orders by their order ID

%clearExpiredOrders

Parameters: clearExpiredOrdersParams : list(orderIdAndTypeSingle)

type orderIdAndTypeSingle is [@layout:comb] record [

orderId : nat;

orderType : string;

]

type clearExpiredOrdersActionType is list(orderIdAndTypeSingle)

Admin can clear expired buy or sell orders by their order ID

%matchOrders

Parameters: numberOfOrdersToMatch : int

This entry point should be called regularly by a trusted source (e.g. Admin) to match orders in the RWA Orderbook contract

E) Orderbook Entry Points

%placeBuyOrder

Parameters: placeOrderActionParams : placeOrderActionType

type placeSingleOrderType is [@layout:comb] record [

rwaTokenAmount : nat;

pricePerRwaToken : nat;

currency : string; // use USDT or USDC only

orderExpiry : option(timestamp);

]

type placeOrderActionType is list(placeSingleOrderType)

Users can place a buy order for RWA Tokens. Currency tokens for the buy order will be transferred to the RWA Orderbook contract and held in escrow until orders are matched.

%placeSellOrder

Parameters: placeOrderActionParams : placeOrderActionType

type placeSingleOrderType is [@layout:comb] record [

rwaTokenAmount : nat;

pricePerRwaToken : nat;

currency : string; // use USDT or USDC only

orderExpiry : option(timestamp);

]

type placeOrderActionType is list(placeSingleOrderType)

User can place a sell order for RWA Tokens. RWA tokens used for the buy order will be transferred to the RWA Orderbook contract to be held in escrow until orders are matched.

%cancelOrder

Parameters: cancelOrdersParams : list(orderIdAndTypeSingle)

type orderIdAndTypeSingle is [@layout:comb] record [

orderId : nat;

orderType : string;

]

type cancelOrderActionType is list(orderIdAndTypeSingle)

Users can cancel a list of buy orders or sell orders they have placed at any time, and be returned the corresponding amount of tokens they owe.

%processRefund

Parameters: processRefundParams : list(orderIdAndTypeSingle)

type orderIdAndTypeSingle is [@layout:comb] record [

orderId : nat;

orderType : string;

]

type processRefundActionType is list(orderIdAndTypeSingle)

Users with excess amounts left in their buy orders (from being matched with sell orders at lower prices) can process a refund of the corresponding tokens after their buy order is closed.

F) Lambda Entry points

%setLambda

Parameters: setLambdaParams : setLambdaType

Admins can set custom lambdas to implement specific contract behavior or automate actions.

PreviousRWA Orderbook DEXNextEquiteez OTC Markets

Last updated 3 months ago