Exchange Information

Overview

Dolomite makes use of several smart contracts in its operation to give traders control of their assets and to securely settle trades.

Basics

Smart contracts are pieces of code that run on the Ethereum blockchain. Once deployed to the blockchain, this code is unchanging and publicly accessible. This code is viewable by anyone and as such can be audited to make sure it's only performing the task that users expect. This code is run in a similar way to how transactions are processed on the Ethereum blockchain. This code can be interacted with by using one or more Ethereum wallets, and can hold tokens on behalf of those wallets, as well as perform transfers on behalf of those wallets. This is the base structure on which decentralized exchanges are built. Smart contracts hold onto the traders' assets, and those assets can only be withdrawn by the trader themselves or exchanged for another asset at a rate approved by the trader. As a result there's no worry of an exchange running off with traders' funds or being hacked, funds are just as secure in a smart contract as they are in your own personal wallet.

Dolomite Smart Contracts

The following are the smart contracts utilized in one way or another by Dolomite.

Loopring Settlement Contract

This is used to settle our rings which materialize the matches into transfers.

Contract address: 0x610c5E1Eb8E97A38c1706af02b0Caa778F74127c

ABI:
[{"constant":true,"inputs":[],"name":"orderBrokerRegistryAddress","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"wethTokenAddress","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"tradeHistoryAddress","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"ringIndex","outputs":[{"name":"","type":"uint64"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"lrcTokenAddress","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"delegateAddress","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"orderBookAddress","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"orderRegistryAddress","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"MAX_RING_SIZE","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"data","type":"bytes"}],"name":"submitRings","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"FEE_PERCENTAGE_BASE","outputs":[{"name":"","type":"uint16"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"burnRateTableAddress","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"feeHolderAddress","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_lrcTokenAddress","type":"address"},{"name":"_wethTokenAddress","type":"address"},{"name":"_delegateAddress","type":"address"},{"name":"_tradeHistoryAddress","type":"address"},{"name":"_orderBrokerRegistryAddress","type":"address"},{"name":"_orderRegistryAddress","type":"address"},{"name":"_feeHolderAddress","type":"address"},{"name":"_orderBookAddress","type":"address"},{"name":"_burnRateTableAddress","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_ringIndex","type":"uint256"},{"indexed":true,"name":"_ringHash","type":"bytes32"},{"indexed":true,"name":"_feeRecipient","type":"address"},{"indexed":false,"name":"_fills","type":"bytes"}],"name":"RingMined","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_ringHash","type":"bytes32"}],"name":"InvalidRing","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"_ringHash","type":"bytes32"},{"indexed":true,"name":"_orderHash","type":"bytes32"},{"indexed":false,"name":"_feeToken","type":"address"},{"indexed":false,"name":"_feeAmount","type":"uint256"}],"name":"DistributeFeeRebate","type":"event"}]

Loopring Trade Delegate

This is used to execute the transfers and it's what you set as the spender (as the end user) when allocating your allowance.

Contract address: 0x48c40e8B9F45E199238e3131B232ADf12d88eA2C

ABI:
[{"constant":false,"inputs":[],"name":"resume","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"kill","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"addr","type":"address"}],"name":"authorizeAddress","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[],"name":"claimOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"suspended","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"addr","type":"address"}],"name":"isAddressAuthorized","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"pendingOwner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"suspend","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"addr","type":"address"}],"name":"deauthorizeAddress","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"batch","type":"bytes32[]"}],"name":"batchTransfer","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"anonymous":false,"inputs":[{"indexed":true,"name":"addr","type":"address"}],"name":"AddressAuthorized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"addr","type":"address"}],"name":"AddressDeauthorized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"},{"indexed":true,"name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"}]

Loopring Fee Holder

This contract is responsible for the collection of trading/gas fees that are paid by traders. All negative maker fees are also accumulated in this contract.

Contract address: 0xaFDC6417d5B8Df07AF13918b73155541F08AA472

ABI:
[{"constant":true,"inputs":[{"name":"","type":"address"},{"name":"","type":"address"}],"name":"feeBalances","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"batch","type":"bytes32[]"}],"name":"batchAddFeeBalances","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"delegateAddress","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"token","type":"address"},{"name":"value","type":"uint256"}],"name":"withdrawBurned","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"token","type":"address"},{"name":"value","type":"uint256"}],"name":"withdrawToken","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"inputs":[{"name":"_delegateAddress","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"payable":true,"stateMutability":"payable","type":"fallback"},{"anonymous":false,"inputs":[{"indexed":false,"name":"owner","type":"address"},{"indexed":false,"name":"token","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"TokenWithdrawn","type":"event"}]

Dolomite Margin Trading

This contract connects dYdX to the Loopring Protocol to allow us to open/close margin trades.

Contract address: 0xc0f0Db6c198c101e486CD0A1AEEc62620b81B90d

Dolomite Direct Smart Wallet

This is the version of Dolomite Direct that manages the user's smart wallet for managed accounts.

Contract address: 0xc0f8da42bf27302b7967b87d78051bcc9038ceda

ABI:
[{"constant":false,"inputs":[{"name":"token","type":"address"}],"name":"enableTrading","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"wethTokenAddress","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"dolomiteMarginProtocolAddress","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"owner","type":"address"},{"name":"depositAddress","type":"address"},{"name":"oldVersion","type":"address"},{"name":"additionalData","type":"bytes"}],"name":"versionBeginUsage","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"owner","type":"address"},{"name":"token","type":"address"},{"name":"amount","type":"uint256"}],"name":"brokerMarginRequestApproval","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"components":[{"name":"owner","type":"address"},{"name":"broker","type":"address"},{"name":"orderHash","type":"bytes32"},{"name":"tokenB","type":"address"},{"name":"tokenS","type":"address"},{"name":"feeToken","type":"address"},{"name":"fillAmountB","type":"uint256"},{"name":"spentAmountS","type":"uint256"},{"name":"spentFeeAmount","type":"uint256"},{"name":"tokenRecipient","type":"address"},{"name":"extraData","type":"bytes"}],"name":"fillReport","type":"tuple"}],"name":"onOrderFillReport","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"owner","type":"address"},{"name":"depositAddress","type":"address"},{"name":"newVersion","type":"address"},{"name":"additionalData","type":"bytes"}],"name":"versionEndUsage","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"owner","type":"address"},{"name":"orderData","type":"bytes"}],"name":"brokerMarginGetTrader","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"registry","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"owner","type":"address"},{"name":"tokenAddress","type":"address"}],"name":"brokerBalanceOf","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"components":[{"name":"owner","type":"address"},{"name":"target","type":"address"},{"name":"requestType","type":"uint8"},{"name":"payload","type":"bytes"},{"name":"nonce","type":"uint256"},{"components":[{"name":"feeRecipient","type":"address"},{"name":"feeToken","type":"address"},{"name":"feeAmount","type":"uint256"}],"name":"fee","type":"tuple"},{"components":[{"name":"v","type":"uint8"},{"name":"r","type":"bytes32"},{"name":"s","type":"bytes32"}],"name":"signature","type":"tuple"}],"name":"request","type":"tuple"}],"name":"transfer","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"loopringProtocolAddress","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"dydxProtocolAddress","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"components":[{"components":[{"name":"owner","type":"address"},{"name":"orderHash","type":"bytes32"},{"name":"fillAmountB","type":"uint256"},{"name":"requestedAmountS","type":"uint256"},{"name":"requestedFeeAmount","type":"uint256"},{"name":"tokenRecipient","type":"address"},{"name":"extraData","type":"bytes"}],"name":"orders","type":"tuple[]"},{"name":"tokenS","type":"address"},{"name":"tokenB","type":"address"},{"name":"feeToken","type":"address"},{"name":"totalFillAmountB","type":"uint256"},{"name":"totalRequestedAmountS","type":"uint256"},{"name":"totalRequestedFeeAmount","type":"uint256"}],"name":"request","type":"tuple"}],"name":"brokerRequestAllowance","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"owner","type":"address"}],"name":"nonceOf","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"owner","type":"address"},{"name":"token","type":"address"}],"name":"balanceOf","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_depositContractRegistry","type":"address"},{"name":"_loopringRingSubmitter","type":"address"},{"name":"_dolomiteMarginProtocol","type":"address"},{"name":"_dydxProtocolAddress","type":"address"},{"name":"_wethTokenAddress","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"}]

Dolomite Direct Contract Registry

This contract is responsible for managing the creation/upgrades for individual deposit contracts for each user Dolomite Direct (managed account) user.

Contract address: 0xcA8EFCC93bca0BD89aD9bfffD050483dD80fdf07

ABI:
[{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"registry","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"components":[{"name":"owner","type":"address"},{"name":"target","type":"address"},{"name":"requestType","type":"uint8"},{"name":"payload","type":"bytes"},{"name":"nonce","type":"uint256"},{"components":[{"name":"feeRecipient","type":"address"},{"name":"feeToken","type":"address"},{"name":"feeAmount","type":"uint256"}],"name":"fee","type":"tuple"},{"components":[{"name":"v","type":"uint8"},{"name":"r","type":"bytes32"},{"name":"s","type":"bytes32"}],"name":"signature","type":"tuple"}],"name":"request","type":"tuple"}],"name":"createDepositContract","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"owner","type":"address"}],"name":"versionOf","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"wethTokenAddress","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"owner","type":"address"},{"name":"operator","type":"address"}],"name":"operatorOf","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"versions","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"components":[{"name":"owner","type":"address"},{"name":"target","type":"address"},{"name":"requestType","type":"uint8"},{"name":"payload","type":"bytes"},{"name":"nonce","type":"uint256"},{"components":[{"name":"feeRecipient","type":"address"},{"name":"feeToken","type":"address"},{"name":"feeAmount","type":"uint256"}],"name":"fee","type":"tuple"},{"components":[{"name":"v","type":"uint8"},{"name":"r","type":"bytes32"},{"name":"s","type":"bytes32"}],"name":"signature","type":"tuple"}],"name":"request","type":"tuple"}],"name":"perform","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"components":[{"name":"owner","type":"address"},{"name":"target","type":"address"},{"name":"requestType","type":"uint8"},{"name":"payload","type":"bytes"},{"name":"nonce","type":"uint256"},{"components":[{"name":"feeRecipient","type":"address"},{"name":"feeToken","type":"address"},{"name":"feeAmount","type":"uint256"}],"name":"fee","type":"tuple"},{"components":[{"name":"v","type":"uint8"},{"name":"r","type":"bytes32"},{"name":"s","type":"bytes32"}],"name":"signature","type":"tuple"}],"name":"request","type":"tuple"}],"name":"upgradeVersion","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"components":[{"name":"owner","type":"address"},{"name":"target","type":"address"},{"name":"requestType","type":"uint8"},{"name":"payload","type":"bytes"},{"name":"nonce","type":"uint256"},{"components":[{"name":"feeRecipient","type":"address"},{"name":"feeToken","type":"address"},{"name":"feeAmount","type":"uint256"}],"name":"fee","type":"tuple"},{"components":[{"name":"v","type":"uint8"},{"name":"r","type":"bytes32"},{"name":"s","type":"bytes32"}],"name":"signature","type":"tuple"}],"name":"request","type":"tuple"}],"name":"setOperator","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"owner","type":"address"}],"name":"isDepositContractCreatedFor","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"DEPOSIT_CONTRACT_BYTECODE","outputs":[{"name":"","type":"bytes"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"owner","type":"address"}],"name":"depositAddressOf","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"owner","type":"address"}],"name":"nonceOf","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"owner","type":"address"},{"name":"token","type":"address"}],"name":"balanceOf","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"name":"_wethTokenAddress","type":"address"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"owner","type":"address"},{"indexed":true,"name":"depositAddress","type":"address"}],"name":"CreatedDepositContract","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"owner","type":"address"},{"indexed":true,"name":"depositAddress","type":"address"},{"indexed":false,"name":"newVersion","type":"address"}],"name":"UpgradedVersion","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"owner","type":"address"},{"indexed":true,"name":"operator","type":"address"},{"indexed":false,"name":"canOperate","type":"bool"}],"name":"SetOperator","type":"event"}]

dYdX: Solo Margin

The main contract used by dYdX to offer margin lending.

Contract address: 0x1E0447b19BB6EcFdAe1e4AE1694b0C3659614e4e

ABI:
[{"constant":false,"inputs":[{"name":"marketId","type":"uint256"},{"components":[{"name":"value","type":"uint256"}],"name":"spreadPremium","type":"tuple"}],"name":"ownerSetSpreadPremium","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"operator","type":"address"}],"name":"getIsGlobalOperator","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"marketId","type":"uint256"}],"name":"getMarketTokenAddress","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"marketId","type":"uint256"},{"name":"interestSetter","type":"address"}],"name":"ownerSetInterestSetter","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"components":[{"name":"owner","type":"address"},{"name":"number","type":"uint256"}],"name":"account","type":"tuple"}],"name":"getAccountValues","outputs":[{"components":[{"name":"value","type":"uint256"}],"name":"","type":"tuple"},{"components":[{"name":"value","type":"uint256"}],"name":"","type":"tuple"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"marketId","type":"uint256"}],"name":"getMarketPriceOracle","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"marketId","type":"uint256"}],"name":"getMarketInterestSetter","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"marketId","type":"uint256"}],"name":"getMarketSpreadPremium","outputs":[{"components":[{"name":"value","type":"uint256"}],"name":"","type":"tuple"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getNumMarkets","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"token","type":"address"},{"name":"recipient","type":"address"}],"name":"ownerWithdrawUnsupportedTokens","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"components":[{"name":"value","type":"uint256"}],"name":"minBorrowedValue","type":"tuple"}],"name":"ownerSetMinBorrowedValue","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"components":[{"name":"value","type":"uint256"}],"name":"spread","type":"tuple"}],"name":"ownerSetLiquidationSpread","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"components":[{"name":"value","type":"uint256"}],"name":"earningsRate","type":"tuple"}],"name":"ownerSetEarningsRate","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"owner","type":"address"},{"name":"operator","type":"address"}],"name":"getIsLocalOperator","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"components":[{"name":"owner","type":"address"},{"name":"number","type":"uint256"}],"name":"account","type":"tuple"},{"name":"marketId","type":"uint256"}],"name":"getAccountPar","outputs":[{"components":[{"name":"sign","type":"bool"},{"name":"value","type":"uint128"}],"name":"","type":"tuple"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"marketId","type":"uint256"},{"components":[{"name":"value","type":"uint256"}],"name":"marginPremium","type":"tuple"}],"name":"ownerSetMarginPremium","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getMarginRatio","outputs":[{"components":[{"name":"value","type":"uint256"}],"name":"","type":"tuple"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"marketId","type":"uint256"}],"name":"getMarketCurrentIndex","outputs":[{"components":[{"name":"borrow","type":"uint96"},{"name":"supply","type":"uint96"},{"name":"lastUpdate","type":"uint32"}],"name":"","type":"tuple"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"marketId","type":"uint256"}],"name":"getMarketIsClosing","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getRiskParams","outputs":[{"components":[{"components":[{"name":"value","type":"uint256"}],"name":"marginRatio","type":"tuple"},{"components":[{"name":"value","type":"uint256"}],"name":"liquidationSpread","type":"tuple"},{"components":[{"name":"value","type":"uint256"}],"name":"earningsRate","type":"tuple"},{"components":[{"name":"value","type":"uint256"}],"name":"minBorrowedValue","type":"tuple"}],"name":"","type":"tuple"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"components":[{"name":"owner","type":"address"},{"name":"number","type":"uint256"}],"name":"account","type":"tuple"}],"name":"getAccountBalances","outputs":[{"name":"","type":"address[]"},{"components":[{"name":"sign","type":"bool"},{"name":"value","type":"uint128"}],"name":"","type":"tuple[]"},{"components":[{"name":"sign","type":"bool"},{"name":"value","type":"uint256"}],"name":"","type":"tuple[]"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[],"name":"renounceOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getMinBorrowedValue","outputs":[{"components":[{"name":"value","type":"uint256"}],"name":"","type":"tuple"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"components":[{"name":"operator","type":"address"},{"name":"trusted","type":"bool"}],"name":"args","type":"tuple[]"}],"name":"setOperators","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"marketId","type":"uint256"}],"name":"getMarketPrice","outputs":[{"components":[{"name":"value","type":"uint256"}],"name":"","type":"tuple"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"owner","outputs":[{"name":"","type":"address"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"isOwner","outputs":[{"name":"","type":"bool"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"marketId","type":"uint256"},{"name":"recipient","type":"address"}],"name":"ownerWithdrawExcessTokens","outputs":[{"name":"","type":"uint256"}],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"token","type":"address"},{"name":"priceOracle","type":"address"},{"name":"interestSetter","type":"address"},{"components":[{"name":"value","type":"uint256"}],"name":"marginPremium","type":"tuple"},{"components":[{"name":"value","type":"uint256"}],"name":"spreadPremium","type":"tuple"}],"name":"ownerAddMarket","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"components":[{"name":"owner","type":"address"},{"name":"number","type":"uint256"}],"name":"accounts","type":"tuple[]"},{"components":[{"name":"actionType","type":"uint8"},{"name":"accountId","type":"uint256"},{"components":[{"name":"sign","type":"bool"},{"name":"denomination","type":"uint8"},{"name":"ref","type":"uint8"},{"name":"value","type":"uint256"}],"name":"amount","type":"tuple"},{"name":"primaryMarketId","type":"uint256"},{"name":"secondaryMarketId","type":"uint256"},{"name":"otherAddress","type":"address"},{"name":"otherAccountId","type":"uint256"},{"name":"data","type":"bytes"}],"name":"actions","type":"tuple[]"}],"name":"operate","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"name":"marketId","type":"uint256"}],"name":"getMarketWithInfo","outputs":[{"components":[{"name":"token","type":"address"},{"components":[{"name":"borrow","type":"uint128"},{"name":"supply","type":"uint128"}],"name":"totalPar","type":"tuple"},{"components":[{"name":"borrow","type":"uint96"},{"name":"supply","type":"uint96"},{"name":"lastUpdate","type":"uint32"}],"name":"index","type":"tuple"},{"name":"priceOracle","type":"address"},{"name":"interestSetter","type":"address"},{"components":[{"name":"value","type":"uint256"}],"name":"marginPremium","type":"tuple"},{"components":[{"name":"value","type":"uint256"}],"name":"spreadPremium","type":"tuple"},{"name":"isClosing","type":"bool"}],"name":"","type":"tuple"},{"components":[{"name":"borrow","type":"uint96"},{"name":"supply","type":"uint96"},{"name":"lastUpdate","type":"uint32"}],"name":"","type":"tuple"},{"components":[{"name":"value","type":"uint256"}],"name":"","type":"tuple"},{"components":[{"name":"value","type":"uint256"}],"name":"","type":"tuple"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"components":[{"name":"value","type":"uint256"}],"name":"ratio","type":"tuple"}],"name":"ownerSetMarginRatio","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getLiquidationSpread","outputs":[{"components":[{"name":"value","type":"uint256"}],"name":"","type":"tuple"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"components":[{"name":"owner","type":"address"},{"name":"number","type":"uint256"}],"name":"account","type":"tuple"},{"name":"marketId","type":"uint256"}],"name":"getAccountWei","outputs":[{"components":[{"name":"sign","type":"bool"},{"name":"value","type":"uint256"}],"name":"","type":"tuple"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"marketId","type":"uint256"}],"name":"getMarketTotalPar","outputs":[{"components":[{"name":"borrow","type":"uint128"},{"name":"supply","type":"uint128"}],"name":"","type":"tuple"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"heldMarketId","type":"uint256"},{"name":"owedMarketId","type":"uint256"}],"name":"getLiquidationSpreadForPair","outputs":[{"components":[{"name":"value","type":"uint256"}],"name":"","type":"tuple"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"marketId","type":"uint256"}],"name":"getNumExcessTokens","outputs":[{"components":[{"name":"sign","type":"bool"},{"name":"value","type":"uint256"}],"name":"","type":"tuple"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"marketId","type":"uint256"}],"name":"getMarketCachedIndex","outputs":[{"components":[{"name":"borrow","type":"uint96"},{"name":"supply","type":"uint96"},{"name":"lastUpdate","type":"uint32"}],"name":"","type":"tuple"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"components":[{"name":"owner","type":"address"},{"name":"number","type":"uint256"}],"name":"account","type":"tuple"}],"name":"getAccountStatus","outputs":[{"name":"","type":"uint8"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[],"name":"getEarningsRate","outputs":[{"components":[{"name":"value","type":"uint256"}],"name":"","type":"tuple"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"marketId","type":"uint256"},{"name":"priceOracle","type":"address"}],"name":"ownerSetPriceOracle","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[],"name":"getRiskLimits","outputs":[{"components":[{"name":"marginRatioMax","type":"uint64"},{"name":"liquidationSpreadMax","type":"uint64"},{"name":"earningsRateMax","type":"uint64"},{"name":"marginPremiumMax","type":"uint64"},{"name":"spreadPremiumMax","type":"uint64"},{"name":"minBorrowedValueMax","type":"uint128"}],"name":"","type":"tuple"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"marketId","type":"uint256"}],"name":"getMarket","outputs":[{"components":[{"name":"token","type":"address"},{"components":[{"name":"borrow","type":"uint128"},{"name":"supply","type":"uint128"}],"name":"totalPar","type":"tuple"},{"components":[{"name":"borrow","type":"uint96"},{"name":"supply","type":"uint96"},{"name":"lastUpdate","type":"uint32"}],"name":"index","type":"tuple"},{"name":"priceOracle","type":"address"},{"name":"interestSetter","type":"address"},{"components":[{"name":"value","type":"uint256"}],"name":"marginPremium","type":"tuple"},{"components":[{"name":"value","type":"uint256"}],"name":"spreadPremium","type":"tuple"},{"name":"isClosing","type":"bool"}],"name":"","type":"tuple"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":false,"inputs":[{"name":"marketId","type":"uint256"},{"name":"isClosing","type":"bool"}],"name":"ownerSetIsClosing","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"operator","type":"address"},{"name":"approved","type":"bool"}],"name":"ownerSetGlobalOperator","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":false,"inputs":[{"name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"payable":false,"stateMutability":"nonpayable","type":"function"},{"constant":true,"inputs":[{"components":[{"name":"owner","type":"address"},{"name":"number","type":"uint256"}],"name":"account","type":"tuple"}],"name":"getAdjustedAccountValues","outputs":[{"components":[{"name":"value","type":"uint256"}],"name":"","type":"tuple"},{"components":[{"name":"value","type":"uint256"}],"name":"","type":"tuple"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"marketId","type":"uint256"}],"name":"getMarketMarginPremium","outputs":[{"components":[{"name":"value","type":"uint256"}],"name":"","type":"tuple"}],"payable":false,"stateMutability":"view","type":"function"},{"constant":true,"inputs":[{"name":"marketId","type":"uint256"}],"name":"getMarketInterestRate","outputs":[{"components":[{"name":"value","type":"uint256"}],"name":"","type":"tuple"}],"payable":false,"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"components":[{"name":"value","type":"uint256"}],"name":"marginRatio","type":"tuple"},{"components":[{"name":"value","type":"uint256"}],"name":"liquidationSpread","type":"tuple"},{"components":[{"name":"value","type":"uint256"}],"name":"earningsRate","type":"tuple"},{"components":[{"name":"value","type":"uint256"}],"name":"minBorrowedValue","type":"tuple"}],"name":"riskParams","type":"tuple"},{"components":[{"name":"marginRatioMax","type":"uint64"},{"name":"liquidationSpreadMax","type":"uint64"},{"name":"earningsRateMax","type":"uint64"},{"name":"marginPremiumMax","type":"uint64"},{"name":"spreadPremiumMax","type":"uint64"},{"name":"minBorrowedValueMax","type":"uint128"}],"name":"riskLimits","type":"tuple"}],"payable":false,"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"name":"owner","type":"address"},{"indexed":false,"name":"operator","type":"address"},{"indexed":false,"name":"trusted","type":"bool"}],"name":"LogOperatorSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"name":"previousOwner","type":"address"},{"indexed":true,"name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"}]