Search by name, SuiNS, address, digest, object ID, coin type or checkpoint.

vault_oracle

Module0xdb8f…f02e
Move path
0xcd86…fefa::vault_oracle
Functions
2815 public, 0 entry
Structs
13
Friend modules
vault_manage
vault_oracle

Bytecode1157 lines

The on-chain disassembly. Offsets are instruction numbers within each function.

// Move bytecode v7
module cd86f77503a755c48fe6c87e1b8e9a137ec0c1bf37aac8878b6083262b27fefa.vault_oracle {
use 55300367a2d40813727ccac4ecee977a39fb9cdb46f2e6b2c354b9798f5de2c0::i64;
use 55300367a2d40813727ccac4ecee977a39fb9cdb46f2e6b2c354b9798f5de2c0::price;
use 55300367a2d40813727ccac4ecee977a39fb9cdb46f2e6b2c354b9798f5de2c0::price_identifier;
use 55300367a2d40813727ccac4ecee977a39fb9cdb46f2e6b2c354b9798f5de2c0::price_info;
use 55300367a2d40813727ccac4ecee977a39fb9cdb46f2e6b2c354b9798f5de2c0::pyth;
use 55300367a2d40813727ccac4ecee977a39fb9cdb46f2e6b2c354b9798f5de2c0::state;
use 0000000000000000000000000000000000000000000000000000000000000001::ascii;
use 0000000000000000000000000000000000000000000000000000000000000001::u64;
use 0000000000000000000000000000000000000000000000000000000000000002::address;
use 0000000000000000000000000000000000000000000000000000000000000002::clock;
use 0000000000000000000000000000000000000000000000000000000000000002::event;
use 0000000000000000000000000000000000000000000000000000000000000002::object;
use 0000000000000000000000000000000000000000000000000000000000000002::table;
use 0000000000000000000000000000000000000000000000000000000000000002::transfer;
use 0000000000000000000000000000000000000000000000000000000000000002::tx_context;
use c3c7e6eb7202e9fb0389a2f7542b91cc40e4f7a33c02554fec11c4c92f938ea3::aggregator;
use cd86f77503a755c48fe6c87e1b8e9a137ec0c1bf37aac8878b6083262b27fefa::vault_utils;
 
struct PriceInfo has drop, store {
aggregator: address,
decimals: u8,
price: u256,
last_updated: u64
}
 
struct OracleConfig has store, key {
id: UID,
version: u64,
aggregators: Table<String, PriceInfo>,
update_interval: u64,
dex_slippage: u256
}
 
struct UpdateIntervalSet has copy, drop {
update_interval: u64
}
 
struct DexSlippageSet has copy, drop {
dex_slippage: u256
}
 
struct PriceUpdated has copy, drop {
price: u256,
timestamp: u64
}
 
struct SwitchboardAggregatorAdded has copy, drop {
asset_type: String,
aggregator: address
}
 
struct PythAggregatorAdded has copy, drop {
asset_type: String,
aggregator: address
}
 
struct SwitchboardAggregatorRemoved has copy, drop {
asset_type: String,
aggregator: address
}
 
struct PythAggregatorRemoved has copy, drop {
asset_type: String,
aggregator: address
}
 
struct SwitchboardAggregatorChanged has copy, drop {
asset_type: String,
old_aggregator: address,
new_aggregator: address
}
 
struct PythAggregatorChanged has copy, drop {
asset_type: String,
old_aggregator: address,
new_aggregator: address
}
 
struct OracleConfigUpgraded has copy, drop {
oracle_config_id: address,
version: u64
}
 
struct AssetPriceUpdated has copy, drop {
asset_type: String,
price: u256,
timestamp: u64
}
 
init(Arg0: &mut TxContext) {
B0:
0CopyLoc[0](Arg0: &mut TxContext)
1Call object::new(&mut TxContext): UID
2LdConst[0](u64: 5)
3MoveLoc[0](Arg0: &mut TxContext)
4Call table::new<String, PriceInfo>(&mut TxContext): Table<String, PriceInfo>
5LdConst[1](u64: 60000)
6LdConst[2](u256: 100)
7Pack[1](OracleConfig)
8Call transfer::share_object<OracleConfig>(OracleConfig)
9Ret
}
 
public(friend) check_version(Arg0: &OracleConfig) {
B0:
0MoveLoc[0](Arg0: &OracleConfig)
1ImmBorrowField[0](OracleConfig.version: u64)
2ReadRef
3LdConst[0](u64: 5)
4Eq
5BrFalse(7)
B1:
6Branch(9)
B2:
7LdConst[14](u64: 2005)
8Abort
B3:
9Ret
}
 
public(friend) upgrade_oracle_config(Arg0: &mut OracleConfig) {
B0:
0CopyLoc[0](Arg0: &mut OracleConfig)
1ImmBorrowField[0](OracleConfig.version: u64)
2ReadRef
3LdConst[0](u64: 5)
4Lt
5BrFalse(7)
B1:
6Branch(11)
B2:
7MoveLoc[0](Arg0: &mut OracleConfig)
8Pop
9LdConst[14](u64: 2005)
10Abort
B3:
11LdConst[0](u64: 5)
12CopyLoc[0](Arg0: &mut OracleConfig)
13MutBorrowField[0](OracleConfig.version: u64)
14WriteRef
15MoveLoc[0](Arg0: &mut OracleConfig)
16ImmBorrowField[1](OracleConfig.id: UID)
17Call object::uid_to_address(&UID): address
18LdConst[0](u64: 5)
19Pack[11](OracleConfigUpgraded)
20Call event::emit<OracleConfigUpgraded>(OracleConfigUpgraded)
21Ret
}
 
public(friend) set_update_interval(Arg0: &mut OracleConfig, Arg1: u64) {
L2: loc0: bool
B0:
0CopyLoc[0](Arg0: &mut OracleConfig)
1FreezeRef
2Call check_version(&OracleConfig)
3CopyLoc[1](Arg1: u64)
4LdU64(0)
5Gt
6BrFalse(12)
B1:
7CopyLoc[1](Arg1: u64)
8LdConst[1](u64: 60000)
9Le
10StLoc[2](loc0: bool)
11Branch(14)
B2:
12LdFalse
13StLoc[2](loc0: bool)
B3:
14MoveLoc[2](loc0: bool)
15BrFalse(17)
B4:
16Branch(21)
B5:
17MoveLoc[0](Arg0: &mut OracleConfig)
18Pop
19LdConst[17](u64: 2008)
20Abort
B6:
21CopyLoc[1](Arg1: u64)
22MoveLoc[0](Arg0: &mut OracleConfig)
23MutBorrowField[2](OracleConfig.update_interval: u64)
24WriteRef
25MoveLoc[1](Arg1: u64)
26Pack[2](UpdateIntervalSet)
27Call event::emit<UpdateIntervalSet>(UpdateIntervalSet)
28Ret
}
 
public(friend) set_dex_slippage(Arg0: &mut OracleConfig, Arg1: u256) {
B0:
0CopyLoc[0](Arg0: &mut OracleConfig)
1FreezeRef
2Call check_version(&OracleConfig)
3CopyLoc[1](Arg1: u256)
4MoveLoc[0](Arg0: &mut OracleConfig)
5MutBorrowField[3](OracleConfig.dex_slippage: u256)
6WriteRef
7MoveLoc[1](Arg1: u256)
8Pack[3](DexSlippageSet)
9Call event::emit<DexSlippageSet>(DexSlippageSet)
10Ret
}
 
public get_asset_price(Arg0: &OracleConfig, Arg1: &Clock, Arg2: String): u256 {
L3: loc0: u64
L4: loc1: &PriceInfo
B0:
0CopyLoc[0](Arg0: &OracleConfig)
1Call check_version(&OracleConfig)
2CopyLoc[0](Arg0: &OracleConfig)
3ImmBorrowField[4](OracleConfig.aggregators: Table<String, PriceInfo>)
4CopyLoc[2](Arg2: String)
5Call table::contains<String, PriceInfo>(&Table<String, PriceInfo>, String): bool
6BrFalse(8)
B1:
7Branch(14)
B2:
8MoveLoc[0](Arg0: &OracleConfig)
9Pop
10MoveLoc[1](Arg1: &Clock)
11Pop
12LdConst[10](u64: 2001)
13Abort
B3:
14CopyLoc[0](Arg0: &OracleConfig)
15ImmBorrowField[4](OracleConfig.aggregators: Table<String, PriceInfo>)
16MoveLoc[2](Arg2: String)
17Call table::borrow<String, PriceInfo>(&Table<String, PriceInfo>, String): &PriceInfo
18StLoc[4](loc1: &PriceInfo)
19MoveLoc[1](Arg1: &Clock)
20Call clock::timestamp_ms(&Clock): u64
21StLoc[3](loc0: u64)
22CopyLoc[4](loc1: &PriceInfo)
23ImmBorrowField[5](PriceInfo.last_updated: u64)
24ReadRef
25MoveLoc[3](loc0: u64)
26Call u64::diff(u64, u64): u64
27MoveLoc[0](Arg0: &OracleConfig)
28ImmBorrowField[2](OracleConfig.update_interval: u64)
29ReadRef
30Lt
31BrFalse(33)
B4:
32Branch(37)
B5:
33MoveLoc[4](loc1: &PriceInfo)
34Pop
35LdConst[11](u64: 2002)
36Abort
B6:
37MoveLoc[4](loc1: &PriceInfo)
38ImmBorrowField[6](PriceInfo.price: u256)
39ReadRef
40Ret
}
 
public get_normalized_asset_price(Arg0: &OracleConfig, Arg1: &Clock, Arg2: String): u256 {
L3: loc0: u256
L4: loc1: u8
L5: loc2: u256
B0:
0CopyLoc[0](Arg0: &OracleConfig)
1MoveLoc[1](Arg1: &Clock)
2CopyLoc[2](Arg2: String)
3Call get_asset_price(&OracleConfig, &Clock, String): u256
4StLoc[5](loc2: u256)
5MoveLoc[0](Arg0: &OracleConfig)
6ImmBorrowField[4](OracleConfig.aggregators: Table<String, PriceInfo>)
7MoveLoc[2](Arg2: String)
8Call table::borrow<String, PriceInfo>(&Table<String, PriceInfo>, String): &PriceInfo
9ImmBorrowField[7](PriceInfo.decimals: u8)
10ReadRef
11StLoc[4](loc1: u8)
12CopyLoc[4](loc1: u8)
13LdU8(9)
14Lt
15BrFalse(26)
B1:
16MoveLoc[5](loc2: u256)
17LdU64(10)
18LdU8(9)
19MoveLoc[4](loc1: u8)
20Sub
21Call u64::pow(u64, u8): u64
22CastU256
23Mul
24StLoc[3](loc0: u256)
25Branch(35)
B2:
26MoveLoc[5](loc2: u256)
27LdU64(10)
28MoveLoc[4](loc1: u8)
29LdU8(9)
30Sub
31Call u64::pow(u64, u8): u64
32CastU256
33Div
34StLoc[3](loc0: u256)
B3:
35MoveLoc[3](loc0: u256)
36Ret
}
 
public(friend) add_switchboard_aggregator(Arg0: &mut OracleConfig, Arg1: &Clock, Arg2: String, Arg3: u8, Arg4: &Aggregator) {
B0:
0LdConst[18](u64: 2009)
1Abort
}
 
public(friend) add_pyth_aggregator(Arg0: &mut OracleConfig, Arg1: &Clock, Arg2: String, Arg3: u8, Arg4: &State, Arg5: &PriceInfoObject) {
L6: loc0: u256
L7: loc1: u64
L8: loc2: PriceInfo
L9: loc3: address
B0:
0CopyLoc[0](Arg0: &mut OracleConfig)
1FreezeRef
2Call check_version(&OracleConfig)
3CopyLoc[0](Arg0: &mut OracleConfig)
4ImmBorrowField[4](OracleConfig.aggregators: Table<String, PriceInfo>)
5CopyLoc[2](Arg2: String)
6Call table::contains<String, PriceInfo>(&Table<String, PriceInfo>, String): bool
7Not
8BrFalse(10)
B1:
9Branch(20)
B2:
10MoveLoc[4](Arg4: &State)
11Pop
12MoveLoc[5](Arg5: &PriceInfoObject)
13Pop
14MoveLoc[0](Arg0: &mut OracleConfig)
15Pop
16MoveLoc[1](Arg1: &Clock)
17Pop
18LdConst[12](u64: 2003)
19Abort
B3:
20CopyLoc[1](Arg1: &Clock)
21Call clock::timestamp_ms(&Clock): u64
22StLoc[7](loc1: u64)
23CopyLoc[5](Arg5: &PriceInfoObject)
24Call get_pyth_object_identifier(&PriceInfoObject): address
25StLoc[9](loc3: address)
26CopyLoc[9](loc3: address)
27Call is_rate_feed(address): bool
28Not
29BrFalse(31)
B4:
30Branch(41)
B5:
31MoveLoc[4](Arg4: &State)
32Pop
33MoveLoc[5](Arg5: &PriceInfoObject)
34Pop
35MoveLoc[0](Arg0: &mut OracleConfig)
36Pop
37MoveLoc[1](Arg1: &Clock)
38Pop
39LdConst[19](u64: 2010)
40Abort
B6:
41CopyLoc[0](Arg0: &mut OracleConfig)
42FreezeRef
43MoveLoc[1](Arg1: &Clock)
44MoveLoc[4](Arg4: &State)
45MoveLoc[5](Arg5: &PriceInfoObject)
46Call get_current_price_v2(&OracleConfig, &Clock, &State, &PriceInfoObject): u256
47StLoc[6](loc0: u256)
48CopyLoc[9](loc3: address)
49MoveLoc[3](Arg3: u8)
50MoveLoc[6](loc0: u256)
51MoveLoc[7](loc1: u64)
52Pack[0](PriceInfo)
53StLoc[8](loc2: PriceInfo)
54MoveLoc[0](Arg0: &mut OracleConfig)
55MutBorrowField[4](OracleConfig.aggregators: Table<String, PriceInfo>)
56CopyLoc[2](Arg2: String)
57MoveLoc[8](loc2: PriceInfo)
58Call table::add<String, PriceInfo>(&mut Table<String, PriceInfo>, String, PriceInfo)
59MoveLoc[2](Arg2: String)
60MoveLoc[9](loc3: address)
61Pack[6](PythAggregatorAdded)
62Call event::emit<PythAggregatorAdded>(PythAggregatorAdded)
63Ret
}
 
public(friend) set_pyth_aggregator_for_vsui(Arg0: &mut OracleConfig, Arg1: &PriceInfoObject) {
L2: loc0: String
L3: loc1: &mut PriceInfo
L4: loc2: address
B0:
0CopyLoc[0](Arg0: &mut OracleConfig)
1FreezeRef
2Call check_version(&OracleConfig)
3MoveLoc[1](Arg1: &PriceInfoObject)
4Call get_pyth_object_identifier(&PriceInfoObject): address
5StLoc[4](loc2: address)
6CopyLoc[4](loc2: address)
7Call is_rate_feed(address): bool
8BrFalse(10)
B1:
9Branch(14)
B2:
10MoveLoc[0](Arg0: &mut OracleConfig)
11Pop
12LdConst[20](u64: 2011)
13Abort
B3:
14Call vsui_asset_type(): String
15StLoc[2](loc0: String)
16CopyLoc[0](Arg0: &mut OracleConfig)
17ImmBorrowField[4](OracleConfig.aggregators: Table<String, PriceInfo>)
18CopyLoc[2](loc0: String)
19Call table::contains<String, PriceInfo>(&Table<String, PriceInfo>, String): bool
20BrFalse(46)
B4:
21MoveLoc[0](Arg0: &mut OracleConfig)
22MutBorrowField[4](OracleConfig.aggregators: Table<String, PriceInfo>)
23CopyLoc[2](loc0: String)
24Call table::borrow_mut<String, PriceInfo>(&mut Table<String, PriceInfo>, String): &mut PriceInfo
25StLoc[3](loc1: &mut PriceInfo)
26MoveLoc[2](loc0: String)
27CopyLoc[3](loc1: &mut PriceInfo)
28ImmBorrowField[8](PriceInfo.aggregator: address)
29ReadRef
30CopyLoc[4](loc2: address)
31Pack[10](PythAggregatorChanged)
32Call event::emit<PythAggregatorChanged>(PythAggregatorChanged)
33MoveLoc[4](loc2: address)
34CopyLoc[3](loc1: &mut PriceInfo)
35MutBorrowField[8](PriceInfo.aggregator: address)
36WriteRef
37LdU256(0)
38CopyLoc[3](loc1: &mut PriceInfo)
39MutBorrowField[6](PriceInfo.price: u256)
40WriteRef
41LdU64(0)
42MoveLoc[3](loc1: &mut PriceInfo)
43MutBorrowField[5](PriceInfo.last_updated: u64)
44WriteRef
45Branch(59)
B5:
46MoveLoc[0](Arg0: &mut OracleConfig)
47MutBorrowField[4](OracleConfig.aggregators: Table<String, PriceInfo>)
48CopyLoc[2](loc0: String)
49CopyLoc[4](loc2: address)
50LdConst[6](u8: 9)
51LdU256(0)
52LdU64(0)
53Pack[0](PriceInfo)
54Call table::add<String, PriceInfo>(&mut Table<String, PriceInfo>, String, PriceInfo)
55MoveLoc[2](loc0: String)
56MoveLoc[4](loc2: address)
57Pack[6](PythAggregatorAdded)
58Call event::emit<PythAggregatorAdded>(PythAggregatorAdded)
B6:
59Ret
}
 
public(friend) remove_switchboard_aggregator(Arg0: &mut OracleConfig, Arg1: String) {
B0:
0LdConst[18](u64: 2009)
1Abort
}
 
public(friend) remove_pyth_aggregator(Arg0: &mut OracleConfig, Arg1: String) {
B0:
0CopyLoc[0](Arg0: &mut OracleConfig)
1FreezeRef
2Call check_version(&OracleConfig)
3CopyLoc[0](Arg0: &mut OracleConfig)
4ImmBorrowField[4](OracleConfig.aggregators: Table<String, PriceInfo>)
5CopyLoc[1](Arg1: String)
6Call table::contains<String, PriceInfo>(&Table<String, PriceInfo>, String): bool
7BrFalse(9)
B1:
8Branch(13)
B2:
9MoveLoc[0](Arg0: &mut OracleConfig)
10Pop
11LdConst[10](u64: 2001)
12Abort
B3:
13CopyLoc[1](Arg1: String)
14CopyLoc[0](Arg0: &mut OracleConfig)
15ImmBorrowField[4](OracleConfig.aggregators: Table<String, PriceInfo>)
16CopyLoc[1](Arg1: String)
17Call table::borrow<String, PriceInfo>(&Table<String, PriceInfo>, String): &PriceInfo
18ImmBorrowField[8](PriceInfo.aggregator: address)
19ReadRef
20Pack[8](PythAggregatorRemoved)
21Call event::emit<PythAggregatorRemoved>(PythAggregatorRemoved)
22MoveLoc[0](Arg0: &mut OracleConfig)
23MutBorrowField[4](OracleConfig.aggregators: Table<String, PriceInfo>)
24MoveLoc[1](Arg1: String)
25Call table::remove<String, PriceInfo>(&mut Table<String, PriceInfo>, String): PriceInfo
26Pop
27Ret
}
 
public(friend) change_switchboard_aggregator(Arg0: &mut OracleConfig, Arg1: &Clock, Arg2: String, Arg3: &Aggregator) {
B0:
0LdConst[18](u64: 2009)
1Abort
}
 
public(friend) change_pyth_aggregator(Arg0: &mut OracleConfig, Arg1: &Clock, Arg2: String, Arg3: &State, Arg4: &PriceInfoObject) {
L5: loc0: u256
L6: loc1: &mut PriceInfo
L7: loc2: address
B0:
0CopyLoc[0](Arg0: &mut OracleConfig)
1FreezeRef
2Call check_version(&OracleConfig)
3CopyLoc[0](Arg0: &mut OracleConfig)
4ImmBorrowField[4](OracleConfig.aggregators: Table<String, PriceInfo>)
5CopyLoc[2](Arg2: String)
6Call table::contains<String, PriceInfo>(&Table<String, PriceInfo>, String): bool
7BrFalse(9)
B1:
8Branch(19)
B2:
9MoveLoc[3](Arg3: &State)
10Pop
11MoveLoc[4](Arg4: &PriceInfoObject)
12Pop
13MoveLoc[0](Arg0: &mut OracleConfig)
14Pop
15MoveLoc[1](Arg1: &Clock)
16Pop
17LdConst[10](u64: 2001)
18Abort
B3:
19CopyLoc[4](Arg4: &PriceInfoObject)
20Call get_pyth_object_identifier(&PriceInfoObject): address
21StLoc[7](loc2: address)
22CopyLoc[7](loc2: address)
23Call is_rate_feed(address): bool
24Not
25BrFalse(27)
B4:
26Branch(37)
B5:
27MoveLoc[3](Arg3: &State)
28Pop
29MoveLoc[4](Arg4: &PriceInfoObject)
30Pop
31MoveLoc[0](Arg0: &mut OracleConfig)
32Pop
33MoveLoc[1](Arg1: &Clock)
34Pop
35LdConst[19](u64: 2010)
36Abort
B6:
37CopyLoc[0](Arg0: &mut OracleConfig)
38FreezeRef
39CopyLoc[1](Arg1: &Clock)
40MoveLoc[3](Arg3: &State)
41MoveLoc[4](Arg4: &PriceInfoObject)
42Call get_current_price_v2(&OracleConfig, &Clock, &State, &PriceInfoObject): u256
43StLoc[5](loc0: u256)
44MoveLoc[0](Arg0: &mut OracleConfig)
45MutBorrowField[4](OracleConfig.aggregators: Table<String, PriceInfo>)
46CopyLoc[2](Arg2: String)
47Call table::borrow_mut<String, PriceInfo>(&mut Table<String, PriceInfo>, String): &mut PriceInfo
48StLoc[6](loc1: &mut PriceInfo)
49MoveLoc[2](Arg2: String)
50CopyLoc[6](loc1: &mut PriceInfo)
51ImmBorrowField[8](PriceInfo.aggregator: address)
52ReadRef
53CopyLoc[7](loc2: address)
54Pack[10](PythAggregatorChanged)
55Call event::emit<PythAggregatorChanged>(PythAggregatorChanged)
56MoveLoc[7](loc2: address)
57CopyLoc[6](loc1: &mut PriceInfo)
58MutBorrowField[8](PriceInfo.aggregator: address)
59WriteRef
60MoveLoc[5](loc0: u256)
61CopyLoc[6](loc1: &mut PriceInfo)
62MutBorrowField[6](PriceInfo.price: u256)
63WriteRef
64MoveLoc[1](Arg1: &Clock)
65Call clock::timestamp_ms(&Clock): u64
66MoveLoc[6](loc1: &mut PriceInfo)
67MutBorrowField[5](PriceInfo.last_updated: u64)
68WriteRef
69Ret
}
 
public update_price(Arg0: &mut OracleConfig, Arg1: &Aggregator, Arg2: &Clock, Arg3: String) {
B0:
0LdConst[18](u64: 2009)
1Abort
}
 
public update_price_v2(Arg0: &mut OracleConfig, Arg1: &State, Arg2: &PriceInfoObject, Arg3: &Clock, Arg4: String) {
L5: loc0: u256
L6: loc1: u64
L7: loc2: &mut PriceInfo
L8: loc3: address
B0:
0CopyLoc[0](Arg0: &mut OracleConfig)
1FreezeRef
2Call check_version(&OracleConfig)
3CopyLoc[0](Arg0: &mut OracleConfig)
4ImmBorrowField[4](OracleConfig.aggregators: Table<String, PriceInfo>)
5CopyLoc[4](Arg4: String)
6Call table::contains<String, PriceInfo>(&Table<String, PriceInfo>, String): bool
7BrFalse(9)
B1:
8Branch(19)
B2:
9MoveLoc[1](Arg1: &State)
10Pop
11MoveLoc[2](Arg2: &PriceInfoObject)
12Pop
13MoveLoc[0](Arg0: &mut OracleConfig)
14Pop
15MoveLoc[3](Arg3: &Clock)
16Pop
17LdConst[10](u64: 2001)
18Abort
B3:
19CopyLoc[3](Arg3: &Clock)
20Call clock::timestamp_ms(&Clock): u64
21StLoc[6](loc1: u64)
22CopyLoc[2](Arg2: &PriceInfoObject)
23Call get_pyth_object_identifier(&PriceInfoObject): address
24StLoc[8](loc3: address)
25CopyLoc[8](loc3: address)
26Call is_rate_feed(address): bool
27Not
28BrFalse(30)
B4:
29Branch(40)
B5:
30MoveLoc[1](Arg1: &State)
31Pop
32MoveLoc[2](Arg2: &PriceInfoObject)
33Pop
34MoveLoc[0](Arg0: &mut OracleConfig)
35Pop
36MoveLoc[3](Arg3: &Clock)
37Pop
38LdConst[19](u64: 2010)
39Abort
B6:
40CopyLoc[0](Arg0: &mut OracleConfig)
41FreezeRef
42MoveLoc[3](Arg3: &Clock)
43MoveLoc[1](Arg1: &State)
44MoveLoc[2](Arg2: &PriceInfoObject)
45Call get_current_price_v2(&OracleConfig, &Clock, &State, &PriceInfoObject): u256
46StLoc[5](loc0: u256)
47MoveLoc[0](Arg0: &mut OracleConfig)
48MutBorrowField[4](OracleConfig.aggregators: Table<String, PriceInfo>)
49CopyLoc[4](Arg4: String)
50Call table::borrow_mut<String, PriceInfo>(&mut Table<String, PriceInfo>, String): &mut PriceInfo
51StLoc[7](loc2: &mut PriceInfo)
52CopyLoc[7](loc2: &mut PriceInfo)
53ImmBorrowField[8](PriceInfo.aggregator: address)
54ReadRef
55MoveLoc[8](loc3: address)
56Eq
57BrFalse(59)
B7:
58Branch(63)
B8:
59MoveLoc[7](loc2: &mut PriceInfo)
60Pop
61LdConst[13](u64: 2004)
62Abort
B9:
63CopyLoc[5](loc0: u256)
64CopyLoc[7](loc2: &mut PriceInfo)
65MutBorrowField[6](PriceInfo.price: u256)
66WriteRef
67CopyLoc[6](loc1: u64)
68MoveLoc[7](loc2: &mut PriceInfo)
69MutBorrowField[5](PriceInfo.last_updated: u64)
70WriteRef
71MoveLoc[4](Arg4: String)
72MoveLoc[5](loc0: u256)
73MoveLoc[6](loc1: u64)
74Pack[12](AssetPriceUpdated)
75Call event::emit<AssetPriceUpdated>(AssetPriceUpdated)
76Ret
}
 
public update_price_v2_for_vsui(Arg0: &mut OracleConfig, Arg1: &State, Arg2: &PriceInfoObject, Arg3: &PriceInfoObject, Arg4: &Clock, Arg5: String) {
L6: loc0: bool
L7: loc1: u256
L8: loc2: u64
L9: loc3: &mut PriceInfo
L10: loc4: address
L11: loc5: u256
L12: loc6: u256
B0:
0CopyLoc[0](Arg0: &mut OracleConfig)
1FreezeRef
2Call check_version(&OracleConfig)
3CopyLoc[5](Arg5: String)
4Call vsui_asset_type(): String
5Eq
6BrFalse(8)
B1:
7Branch(20)
B2:
8MoveLoc[3](Arg3: &PriceInfoObject)
9Pop
10MoveLoc[2](Arg2: &PriceInfoObject)
11Pop
12MoveLoc[1](Arg1: &State)
13Pop
14MoveLoc[0](Arg0: &mut OracleConfig)
15Pop
16MoveLoc[4](Arg4: &Clock)
17Pop
18LdConst[23](u64: 2014)
19Abort
B3:
20CopyLoc[0](Arg0: &mut OracleConfig)
21ImmBorrowField[4](OracleConfig.aggregators: Table<String, PriceInfo>)
22CopyLoc[5](Arg5: String)
23Call table::contains<String, PriceInfo>(&Table<String, PriceInfo>, String): bool
24BrFalse(26)
B4:
25Branch(38)
B5:
26MoveLoc[3](Arg3: &PriceInfoObject)
27Pop
28MoveLoc[2](Arg2: &PriceInfoObject)
29Pop
30MoveLoc[1](Arg1: &State)
31Pop
32MoveLoc[0](Arg0: &mut OracleConfig)
33Pop
34MoveLoc[4](Arg4: &Clock)
35Pop
36LdConst[10](u64: 2001)
37Abort
B6:
38CopyLoc[4](Arg4: &Clock)
39Call clock::timestamp_ms(&Clock): u64
40StLoc[8](loc2: u64)
41CopyLoc[2](Arg2: &PriceInfoObject)
42Call get_pyth_object_identifier(&PriceInfoObject): address
43LdConst[3](address: 0x23..)
44Eq
45BrFalse(47)
B7:
46Branch(59)
B8:
47MoveLoc[3](Arg3: &PriceInfoObject)
48Pop
49MoveLoc[2](Arg2: &PriceInfoObject)
50Pop
51MoveLoc[1](Arg1: &State)
52Pop
53MoveLoc[0](Arg0: &mut OracleConfig)
54Pop
55MoveLoc[4](Arg4: &Clock)
56Pop
57LdConst[21](u64: 2012)
58Abort
B9:
59CopyLoc[3](Arg3: &PriceInfoObject)
60Call get_pyth_object_identifier(&PriceInfoObject): address
61StLoc[10](loc4: address)
62CopyLoc[10](loc4: address)
63Call is_rate_feed(address): bool
64BrFalse(66)
B10:
65Branch(78)
B11:
66MoveLoc[3](Arg3: &PriceInfoObject)
67Pop
68MoveLoc[2](Arg2: &PriceInfoObject)
69Pop
70MoveLoc[1](Arg1: &State)
71Pop
72MoveLoc[0](Arg0: &mut OracleConfig)
73Pop
74MoveLoc[4](Arg4: &Clock)
75Pop
76LdConst[20](u64: 2011)
77Abort
B12:
78CopyLoc[0](Arg0: &mut OracleConfig)
79FreezeRef
80CopyLoc[4](Arg4: &Clock)
81CopyLoc[1](Arg1: &State)
82MoveLoc[2](Arg2: &PriceInfoObject)
83Call get_current_price_v2(&OracleConfig, &Clock, &State, &PriceInfoObject): u256
84StLoc[11](loc5: u256)
85CopyLoc[0](Arg0: &mut OracleConfig)
86FreezeRef
87MoveLoc[4](Arg4: &Clock)
88MoveLoc[1](Arg1: &State)
89MoveLoc[3](Arg3: &PriceInfoObject)
90Call get_current_price_v2(&OracleConfig, &Clock, &State, &PriceInfoObject): u256
91StLoc[12](loc6: u256)
92CopyLoc[12](loc6: u256)
93LdConst[7](u256: 1000..)
94Ge
95BrFalse(101)
B13:
96CopyLoc[12](loc6: u256)
97LdConst[8](u256: 2000..)
98Le
99StLoc[6](loc0: bool)
100Branch(103)
B14:
101LdFalse
102StLoc[6](loc0: bool)
B15:
103MoveLoc[6](loc0: bool)
104BrFalse(106)
B16:
105Branch(110)
B17:
106MoveLoc[0](Arg0: &mut OracleConfig)
107Pop
108LdConst[22](u64: 2013)
109Abort
B18:
110MoveLoc[11](loc5: u256)
111MoveLoc[12](loc6: u256)
112Call vault_utils::mul_with_oracle_price(u256, u256): u256
113StLoc[7](loc1: u256)
114CopyLoc[7](loc1: u256)
115LdU256(0)
116Gt
117BrFalse(119)
B19:
118Branch(123)
B20:
119MoveLoc[0](Arg0: &mut OracleConfig)
120Pop
121LdConst[16](u64: 2007)
122Abort
B21:
123MoveLoc[0](Arg0: &mut OracleConfig)
124MutBorrowField[4](OracleConfig.aggregators: Table<String, PriceInfo>)
125CopyLoc[5](Arg5: String)
126Call table::borrow_mut<String, PriceInfo>(&mut Table<String, PriceInfo>, String): &mut PriceInfo
127StLoc[9](loc3: &mut PriceInfo)
128CopyLoc[9](loc3: &mut PriceInfo)
129ImmBorrowField[8](PriceInfo.aggregator: address)
130ReadRef
131MoveLoc[10](loc4: address)
132Eq
133BrFalse(135)
B22:
134Branch(139)
B23:
135MoveLoc[9](loc3: &mut PriceInfo)
136Pop
137LdConst[13](u64: 2004)
138Abort
B24:
139CopyLoc[7](loc1: u256)
140CopyLoc[9](loc3: &mut PriceInfo)
141MutBorrowField[6](PriceInfo.price: u256)
142WriteRef
143CopyLoc[8](loc2: u64)
144MoveLoc[9](loc3: &mut PriceInfo)
145MutBorrowField[5](PriceInfo.last_updated: u64)
146WriteRef
147MoveLoc[5](Arg5: String)
148MoveLoc[7](loc1: u256)
149MoveLoc[8](loc2: u64)
150Pack[12](AssetPriceUpdated)
151Call event::emit<AssetPriceUpdated>(AssetPriceUpdated)
152Ret
}
 
public get_current_price(Arg0: &OracleConfig, Arg1: &Clock, Arg2: &Aggregator): u256 {
B0:
0LdConst[18](u64: 2009)
1Abort
}
 
public get_current_price_v2(Arg0: &OracleConfig, Arg1: &Clock, Arg2: &State, Arg3: &PriceInfoObject): u256 {
L4: loc0: u64
L5: loc1: I64
L6: loc2: I64
L7: loc3: u64
L8: loc4: u64
L9: loc5: u256
L10: loc6: Price
L11: loc7: u64
B0:
0CopyLoc[0](Arg0: &OracleConfig)
1Call check_version(&OracleConfig)
2CopyLoc[1](Arg1: &Clock)
3Call clock::timestamp_ms(&Clock): u64
4StLoc[7](loc3: u64)
5MoveLoc[2](Arg2: &State)
6MoveLoc[3](Arg3: &PriceInfoObject)
7MoveLoc[1](Arg1: &Clock)
8Call pyth::get_price(&State, &PriceInfoObject, &Clock): Price
9StLoc[10](loc6: Price)
10ImmBorrowLoc[10](loc6: Price)
11Call price::get_price(&Price): I64
12StLoc[6](loc2: I64)
13ImmBorrowLoc[10](loc6: Price)
14Call price::get_expo(&Price): I64
15StLoc[5](loc1: I64)
16ImmBorrowLoc[10](loc6: Price)
17Call price::get_timestamp(&Price): u64
18LdU64(1000)
19Mul
20StLoc[11](loc7: u64)
21ImmBorrowLoc[6](loc2: I64)
22Call i64::get_is_negative(&I64): bool
23Not
24BrFalse(26)
B1:
25Branch(30)
B2:
26MoveLoc[0](Arg0: &OracleConfig)
27Pop
28LdConst[16](u64: 2007)
29Abort
B3:
30ImmBorrowLoc[5](loc1: I64)
31Call i64::get_is_negative(&I64): bool
32BrFalse(34)
B4:
33Branch(38)
B5:
34MoveLoc[0](Arg0: &OracleConfig)
35Pop
36LdConst[16](u64: 2007)
37Abort
B6:
38ImmBorrowLoc[6](loc2: I64)
39Call i64::get_magnitude_if_positive(&I64): u64
40StLoc[8](loc4: u64)
41ImmBorrowLoc[5](loc1: I64)
42Call i64::get_magnitude_if_negative(&I64): u64
43StLoc[4](loc0: u64)
44CopyLoc[4](loc0: u64)
45LdConst[9](u64: 36)
46Le
47BrFalse(49)
B7:
48Branch(53)
B8:
49MoveLoc[0](Arg0: &OracleConfig)
50Pop
51LdConst[16](u64: 2007)
52Abort
B9:
53CopyLoc[11](loc7: u64)
54CopyLoc[7](loc3: u64)
55LdConst[1](u64: 60000)
56Add
57Le
58BrFalse(60)
B10:
59Branch(64)
B11:
60MoveLoc[0](Arg0: &OracleConfig)
61Pop
62LdConst[15](u64: 2006)
63Abort
B12:
64CopyLoc[7](loc3: u64)
65CopyLoc[11](loc7: u64)
66Ge
67BrFalse(79)
B13:
68MoveLoc[7](loc3: u64)
69MoveLoc[11](loc7: u64)
70Sub
71MoveLoc[0](Arg0: &OracleConfig)
72ImmBorrowField[2](OracleConfig.update_interval: u64)
73ReadRef
74Lt
75BrFalse(77)
B14:
76Branch(81)
B15:
77LdConst[11](u64: 2002)
78Abort
B16:
79MoveLoc[0](Arg0: &OracleConfig)
80Pop
B17:
81MoveLoc[8](loc4: u64)
82CastU256
83MoveLoc[4](loc0: u64)
84Call vault_utils::to_oracle_decimal(u256, u64): u256
85StLoc[9](loc5: u256)
86CopyLoc[9](loc5: u256)
87LdU256(0)
88Gt
89BrFalse(91)
B18:
90Branch(93)
B19:
91LdConst[16](u64: 2007)
92Abort
B20:
93MoveLoc[9](loc5: u256)
94Ret
}
 
is_rate_feed(Arg0: address): bool {
B0:
0MoveLoc[0](Arg0: address)
1LdConst[4](address: 0x77..)
2Eq
3Ret
}
 
public vsui_asset_type(): String {
B0:
0LdConst[5](vector<u8>: "549..)
1Call ascii::string(vector<u8>): String
2Ret
}
 
public update_interval(Arg0: &OracleConfig): u64 {
B0:
0MoveLoc[0](Arg0: &OracleConfig)
1ImmBorrowField[2](OracleConfig.update_interval: u64)
2ReadRef
3Ret
}
 
public coin_decimals(Arg0: &OracleConfig, Arg1: String): u8 {
B0:
0MoveLoc[0](Arg0: &OracleConfig)
1ImmBorrowField[4](OracleConfig.aggregators: Table<String, PriceInfo>)
2MoveLoc[1](Arg1: String)
3Call table::borrow<String, PriceInfo>(&Table<String, PriceInfo>, String): &PriceInfo
4ImmBorrowField[7](PriceInfo.decimals: u8)
5ReadRef
6Ret
}
 
public has_aggregator(Arg0: &OracleConfig, Arg1: String): bool {
B0:
0MoveLoc[0](Arg0: &OracleConfig)
1ImmBorrowField[4](OracleConfig.aggregators: Table<String, PriceInfo>)
2MoveLoc[1](Arg1: String)
3Call table::contains<String, PriceInfo>(&Table<String, PriceInfo>, String): bool
4Ret
}
 
public asset_aggregator(Arg0: &OracleConfig, Arg1: String): address {
B0:
0CopyLoc[0](Arg0: &OracleConfig)
1ImmBorrowField[4](OracleConfig.aggregators: Table<String, PriceInfo>)
2CopyLoc[1](Arg1: String)
3Call table::contains<String, PriceInfo>(&Table<String, PriceInfo>, String): bool
4BrFalse(6)
B1:
5Branch(10)
B2:
6MoveLoc[0](Arg0: &OracleConfig)
7Pop
8LdConst[10](u64: 2001)
9Abort
B3:
10MoveLoc[0](Arg0: &OracleConfig)
11ImmBorrowField[4](OracleConfig.aggregators: Table<String, PriceInfo>)
12MoveLoc[1](Arg1: String)
13Call table::borrow<String, PriceInfo>(&Table<String, PriceInfo>, String): &PriceInfo
14ImmBorrowField[8](PriceInfo.aggregator: address)
15ReadRef
16Ret
}
 
public asset_price_last_updated(Arg0: &OracleConfig, Arg1: String): u64 {
B0:
0CopyLoc[0](Arg0: &OracleConfig)
1ImmBorrowField[4](OracleConfig.aggregators: Table<String, PriceInfo>)
2CopyLoc[1](Arg1: String)
3Call table::contains<String, PriceInfo>(&Table<String, PriceInfo>, String): bool
4BrFalse(6)
B1:
5Branch(10)
B2:
6MoveLoc[0](Arg0: &OracleConfig)
7Pop
8LdConst[10](u64: 2001)
9Abort
B3:
10MoveLoc[0](Arg0: &OracleConfig)
11ImmBorrowField[4](OracleConfig.aggregators: Table<String, PriceInfo>)
12MoveLoc[1](Arg1: String)
13Call table::borrow<String, PriceInfo>(&Table<String, PriceInfo>, String): &PriceInfo
14ImmBorrowField[5](PriceInfo.last_updated: u64)
15ReadRef
16Ret
}
 
public dex_slippage(Arg0: &OracleConfig): u256 {
B0:
0MoveLoc[0](Arg0: &OracleConfig)
1ImmBorrowField[3](OracleConfig.dex_slippage: u256)
2ReadRef
3Ret
}
 
public get_pyth_object_identifier(Arg0: &PriceInfoObject): address {
L1: loc0: PriceIdentifier
L2: loc1: PriceInfo
B0:
0MoveLoc[0](Arg0: &PriceInfoObject)
1Call price_info::get_price_info_from_price_info_object(&PriceInfoObject): PriceInfo
2StLoc[2](loc1: PriceInfo)
3ImmBorrowLoc[2](loc1: PriceInfo)
4Call price_info::get_price_identifier(&PriceInfo): PriceIdentifier
5StLoc[1](loc0: PriceIdentifier)
6ImmBorrowLoc[1](loc0: PriceIdentifier)
7Call price_identifier::get_bytes(&PriceIdentifier): vector<u8>
8Call address::from_bytes(vector<u8>): address
9Ret
}
 
Constants [
0 => u64: 5
1 => u64: 60000
2 => u256: 100
3 => address: 0x23d7315113f5b1d3ba7a83604c44b94d79f4fd69af77f804fc7f920a6dc65744
4 => address: 0x77a89fd7818905d056d1ba2a841868ad932fd32260a98a2205c5db28e02ea736
5 => vector<u8>: "549e8b69270defbfafd4f94e17ec44cdbdd99820b33bda2278dea3b9a32d3f55::cert::CERT" // interpreted as UTF8 string
6 => u8: 9
7 => u256: 1000000000000000000
8 => u256: 2000000000000000000
9 => u64: 36
10 => u64: 2001
11 => u64: 2002
12 => u64: 2003
13 => u64: 2004
14 => u64: 2005
15 => u64: 2006
16 => u64: 2007
17 => u64: 2008
18 => u64: 2009
19 => u64: 2010
20 => u64: 2011
21 => u64: 2012
22 => u64: 2013
23 => u64: 2014
]
}