dYdX Governance Mechanism
Published: 2022-07-05 15:08:09

> Who controls dYdX bridge ?

## Ownership
- **dYdX Bridge** is a [Proxy](https://etherscan.deth.net/address/0xD54f502e184B6B739d7D27a6410a67dc462D69c8#readContract) [0xd54f...](https://etherscan.io/address/0xD54f502e184B6B739d7D27a6410a67dc462D69c8) 
can be upgraded via `upgradeTo(...) onlyGovernance` method 
- Current governor is [StarkExRemoverGovernorV2](https://etherscan.deth.net/address/0xfcaac0f14dea11ede11afcb875f29130e1ad5ec0#code) [0xfcaa...](0xfcaac0f14dea11ede11afcb875f29130e1ad5ec0) 
- Admin of StarkExRemoverGovernorV2 is [PriorityExecutor](https://etherscan.deth.net/address/0xa306989ba6bcacdeccf3c0614fff2b8c668e3cae#code) [0xa306...](https://etherscan.io/address/0xa306989ba6bcacdeccf3c0614fff2b8c668e3cae) 
- Admin of PriorityExecutor is [DydxGovernor](https://etherscan.deth.net/address/0x7e9b1672616ff6d6629ef2879419aae79a9018d2#code) [0x7e9b...](https://etherscan.io/address/0x7e9b1672616ff6d6629ef2879419aae79a9018d2)
- Current governance strategy is [GovernanceStrategy](https://etherscan.deth.net/address/0x90dfd35f4a0bb2d30cdf66508085e33c353475d9) [0x90df](https://etherscan.io/address/0x90dfd35f4a0bb2d30cdf66508085e33c353475d9) 

---

## Logic
voting power is held by **dydx token owners**

the proposal goes through stages `Pending => Active => Succeeded => Queued => Executed`

---

### Proposal creation 
```solidity
DydxGovernor.create(...)
```

#### Requirements for creation  
```solidity
PriorityExecutor.validateCreatorOfProposal()
```

##### What is being checked 
```solidity
GovernanceStrategy.getPropositionPowerAt() >= getMinimumPropositionPowerNeeded()
``` 

###### getMinimumPropositionPowerNeeded() 
```solidity
GovernanceStrategy.getTotalPropositionSupplyAt(blockNumber)
        .mul(PROPOSITION_THRESHOLD)
        .div(ONE_HUNDRED_WITH_PRECISION)
//PROPOSITION_THRESHOLD = 50
//ONE_HUNDRED_WITH_PRECISION = 10000
```

> **current proposal threshold is 0.5%**

so anyone with at least 0.5% of total supply of dydx token can create a proposal

---

### Voting result

voting succeeds when
```
PriorityExecutor.isProposalPassed() && executionTime = 0` 
```
it means the proposal was voted for by a majority and was not yet executed, now it can be enqueued for execution

#### What is being checked
````
isQuorumValid(governance, proposalId) && isVoteDifferentialValid(governance, proposalId)
```

##### isQuorumValid 
```
proposal.forVotes >= getMinimumVotingPowerNeeded(votingSupply)
```
###### getMinimumVotingPowerNeeded()
```
votingSupply.mul(MINIMUM_QUORUM).div(ONE_HUNDRED_WITH_PRECISION)
//MINIMUM_QUORUM=200
```
> current minimum quorum is 2%

##### isVoteDifferentialValid 
```solidity
proposal.forVotes.mul(ONE_HUNDRED_WITH_PRECISION).div(votingSupply) > proposal.againstVotes.mul(ONE_HUNDRED_WITH_PRECISION).div(votingSupply).add(VOTE_DIFFERENTIAL)
//VOTE_DIFFERENTIAL=50
``` 

> current VOTE_DIFFERENTIAL is 0.5%

---

### Execution
when the vote succeeds it can be executed by executor


---

## dydx token

The token contract is at [0x92d5](https://etherscan.io/address/0x92d6c1e31e14520e676a687f0a93788b716beff5)

Current total supply is **1,000,000,000**
Minimum amount to create proposal is **5,000,000**
Minimum quorum is **20,000,000**

![dydx token info](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r9ohxti4ib2282xy3q5u.png)

there are: 
- 21 addresses who can create a proposal
- 8 addresses that can singlehandedly push proposal (if no other address votes)

![dydx whales](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7umd1w3qkt9m5na6oiwy.png)