Market

Abstract Class
Inheritance: SmartContract, IOpdexMarket

An abstract smart contract class that is inherited by Standard Market and Staking Market. Provides a base class sharing similar properties and methods between the two different market types.

Constructor

protected OpdexMarket(ISmartContractState state, uint transactionFee) : base(state)

Parameters

Type

Property

Description

ISmartContractState

state

Dependency injected smart contract state.
Omitted from parameters during deployment.

uint

transactionFee

The market transaction fee, 0-10 equal to 0-1%.


Properties

Type

Property

Description

uint

TransactionFee

The staking market transaction fee set at 3 equal to 0.3%.


Methods

Get Pool

Retrieve a pool's contract address by the SRC20 token associated.

Address GetPool(Address token);

Properties

Type

Property

Description

Address

token

The address of the SRC token.

Returns

Type

Property

Description

Address

pool

The address of the requested pool.


Create Pool

Creates a new liquidity pool for the provided token with 0 liquidity if it doesn't already exist.

🚧

Potentially Permissioned

Some standard markets may have authorization implemented on this method requiring address whitelisting.

Address CreatePool(Address token);

Properties

Type

Property

Description

Address

token

The address of the SRC token.

Returns

Type

Property

Description

Address

pool

The address of the created pool.


Logs

Create Liquidity Pool Log

Emitted when a new liquidity pool is created.

Properties

Index

Type

Property

Description

:ballot-box-with-check:

Address

Token

The address of the SRC token in the liquidity pool.

:ballot-box-with-check:

Address

Pool

The address of the new liquidity pool smart contract.


References

OpdexMarket Smart Contract - Github

IOpdexMarket Interface - Github

Stratis SmartContract Documentation - Stratis Academy


Did this page help you?