Links

/v1/models/results

This endpoint allows us to retrieve information about recent runs of a model. This data is retrieved from cache, which is emptied whenever a new version is deployed.
A simple request looks like this:
curl 'https://gateway.credmark.com/v1/model/results?slug=aave-v2.get-lending-pool' \
-H 'Authorization: Bearer <API key>'
The slug parameter is required. Additional parameters can be used to control the output:
Parameter
Possible Values
Default
Meaning
sort
time, runtime
time
time: the time at which a model was run.
runtime: the amount of time it took to run the model.
order
asc, desc
desc
The sort order.
limit
a whole number
100
The number of results to return.
offset
a whole number
0
The first result to include. This is used for paginating output.
Given the request above, we get the following (truncated) output:
{
"results": [
{
"time": "2022-08-11T23:46:46.000Z",
"slug": "aave-v2.get-lending-pool",
"version": "1.1",
"chainid": 1,
"blocknumber": "15323579",
"input": {},
"output": {
"address": "0x7d2768de32b0b80b7a3454c06bdac94a69ddc7a9"
},
"error": null,
"dependencies": {
"contract.metadata": {
"1.0": 2
},
"aave-v2.get-lending-pool": {
"1.1": 1
},
"aave-v2.get-lending-pool-provider": {
"1.1": 1
}
},
"runtime": 1546
},
{
"time": "2022-07-29T02:40:12.000Z",
"slug": "aave-v2.get-lending-pool",
"version": "1.1",
"chainid": 1,
"blocknumber": "15234708",
"input": {},
"output": {
"address": "0x7d2768de32b0b80b7a3454c06bdac94a69ddc7a9"
},
"error": null,
"dependencies": {
"contract.metadata": {
"1.0": 3
},
"aave-v2.get-lending-pool": {
"1.1": 1
},
"aave-v2.get-lending-pool-provider": {
"1.1": 1
}
},
"runtime": 2743
}
For each model run we return the following data:
Field
Value
Meaning
time
2022-08-11T23:46:46.000Z
The time at which this run occurred.
slug
aave-v2.get-lending-pool
The slug (unique ID) of the model that was run.
version
1.1
The model version being reported.
chainid
1
The chain for which the model was run. Ethereum mainnet in this case.
blocknumber
15323579
The block for which the model was run.
input
JSON block
Input data.
output
JSON block or null
Output data.
error
JSON block or null
Error data.
dependencies
JSON dictionary
A list of models, version numbers, and invocation counts of all models called (directly or indirectly) by the model.
runtime
1546
The amount of time spent running the model.