2026-05-14 00:20:14 -03:00
|
|
|
{
|
|
|
|
|
"version": "0.1.0",
|
|
|
|
|
"name": "twap_oracle",
|
|
|
|
|
"instructions": [
|
|
|
|
|
{
|
2026-05-28 10:35:05 +02:00
|
|
|
"name": "create_price_observations",
|
|
|
|
|
"accounts": [
|
|
|
|
|
{
|
|
|
|
|
"name": "price_observations",
|
|
|
|
|
"writable": false,
|
|
|
|
|
"signer": false,
|
|
|
|
|
"init": false
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"name": "price_source",
|
|
|
|
|
"writable": false,
|
|
|
|
|
"signer": false,
|
|
|
|
|
"init": false
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"name": "clock",
|
|
|
|
|
"writable": false,
|
|
|
|
|
"signer": false,
|
|
|
|
|
"init": false
|
|
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"args": [
|
|
|
|
|
{
|
|
|
|
|
"name": "initial_tick",
|
|
|
|
|
"type": "i32"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"name": "window_duration",
|
|
|
|
|
"type": "u64"
|
|
|
|
|
}
|
|
|
|
|
]
|
2026-05-14 00:20:14 -03:00
|
|
|
}
|
|
|
|
|
],
|
|
|
|
|
"accounts": [
|
2026-05-28 10:35:05 +02:00
|
|
|
{
|
|
|
|
|
"name": "PriceObservations",
|
|
|
|
|
"type": {
|
|
|
|
|
"kind": "struct",
|
|
|
|
|
"fields": [
|
|
|
|
|
{
|
|
|
|
|
"name": "price_source_id",
|
|
|
|
|
"type": "account_id"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"name": "write_index",
|
|
|
|
|
"type": "u32"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"name": "total_entries",
|
|
|
|
|
"type": "u64"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"name": "last_recorded_tick",
|
|
|
|
|
"type": "i32"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"name": "entries",
|
|
|
|
|
"type": {
|
|
|
|
|
"vec": {
|
|
|
|
|
"defined": "ObservationEntry"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
},
|
2026-05-14 00:20:14 -03:00
|
|
|
{
|
|
|
|
|
"name": "OraclePriceAccount",
|
|
|
|
|
"type": {
|
|
|
|
|
"kind": "struct",
|
|
|
|
|
"fields": [
|
|
|
|
|
{
|
|
|
|
|
"name": "base_asset",
|
|
|
|
|
"type": "account_id"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"name": "quote_asset",
|
|
|
|
|
"type": "account_id"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"name": "price",
|
|
|
|
|
"type": "u128"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"name": "timestamp",
|
|
|
|
|
"type": "u64"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"name": "source_id",
|
|
|
|
|
"type": "string"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"name": "confidence_interval",
|
|
|
|
|
"type": "u128"
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
],
|
2026-05-28 10:35:05 +02:00
|
|
|
"types": [
|
|
|
|
|
{
|
|
|
|
|
"name": "ObservationEntry",
|
|
|
|
|
"kind": "struct",
|
|
|
|
|
"fields": [
|
|
|
|
|
{
|
|
|
|
|
"name": "timestamp",
|
|
|
|
|
"type": "u64"
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
"name": "tick_cumulative",
|
|
|
|
|
"type": "i64"
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
],
|
2026-05-14 00:20:14 -03:00
|
|
|
"instruction_type": "twap_oracle_core::Instruction"
|
|
|
|
|
}
|