Data Availability Layer API (DAL)
Pull-based oracle submission using Data Availability Layer API
The on-chain price data can be updated on-demand by a user through the pull-based oracle. Off-chain price data are updated at sub-second intervals. Users with valid API key can access and submit the latest price data on-chain. The price data can be either accessed through REST API or WebSocket API.
The DAL API requires the X-API-Key
header. Please contact us to receive a valid API key.
Basic Return Types
symbol
string
symbol name
value
string
price value
aggregateTime
string
timestamp value
proof
string
proof hexstring
feedHash
string
feed hash hexstring
decimals
string
decimals
Rest API
Testnet (REST): https://dal.baobab.orakl.network
Mainnet (REST): https://dal.cypress.orakl.network
GET /symbols
/symbols
returns supported symbols
GET /latest-data-feeds/all
/latest-data-feeds/all
returns latest submission parameters for all supported pairs
GET /latest-data-feeds/{symbol,symbol,...}
/latest-data-feeds/{symbol,symbol,...}
returns the latest submission parameters for requested pairs
GET /latest-data-feeds/transpose/all
/latest-data-feeds/transpose/all
returns latest submission paramters for all pairs in transpose format
Get /latest-data-feeds/transpose/{symbol, symbol..}
/latest-data-feeds/transpose/{symbol, symbol..}
returns latest submission paramters for certain pairs in transpose format
WebSocket API
Testnet (WS): ws://dal.baobab.orakl.network/ws
Mainnet (WS): ws://dal.cypress.orakl.network/ws
Connect and Request /ws
/ws
subscribes and pushes price feeds
On-chain Price Data Submission
The price data is submitted on-chain through SubmissionProxy contract. The contract address can be found at JSON configuration.
submit
function
submit
functionSubmits in bulk without strict checks. It will silently skip invalid submissions and submit only valid submissions.
Signature
function submit(
bytes32[] calldata _feedHashes,
int256[] calldata _answers,
uint256[] calldata _timestamps,
bytes[] calldata _proofs
)
ABI
[
{
"type": "function",
"name": "submit",
"inputs": [
{
"name": "_feedHashes",
"type": "bytes32[]",
"internalType": "bytes32[]"
},
{
"name": "_answers",
"type": "int256[]",
"internalType": "int256[]"
},
{
"name": "_timestamps",
"type": "uint256[]",
"internalType": "uint256[]"
},
{
"name": "_proofs",
"type": "bytes[]",
"internalType": "bytes[]"
}
],
"outputs": [],
"stateMutability": "nonpayable"
}
]
submitStrict
function
submitStrict
functionSubmits in bulk with strict checks. If one of the submission entry fails, the whole tx will fail with error
signature
function submitStrict(
bytes32[] calldata _feedHashes,
int256[] calldata _answers,
uint256[] calldata _timestamps,
bytes[] calldata _proofs
)
abi
[
{
"type": "function",
"name": "submitStrict",
"inputs": [
{
"name": "_feedHashes",
"type": "bytes32[]",
"internalType": "bytes32[]"
},
{ "name": "_answers", "type": "int256[]", "internalType": "int256[]" },
{
"name": "_timestamps",
"type": "uint256[]",
"internalType": "uint256[]"
},
{ "name": "_proofs", "type": "bytes[]", "internalType": "bytes[]" }
],
"outputs": [],
"stateMutability": "nonpayable"
}
]
submitSingle
function
submitSingle
functionSubmits single entry with checks.
signature
function submitSingle(bytes32 _feedHash, int256 _answer, uint256 _timestamp, bytes calldata _proof)
abi
[
{
"type": "function",
"name": "submitSingle",
"inputs": [
{ "name": "_feedHash", "type": "bytes32", "internalType": "bytes32" },
{ "name": "_answer", "type": "int256", "internalType": "int256" },
{ "name": "_timestamp", "type": "uint256", "internalType": "uint256" },
{ "name": "_proof", "type": "bytes", "internalType": "bytes" }
],
"outputs": [],
"stateMutability": "nonpayable"
}
]
submitWithoutSupersedValidation
function
submitWithoutSupersedValidation
functionSubmit a batch of answers to multiple feeds. The answers are ignored if they have been superseded. If any of the answers do not meet the rest of required conditions the whole batch is reverted.
signature
function submitWithoutSupersedValidation(
bytes32[] calldata _feedHashes,
int256[] calldata _answers,
uint256[] calldata _timestamps,
bytes[] calldata _proofs
)
abi
[
{
"type": "function",
"name": "submitWithoutSupersedValidation",
"inputs": [
{
"name": "_feedHashes",
"type": "bytes32[]",
"internalType": "bytes32[]"
},
{ "name": "_answers", "type": "int256[]", "internalType": "int256[]" },
{
"name": "_timestamps",
"type": "uint256[]",
"internalType": "uint256[]"
},
{ "name": "_proofs", "type": "bytes[]", "internalType": "bytes[]" }
],
"outputs": [],
"stateMutability": "nonpayable"
}
]
submitSingleWithoutSupersedValidation
function
submitSingleWithoutSupersedValidation
functionSubmit a single submission to a feed. The submission is ignored if it has been superseded. If the submission does not meet the rest of required conditions the submission is reverted.
signature
function submitSingleWithoutSupersedValidation(bytes32 _feedHash, int256 _answer, uint256 _timestamp, bytes calldata _proof)
abi
{
"type": "function",
"name": "submitSingleWithoutSupersedValidation",
"inputs": [
{ "name": "_feedHash", "type": "bytes32", "internalType": "bytes32" },
{ "name": "_answer", "type": "int256", "internalType": "int256" },
{ "name": "_timestamp", "type": "uint256", "internalType": "uint256" },
{ "name": "_proof", "type": "bytes", "internalType": "bytes" }
],
"outputs": [],
"stateMutability": "nonpayable"
}
Last updated