Skip to content

Commit

Permalink
Merge pull request #182 from Synthetixio/futures-in-totals
Browse files Browse the repository at this point in the history
Add Futures to Totals
  • Loading branch information
dbeal-eth authored Jun 8, 2022
2 parents 4a10089 + 1b5c0fc commit 4c8f1fd
Show file tree
Hide file tree
Showing 28 changed files with 5,250 additions and 643 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ on:

jobs:
build:
name: Update synthetix in contracts-interface
name: Build subgraphs
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'
node-version: '16'
registry-url: 'https://registry.npmjs.org'
- name: Set npm cache directory
run: npm config set cache .npm-cache --global
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ Each time a synth is exchanged, a new SynthExchange entity is created.

### Total

The Total entities aggregate SynthExchange data over time. Note that we are only collecting a single entity to record all-time totals for each combination of `bucketMagnitude` and `synth` filters. (i.e. All totals with a period of 0 have a timestamp of 0.)
The Total entities aggregate SynthExchange data and futures trades over time. Note that we are only collecting a single entity to record all-time totals for each combination of `bucketMagnitude` and `synth` filters. (i.e. All totals with a period of 0 have a timestamp of 0.)

- `id` (string) - The unique identifier for this total, represented as _timestamp_-_bucketMagnitude_-_synth_-_period_
- `period` (integer) - The duration this candle is tracking, in seconds. The following periods are available: year (31556736), quarter (7889184), month (2629728), week (604800), day (86400), 15 minutes (900), and all-time (0). This is especially useful for filtering.
Expand Down
40 changes: 40 additions & 0 deletions abis/DebtCache.json
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,11 @@
"name": "debtValues",
"type": "uint256[]"
},
{
"internalType": "uint256",
"name": "futuresDebt",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "excludedDebt",
Expand Down Expand Up @@ -349,6 +354,41 @@
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"internalType": "contract IDebtCache",
"name": "prevDebtCache",
"type": "address"
},
{
"internalType": "contract IIssuer",
"name": "prevIssuer",
"type": "address"
}
],
"name": "importExcludedIssuedDebts",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "isInitialized",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
Expand Down
120 changes: 120 additions & 0 deletions abis/EmptyFuturesMarketManager.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
[
{
"constant": true,
"inputs": [],
"name": "allMarkets",
"outputs": [
{
"internalType": "address[]",
"name": "",
"type": "address[]"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"internalType": "bytes32",
"name": "marketKey",
"type": "bytes32"
}
],
"name": "marketForKey",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"internalType": "uint256",
"name": "index",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "pageSize",
"type": "uint256"
}
],
"name": "markets",
"outputs": [
{
"internalType": "address[]",
"name": "",
"type": "address[]"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [
{
"internalType": "bytes32[]",
"name": "marketKeys",
"type": "bytes32[]"
}
],
"name": "marketsForKeys",
"outputs": [
{
"internalType": "address[]",
"name": "",
"type": "address[]"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "numMarkets",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "totalDebt",
"outputs": [
{
"internalType": "uint256",
"name": "debt",
"type": "uint256"
},
{
"internalType": "bool",
"name": "isInvalid",
"type": "bool"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
}
]
Loading

0 comments on commit 4c8f1fd

Please sign in to comment.