diff --git a/_data/navigation.js b/_data/navigation.js index bda989a38ee..b900a923a9d 100644 --- a/_data/navigation.js +++ b/_data/navigation.js @@ -282,6 +282,10 @@ module.exports = { title: 'Bookmaker Ratings Oracle', url: 'bookmaker-ratings-oracle' }, + { + title: 'Finage Global Market Data Oracle', + url: 'finage-global-market-data-oracle' + } ], }, ], diff --git a/docs/Data Provider Nodes/bookmaker-ratings-oracle.md b/docs/Data Provider Nodes/bookmaker-ratings-oracle.md index 5e8294abab9..b97ed915f8f 100644 --- a/docs/Data Provider Nodes/bookmaker-ratings-oracle.md +++ b/docs/Data Provider Nodes/bookmaker-ratings-oracle.md @@ -4,6 +4,7 @@ section: smartContract date: Last Modified title: "Bookmaker Ratings Oracle" permalink: "docs/bookmaker-ratings-oracle/" +whatsnext: {"Finage Global Market Data Oracle":"/docs/finage-global-market-data-oracle/"} hidden: false --- Bookmaker Ratings is the premier betting media in Russia and Eastern Europe. Their expansive set of APIs providers users with access to proprietary and aggregated sports odds and sports results data. diff --git a/docs/Data Provider Nodes/finage-global-market-data-oracle.md b/docs/Data Provider Nodes/finage-global-market-data-oracle.md new file mode 100644 index 00000000000..34d66ae4799 --- /dev/null +++ b/docs/Data Provider Nodes/finage-global-market-data-oracle.md @@ -0,0 +1,148 @@ +--- +layout: nodes.liquid +section: smartContract +date: Last Modified +title: "Finage Global Market Data Oracle" +permalink: "docs/finage-global-market-data-oracle/" +hidden: false +--- + +Finage is a leading real-time stock, forex, and cryptocurrency data provider. They offer market data for 60,000+ securities, and a broad selection of data such as financial statements, Ownership, News Sentiments, Earning Call Transcripts and Mergers and Acquisitions. This oracle will initially provide a given stock’s performance relative to its sector’s performance. + +# Steps For Using This Oracle + +- Write and deploy your [Chainlink](../example-walkthrough) contract using the network details below +- Fund it with [LINK](../link-token-contracts) +- Call your [request method](#section-chainlink-examples) + +# Network Details + +#### Ethereum Mainnet +Payment Amount: 1 LINK +LINK Token Address: `{{variables.MAINNET_LINK_TOKEN}}` +Oracle Address: `0xE98dFc0C36408b54326Fa11235D573574B1e8eC3` +JobID: `3e478404a3ca4cf5abd2820efe7c1913` + +#### Ethereum Kovan Testnet +Payment Amount: 0.1 LINK +LINK Token Address: `{{variables.KOVAN_LINK_TOKEN}}` +Oracle Address: `0x56dd6586DB0D08c6Ce7B2f2805af28616E082455` +JobID: `955810d193e144abb85ae2edea65344d` + +#### Binance Smart Chain Mainnet +Payment Amount: 0.1 LINK +LINK Token address:`{{variables.BINANCE_MAINNET_LINK_TOKEN}}` +Oracle Address: `0xa80bEAEBf1955D8AA9B5f741388e5A43Ba309935` +JobID: `55d23024c541439ca28b456044d01304` + +# Create Your Contract + +Import `ChainlinkClient.sol` into your contract so you can inherit the Chainlink behavior. + +```solidity Solidity 4 +pragma solidity ^0.4.24; + +import "@chainlink/contracts/v0.4/ChainlinkClient.sol"; + +contract FinageChainlink is ChainlinkClient { + + uint256 oraclePayment; + + constructor(uint256 _oraclePayment) public { + setPublicChainlinkToken(); + oraclePayment = _oraclePayment; + } + // Additional functions here: + +} +``` +```solidity Solidity 5 +pragma solidity ^0.5.0; + +import "@chainlink/contracts/v0.5/ChainlinkClient.sol"; + +contract FinageChainlink is ChainlinkClient { + + uint256 oraclePayment; + + constructor(uint256 _oraclePayment) public { + setPublicChainlinkToken(); + oraclePayment = _oraclePayment; + } + // Additional functions here: + +} +``` +```solidity Solidity 6 +pragma solidity ^0.6.0; + +import "@chainlink/contracts/v0.6/ChainlinkClient.sol"; + +contract FinageChainlink is ChainlinkClient { + + uint256 oraclePayment; + + constructor(uint256 _oraclePayment) public { + setPublicChainlinkToken(); + oraclePayment = _oraclePayment; + } + // Additional functions here: + +} +``` + +
+ Deploy this contract using Remix ↗ + What is Remix? +
+ +# Tasks +* Finage Relative Stock Performance +* [Copy](../adapters/#copy) +* [Multiply](../adapters/#multiply) +* [EthInt256](../adapters/#ethint256) +* [EthTx](../adapters/#ethtx) + +# Request Parameters +### `symbol` +- The symbol of the stock to query +#### Solidity Example +`req.add("symbol", "AAPL");` + +# Chainlink Examples + +The examples below show how to create a request for the Chainlink node. + +### `requestData` function + +```javascript +function requestData +( + address _oracle, + bytes32 _jobId, + string memory _symbol +) + public + onlyOwner +{ + Chainlink.Request memory req = buildChainlinkRequest(_jobId, this, this.fulfill.selector); + req.add("symbol", _symbol); + sendChainlinkRequestTo(_oracle, req, oraclePayment); +} +``` +### `fulfill` function + +```javascript +int256 public data; + +function fulfill(bytes32 _requestId, int256 _data) + public + recordChainlinkFulfillment(_requestId) +{ + data = _data; +} +``` + +# Documentation and Support +- The `Finage Relative Stock Performance` job depends on calls to the Finage Stock Market Aggregates API and the Stock Market Details API +- For assistance, reach out to Finage using this form \ No newline at end of file