ClearDAO FAQ
  • Getting Started
    • How it Works
    • Product
    • Roadmap
    • Team
    • ClearDAO Token
    • ClearDAO Token Bridge
    • Contact
  • Development Resources
    • SDK
      • ClearDAO Developer Guide
      • Deploy Contracts
        • Options and Notes
          • Quick Start
          • Configure Contract
          • Contract Upgrade
          • Contract Address
        • TRS
      • Configure Contract Parameters
      • Interact With Contracts
        • Options
        • Notes
        • TRS
        • CDS
          • README
          • CDS Buyer
          • Challenger
          • Liquidity Provider
          • Ticket
          • Ticket Market
          • Ticket Sale
          • Seller
      • Contract Reference
        • Oracle
        • Index Contract
        • Option Contract
        • Market Maker Contract
        • Note Contract
      • APIs
        • CDS
          • Config
          • Ticket
          • Ticket Sale
          • Transaction
          • CDS Market
          • Issue CDS
          • CDS Category
          • Ticket Market
        • Options and Notes
          • Configure
          • Price
          • User
          • Index
          • Option Parameter Configuration
          • Faucet
          • Market Maker
        • TRS
        • CLEARIndex
    • Barrier Options
    • NFT Marketplace
    • ClearIndex
  • Governance
    • CLH Staking Module
Powered by GitBook
On this page
  • Market Maker Contract
  • code
  • abi
  • Interface
  • Methods(read thmods)
  • Methods(write methods)
  1. Development Resources
  2. SDK
  3. Contract Reference

Market Maker Contract

Market Maker Contract

code

abi

Interface

pragma solidity ^0.6.7;
contract OptionV2Maker {
	address[] public maker;
	mapping(address => bool) public allowMaker;
    mapping(address => uint256) public makerIndex;
    uint256 public rate;
    //makerBalance[_payToken][_indexNo][makeraddress][_poolId]
    mapping(address => mapping(uint256 => mapping(address => uint256[16])))
        public makerBalance;
	function getOrderMaker(uint256 _orderNo, uint256 _start) external  view  returns (uint256[50] memory makerArr, uint256[50] memory makerMargin);
	event Maker(address maker, bool allow);
    event MakerDeposit(address payToken, uint256 indexNo, uint8 poolId, address maker, uint256 amount, uint256 fee);
    event MakerWithdraw( address payToken,uint256 indexNo, uint8 poolId,  address maker,   uint256 amount);
}

##Events

  • Maker(address maker, bool allow) Add new or modify market maker permissions

  • MakerDeposit(address payToken,uint256 indexNo,uint8 poolId,address maker, uint256 amount, uint256 fee ) Market makers deposit margin MakerWithdraw(address payToken,uint256 indexNo,uint8 poolId,address maker, uint256 amount) Market makers withdrow margin

Methods(read thmods)

Based on the market maker address to lookup: maker_index

1. Allow Maker

mapping(address => bool) public allowMaker

Whether to run deposite margin

2. Maker

address[] public maker;

Based on maker_index to ger address

node

let address = await contract.maker(maker_index);

3.Rate

uint256 public rate

**The rate of market maker deposits margin **

4. Maker Balance

mapping(uint256 => mapping(uint256 => uint256[16])) public makerBalance

View the balance of single market maker in option pool

param
type
description

index_no

uint256

index_no

maker_index

uint256

maker_index

pool_id

uint8

pool_id

return
type
description

balance

uint256

balance

node

	let balance = await contract.makerBalance(pay_token,index_no,maker_index,pool_id);

5. Order Maker Length

function orderMakerLength( uint256 _orderNo ) external view returns (uint256)

Order maker length

6. Get Order Maker

function getOrderMaker( uint256 _orderNo, uint256 _start) external view returns (uint256[50] memory makerArr, uint256[50] memory makerMargin)

Get order maker

param
type
description

order_no

uint256

order_no

start

uint256

start from

return
type
description

makerArr

uint256[50]

maker_index list

makerMargin

uint256[50]

margin list

7. Pools

function pools(address _payToken, uint256 _indexNo, uint8 _poolId) external view returns (uint256)

Pools balance

Methods(write methods)

1. Make rDeposit

function makerDeposit(uint256 _payToken, uint256 _indexNo,uint8 _poolId, uint256 _amount ) external

Deposit margin

param
type
description

_payToken

address

base token

_index_no

uint256

index_no

_pool_id

uint8

pool_id

_amount

uint256

deposit margin

2. Maker Withdraw

function makerWithdraw(uint256 _payToken, uint256 _indexNo,uint8 _poolId, uint256 _amount ) external

Withdraw margin

param
type
description

_payToken

address

base token

_index_no

uint256

index_no

_pool_id

uint8

pool_id

_amount

uint256

withdraw amount

PreviousOption ContractNextNote Contract

Last updated 2 years ago