Contract integration
How to calculate prices at your Antelope smart contract
Interfaces
```cpp
struct [[eosio::table]] markets{
uint64_t id;
eosio::name payer;
eosio::asset target; // 0 amount of target token
uint8_t position; // 0 = tokenA, 1 = tokenB
uint8_t stored_days; // in days
uint16_t delay_period; // in minutes
uint32_t stale_after; // in seconds
uint64_t market_id;
int64_t cumulated_tick;
uint16_t target_ticks_amount;
uint16_t target_ticks_cumulated;
int32_t initial_timestamp; // in seconds
int32_t last_update; // in seconds
std::string description;
uint64_t primary_key() const { return id; }
uint64_t market_key() const { return market_id; }
};
typedef multi_index<"markets"_n, markets,
indexed_by<"market"_n, const_mem_fun<markets, uint64_t, &markets::market_key>>
>markets_table;
```Query
Cumulated tick
Last update
Observation
Price calculation
Security
Price staleness
Amount of cumulated ticks
Last updated