algod client
historical indexer client
application id of the market we are interested in
Returns active collateral for this market
active collateral
Returns asset object for this market
asset
Returns bank circulation for this market
bank circulation
Returns bank to underlying exchange for this market
bank to underlying exchange
Returns collateral factor for this market
collateral factor
Returns liquidation incentive for this market
liquidation incentive
Returns the market address for this market
market address
Returns the app id for this market
market app id
Returns the market counter for this market
market counter
Returns outstanding borrow shares for this market
outstanding borrow shares
Returns the market local state for address
storage addres to get info for
market local state for address
Returns total borrow interest rate for this market
block to get total borrow interest rate for
total borrow interest rate
Returns underlying borrowed for this market
specific block to get underlying borrowe for
Returns underlying cash for this market
block to get underlying cash for
underlying cash
Returns underlying reserves for this market
block to get underlying reserves for
underlying reserves
Method to fetch most recent market global state
This is the function that should be called when creating a new market. You pass everything you would to the constructor, but to this function instead and this returns the new and created market.
//Correct way to instantiate new market
const newMarket = await Market.init(algodClient, historicalIndexerClient, marketAppId)
//Incorrect way to instantiate new market
const newMarket = new Market(algodClient, historicalIndexerClient, marketAppId)
algod client
historical indexer client
application id of the market we are interested in
a new instance of the market class fully constructed
Generated using TypeDoc
This is the constructor for the Market class.
Note, do not call this to create a new market. Instead call the static method init as there are asynchronous set up steps in creating an market and a constructor can only return an instance of the class and not a promise.
Example