@haven-fi/solauto-sdk 1.0.299 → 1.0.301
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/clients/solautoMarginfiClient.d.ts.map +1 -1
- package/dist/clients/solautoMarginfiClient.js +3 -3
- package/dist/constants/marginfiAccounts.d.ts.map +1 -1
- package/dist/constants/marginfiAccounts.js +69 -13
- package/dist/constants/pythConstants.d.ts +2 -2
- package/dist/constants/pythConstants.js +2 -2
- package/dist/constants/switchboardConstants.d.ts +4 -0
- package/dist/constants/switchboardConstants.d.ts.map +1 -0
- package/dist/constants/switchboardConstants.js +35 -0
- package/dist/constants/tokenConstants.d.ts +9 -2
- package/dist/constants/tokenConstants.d.ts.map +1 -1
- package/dist/constants/tokenConstants.js +54 -16
- package/dist/idls/switchboard.json +1 -0
- package/dist/transactions/transactionUtils.d.ts.map +1 -1
- package/dist/transactions/transactionUtils.js +1 -1
- package/dist/utils/generalUtils.d.ts +5 -2
- package/dist/utils/generalUtils.d.ts.map +1 -1
- package/dist/utils/generalUtils.js +54 -7
- package/dist/utils/marginfiUtils.d.ts +4 -4
- package/dist/utils/marginfiUtils.d.ts.map +1 -1
- package/dist/utils/marginfiUtils.js +16 -12
- package/dist/utils/solauto/generalUtils.d.ts +3 -3
- package/dist/utils/solauto/generalUtils.d.ts.map +1 -1
- package/dist/utils/solauto/generalUtils.js +4 -4
- package/local/createFeeAccounts.ts +52 -0
- package/local/shared.ts +1 -1
- package/package.json +5 -2
- package/src/clients/solautoMarginfiClient.ts +3 -0
- package/src/constants/marginfiAccounts.ts +70 -13
- package/src/constants/pythConstants.ts +4 -4
- package/src/constants/switchboardConstants.ts +10 -0
- package/src/constants/tokenConstants.ts +55 -15
- package/src/idls/switchboard.json +1 -0
- package/src/transactions/transactionUtils.ts +1 -0
- package/src/utils/generalUtils.ts +93 -10
- package/src/utils/marginfiUtils.ts +20 -8
- package/src/utils/solauto/generalUtils.ts +6 -3
- package/tests/transactions/solautoMarginfi.ts +1 -1
- package/tests/unit/rebalanceCalculations.ts +6 -2
@@ -7,9 +7,9 @@ export const JITO_SOL = "J1toso1uCk3RLmjorhTtrVwY9HJ7X8V9yYac6Y7kGCPn";
|
|
7
7
|
export const LST = "LSTxxxnJzKDFSLr4dUkPcmCf5VyryEqzPLz5j4bpxFp";
|
8
8
|
export const M_SOL = "mSoLzYCxHdYgdzU16g5QSh3i5K3z3KZK7ytfqcJm7So";
|
9
9
|
export const INF = "5oVNBeEEQvYi1cX3ir8Dx5n1P7pdxydbGF2X4TxVusJm";
|
10
|
+
export const H_SOL = "he1iusmfkpAdwvxLNGV8Y1iSbj4rUy6yMhEA3fotn9A";
|
11
|
+
export const JUP_SOL = "jupSoLaHXQiZZTSfEWMTRRgpnyFm8f6sZdosWBjx93v";
|
10
12
|
export const JUP = "JUPyiwrYJFskUPiHa7hkeR8VUtAeFoSYbKedZNsDvCN";
|
11
|
-
export const BONK = "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263";
|
12
|
-
export const WIF = "EKpQGSJtjMFqKZ9KQanSqYXRcF8fBopzLHYxdM65zcjm";
|
13
13
|
export const JTO = "jtojtomepa8beP8AuQc6eXt5FriJwfFMwQx2v2f9mCL";
|
14
14
|
export const JLP = "27G8MtK7VtTcCHkpASjSDdkWWYfoqT6ggEuKidVJidD4";
|
15
15
|
export const WBTC = "3NZ9JMVBmGAqocybic2c7LQCJScmgsAZ6vQqTDzcqmJh";
|
@@ -18,6 +18,11 @@ export const HNT = "hntyVP6YFm1Hg25TN9WGLqM12b8TQmcknKrdu1oxWux";
|
|
18
18
|
export const PYTH = "HZ1JovNiVvGrGNiiYvEozEVgZ58xaU3RKwX8eACQBCt3";
|
19
19
|
export const USDC = "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v";
|
20
20
|
export const USDT = "Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB";
|
21
|
+
export const BONK = "DezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263";
|
22
|
+
export const WIF = "EKpQGSJtjMFqKZ9KQanSqYXRcF8fBopzLHYxdM65zcjm";
|
23
|
+
export const POPCAT = "7GCihgDB8fe6KNjn2MYtkzZcRjQy3t9GHdC8uHYmW2hr";
|
24
|
+
export const RETARDIO = "6ogzHhzdrQr9Pgv6hZ2MNze7UrzBMAFyBBWUYp1Fhitx";
|
25
|
+
export const BILLY = "3B5wuUrMEi5yATD7on46hKfej3pfmd7t1RKgrsN3pump";
|
21
26
|
|
22
27
|
export const ALL_SUPPORTED_TOKENS = [
|
23
28
|
NATIVE_MINT.toString(),
|
@@ -26,9 +31,9 @@ export const ALL_SUPPORTED_TOKENS = [
|
|
26
31
|
JITO_SOL,
|
27
32
|
LST,
|
28
33
|
INF,
|
34
|
+
H_SOL,
|
35
|
+
JUP_SOL,
|
29
36
|
JUP,
|
30
|
-
BONK,
|
31
|
-
WIF,
|
32
37
|
JTO,
|
33
38
|
JLP,
|
34
39
|
WBTC,
|
@@ -37,6 +42,11 @@ export const ALL_SUPPORTED_TOKENS = [
|
|
37
42
|
PYTH,
|
38
43
|
USDC,
|
39
44
|
USDT,
|
45
|
+
BONK,
|
46
|
+
WIF,
|
47
|
+
POPCAT,
|
48
|
+
RETARDIO,
|
49
|
+
BILLY,
|
40
50
|
];
|
41
51
|
|
42
52
|
interface TokenInfo {
|
@@ -44,6 +54,8 @@ interface TokenInfo {
|
|
44
54
|
decimals: number;
|
45
55
|
isStableCoin?: boolean;
|
46
56
|
isLST?: boolean;
|
57
|
+
isMeme?: boolean;
|
58
|
+
isMajor?: boolean;
|
47
59
|
}
|
48
60
|
|
49
61
|
export const TOKEN_INFO: { [key: string]: TokenInfo } = {
|
@@ -54,6 +66,7 @@ export const TOKEN_INFO: { [key: string]: TokenInfo } = {
|
|
54
66
|
[NATIVE_MINT.toString()]: {
|
55
67
|
ticker: "SOL",
|
56
68
|
decimals: 9,
|
69
|
+
isMajor: true,
|
57
70
|
},
|
58
71
|
[B_SOL]: {
|
59
72
|
ticker: "bSOL",
|
@@ -80,18 +93,18 @@ export const TOKEN_INFO: { [key: string]: TokenInfo } = {
|
|
80
93
|
decimals: 9,
|
81
94
|
isLST: true,
|
82
95
|
},
|
96
|
+
[H_SOL]: {
|
97
|
+
ticker: "hSOL",
|
98
|
+
decimals: 9,
|
99
|
+
},
|
100
|
+
[JUP_SOL]: {
|
101
|
+
ticker: "JupSOL",
|
102
|
+
decimals: 9,
|
103
|
+
},
|
83
104
|
[JUP]: {
|
84
105
|
ticker: "JUP",
|
85
106
|
decimals: 6,
|
86
107
|
},
|
87
|
-
[BONK]: {
|
88
|
-
ticker: "BONK",
|
89
|
-
decimals: 5,
|
90
|
-
},
|
91
|
-
[WIF]: {
|
92
|
-
ticker: "WIF",
|
93
|
-
decimals: 6
|
94
|
-
},
|
95
108
|
[JTO]: {
|
96
109
|
ticker: "JTO",
|
97
110
|
decimals: 9,
|
@@ -103,18 +116,20 @@ export const TOKEN_INFO: { [key: string]: TokenInfo } = {
|
|
103
116
|
[WBTC]: {
|
104
117
|
ticker: "WBTC",
|
105
118
|
decimals: 8,
|
119
|
+
isMajor: true,
|
106
120
|
},
|
107
121
|
[WETH]: {
|
108
122
|
ticker: "WETH",
|
109
|
-
decimals: 8
|
123
|
+
decimals: 8,
|
124
|
+
isMajor: true,
|
110
125
|
},
|
111
126
|
[HNT]: {
|
112
127
|
ticker: "HNT",
|
113
|
-
decimals: 8
|
128
|
+
decimals: 8,
|
114
129
|
},
|
115
130
|
[PYTH]: {
|
116
131
|
ticker: "PYTH",
|
117
|
-
decimals: 6
|
132
|
+
decimals: 6,
|
118
133
|
},
|
119
134
|
[USDC]: {
|
120
135
|
ticker: "USDC",
|
@@ -126,4 +141,29 @@ export const TOKEN_INFO: { [key: string]: TokenInfo } = {
|
|
126
141
|
decimals: 6,
|
127
142
|
isStableCoin: true,
|
128
143
|
},
|
144
|
+
[BONK]: {
|
145
|
+
ticker: "BONK",
|
146
|
+
decimals: 5,
|
147
|
+
isMeme: true,
|
148
|
+
},
|
149
|
+
[WIF]: {
|
150
|
+
ticker: "WIF",
|
151
|
+
decimals: 6,
|
152
|
+
isMeme: true,
|
153
|
+
},
|
154
|
+
[POPCAT]: {
|
155
|
+
ticker: "POPCAT",
|
156
|
+
decimals: 9,
|
157
|
+
isMeme: true,
|
158
|
+
},
|
159
|
+
[RETARDIO]: {
|
160
|
+
ticker: "RETARDIO",
|
161
|
+
decimals: 6,
|
162
|
+
isMeme: true,
|
163
|
+
},
|
164
|
+
[BILLY]: {
|
165
|
+
ticker: "BILLY",
|
166
|
+
decimals: 6,
|
167
|
+
isMeme: true,
|
168
|
+
},
|
129
169
|
};
|
@@ -0,0 +1 @@
|
|
1
|
+
{"address":"SBondMDrcV3K4kxZR1HNVT7osZxAHVHgYXL5Ze1oMUv","metadata":{"name":"sb_on_demand","version":"0.1.0","spec":"0.1.0","description":"Created with Anchor"},"instructions":[{"name":"guardian_quote_verify","discriminator":[168,36,93,156,157,150,148,45],"accounts":[{"name":"guardian","writable":true},{"name":"oracle","writable":true},{"name":"authority","signer":true,"relations":["oracle"]},{"name":"guardian_queue","writable":true,"relations":["state"]},{"name":"state"},{"name":"recent_slothashes","address":"SysvarS1otHashes111111111111111111111111111"}],"args":[{"name":"params","type":{"defined":{"name":"GuardianQuoteVerifyParams"}}}]},{"name":"guardian_register","discriminator":[159,76,53,117,219,29,116,135],"accounts":[{"name":"oracle","writable":true},{"name":"state"},{"name":"guardian_queue","relations":["state"]},{"name":"authority","signer":true,"relations":["state"]}],"args":[{"name":"params","type":{"defined":{"name":"GuardianRegisterParams"}}}]},{"name":"guardian_unregister","discriminator":[215,19,61,120,155,224,120,60],"accounts":[{"name":"oracle","writable":true},{"name":"state"},{"name":"guardian_queue","writable":true,"relations":["state"]},{"name":"authority","signer":true,"relations":["state"]}],"args":[{"name":"params","type":{"defined":{"name":"GuardianUnregisterParams"}}}]},{"name":"oracle_heartbeat","discriminator":[10,175,217,130,111,35,117,54],"accounts":[{"name":"oracle","writable":true},{"name":"oracle_stats","writable":true,"pda":{"seeds":[{"kind":"const","value":[79,114,97,99,108,101,83,116,97,116,115]},{"kind":"account","path":"oracle"}]}},{"name":"oracle_signer","signer":true},{"name":"queue","writable":true,"relations":["oracle","gc_node"]},{"name":"gc_node","writable":true},{"name":"program_state","writable":true},{"name":"payer","writable":true,"signer":true},{"name":"system_program","address":"11111111111111111111111111111111"},{"name":"token_program","address":"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"},{"name":"native_mint","address":"So11111111111111111111111111111111111111112"},{"name":"queue_escrow","writable":true},{"name":"stake_program","address":"SBSTk6t52R89MmCdD739Rdd97HdbTQUFHe41vCX7pTt","relations":["program_state"]},{"name":"delegation_pool","writable":true},{"name":"delegation_group","writable":true}],"args":[{"name":"params","type":{"defined":{"name":"OracleHeartbeatParams"}}}]},{"name":"oracle_init","discriminator":[21,158,66,65,60,221,148,61],"accounts":[{"name":"oracle","writable":true,"signer":true},{"name":"oracle_stats","writable":true,"pda":{"seeds":[{"kind":"const","value":[79,114,97,99,108,101,83,116,97,116,115]},{"kind":"account","path":"oracle"}]}},{"name":"program_state","writable":true},{"name":"payer","writable":true,"signer":true},{"name":"system_program","address":"11111111111111111111111111111111"},{"name":"token_program","address":"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"},{"name":"lut_signer"},{"name":"lut","writable":true},{"name":"address_lookup_table_program","address":"AddressLookupTab1e1111111111111111111111111"},{"name":"stake_program","relations":["program_state"]},{"name":"stake_pool","relations":["program_state"]}],"args":[{"name":"params","type":{"defined":{"name":"OracleInitParams"}}}]},{"name":"oracle_set_configs","discriminator":[129,111,223,4,191,188,70,180],"accounts":[{"name":"oracle"},{"name":"authority","signer":true,"relations":["oracle"]}],"args":[{"name":"params","type":{"defined":{"name":"OracleSetConfigsParams"}}}]},{"name":"oracle_update_delegation","discriminator":[46,198,113,223,160,189,118,90],"accounts":[{"name":"oracle","writable":true},{"name":"oracle_stats","pda":{"seeds":[{"kind":"const","value":[79,114,97,99,108,101,83,116,97,116,115]},{"kind":"account","path":"oracle"}]}},{"name":"queue","relations":["oracle"]},{"name":"authority","signer":true},{"name":"program_state","writable":true},{"name":"payer","writable":true,"signer":true},{"name":"system_program","address":"11111111111111111111111111111111"},{"name":"token_program","address":"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"},{"name":"delegation_pool","writable":true},{"name":"lut_signer"},{"name":"lut","writable":true},{"name":"address_lookup_table_program","address":"AddressLookupTab1e1111111111111111111111111"},{"name":"switch_mint"},{"name":"native_mint","address":"So11111111111111111111111111111111111111112"},{"name":"wsol_vault","writable":true},{"name":"switch_vault","writable":true},{"name":"stake_program","relations":["program_state"]},{"name":"stake_pool"},{"name":"delegation_group"}],"args":[{"name":"params","type":{"defined":{"name":"OracleUpdateDelegationParams"}}}]},{"name":"permission_set","discriminator":[211,122,185,120,129,182,55,103],"accounts":[{"name":"authority","signer":true},{"name":"granter"}],"args":[{"name":"params","type":{"defined":{"name":"PermissionSetParams"}}}]},{"name":"pull_feed_close","discriminator":[19,134,50,142,177,215,196,83],"accounts":[{"name":"pull_feed","writable":true},{"name":"reward_escrow","writable":true},{"name":"lut","writable":true},{"name":"lut_signer"},{"name":"payer","writable":true,"signer":true},{"name":"state"},{"name":"authority","writable":true,"signer":true,"relations":["pull_feed"]},{"name":"token_program","address":"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"},{"name":"associated_token_program","address":"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"},{"name":"system_program","address":"11111111111111111111111111111111"},{"name":"address_lookup_table_program","address":"AddressLookupTab1e1111111111111111111111111"}],"args":[{"name":"params","type":{"defined":{"name":"PullFeedCloseParams"}}}]},{"name":"pull_feed_init","discriminator":[198,130,53,198,235,61,143,40],"accounts":[{"name":"pull_feed","writable":true,"signer":true},{"name":"queue"},{"name":"authority"},{"name":"payer","writable":true,"signer":true},{"name":"system_program","address":"11111111111111111111111111111111"},{"name":"program_state"},{"name":"reward_escrow","writable":true,"pda":{"seeds":[{"kind":"account","path":"pull_feed"},{"kind":"const","value":[6,221,246,225,215,101,161,147,217,203,225,70,206,235,121,172,28,180,133,237,95,91,55,145,58,140,245,133,126,255,0,169]},{"kind":"account","path":"wrapped_sol_mint"}],"program":{"kind":"const","value":[140,151,37,143,78,36,137,241,187,61,16,41,20,142,13,131,11,90,19,153,218,255,16,132,4,142,123,216,219,233,248,89]}}},{"name":"token_program","address":"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"},{"name":"associated_token_program","address":"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"},{"name":"wrapped_sol_mint","address":"So11111111111111111111111111111111111111112"},{"name":"lut_signer"},{"name":"lut","writable":true},{"name":"address_lookup_table_program","address":"AddressLookupTab1e1111111111111111111111111"}],"args":[{"name":"params","type":{"defined":{"name":"PullFeedInitParams"}}}]},{"name":"pull_feed_set_configs","discriminator":[217,45,11,246,64,26,82,168],"accounts":[{"name":"pull_feed","writable":true},{"name":"authority","signer":true,"relations":["pull_feed"]}],"args":[{"name":"params","type":{"defined":{"name":"PullFeedSetConfigsParams"}}}]},{"name":"pull_feed_submit_response","discriminator":[150,22,215,166,143,93,48,137],"accounts":[{"name":"feed","writable":true},{"name":"queue","relations":["feed"]},{"name":"program_state"},{"name":"recent_slothashes","address":"SysvarS1otHashes111111111111111111111111111"},{"name":"payer","writable":true,"signer":true},{"name":"system_program","address":"11111111111111111111111111111111"},{"name":"reward_vault","writable":true},{"name":"token_program","address":"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"},{"name":"token_mint","address":"So11111111111111111111111111111111111111112"}],"args":[{"name":"params","type":{"defined":{"name":"PullFeedSubmitResponseParams"}}}]},{"name":"pull_feed_submit_response_many","discriminator":[47,156,45,25,200,71,37,215],"accounts":[{"name":"queue"},{"name":"program_state"},{"name":"recent_slothashes","address":"SysvarS1otHashes111111111111111111111111111"},{"name":"payer","writable":true,"signer":true},{"name":"system_program","address":"11111111111111111111111111111111"},{"name":"reward_vault","writable":true},{"name":"token_program","address":"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"},{"name":"token_mint","address":"So11111111111111111111111111111111111111112"}],"args":[{"name":"params","type":{"defined":{"name":"PullFeedSubmitResponseManyParams"}}}]},{"name":"queue_add_mr_enclave","discriminator":[199,255,81,50,60,133,171,138],"accounts":[{"name":"queue","writable":true},{"name":"authority","signer":true},{"name":"program_authority"},{"name":"state"}],"args":[{"name":"params","type":{"defined":{"name":"QueueAddMrEnclaveParams"}}}]},{"name":"queue_allow_subsidies","discriminator":[94,203,82,157,188,138,202,108],"accounts":[{"name":"queue","writable":true},{"name":"authority","signer":true,"relations":["state"]},{"name":"state","writable":true}],"args":[{"name":"params","type":{"defined":{"name":"QueueAllowSubsidiesParams"}}}]},{"name":"queue_garbage_collect","discriminator":[187,208,104,247,16,91,96,98],"accounts":[{"name":"queue","writable":true},{"name":"oracle","writable":true},{"name":"authority","signer":true},{"name":"state"}],"args":[{"name":"params","type":{"defined":{"name":"QueueGarbageCollectParams"}}}]},{"name":"queue_init","discriminator":[144,18,99,145,133,27,207,13],"accounts":[{"name":"queue","writable":true,"signer":true},{"name":"queue_escrow","writable":true,"pda":{"seeds":[{"kind":"account","path":"queue"},{"kind":"const","value":[6,221,246,225,215,101,161,147,217,203,225,70,206,235,121,172,28,180,133,237,95,91,55,145,58,140,245,133,126,255,0,169]},{"kind":"account","path":"native_mint"}],"program":{"kind":"const","value":[140,151,37,143,78,36,137,241,187,61,16,41,20,142,13,131,11,90,19,153,218,255,16,132,4,142,123,216,219,233,248,89]}}},{"name":"authority"},{"name":"payer","writable":true,"signer":true},{"name":"system_program","address":"11111111111111111111111111111111"},{"name":"token_program","address":"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"},{"name":"native_mint","address":"So11111111111111111111111111111111111111112"},{"name":"program_state"},{"name":"lut_signer","writable":true},{"name":"lut","writable":true},{"name":"address_lookup_table_program","address":"AddressLookupTab1e1111111111111111111111111"},{"name":"associated_token_program","address":"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"}],"args":[{"name":"params","type":{"defined":{"name":"QueueInitParams"}}}]},{"name":"queue_init_delegation_group","discriminator":[239,146,75,158,20,166,159,14],"accounts":[{"name":"queue","writable":true},{"name":"payer","writable":true,"signer":true},{"name":"system_program","address":"11111111111111111111111111111111"},{"name":"program_state"},{"name":"lut_signer"},{"name":"lut","writable":true},{"name":"address_lookup_table_program","address":"AddressLookupTab1e1111111111111111111111111"},{"name":"delegation_group","writable":true},{"name":"stake_program","relations":["program_state"]},{"name":"stake_pool"}],"args":[{"name":"params","type":{"defined":{"name":"QueueInitDelegationGroupParams"}}}]},{"name":"queue_remove_mr_enclave","discriminator":[3,64,135,33,190,133,68,252],"accounts":[{"name":"queue","writable":true},{"name":"authority","signer":true},{"name":"program_authority"},{"name":"state"}],"args":[{"name":"params","type":{"defined":{"name":"QueueRemoveMrEnclaveParams"}}}]},{"name":"queue_set_configs","discriminator":[54,183,243,199,49,103,142,48],"accounts":[{"name":"queue","writable":true},{"name":"authority","signer":true},{"name":"state"}],"args":[{"name":"params","type":{"defined":{"name":"QueueSetConfigsParams"}}}]},{"name":"randomness_commit","discriminator":[52,170,152,201,179,133,242,141],"accounts":[{"name":"randomness","writable":true},{"name":"queue","relations":["randomness","oracle"]},{"name":"oracle","writable":true},{"name":"recent_slothashes","address":"SysvarS1otHashes111111111111111111111111111"},{"name":"authority","signer":true,"relations":["randomness"]}],"args":[{"name":"params","type":{"defined":{"name":"RandomnessCommitParams"}}}]},{"name":"randomness_init","discriminator":[9,9,204,33,50,116,113,15],"accounts":[{"name":"randomness","writable":true,"signer":true},{"name":"reward_escrow","writable":true,"pda":{"seeds":[{"kind":"account","path":"randomness"},{"kind":"const","value":[6,221,246,225,215,101,161,147,217,203,225,70,206,235,121,172,28,180,133,237,95,91,55,145,58,140,245,133,126,255,0,169]},{"kind":"account","path":"wrapped_sol_mint"}],"program":{"kind":"const","value":[140,151,37,143,78,36,137,241,187,61,16,41,20,142,13,131,11,90,19,153,218,255,16,132,4,142,123,216,219,233,248,89]}}},{"name":"authority","signer":true},{"name":"queue","writable":true},{"name":"payer","writable":true,"signer":true},{"name":"system_program","address":"11111111111111111111111111111111"},{"name":"token_program","address":"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"},{"name":"associated_token_program","address":"ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"},{"name":"wrapped_sol_mint","address":"So11111111111111111111111111111111111111112"},{"name":"program_state"},{"name":"lut_signer"},{"name":"lut","writable":true},{"name":"address_lookup_table_program","address":"AddressLookupTab1e1111111111111111111111111"}],"args":[{"name":"params","type":{"defined":{"name":"RandomnessInitParams"}}}]},{"name":"randomness_reveal","discriminator":[197,181,187,10,30,58,20,73],"accounts":[{"name":"randomness","writable":true},{"name":"oracle","relations":["randomness"]},{"name":"queue","relations":["oracle"]},{"name":"stats","writable":true,"pda":{"seeds":[{"kind":"const","value":[79,114,97,99,108,101,82,97,110,100,111,109,110,101,115,115,83,116,97,116,115]},{"kind":"account","path":"oracle"}]}},{"name":"authority","signer":true,"relations":["randomness"]},{"name":"payer","writable":true,"signer":true},{"name":"recent_slothashes","address":"SysvarS1otHashes111111111111111111111111111"},{"name":"system_program","address":"11111111111111111111111111111111"},{"name":"reward_escrow","writable":true},{"name":"token_program","address":"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"},{"name":"wrapped_sol_mint","address":"So11111111111111111111111111111111111111112"},{"name":"program_state"}],"args":[{"name":"params","type":{"defined":{"name":"RandomnessRevealParams"}}}]},{"name":"state_init","discriminator":[103,241,106,190,217,153,87,105],"accounts":[{"name":"state","writable":true,"pda":{"seeds":[{"kind":"const","value":[83,84,65,84,69]}]}},{"name":"payer","writable":true,"signer":true},{"name":"system_program","address":"11111111111111111111111111111111"}],"args":[{"name":"params","type":{"defined":{"name":"StateInitParams"}}}]},{"name":"state_set_configs","discriminator":[40,98,76,37,206,9,47,144],"accounts":[{"name":"state","writable":true},{"name":"authority","signer":true,"relations":["state"]},{"name":"queue","writable":true},{"name":"payer","writable":true,"signer":true},{"name":"system_program","address":"11111111111111111111111111111111"}],"args":[{"name":"params","type":{"defined":{"name":"StateSetConfigsParams"}}}]}],"accounts":[{"name":"OracleAccountData","discriminator":[128,30,16,241,170,73,55,54]},{"name":"OracleStatsAccountData","discriminator":[180,157,178,234,240,27,152,179]},{"name":"PullFeedAccountData","discriminator":[196,27,108,196,10,215,219,40]},{"name":"QueueAccountData","discriminator":[217,194,55,127,184,83,138,1]},{"name":"RandomnessAccountData","discriminator":[10,66,229,135,220,239,217,114]},{"name":"State","discriminator":[216,146,107,94,104,75,182,177]}],"events":[{"name":"CostWhitelistEvent","discriminator":[56,107,191,127,116,6,138,149]},{"name":"GarbageCollectionEvent","discriminator":[232,235,2,188,8,143,145,237]},{"name":"GuardianQuoteVerifyEvent","discriminator":[31,37,39,6,214,186,33,115]},{"name":"OracleHeartbeatEvent","discriminator":[52,29,166,2,94,7,188,13]},{"name":"OracleInitEvent","discriminator":[89,193,219,200,1,83,167,24]},{"name":"OracleQuoteOverrideEvent","discriminator":[78,204,191,210,164,196,244,65]},{"name":"OracleQuoteRotateEvent","discriminator":[26,189,196,192,225,127,26,228]},{"name":"OracleQuoteVerifyRequestEvent","discriminator":[203,209,79,0,20,71,226,202]},{"name":"PermissionSetEvent","discriminator":[148,86,123,0,102,20,119,206]},{"name":"PullFeedErrorValueEvent","discriminator":[225,80,192,95,14,12,83,192]},{"name":"PullFeedValueEvents","discriminator":[86,7,231,28,122,161,117,69]},{"name":"QueueAddMrEnclaveEvent","discriminator":[170,186,175,38,216,51,69,175]},{"name":"QueueInitEvent","discriminator":[44,137,99,227,107,8,30,105]},{"name":"QueueRemoveMrEnclaveEvent","discriminator":[4,105,196,60,84,122,203,196]},{"name":"RandomnessCommitEvent","discriminator":[88,60,172,90,112,10,206,147]}],"errors":[{"code":6000,"name":"GenericError"},{"code":6001,"name":"InvalidQuote"},{"code":6002,"name":"InsufficientQueue"},{"code":6003,"name":"QueueFull"},{"code":6004,"name":"InvalidEnclaveSigner"},{"code":6005,"name":"InvalidSigner"},{"code":6006,"name":"MrEnclaveAlreadyExists"},{"code":6007,"name":"MrEnclaveAtCapacity"},{"code":6008,"name":"MrEnclaveDoesntExist"},{"code":6009,"name":"PermissionDenied"},{"code":6010,"name":"InvalidQueue"},{"code":6011,"name":"IncorrectMrEnclave"},{"code":6012,"name":"InvalidAuthority"},{"code":6013,"name":"InvalidMrEnclave"},{"code":6014,"name":"InvalidTimestamp"},{"code":6015,"name":"InvalidOracleIdx"},{"code":6016,"name":"InvalidSecpSignature"},{"code":6017,"name":"InvalidGuardianQueue"},{"code":6018,"name":"InvalidIndex"},{"code":6019,"name":"InvalidOracleQueue"},{"code":6020,"name":"InvalidPermission"},{"code":6021,"name":"InvalidePermissionedAccount"},{"code":6022,"name":"InvalidEpochRotate"},{"code":6023,"name":"InvalidEpochFinalize"},{"code":6024,"name":"InvalidEscrow"},{"code":6025,"name":"IllegalOracle"},{"code":6026,"name":"IllegalExecuteAttempt"},{"code":6027,"name":"IllegalFeedValue"},{"code":6028,"name":"InvalidOracleFeedStats"},{"code":6029,"name":"InvalidStateAuthority"},{"code":6030,"name":"NotEnoughSamples"},{"code":6031,"name":"OracleIsVerified"},{"code":6032,"name":"QueueIsEmpty"},{"code":6033,"name":"SecpRecoverFailure"},{"code":6034,"name":"StaleSample"},{"code":6035,"name":"SwitchboardRandomnessTooOld"},{"code":6036,"name":"EpochIdMismatch"},{"code":6037,"name":"GuardianAlreadyVoted"},{"code":6038,"name":"RandomnessNotRequested"},{"code":6039,"name":"InvalidSlotNumber"},{"code":6040,"name":"RandomnessOracleKeyExpired"},{"code":6041,"name":"InvalidAdvisory"},{"code":6042,"name":"InvalidOracleStats"},{"code":6043,"name":"InvalidStakeProgram"},{"code":6044,"name":"InvalidStakePool"},{"code":6045,"name":"InvalidDelegationPool"},{"code":6046,"name":"UnparsableAccount"},{"code":6047,"name":"InvalidInstruction"},{"code":6048,"name":"OracleAlreadyVerified"},{"code":6049,"name":"GuardianNotVerified"},{"code":6050,"name":"InvalidConstraint"},{"code":6051,"name":"InvalidDelegationGroup"},{"code":6052,"name":"OracleKeyNotFound"},{"code":6053,"name":"GuardianReregisterAttempt"}],"types":[{"name":"CompactResult","serialization":"bytemuck","repr":{"kind":"c"},"type":{"kind":"struct","fields":[{"name":"std_dev","docs":["The standard deviation of the submissions needed for quorom size"],"type":"f32"},{"name":"mean","docs":["The mean of the submissions needed for quorom size"],"type":"f32"},{"name":"slot","docs":["The slot at which this value was signed."],"type":"u64"}]}},{"name":"CostWhitelistEvent","type":{"kind":"struct","fields":[{"name":"feeds","type":{"vec":"pubkey"}},{"name":"reward","type":"u32"}]}},{"name":"CurrentResult","serialization":"bytemuck","repr":{"kind":"c"},"type":{"kind":"struct","fields":[{"name":"value","docs":["The median value of the submissions needed for quorom size"],"type":"i128"},{"name":"std_dev","docs":["The standard deviation of the submissions needed for quorom size"],"type":"i128"},{"name":"mean","docs":["The mean of the submissions needed for quorom size"],"type":"i128"},{"name":"range","docs":["The range of the submissions needed for quorom size"],"type":"i128"},{"name":"min_value","docs":["The minimum value of the submissions needed for quorom size"],"type":"i128"},{"name":"max_value","docs":["The maximum value of the submissions needed for quorom size"],"type":"i128"},{"name":"num_samples","docs":["The number of samples used to calculate this result"],"type":"u8"},{"name":"padding1","type":{"array":["u8",7]}},{"name":"slot","docs":["The slot at which this value was signed."],"type":"u64"},{"name":"min_slot","docs":["The slot at which the first considered submission was made"],"type":"u64"},{"name":"max_slot","docs":["The slot at which the last considered submission was made"],"type":"u64"}]}},{"name":"GarbageCollectionEvent","type":{"kind":"struct","fields":[{"name":"oracle","type":"pubkey"},{"name":"queue","type":"pubkey"}]}},{"name":"GuardianQuoteVerifyEvent","type":{"kind":"struct","fields":[{"name":"quote","type":"pubkey"},{"name":"queue","type":"pubkey"},{"name":"oracle","type":"pubkey"}]}},{"name":"GuardianQuoteVerifyParams","type":{"kind":"struct","fields":[{"name":"timestamp","type":"i64"},{"name":"mr_enclave","type":{"array":["u8",32]}},{"name":"_reserved1","type":"u32"},{"name":"ed25519_key","type":"pubkey"},{"name":"secp256k1_key","type":{"array":["u8",64]}},{"name":"slot","type":"u64"},{"name":"signature","type":{"array":["u8",64]}},{"name":"recovery_id","type":"u8"},{"name":"advisories","type":{"vec":"u32"}}]}},{"name":"GuardianRegisterParams","type":{"kind":"struct","fields":[]}},{"name":"GuardianUnregisterParams","type":{"kind":"struct","fields":[]}},{"name":"MegaSlotInfo","serialization":"bytemuck","repr":{"kind":"c"},"type":{"kind":"struct","fields":[{"name":"reserved1","type":"u64"},{"name":"slot_end","type":"u64"},{"name":"perf_goal","type":"i64"},{"name":"current_signature_count","type":"i64"}]}},{"name":"MultiSubmission","type":{"kind":"struct","fields":[{"name":"values","type":{"vec":"i128"}},{"name":"signature","type":{"array":["u8",64]}},{"name":"recovery_id","type":"u8"}]}},{"name":"OracleAccountData","serialization":"bytemuck","repr":{"kind":"c"},"type":{"kind":"struct","fields":[{"name":"enclave","docs":["Represents the state of the quote verifiers enclave."],"type":{"defined":{"name":"Quote"}}},{"name":"authority","docs":["The authority of the EnclaveAccount which is permitted to make account changes."],"type":"pubkey"},{"name":"queue","docs":["Queue used for attestation to verify a MRENCLAVE measurement."],"type":"pubkey"},{"name":"created_at","docs":["The unix timestamp when the quote was created."],"type":"i64"},{"name":"last_heartbeat","docs":["The last time the quote heartbeated on-chain."],"type":"i64"},{"name":"secp_authority","type":{"array":["u8",64]}},{"name":"gateway_uri","docs":["URI location of the verifier's gateway."],"type":{"array":["u8",64]}},{"name":"permissions","type":"u64"},{"name":"is_on_queue","docs":["Whether the quote is located on the AttestationQueues buffer."],"type":"u8"},{"name":"_padding1","type":{"array":["u8",7]}},{"name":"lut_slot","type":"u64"},{"name":"last_reward_epoch","type":"u64"},{"name":"_ebuf4","type":{"array":["u8",16]}},{"name":"_ebuf3","type":{"array":["u8",32]}},{"name":"_ebuf2","type":{"array":["u8",64]}},{"name":"_ebuf1","type":{"array":["u8",1024]}}]}},{"name":"OracleEpochInfo","serialization":"bytemuck","repr":{"kind":"c"},"type":{"kind":"struct","fields":[{"name":"id","type":"u64"},{"name":"reserved1","type":"u64"},{"name":"slot_end","type":"u64"},{"name":"slash_score","type":"u64"},{"name":"reward_score","type":"u64"},{"name":"stake_score","type":"u64"}]}},{"name":"OracleHeartbeatEvent","type":{"kind":"struct","fields":[{"name":"oracle","type":"pubkey"},{"name":"queue","type":"pubkey"}]}},{"name":"OracleHeartbeatParams","type":{"kind":"struct","fields":[{"name":"gateway_uri","type":{"option":{"array":["u8",64]}}}]}},{"name":"OracleInitEvent","type":{"kind":"struct","fields":[{"name":"oracle","type":"pubkey"}]}},{"name":"OracleInitParams","type":{"kind":"struct","fields":[{"name":"recent_slot","type":"u64"},{"name":"authority","type":"pubkey"},{"name":"queue","type":"pubkey"},{"name":"secp_authority","type":{"option":{"array":["u8",64]}}}]}},{"name":"OracleQuoteOverrideEvent","type":{"kind":"struct","fields":[{"name":"oracle","type":"pubkey"},{"name":"queue","type":"pubkey"}]}},{"name":"OracleQuoteRotateEvent","type":{"kind":"struct","fields":[{"name":"oracle","type":"pubkey"}]}},{"name":"OracleQuoteVerifyRequestEvent","type":{"kind":"struct","fields":[{"name":"quote","type":"pubkey"},{"name":"oracle","type":"pubkey"}]}},{"name":"OracleSetConfigsParams","type":{"kind":"struct","fields":[{"name":"new_authority","type":{"option":"pubkey"}},{"name":"new_secp_authority","type":{"option":{"array":["u8",64]}}}]}},{"name":"OracleStatsAccountData","serialization":"bytemuck","repr":{"kind":"c"},"type":{"kind":"struct","fields":[{"name":"owner","type":"pubkey"},{"name":"oracle","type":"pubkey"},{"name":"finalized_epoch","docs":["The last epoch that has completed. cleared after registered with the","staking program."],"type":{"defined":{"name":"OracleEpochInfo"}}},{"name":"current_epoch","docs":["The current epoch info being used by the oracle. for stake. Will moved","to finalized_epoch as soon as the epoch is over."],"type":{"defined":{"name":"OracleEpochInfo"}}},{"name":"mega_slot_info","type":{"defined":{"name":"MegaSlotInfo"}}},{"name":"last_transfer_slot","type":"u64"},{"name":"bump","type":"u8"},{"name":"padding1","type":{"array":["u8",7]}},{"name":"_ebuf","docs":["Reserved."],"type":{"array":["u8",1024]}}]}},{"name":"OracleSubmission","serialization":"bytemuck","repr":{"kind":"c"},"type":{"kind":"struct","fields":[{"name":"oracle","docs":["The public key of the oracle that submitted this value."],"type":"pubkey"},{"name":"slot","docs":["The slot at which this value was signed."],"type":"u64"},{"name":"padding1","type":{"array":["u8",8]}},{"name":"value","docs":["The value that was submitted."],"type":"i128"}]}},{"name":"OracleUpdateDelegationParams","type":{"kind":"struct","fields":[{"name":"_reserved1","type":"u64"}]}},{"name":"PermissionSetEvent","type":{"kind":"struct","fields":[{"name":"permission","type":"pubkey"}]}},{"name":"PermissionSetParams","type":{"kind":"struct","fields":[{"name":"permission","type":"u8"},{"name":"enable","type":"bool"}]}},{"name":"PullFeedAccountData","docs":["A representation of the data in a pull feed account."],"serialization":"bytemuck","repr":{"kind":"c"},"type":{"kind":"struct","fields":[{"name":"submissions","docs":["The oracle submissions for this feed."],"type":{"array":[{"defined":{"name":"OracleSubmission"}},32]}},{"name":"authority","docs":["The public key of the authority that can update the feed hash that","this account will use for registering updates."],"type":"pubkey"},{"name":"queue","docs":["The public key of the queue which oracles must be bound to in order to","submit data to this feed."],"type":"pubkey"},{"name":"feed_hash","docs":["SHA-256 hash of the job schema oracles will execute to produce data","for this feed."],"type":{"array":["u8",32]}},{"name":"initialized_at","docs":["The slot at which this account was initialized."],"type":"i64"},{"name":"permissions","type":"u64"},{"name":"max_variance","type":"u64"},{"name":"min_responses","type":"u32"},{"name":"name","type":{"array":["u8",32]}},{"name":"padding1","type":{"array":["u8",2]}},{"name":"historical_result_idx","type":"u8"},{"name":"min_sample_size","type":"u8"},{"name":"last_update_timestamp","type":"i64"},{"name":"lut_slot","type":"u64"},{"name":"_reserved1","type":{"array":["u8",32]}},{"name":"result","type":{"defined":{"name":"CurrentResult"}}},{"name":"max_staleness","type":"u32"},{"name":"padding2","type":{"array":["u8",12]}},{"name":"historical_results","type":{"array":[{"defined":{"name":"CompactResult"}},32]}},{"name":"_ebuf4","type":{"array":["u8",8]}},{"name":"_ebuf3","type":{"array":["u8",24]}},{"name":"_ebuf2","type":{"array":["u8",256]}}]}},{"name":"PullFeedCloseParams","type":{"kind":"struct","fields":[]}},{"name":"PullFeedErrorValueEvent","type":{"kind":"struct","fields":[{"name":"feed","type":"pubkey"},{"name":"oracle","type":"pubkey"}]}},{"name":"PullFeedInitParams","type":{"kind":"struct","fields":[{"name":"feed_hash","type":{"array":["u8",32]}},{"name":"max_variance","type":"u64"},{"name":"min_responses","type":"u32"},{"name":"name","type":{"array":["u8",32]}},{"name":"recent_slot","type":"u64"},{"name":"ipfs_hash","type":{"array":["u8",32]}},{"name":"min_sample_size","type":"u8"},{"name":"max_staleness","type":"u32"}]}},{"name":"PullFeedSetConfigsParams","type":{"kind":"struct","fields":[{"name":"feed_hash","type":{"option":{"array":["u8",32]}}},{"name":"authority","type":{"option":"pubkey"}},{"name":"max_variance","type":{"option":"u64"}},{"name":"min_responses","type":{"option":"u32"}},{"name":"name","type":{"option":{"array":["u8",32]}}},{"name":"ipfs_hash","type":{"option":{"array":["u8",32]}}},{"name":"min_sample_size","type":{"option":"u8"}},{"name":"max_staleness","type":{"option":"u32"}}]}},{"name":"PullFeedSubmitResponseManyParams","type":{"kind":"struct","fields":[{"name":"slot","type":"u64"},{"name":"submissions","type":{"vec":{"defined":{"name":"MultiSubmission"}}}}]}},{"name":"PullFeedSubmitResponseParams","type":{"kind":"struct","fields":[{"name":"slot","type":"u64"},{"name":"submissions","type":{"vec":{"defined":{"name":"Submission"}}}}]}},{"name":"PullFeedValueEvents","type":{"kind":"struct","fields":[{"name":"feeds","type":{"vec":"pubkey"}},{"name":"oracles","type":{"vec":"pubkey"}},{"name":"values","type":{"vec":{"vec":"i128"}}},{"name":"reward","type":"u32"}]}},{"name":"QueueAccountData","docs":["An Queue represents a round-robin queue of oracle oracles who attest on-chain","whether a Switchboard Function was executed within an enclave against an expected set of","enclave measurements.","","For an oracle to join the queue, the oracle must first submit their enclave quote on-chain and","wait for an existing oracle to attest their quote. If the oracle's quote matches an expected","measurement within the queues mr_enclaves config, it is granted permissions and will start","being assigned update requests."],"serialization":"bytemuck","repr":{"kind":"c"},"type":{"kind":"struct","fields":[{"name":"authority","docs":["The address of the authority which is permitted to add/remove allowed enclave measurements."],"type":"pubkey"},{"name":"mr_enclaves","docs":["Allowed enclave measurements."],"type":{"array":[{"array":["u8",32]},32]}},{"name":"oracle_keys","docs":["The addresses of the quote oracles who have a valid","verification status and have heartbeated on-chain recently."],"type":{"array":["pubkey",128]}},{"name":"max_quote_verification_age","docs":["The maximum allowable time until a EnclaveAccount needs to be re-verified on-chain."],"type":"i64"},{"name":"last_heartbeat","docs":["The unix timestamp when the last quote oracle heartbeated on-chain."],"type":"i64"},{"name":"node_timeout","type":"i64"},{"name":"oracle_min_stake","docs":["The minimum number of lamports a quote oracle needs to lock-up in order to heartbeat and verify other quotes."],"type":"u64"},{"name":"allow_authority_override_after","type":"i64"},{"name":"mr_enclaves_len","docs":["The number of allowed enclave measurements."],"type":"u32"},{"name":"oracle_keys_len","docs":["The length of valid quote oracles for the given attestation queue."],"type":"u32"},{"name":"reward","docs":["The reward paid to quote oracles for attesting on-chain."],"type":"u32"},{"name":"curr_idx","docs":["Incrementer used to track the current quote oracle permitted to run any available functions."],"type":"u32"},{"name":"gc_idx","docs":["Incrementer used to garbage collect and remove stale quote oracles."],"type":"u32"},{"name":"require_authority_heartbeat_permission","type":"u8"},{"name":"require_authority_verify_permission","type":"u8"},{"name":"require_usage_permissions","type":"u8"},{"name":"signer_bump","type":"u8"},{"name":"mint","type":"pubkey"},{"name":"lut_slot","type":"u64"},{"name":"allow_subsidies","type":"u8"},{"name":"_ebuf6","docs":["Reserved."],"type":{"array":["u8",23]}},{"name":"_ebuf5","type":{"array":["u8",32]}},{"name":"_ebuf4","type":{"array":["u8",64]}},{"name":"_ebuf3","type":{"array":["u8",128]}},{"name":"_ebuf2","type":{"array":["u8",256]}},{"name":"_ebuf1","type":{"array":["u8",512]}}]}},{"name":"QueueAddMrEnclaveEvent","type":{"kind":"struct","fields":[{"name":"queue","type":"pubkey"},{"name":"mr_enclave","type":{"array":["u8",32]}}]}},{"name":"QueueAddMrEnclaveParams","type":{"kind":"struct","fields":[{"name":"mr_enclave","type":{"array":["u8",32]}}]}},{"name":"QueueAllowSubsidiesParams","type":{"kind":"struct","fields":[{"name":"allow_subsidies","type":"u8"}]}},{"name":"QueueGarbageCollectParams","type":{"kind":"struct","fields":[{"name":"idx","type":"u32"}]}},{"name":"QueueInitDelegationGroupParams","type":{"kind":"struct","fields":[]}},{"name":"QueueInitEvent","type":{"kind":"struct","fields":[{"name":"queue","type":"pubkey"}]}},{"name":"QueueInitParams","type":{"kind":"struct","fields":[{"name":"allow_authority_override_after","type":"u32"},{"name":"require_authority_heartbeat_permission","type":"bool"},{"name":"require_usage_permissions","type":"bool"},{"name":"max_quote_verification_age","type":"u32"},{"name":"reward","type":"u32"},{"name":"node_timeout","type":"u32"},{"name":"recent_slot","type":"u64"}]}},{"name":"QueueRemoveMrEnclaveEvent","type":{"kind":"struct","fields":[{"name":"queue","type":"pubkey"},{"name":"mr_enclave","type":{"array":["u8",32]}}]}},{"name":"QueueRemoveMrEnclaveParams","type":{"kind":"struct","fields":[{"name":"mr_enclave","type":{"array":["u8",32]}}]}},{"name":"QueueSetConfigsParams","type":{"kind":"struct","fields":[{"name":"authority","type":{"option":"pubkey"}},{"name":"reward","type":{"option":"u32"}},{"name":"node_timeout","type":{"option":"i64"}}]}},{"name":"Quote","serialization":"bytemuck","repr":{"kind":"c"},"type":{"kind":"struct","fields":[{"name":"enclave_signer","docs":["The address of the signer generated within an enclave."],"type":"pubkey"},{"name":"mr_enclave","docs":["The quotes MRENCLAVE measurement dictating the contents of the secure enclave."],"type":{"array":["u8",32]}},{"name":"verification_status","docs":["The VerificationStatus of the quote."],"type":"u8"},{"name":"padding1","type":{"array":["u8",7]}},{"name":"verification_timestamp","docs":["The unix timestamp when the quote was last verified."],"type":"i64"},{"name":"valid_until","docs":["The unix timestamp when the quotes verification status expires."],"type":"i64"},{"name":"quote_registry","docs":["The off-chain registry where the verifiers quote can be located."],"type":{"array":["u8",32]}},{"name":"registry_key","docs":["Key to lookup the buffer data on IPFS or an alternative decentralized storage solution."],"type":{"array":["u8",64]}},{"name":"secp256k1_signer","docs":["The secp256k1 public key of the enclave signer. Derived from the enclave_signer."],"type":{"array":["u8",64]}},{"name":"last_ed25519_signer","type":"pubkey"},{"name":"last_secp256k1_signer","type":{"array":["u8",64]}},{"name":"last_rotate_slot","type":"u64"},{"name":"guardian_approvers","type":{"array":["pubkey",64]}},{"name":"guardian_approvers_len","type":"u8"},{"name":"padding2","type":{"array":["u8",7]}},{"name":"staging_ed25519_signer","type":"pubkey"},{"name":"staging_secp256k1_signer","type":{"array":["u8",64]}},{"name":"_ebuf4","docs":["Reserved."],"type":{"array":["u8",32]}},{"name":"_ebuf3","type":{"array":["u8",128]}},{"name":"_ebuf2","type":{"array":["u8",256]}},{"name":"_ebuf1","type":{"array":["u8",512]}}]}},{"name":"RandomnessAccountData","serialization":"bytemuck","repr":{"kind":"c"},"type":{"kind":"struct","fields":[{"name":"authority","type":"pubkey"},{"name":"queue","type":"pubkey"},{"name":"seed_slothash","type":{"array":["u8",32]}},{"name":"seed_slot","type":"u64"},{"name":"oracle","type":"pubkey"},{"name":"reveal_slot","type":"u64"},{"name":"value","type":{"array":["u8",32]}},{"name":"lut_slot","type":"u64"},{"name":"_ebuf3","type":{"array":["u8",24]}},{"name":"_ebuf2","type":{"array":["u8",64]}},{"name":"_ebuf1","type":{"array":["u8",128]}},{"name":"active_secp256k1_signer","type":{"array":["u8",64]}},{"name":"active_secp256k1_expiration","type":"i64"}]}},{"name":"RandomnessCommitEvent","type":{"kind":"struct","fields":[{"name":"randomness_account","type":"pubkey"},{"name":"oracle","type":"pubkey"},{"name":"slot","type":"u64"},{"name":"slothash","type":{"array":["u8",32]}}]}},{"name":"RandomnessCommitParams","type":{"kind":"struct","fields":[]}},{"name":"RandomnessInitParams","type":{"kind":"struct","fields":[{"name":"recent_slot","type":"u64"}]}},{"name":"RandomnessRevealParams","type":{"kind":"struct","fields":[{"name":"signature","type":{"array":["u8",64]}},{"name":"recovery_id","type":"u8"},{"name":"value","type":{"array":["u8",32]}}]}},{"name":"State","serialization":"bytemuck","repr":{"kind":"c"},"type":{"kind":"struct","fields":[{"name":"bump","type":"u8"},{"name":"test_only_disable_mr_enclave_check","type":"u8"},{"name":"enable_staking","type":"u8"},{"name":"padding1","type":{"array":["u8",5]}},{"name":"authority","type":"pubkey"},{"name":"guardian_queue","type":"pubkey"},{"name":"reserved1","type":"u64"},{"name":"epoch_length","type":"u64"},{"name":"current_epoch","type":{"defined":{"name":"StateEpochInfo"}}},{"name":"next_epoch","type":{"defined":{"name":"StateEpochInfo"}}},{"name":"finalized_epoch","type":{"defined":{"name":"StateEpochInfo"}}},{"name":"stake_pool","type":"pubkey"},{"name":"stake_program","type":"pubkey"},{"name":"switch_mint","type":"pubkey"},{"name":"sgx_advisories","type":{"array":["u16",32]}},{"name":"advisories_len","type":"u8"},{"name":"padding2","type":"u8"},{"name":"flat_reward_cut_percentage","type":"u8"},{"name":"enable_slashing","type":"u8"},{"name":"subsidy_amount","type":"u32"},{"name":"lut_slot","type":"u64"},{"name":"base_reward","type":"u32"},{"name":"_ebuf6","type":{"array":["u8",28]}},{"name":"_ebuf5","type":{"array":["u8",32]}},{"name":"_ebuf4","type":{"array":["u8",64]}},{"name":"_ebuf3","type":{"array":["u8",128]}},{"name":"_ebuf2","type":{"array":["u8",512]}},{"name":"cost_whitelist","docs":["Cost whitelist by authority"],"type":{"array":["pubkey",32]}}]}},{"name":"StateEpochInfo","serialization":"bytemuck","repr":{"kind":"c"},"type":{"kind":"struct","fields":[{"name":"id","type":"u64"},{"name":"_reserved1","type":"u64"},{"name":"slot_end","type":"u64"}]}},{"name":"StateInitParams","type":{"kind":"struct","fields":[]}},{"name":"StateSetConfigsParams","type":{"kind":"struct","fields":[{"name":"new_authority","type":"pubkey"},{"name":"test_only_disable_mr_enclave_check","type":"u8"},{"name":"stake_pool","type":"pubkey"},{"name":"stake_program","type":"pubkey"},{"name":"add_advisory","type":"u16"},{"name":"rm_advisory","type":"u16"},{"name":"epoch_length","type":"u32"},{"name":"reset_epochs","type":"bool"},{"name":"switch_mint","type":"pubkey"},{"name":"enable_staking","type":"u8"},{"name":"subsidy_amount","type":"u32"},{"name":"base_reward","type":"u32"},{"name":"add_cost_wl","type":"pubkey"},{"name":"rm_cost_wl","type":"pubkey"}]}},{"name":"Submission","type":{"kind":"struct","fields":[{"name":"value","type":"i128"},{"name":"signature","type":{"array":["u8",64]}},{"name":"recovery_id","type":"u8"},{"name":"offset","type":"u8"}]}}]}
|
@@ -609,6 +609,7 @@ export async function requiresRefreshBeforeRebalance(client: SolautoClient) {
|
|
609
609
|
}
|
610
610
|
|
611
611
|
const oldStateWithLatestPrices = await positionStateWithLatestPrices(
|
612
|
+
client.connection,
|
612
613
|
client.solautoPositionData.state,
|
613
614
|
PRICES[client.supplyMint.toString()].price,
|
614
615
|
PRICES[client.debtMint.toString()].price
|
@@ -1,4 +1,10 @@
|
|
1
|
-
import {
|
1
|
+
import {
|
2
|
+
Connection,
|
3
|
+
Keypair,
|
4
|
+
PublicKey,
|
5
|
+
Transaction,
|
6
|
+
VersionedTransaction,
|
7
|
+
} from "@solana/web3.js";
|
2
8
|
import {
|
3
9
|
MaybeRpcAccount,
|
4
10
|
publicKey,
|
@@ -8,6 +14,14 @@ import {
|
|
8
14
|
import { PYTH_PRICE_FEED_IDS } from "../constants/pythConstants";
|
9
15
|
import { fromBaseUnit, toBaseUnit } from "./numberUtils";
|
10
16
|
import { PRICES } from "../constants/solautoConstants";
|
17
|
+
import {
|
18
|
+
getProgramId,
|
19
|
+
PullFeed,
|
20
|
+
SwitchboardPermission,
|
21
|
+
} from "@switchboard-xyz/on-demand";
|
22
|
+
import { AnchorProvider, Idl, Program, Wallet } from "@coral-xyz/anchor";
|
23
|
+
import switchboardIdl from "../idls/switchboard.json";
|
24
|
+
import { SWITCHBOARD_PRICE_FEED_IDS } from "../constants/switchboardConstants";
|
11
25
|
|
12
26
|
export function consoleLog(...args: any[]): void {
|
13
27
|
if ((globalThis as any).LOCAL_TEST) {
|
@@ -57,7 +71,21 @@ export function arraysAreEqual(arrayA: number[], arrayB: number[]): boolean {
|
|
57
71
|
return true;
|
58
72
|
}
|
59
73
|
|
60
|
-
export
|
74
|
+
export function zip<T, U>(list1: T[], list2: U[]): [T, U][] {
|
75
|
+
const minLength = Math.min(list1.length, list2.length);
|
76
|
+
const result: [T, U][] = [];
|
77
|
+
|
78
|
+
for (let i = 0; i < minLength; i++) {
|
79
|
+
result.push([list1[i], list2[i]]);
|
80
|
+
}
|
81
|
+
|
82
|
+
return result;
|
83
|
+
}
|
84
|
+
|
85
|
+
export async function fetchTokenPrices(
|
86
|
+
conn: Connection,
|
87
|
+
mints: PublicKey[]
|
88
|
+
): Promise<number[]> {
|
61
89
|
const currentTime = currentUnixSeconds();
|
62
90
|
if (
|
63
91
|
!mints.some(
|
@@ -69,6 +97,34 @@ export async function fetchTokenPrices(mints: PublicKey[]): Promise<number[]> {
|
|
69
97
|
return mints.map((mint) => PRICES[mint.toString()].price);
|
70
98
|
}
|
71
99
|
|
100
|
+
const pythMints = mints.filter((x) => x.toString() in PYTH_PRICE_FEED_IDS);
|
101
|
+
const switchboardMints = mints.filter(
|
102
|
+
(x) => x.toString() in SWITCHBOARD_PRICE_FEED_IDS
|
103
|
+
);
|
104
|
+
|
105
|
+
const [pythData, switchboardData] = await Promise.all([
|
106
|
+
zip(pythMints, await getPythPrices(pythMints)),
|
107
|
+
zip(switchboardMints, await getSwitchboardPrices(conn, switchboardMints)),
|
108
|
+
]);
|
109
|
+
|
110
|
+
const prices = mints.map((mint) => {
|
111
|
+
const item = [...pythData, ...switchboardData].find((data) =>
|
112
|
+
data[0].equals(mint)
|
113
|
+
);
|
114
|
+
return item ? item[1] : 0;
|
115
|
+
});
|
116
|
+
|
117
|
+
for (var i = 0; i < mints.length; i++) {
|
118
|
+
PRICES[mints[i].toString()] = {
|
119
|
+
price: prices[i],
|
120
|
+
time: currentUnixSeconds(),
|
121
|
+
};
|
122
|
+
}
|
123
|
+
|
124
|
+
return prices;
|
125
|
+
}
|
126
|
+
|
127
|
+
export async function getPythPrices(mints: PublicKey[]) {
|
72
128
|
const priceFeedIds = mints.map(
|
73
129
|
(mint) => PYTH_PRICE_FEED_IDS[mint.toString()]
|
74
130
|
);
|
@@ -78,7 +134,7 @@ export async function fetchTokenPrices(mints: PublicKey[]): Promise<number[]> {
|
|
78
134
|
`https://hermes.pyth.network/v2/updates/price/latest?${priceFeedIds.map((x) => `ids%5B%5D=${x}`).join("&")}`
|
79
135
|
);
|
80
136
|
|
81
|
-
const prices = await retryWithExponentialBackoff(
|
137
|
+
const prices: number[] = await retryWithExponentialBackoff(
|
82
138
|
async () => {
|
83
139
|
let resp = await getReq();
|
84
140
|
let status = resp.status;
|
@@ -103,16 +159,43 @@ export async function fetchTokenPrices(mints: PublicKey[]): Promise<number[]> {
|
|
103
159
|
200
|
104
160
|
);
|
105
161
|
|
106
|
-
for (var i = 0; i < mints.length; i++) {
|
107
|
-
PRICES[mints[i].toString()] = {
|
108
|
-
price: prices[i],
|
109
|
-
time: currentUnixSeconds(),
|
110
|
-
};
|
111
|
-
}
|
112
|
-
|
113
162
|
return prices;
|
114
163
|
}
|
115
164
|
|
165
|
+
export async function getSwitchboardPrices(
|
166
|
+
conn: Connection,
|
167
|
+
mints: PublicKey[]
|
168
|
+
) {
|
169
|
+
const dummyWallet = {
|
170
|
+
publicKey: new PublicKey("11111111111111111111111111111111"),
|
171
|
+
signTransaction: async <T extends Transaction | VersionedTransaction>(
|
172
|
+
tx: T
|
173
|
+
): Promise<T> => tx,
|
174
|
+
signAllTransactions: async <T extends Transaction | VersionedTransaction>(
|
175
|
+
txs: T[]
|
176
|
+
): Promise<T[]> => txs,
|
177
|
+
};
|
178
|
+
const provider = new AnchorProvider(
|
179
|
+
conn,
|
180
|
+
dummyWallet,
|
181
|
+
AnchorProvider.defaultOptions()
|
182
|
+
);
|
183
|
+
const program = new Program(switchboardIdl as Idl, provider);
|
184
|
+
|
185
|
+
const results = await Promise.all(
|
186
|
+
mints.map(async (mint) => {
|
187
|
+
const feed = new PullFeed(
|
188
|
+
program,
|
189
|
+
new PublicKey(SWITCHBOARD_PRICE_FEED_IDS[mint.toString()])
|
190
|
+
);
|
191
|
+
const result = await feed.loadData();
|
192
|
+
return Number(result.result.value) / Math.pow(10, 18);
|
193
|
+
})
|
194
|
+
);
|
195
|
+
|
196
|
+
return results;
|
197
|
+
}
|
198
|
+
|
116
199
|
export function safeGetPrice(
|
117
200
|
mint: PublicKey | UmiPublicKey | undefined
|
118
201
|
): number | undefined {
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { PublicKey } from "@solana/web3.js";
|
1
|
+
import { Connection, PublicKey } from "@solana/web3.js";
|
2
2
|
import { publicKey, Umi } from "@metaplex-foundation/umi";
|
3
3
|
import { toWeb3JsPublicKey } from "@metaplex-foundation/umi-web3js-adapters";
|
4
4
|
import {
|
@@ -35,7 +35,9 @@ interface AllMarginfiAssetAccounts extends MarginfiAssetAccounts {
|
|
35
35
|
mint: PublicKey;
|
36
36
|
}
|
37
37
|
|
38
|
-
export function findMarginfiAccounts(
|
38
|
+
export function findMarginfiAccounts(
|
39
|
+
bank: PublicKey
|
40
|
+
): AllMarginfiAssetAccounts {
|
39
41
|
for (const group in MARGINFI_ACCOUNTS) {
|
40
42
|
for (const key in MARGINFI_ACCOUNTS[group]) {
|
41
43
|
const account = MARGINFI_ACCOUNTS[group][key];
|
@@ -85,6 +87,7 @@ export function calcMaxLtvAndLiqThreshold(
|
|
85
87
|
}
|
86
88
|
|
87
89
|
export async function getMaxLtvAndLiqThreshold(
|
90
|
+
conn: Connection,
|
88
91
|
umi: Umi,
|
89
92
|
marginfiGroup: PublicKey,
|
90
93
|
supply: {
|
@@ -125,7 +128,7 @@ export async function getMaxLtvAndLiqThreshold(
|
|
125
128
|
}
|
126
129
|
|
127
130
|
if (!supplyPrice) {
|
128
|
-
const [price] = await fetchTokenPrices([
|
131
|
+
const [price] = await fetchTokenPrices(conn, [
|
129
132
|
toWeb3JsPublicKey(supply.bank!.mint),
|
130
133
|
]);
|
131
134
|
supplyPrice = price;
|
@@ -139,6 +142,7 @@ export async function getMaxLtvAndLiqThreshold(
|
|
139
142
|
}
|
140
143
|
|
141
144
|
export async function getAllMarginfiAccountsByAuthority(
|
145
|
+
conn: Connection,
|
142
146
|
umi: Umi,
|
143
147
|
authority: PublicKey,
|
144
148
|
compatibleWithSolauto?: boolean
|
@@ -171,10 +175,9 @@ export async function getAllMarginfiAccountsByAuthority(
|
|
171
175
|
const positionStates = await Promise.all(
|
172
176
|
marginfiAccounts.map(async (x) => ({
|
173
177
|
publicKey: x.publicKey,
|
174
|
-
state: await getMarginfiAccountPositionState(
|
175
|
-
|
176
|
-
|
177
|
-
),
|
178
|
+
state: await getMarginfiAccountPositionState(conn, umi, {
|
179
|
+
pk: toWeb3JsPublicKey(x.publicKey),
|
180
|
+
}),
|
178
181
|
}))
|
179
182
|
);
|
180
183
|
return positionStates
|
@@ -203,6 +206,7 @@ export async function getAllMarginfiAccountsByAuthority(
|
|
203
206
|
}
|
204
207
|
|
205
208
|
async function getTokenUsage(
|
209
|
+
conn: Connection,
|
206
210
|
bank: Bank | null,
|
207
211
|
isAsset: boolean,
|
208
212
|
shares: number,
|
@@ -213,7 +217,9 @@ async function getTokenUsage(
|
|
213
217
|
let marketPrice = 0;
|
214
218
|
|
215
219
|
if (bank !== null) {
|
216
|
-
[marketPrice] = await fetchTokenPrices([
|
220
|
+
[marketPrice] = await fetchTokenPrices(conn, [
|
221
|
+
toWeb3JsPublicKey(bank.mint),
|
222
|
+
]);
|
217
223
|
const [assetShareValue, liabilityShareValue] =
|
218
224
|
await getUpToDateShareValues(bank);
|
219
225
|
const shareValue = isAsset ? assetShareValue : liabilityShareValue;
|
@@ -269,6 +275,7 @@ interface BankSelection {
|
|
269
275
|
type BanksCache = { [group: string]: { [mint: string]: Bank } };
|
270
276
|
|
271
277
|
export async function getMarginfiAccountPositionState(
|
278
|
+
conn: Connection,
|
272
279
|
umi: Umi,
|
273
280
|
protocolAccount: { pk: PublicKey; data?: MarginfiAccount },
|
274
281
|
marginfiGroup?: PublicKey,
|
@@ -353,6 +360,7 @@ export async function getMarginfiAccountPositionState(
|
|
353
360
|
supply.mint = toWeb3JsPublicKey(supplyBank!.mint);
|
354
361
|
}
|
355
362
|
supplyUsage = await getTokenUsage(
|
363
|
+
conn,
|
356
364
|
supplyBank!,
|
357
365
|
true,
|
358
366
|
bytesToI80F48(supplyBalances[0].assetShares.value),
|
@@ -370,6 +378,7 @@ export async function getMarginfiAccountPositionState(
|
|
370
378
|
debt.mint = toWeb3JsPublicKey(debtBank!.mint);
|
371
379
|
}
|
372
380
|
debtUsage = await getTokenUsage(
|
381
|
+
conn,
|
373
382
|
debtBank!,
|
374
383
|
false,
|
375
384
|
bytesToI80F48(debtBalances[0].liabilityShares.value),
|
@@ -393,6 +402,7 @@ export async function getMarginfiAccountPositionState(
|
|
393
402
|
|
394
403
|
if (!supplyUsage) {
|
395
404
|
supplyUsage = await getTokenUsage(
|
405
|
+
conn,
|
396
406
|
supplyBank,
|
397
407
|
true,
|
398
408
|
0,
|
@@ -409,6 +419,7 @@ export async function getMarginfiAccountPositionState(
|
|
409
419
|
|
410
420
|
if (!debtUsage) {
|
411
421
|
debtUsage = await getTokenUsage(
|
422
|
+
conn,
|
412
423
|
debtBank,
|
413
424
|
false,
|
414
425
|
0,
|
@@ -418,6 +429,7 @@ export async function getMarginfiAccountPositionState(
|
|
418
429
|
|
419
430
|
const supplyPrice = safeGetPrice(supply.mint!)!;
|
420
431
|
let [maxLtv, liqThreshold] = await getMaxLtvAndLiqThreshold(
|
432
|
+
conn,
|
421
433
|
umi,
|
422
434
|
marginfiGroup ?? new PublicKey(DEFAULT_MARGINFI_GROUP),
|
423
435
|
{
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { PublicKey } from "@solana/web3.js";
|
1
|
+
import { Connection, PublicKey } from "@solana/web3.js";
|
2
2
|
import {
|
3
3
|
isOption,
|
4
4
|
isSome,
|
@@ -136,7 +136,7 @@ export function eligibleForRebalance(
|
|
136
136
|
if (!positionSettings) {
|
137
137
|
return undefined;
|
138
138
|
}
|
139
|
-
|
139
|
+
|
140
140
|
if (
|
141
141
|
positionDca &&
|
142
142
|
positionDca.automation.targetPeriods > 0 &&
|
@@ -345,6 +345,7 @@ export async function getReferralsByUser(
|
|
345
345
|
}
|
346
346
|
|
347
347
|
export async function getAllPositionsByAuthority(
|
348
|
+
conn: Connection,
|
348
349
|
umi: Umi,
|
349
350
|
user: PublicKey,
|
350
351
|
positionTypeFilter?: PositionType
|
@@ -368,6 +369,7 @@ export async function getAllPositionsByAuthority(
|
|
368
369
|
}
|
369
370
|
|
370
371
|
let marginfiPositions = await getAllMarginfiAccountsByAuthority(
|
372
|
+
conn,
|
371
373
|
umi,
|
372
374
|
user,
|
373
375
|
true
|
@@ -395,12 +397,13 @@ export async function getAllPositionsByAuthority(
|
|
395
397
|
}
|
396
398
|
|
397
399
|
export async function positionStateWithLatestPrices(
|
400
|
+
conn: Connection,
|
398
401
|
state: PositionState,
|
399
402
|
supplyPrice?: number,
|
400
403
|
debtPrice?: number
|
401
404
|
): Promise<PositionState> {
|
402
405
|
if (!supplyPrice || !debtPrice) {
|
403
|
-
[supplyPrice, debtPrice] = await fetchTokenPrices([
|
406
|
+
[supplyPrice, debtPrice] = await fetchTokenPrices(conn, [
|
404
407
|
toWeb3JsPublicKey(state.supply.mint),
|
405
408
|
toWeb3JsPublicKey(state.debt.mint),
|
406
409
|
]);
|
@@ -80,7 +80,7 @@ describe("Solauto Marginfi tests", async () => {
|
|
80
80
|
// // const initialSupplyUsd = 150;
|
81
81
|
// transactionItems.push(
|
82
82
|
// new TransactionItem(async () => {
|
83
|
-
// // const [supplyPrice] = await fetchTokenPrices([supply]);
|
83
|
+
// // const [supplyPrice] = await fetchTokenPrices(client.connection, [supply]);
|
84
84
|
// return {
|
85
85
|
// tx: client.protocolInteraction(
|
86
86
|
// solautoAction("Deposit", [toBaseUnit(9.5, supplyDecimals)])
|
@@ -37,9 +37,12 @@ import {
|
|
37
37
|
safeGetPrice,
|
38
38
|
} from "../../src/utils/generalUtils";
|
39
39
|
import { USDC } from "../../src/constants/tokenConstants";
|
40
|
-
import { buildHeliusApiUrl } from "../../src/utils";
|
40
|
+
import { buildHeliusApiUrl, getSolanaRpcConnection } from "../../src/utils";
|
41
41
|
|
42
42
|
const signer = setupTest(undefined, true);
|
43
|
+
const [conn, _] = getSolanaRpcConnection(
|
44
|
+
buildHeliusApiUrl(process.env.HELIUS_API_URL!)
|
45
|
+
);
|
43
46
|
|
44
47
|
function assertAccurateRebalance(
|
45
48
|
client: SolautoClient,
|
@@ -123,6 +126,7 @@ async function getFakePosition(
|
|
123
126
|
const maxLtvBps = 6400;
|
124
127
|
const liqThresholdBps = 8181;
|
125
128
|
client.solautoPositionState = await positionStateWithLatestPrices(
|
129
|
+
conn,
|
126
130
|
createFakePositionState(
|
127
131
|
{
|
128
132
|
amountUsed: supplyUsd / supplyPrice,
|
@@ -283,7 +287,7 @@ describe("Rebalance tests", async () => {
|
|
283
287
|
let supplyPrice: number, debtPrice: number;
|
284
288
|
|
285
289
|
before(async () => {
|
286
|
-
[supplyPrice, debtPrice] = await fetchTokenPrices([
|
290
|
+
[supplyPrice, debtPrice] = await fetchTokenPrices(conn, [
|
287
291
|
NATIVE_MINT,
|
288
292
|
new PublicKey(USDC),
|
289
293
|
]);
|