Skip to content
dYdX V2 Margin Trading Protocol
TypeScript Solidity JavaScript Other
Branch: master
Clone or download
AntonioJuliano Add API client (#307)
* Add API client

* 0.12.0

* hookup

* icon

* cap

* fix

* Add fills endpoint

* docs
Latest commit b0f7393 Aug 23, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
.circleci Fix testing/coverage (#267) Jun 10, 2019
__tests__ v0.11.1: Add Refunder Contract (#300) Aug 21, 2019
contracts v0.11.1: Add Refunder Contract (#300) Aug 21, 2019
docs Add API client (#307) Aug 23, 2019
migrations v0.11.1: Add Refunder Contract (#300) Aug 21, 2019
scripts v0.11.1: Add Refunder Contract (#300) Aug 21, 2019
src Add API client (#307) Aug 23, 2019
util ABIEncoderV2 everywhere (#229) Apr 10, 2019
.babelrc Setup Solo On Kovan (#86) Feb 1, 2019
.env Use own private key to deploy (#189) Mar 30, 2019
.eslintrc.yaml Setup Solo On Kovan (#86) Feb 1, 2019
.gitattributes initial commit Dec 4, 2018
.gitignore Add Solidity Code Coverage (#115) Feb 13, 2019
.solcover.js Fix testing/coverage (#267) Jun 10, 2019
.soliumignore Lint external contracts (#133) Feb 20, 2019
.soliumrc.json initial commit Dec 4, 2018
Dockerfile fix docker build Jan 18, 2019
LICENSE initial commit Dec 4, 2018 add refunder addresses to documentation (#306) Aug 22, 2019
docker-compose.yml Fix testing/coverage (#267) Jun 10, 2019
jest.config.js upgrade to solc 0.5.5 (#158) Mar 9, 2019
jest.setup.js Add Solidity Code Coverage (#115) Feb 13, 2019
package-lock.json Add API client (#307) Aug 23, 2019
package.json Add API client (#307) Aug 23, 2019
truffle.js Implement SignedOperationProxy (#283) Jul 29, 2019
tsconfig.json Properly export TypeScript types (#275) Jul 1, 2019
tslint.json Implement typescript library setup (#4) (#19) Jan 3, 2019

Ethereum Smart Contracts and TypeScript library used for the dYdX Solo Trading Protocol. Currently used by

Full Documentation at

Table of Contents


Check out our full documentation at


npm i -s @dydxprotocol/solo



Contract Name Description Address
SoloMargin Main dYdX contract 0x1E0447b19BB6EcFdAe1e4AE1694b0C3659614e4e
PayableProxyForSoloMargin WETH wrapper proxy 0xa8b39829cE2246f89B31C013b8Cde15506Fb9A76
PolynomialInterestSetter Sets interest rates 0xae089c1c5de5ea6a1e8e77069c7a787172b2e460
Expiry Handles account expiries 0x0ECE224FBC24D40B446c6a94a142dc41fAe76f2d
DaiPriceOracle Price oracle for DAI 0x787F552BDC17332c98aA360748884513e3cB401a
WethPriceOracle Price oracle for WETH 0xf61AE328463CD997C7b58e7045CdC613e1cFdb69
UsdcPriceOracle Price oracle for USDC 0x52f1c952A48a4588f9ae615d38cfdbf8dF036e60
AdminImpl SoloMargin library containing admin functions 0x8a6629fEba4196E0A61B8E8C94D4905e525bc055
OperationImpl SoloMargin library containing operation functions 0x56E7d4520ABFECf10b38368b00723d9BD3c21ee1
LiquidatorProxyV1ForSoloMargin Proxy contract for liquidating other accounts 0xD4B6cd147ad8A0D5376b6FDBa85fE8128C6f0686
LimitOrders Contract for making limit orders using dYdX funds 0xeb32d60A5cDED175cea9aFD0f2447297C125F2f4
SignedOperationProxy Contract for sending signed operations on behalf of another account owner 0x401dca7116d1CACb3c3bc1B4acE16fC87f7EfaBa
Refunder Allows sending of funds to other accounts 0x0ECE224FBC24D40B446c6a94a142dc41fAe76f2d


Independent Audits

The smart contracts were audited independently by both Zeppelin Solutions and Bramah Systems.

Zeppelin Solutions Audit Report

Bramah Systems Audit Report

Code Coverage

All production smart contracts are tested and have 100% branching code-coverage.

Vulnerability Disclosure Policy

The disclosure of security vulnerabilities helps us ensure the security of our users.

How to report a security vulnerability?

If you believe you’ve found a security vulnerability in one of our contracts or platforms, send it to us by emailing Please include the following details with your report:

  • Description of the location and potential impact of the vulnerability;

  • A detailed description of the steps required to reproduce the vulnerability


Any vulnerability not previously disclosed by us or our independent auditors in their reports


We require that all reporters:

  • Make every effort to avoid privacy violations, degradation of user experience, disruption to production systems, and destruction of data during security testing

  • Use the identified communication channels to report vulnerability information to us

  • Keep information about any vulnerabilities you’ve discovered confidential between yourself and dYdX until we’ve had 30 days to resolve the issue

If you follow these guidelines when reporting an issue to us, we commit to:

  • Not pursue or support any legal action related to your findings

  • Work with you to understand and resolve the issue quickly (including an initial confirmation of your report within 72 hours of submission)

  • Grant a monetary reward based on the OWASP risk assessment methodology


Compile Contracts

Requires a running docker engine.

npm run build

Compile TypeScript

npm run build:js


Requires a running docker engine.

Start test node:

docker-compose up

Deploy contracts to test node & run tests:

npm test

Just run tests (contracts must already be deployed to test node):

npm run test_only

Just deploy contracts to test node:

npm run deploy_test




You can’t perform that action at this time.