Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
109 changes: 109 additions & 0 deletions projects/Team-16-Treasury-research/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
## Team#16: Treasury research
### A decentralized Quant Trading platform

<br>

![Untitled (2)](https://user-images.githubusercontent.com/7462849/127729364-9bae63da-fddf-4b1c-a4ab-2122aaafd720.png)


### Product direction
Quant-trading, Decentralized data market, Off-chain computation, Cross-chain interaction, theGraph, Chainlink, MCDEX, Arbitrum

### Introduction
Treasury research is a decentralized quant trading platform. Treasury research built upon highly secured and trustless data flow architecture, **which allows professional quants/traders to create advanced trading strategies with seamless on-chain / off-chain data access, trustworthy decentralized off-chain calculation and cross-chain trading execution.**

- TR will provides a variety of data market
- TR is a de-quant strategy cross-chain & cross-platform fulfilling master board.


### Product design highlights

![image](https://user-images.githubusercontent.com/7462849/127727956-39736d48-fb9c-4555-87df-e47b962d3f5e.png)


Data accessibility and seamlessly - To allow quants access to universal data factors on-chain / off-chain in a seamless manner, Treasury research uses theGraph to query on-chain data, such that executable quants program can query fresh data directly from blockchain. Also, TR uses Chainlink oracle to handle a variety of data queries and post aggregation, such that the entire data flow is entirely implemented in a trustworthy manner.

Another thing worth to highlight, Treasury research uses Chainlink oracle as a trading strategy executable environment to consolidate different types of row data and signals, and make executable calculation and, eventually, fulfill the execution on trading platform MCDEX.

With MCDEX’s Mai protocol, we can easily fulfill quants’ execution strategy on-chain instantly and securely.

In Treasury research, we are empowered by
the Graph’s versatility of on-chain indexing and query;
Chainlink oracle capability of on-chain/off-chain data access and off-chain computation, additionally, we also benefited by Chainlink’s accessibility on different blockchains.
With MCDEX, Quant strategy can be easily executed in MCDEX derivatives platform instantly and securely, MCDEX is building upon Arbitrum, which is a layer 2 solution with high performance and low cost.



### Product UE flow

![image](https://user-images.githubusercontent.com/7462849/127729418-032c49f9-2881-49fb-aa34-782ea65853f7.png)



### Code Struct

```
+-- contracts
+-- keeper
| +-- theGraphEAKeeper.sol
+-- oracle
| +-- oracle.sol
+-- mcdex-mai
| +-- mcdex.sol
priceConsumerV3.sol
theGraphDataEA.sol
```

#### **oracle.sol**
chainlink oracle contracts

#### **mcdex.sol**
mcdex contracts ,this contains **approve**、**deposit**、**tradeBuy**、**tradeSell**

#### **priceConsumerV3.sol**
get Arbitrum UNI-USD price.sol

#### **theGraphDataEA.sol**
chianlink External Adapters.

#### **theGraphEAKeeper.sol**
chianlink keeper. this auto call theGraphDataEA.


### Github link
https://github.com/Treasury-research/TR-theGraph-Chainlink-EA

### Demo link


### Ethereum Wallet Address
0x2858F95DBf90FA9876972150DD303b1024E86179

### Documentation
#### Product & tech docs
https://docs.google.com/document/d/1lXZnjveEo0auYCogztoEqjKRZnxsyqEQE9CaevpH6O4/edit?usp=sharing

#### Pitch deck
https://docs.google.com/presentation/d/1dK8rBgWmJkh5w2fzypOWWTOcGu6gPXXzElGZZADZFxw/edit?usp=sharing

### Twitter handle
https://twitter.com/wenqingyu


### Team information
**Yu Wenqing** - Team leader & product manager, previously worked for BTCChina and Fundamental labs, He is also worked for Chainlink as a Developer advocate and solution architect.

**Wei Yang** - Smart contract developer, previously worked for multiple internet startups, Wei has strong development experience on Python, Node.js, and Solidity.

**Harry Hong** - Data engineering, previously worked for Web3 foundation and multiple blockchain startups, Harry has plenty of blockchain technology experience, he is also a crypto enthusiast.

**Jamie Cheng** - Solution architect, previously worked for BTCChina, Jamie also found a blockchain startup in 2018, he also worked for some famous blockchain projects as architect and technology advisors.

**Ms. X** - Financial product manager, Ms. X requires to stay anonymous, she worked for a topped crypto corporate institution as a research analyst, she has strong capability in financial data analysis and solid experience on on-chain DeFi data analysis.




### Credit
This EA was built upon a Chainlink EA template which created by @Patrick Collions
https://blog.chain.link/build-and-use-external-adapters/
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions projects/Team-16-Treasury-research/project/.envrc.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export API_KEY=abcdefg1234567
21 changes: 21 additions & 0 deletions projects/Team-16-Treasury-research/project/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
module.exports = {
env: {
browser: true,
commonjs: true,
es6: true,
mocha: true
},
extends: [
'standard'
],
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly'
},
parserOptions: {
ecmaVersion: 2018
},
rules: {
'standard/no-callback-literal': 0
}
}
4 changes: 4 additions & 0 deletions projects/Team-16-Treasury-research/project/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules/
package-lock.json
*.zip.DS_Store
theGraph/node_modules/
16 changes: 16 additions & 0 deletions projects/Team-16-Treasury-research/project/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM node:12-alpine

RUN mkdir -p /home/node/app/node_modules && chown -R node:node /home/node/app

WORKDIR /home/node/app

COPY package.json ./
COPY yarn.lock ./

USER node

RUN yarn --frozen-lockfile

COPY --chown=node:node . .

CMD [ "node", "app.js" ]
97 changes: 97 additions & 0 deletions projects/Team-16-Treasury-research/project/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
## Team#16: Treasury research
#### - A decentralized Quant Trading platform

### Product direction
Quant-trading, Decentralized data market, Off-chain computation, Cross-chain interaction, theGraph, Chainlink, MCDEX, Arbitrum

### Introduction
Treasury research is a decentralized quant trading platform. Treasury research built upon highly secured and trustless data flow architecture, **which allows professional quants/traders to create advanced trading strategies with seamless on-chain / off-chain data access, trustworthy decentralized off-chain calculation and cross-chain trading execution.**

- TR will provides a variety of data market
- TR is a de-quant strategy cross-chain & cross-platform fulfilling master board.


### Product design highlights

Data accessibility and seamlessly - To allow quants access to universal data factors on-chain / off-chain in a seamless manner, Treasury research uses theGraph to query on-chain data, such that executable quants program can query fresh data directly from blockchain. Also, TR uses Chainlink oracle to handle a variety of data queries and post aggregation, such that the entire data flow is entirely implemented in a trustworthy manner.

Another thing worth to highlight, Treasury research uses Chainlink oracle as a trading strategy executable environment to consolidate different types of row data and signals, and make executable calculation and, eventually, fulfill the execution on trading platform MCDEX.

With MCDEX’s Mai protocol, we can easily fulfill quants’ execution strategy on-chain instantly and securely.

In Treasury research, we are empowered by
the Graph’s versatility of on-chain indexing and query;
Chainlink oracle capability of on-chain/off-chain data access and off-chain computation, additionally, we also benefited by Chainlink’s accessibility on different blockchains.
With MCDEX, Quant strategy can be easily executed in MCDEX derivatives platform instantly and securely, MCDEX is building upon Arbitrum, which is a layer 2 solution with high performance and low cost.



### Code Struct

```
+-- contracts
+-- keeper
| +-- theGraphEAKeeper.sol
+-- oracle
| +-- oracle.sol
+-- mcdex-mai
| +-- mcdex.sol
priceConsumerV3.sol
theGraphDataEA.sol
```

#### **oracle.sol**
chainlink oracle contracts

#### **mcdex.sol**
mcdex contracts ,this contains **approve**、**deposit**、**tradeBuy**、**tradeSell**

#### **priceConsumerV3.sol**
get Arbitrum UNI-USD price.sol

#### **theGraphDataEA.sol**
chianlink External Adapters.

#### **theGraphEAKeeper.sol**
chianlink keeper. this auto call theGraphDataEA.




### Github link
https://github.com/Treasury-research/TR-theGraph-Chainlink-EA

### Demo link


### Ethereum Wallet Address
0x2858F95DBf90FA9876972150DD303b1024E86179

### Documentation
#### Product & tech docs
https://docs.google.com/document/d/1lXZnjveEo0auYCogztoEqjKRZnxsyqEQE9CaevpH6O4/edit?usp=sharing

#### Pitch deck
https://docs.google.com/presentation/d/1dK8rBgWmJkh5w2fzypOWWTOcGu6gPXXzElGZZADZFxw/edit?usp=sharing

### Twitter handle
https://twitter.com/wenqingyu


### Team information
**Yu Wenqing** - Team leader & product manager, previously worked for BTCChina and Fundamental labs, He is also worked for Chainlink as a Developer advocate and solution architect.

**Wei Yang** - Smart contract developer, previously worked for multiple internet startups, Wei has strong development experience on Python, Node.js, and Solidity.

**Harry Hong** - Data engineering, previously worked for Web3 foundation and multiple blockchain startups, Harry has plenty of blockchain technology experience, he is also a crypto enthusiast.

**Jamie Cheng** - Solution architect, previously worked for BTCChina, Jamie also found a blockchain startup in 2018, he also worked for some famous blockchain projects as architect and technology advisors.

**Ms. X** - Financial product manager, Ms. X requires to stay anonymous, she worked for a topped crypto corporate institution as a research analyst, she has strong capability in financial data analysis and solid experience on on-chain DeFi data analysis.




### Credit
This EA was built upon a Chainlink EA template which created by @Patrick Collions
https://blog.chain.link/build-and-use-external-adapters/
18 changes: 18 additions & 0 deletions projects/Team-16-Treasury-research/project/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const createRequest = require('./index').createRequest

const express = require('express')
const bodyParser = require('body-parser')
const app = express()
const port = process.env.EA_PORT || 8080

app.use(bodyParser.json())

app.post('/', (req, res) => {
console.log('IN POST Data: ', req.body)
createRequest(req.body, (status, result) => {
console.log('Result: ', result)
res.status(status).json(result)
})
})

app.listen(port, () => console.log(`Listening on port ${port}!`))
Empty file.
Empty file.
4 changes: 4 additions & 0 deletions projects/Team-16-Treasury-research/project/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

module.exports = ({ env }) => ({
host: "", // the subgrah host
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.7;

import "@chainlink/contracts/src/v0.6/interfaces/AggregatorV3Interface.sol";

interface KeeperCompatibleInterface {
function checkUpkeep(bytes calldata checkData) external returns (bool upkeepNeeded, bytes memory performData);
function performUpkeep(bytes calldata performData) external;
}


interface ITheGraphDataKovan {
function requesTheGraphData(address _oracle, string calldata _jobId) external;
}

contract TheGraphEAKeeper is KeeperCompatibleInterface {
/**
* Public counter variable
*/
uint public counter;



/**
* Use an interval in seconds and a timestamp to slow execution of Upkeep
*/
uint public immutable interval;
uint public lastTimeStamp;


// address private ITheGraphDataKovan;


constructor(uint updateInterval) public {
interval = updateInterval;
lastTimeStamp = block.timestamp;

counter = 0;
}


function checkUpkeep(bytes calldata checkData) external override returns (bool upkeepNeeded, bytes memory performData) {
upkeepNeeded = (block.timestamp - lastTimeStamp) > interval;

// We don't use the checkData in this example
// checkData was defined when the Upkeep was registered
performData = checkData;
}

function performUpkeep(bytes calldata performData) external override {
lastTimeStamp = block.timestamp;
counter = counter + 1;

//address(0x462c35E1459E4DE7f34059607789C9C1F1Db04Af).call(bytes32(keccak256("requesTheGraphData()")),0xf6980958cc650Be283EbF3d1386b2870c87C30dC,"58f57eb0265b40c7b01f28f137e857e2"); //通过bytes32(keccak256("eat()"指定方法,后面的是参数
// ITheGraphDataKovan().requesTheGraphData(0xf6980958cc650Be283EbF3d1386b2870c87C30dC,"58f57eb0265b40c7b01f28f137e857e2");


// We don't use the performData in this example
// performData is generated by the Keeper's call to your `checkUpkeep` function
/**
* call ITheGraphDataEA requesTheGraphData
*
*
*
*/

ITheGraphDataEA(address(0x462c35E1459E4DE7f34059607789C9C1F1Db04Af)).requesTheGraphData(address(0xf6980958cc650Be283EbF3d1386b2870c87C30dC),"58f57eb0265b40c7b01f28f137e857e2");

// address(0x462c35E1459E4DE7f34059607789C9C1F1Db04Af).call(abi.encodeWithSignature("transfer(address,uint256)", address(0xf6980958cc650Be283EbF3d1386b2870c87C30dC), 123));

performData;

}

}
Loading