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 |
---|---|---|
| state | Dependency injected smart contract state. |
| transactionFee | The market transaction fee, 0-10 equal to 0-1%. |
Properties
Type | Property | Description |
---|---|---|
| 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 |
---|---|---|
| token | The address of the SRC token. |
Returns
Type | Property | Description |
---|---|---|
| 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 |
---|---|---|
| token | The address of the SRC token. |
Returns
Type | Property | Description |
---|---|---|
| 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 |
---|---|---|---|
| Token | The address of the SRC token in the liquidity pool. | |
| Pool | The address of the new liquidity pool smart contract. |
References
OpdexMarket Smart Contract - Github
IOpdexMarket Interface - Github
Stratis SmartContract Documentation - Stratis Academy
Updated 10 months ago