@symmetry-hq/temp-v3-sdk 0.0.11 → 0.0.13
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/src/index.d.ts +21 -20
- package/dist/src/index.js +39 -39
- package/dist/src/instructions/management/edit.d.ts +2 -2
- package/dist/src/instructions/management/edit.js +19 -19
- package/dist/src/layouts/intents/intent.d.ts +116 -194
- package/dist/src/states/basket.js +116 -99
- package/dist/test.js +180 -256
- package/package.json +1 -1
- package/src/index.ts +76 -69
- package/src/instructions/management/edit.ts +21 -21
- package/src/layouts/intents/intent.ts +117 -197
- package/src/states/basket.ts +116 -98
- package/test.ts +195 -266
|
@@ -16,7 +16,7 @@ export interface Intent {
|
|
|
16
16
|
bounty: Bounty;
|
|
17
17
|
taskType: TaskType;
|
|
18
18
|
taskData: number[];
|
|
19
|
-
parsedTaskData?:
|
|
19
|
+
parsedTaskData?: Settings;
|
|
20
20
|
ownAddress?: PublicKey;
|
|
21
21
|
}
|
|
22
22
|
export declare const IntentLayout: any;
|
|
@@ -40,201 +40,123 @@ export declare enum TaskType {
|
|
|
40
40
|
MakeDirectSwap = 203
|
|
41
41
|
}
|
|
42
42
|
export declare function taskTypeFromU8(value: number): TaskType;
|
|
43
|
-
export interface
|
|
44
|
-
basket: string;
|
|
45
|
-
manager: string;
|
|
46
|
-
use_bounty?: boolean;
|
|
47
|
-
activation_timestamp?: number;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
}
|
|
52
|
-
export interface
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
allow_lp: boolean;
|
|
137
|
-
lp_threshold_bps: number;
|
|
138
|
-
modification_delay: number;
|
|
139
|
-
};
|
|
140
|
-
}
|
|
141
|
-
export interface EditMetadataInput {
|
|
142
|
-
basket: string;
|
|
143
|
-
manager: string;
|
|
144
|
-
use_bounty?: boolean;
|
|
145
|
-
activation_timestamp?: number;
|
|
146
|
-
metadata_settings: {
|
|
147
|
-
symbol: string;
|
|
148
|
-
name: string;
|
|
149
|
-
uri: string;
|
|
150
|
-
modification_delay: number;
|
|
151
|
-
};
|
|
152
|
-
}
|
|
153
|
-
export interface EditDepositsInput {
|
|
154
|
-
basket: string;
|
|
155
|
-
manager: string;
|
|
156
|
-
use_bounty?: boolean;
|
|
157
|
-
activation_timestamp?: number;
|
|
158
|
-
deposits_settings: {
|
|
159
|
-
deposits_are_allowed: boolean;
|
|
160
|
-
};
|
|
161
|
-
}
|
|
162
|
-
export interface EditForceRebalanceInput {
|
|
163
|
-
basket: string;
|
|
164
|
-
manager: string;
|
|
165
|
-
use_bounty?: boolean;
|
|
166
|
-
activation_timestamp?: number;
|
|
167
|
-
force_rebalance_settings: {
|
|
168
|
-
force_rebalance_is_allowed: boolean;
|
|
169
|
-
modification_delay: number;
|
|
170
|
-
};
|
|
171
|
-
}
|
|
172
|
-
export interface EditCustomRebalanceInput {
|
|
173
|
-
basket: string;
|
|
174
|
-
manager: string;
|
|
175
|
-
use_bounty?: boolean;
|
|
176
|
-
activation_timestamp?: number;
|
|
177
|
-
custom_rebalance_settings: {
|
|
178
|
-
custom_rebalance_is_allowed: boolean;
|
|
179
|
-
modification_delay: number;
|
|
180
|
-
};
|
|
181
|
-
}
|
|
182
|
-
export interface EditAddTokenDelayInput {
|
|
183
|
-
basket: string;
|
|
184
|
-
manager: string;
|
|
185
|
-
use_bounty?: boolean;
|
|
186
|
-
activation_timestamp?: number;
|
|
187
|
-
add_token_delay: {
|
|
188
|
-
modification_delay: number;
|
|
189
|
-
};
|
|
190
|
-
}
|
|
191
|
-
export interface EditUpdateWeightsDelayInput {
|
|
192
|
-
basket: string;
|
|
193
|
-
manager: string;
|
|
194
|
-
use_bounty?: boolean;
|
|
195
|
-
activation_timestamp?: number;
|
|
196
|
-
update_weights_delay: {
|
|
197
|
-
modification_delay: number;
|
|
198
|
-
};
|
|
199
|
-
}
|
|
200
|
-
export interface EditMakeDirectSwapDelayInput {
|
|
201
|
-
basket: string;
|
|
202
|
-
manager: string;
|
|
203
|
-
use_bounty?: boolean;
|
|
204
|
-
activation_timestamp?: number;
|
|
205
|
-
make_direct_swap_delay: {
|
|
206
|
-
modification_delay: number;
|
|
207
|
-
};
|
|
43
|
+
export interface TaskContext {
|
|
44
|
+
basket: string;
|
|
45
|
+
manager: string;
|
|
46
|
+
use_bounty?: boolean;
|
|
47
|
+
activation_timestamp?: number;
|
|
48
|
+
}
|
|
49
|
+
export interface FormattedCreatorSettings {
|
|
50
|
+
creator: string;
|
|
51
|
+
}
|
|
52
|
+
export interface FormattedManagersSettings {
|
|
53
|
+
managers: {
|
|
54
|
+
pubkey: string;
|
|
55
|
+
fee_split_weight_bps: number;
|
|
56
|
+
authorities: {
|
|
57
|
+
managers: boolean;
|
|
58
|
+
fees: boolean;
|
|
59
|
+
schedule: boolean;
|
|
60
|
+
automation: boolean;
|
|
61
|
+
lp: boolean;
|
|
62
|
+
metadata: boolean;
|
|
63
|
+
deposits: boolean;
|
|
64
|
+
force_rebalance: boolean;
|
|
65
|
+
custom_rebalance: boolean;
|
|
66
|
+
add_token: boolean;
|
|
67
|
+
update_weights: boolean;
|
|
68
|
+
make_direct_swap: boolean;
|
|
69
|
+
};
|
|
70
|
+
}[];
|
|
71
|
+
modification_delay: number;
|
|
72
|
+
}
|
|
73
|
+
export interface FormattedFeeSettings {
|
|
74
|
+
creator_deposit_fee_bps: number;
|
|
75
|
+
creator_withdraw_fee_bps: number;
|
|
76
|
+
creator_management_fee_bps: number;
|
|
77
|
+
creator_performance_fee_bps: number;
|
|
78
|
+
managers_deposit_fee_bps: number;
|
|
79
|
+
managers_withdraw_fee_bps: number;
|
|
80
|
+
managers_management_fee_bps: number;
|
|
81
|
+
managers_performance_fee_bps: number;
|
|
82
|
+
basket_deposit_fee_bps: number;
|
|
83
|
+
basket_withdraw_fee_bps: number;
|
|
84
|
+
modification_delay: number;
|
|
85
|
+
}
|
|
86
|
+
export interface FormattedScheduleSettings {
|
|
87
|
+
cycle_start_time: number;
|
|
88
|
+
cycle_duration: number;
|
|
89
|
+
deposits_start: number;
|
|
90
|
+
deposits_end: number;
|
|
91
|
+
automation_start: number;
|
|
92
|
+
automation_end: number;
|
|
93
|
+
management_start: number;
|
|
94
|
+
management_end: number;
|
|
95
|
+
modification_delay: number;
|
|
96
|
+
}
|
|
97
|
+
export interface FormattedAutomationSettings {
|
|
98
|
+
allow: boolean;
|
|
99
|
+
rebalance_slippage_threshold_bps: number;
|
|
100
|
+
per_trade_rebalance_slippage_threshold_bps: number;
|
|
101
|
+
rebalance_activation_threshold_abs_bps: number;
|
|
102
|
+
rebalance_activation_threshold_rel_bps: number;
|
|
103
|
+
rebalance_activation_cooldown: number;
|
|
104
|
+
modification_delay: number;
|
|
105
|
+
}
|
|
106
|
+
export interface FormattedLpSettings {
|
|
107
|
+
allow: boolean;
|
|
108
|
+
lp_threshold_bps: number;
|
|
109
|
+
modification_delay: number;
|
|
110
|
+
}
|
|
111
|
+
export interface FormattedMetadataSettings {
|
|
112
|
+
symbol: string;
|
|
113
|
+
name: string;
|
|
114
|
+
uri: string;
|
|
115
|
+
modification_delay: number;
|
|
116
|
+
}
|
|
117
|
+
export interface FormattedDepositsSettings {
|
|
118
|
+
allow: boolean;
|
|
119
|
+
}
|
|
120
|
+
export interface FormattedForceRebalanceSettings {
|
|
121
|
+
allow: boolean;
|
|
122
|
+
modification_delay: number;
|
|
123
|
+
}
|
|
124
|
+
export interface FormattedCustomRebalanceSettings {
|
|
125
|
+
allow: boolean;
|
|
126
|
+
modification_delay: number;
|
|
127
|
+
}
|
|
128
|
+
export interface FormattedAddTokenSettings {
|
|
129
|
+
modification_delay: number;
|
|
130
|
+
}
|
|
131
|
+
export interface FormattedUpdateWeightsSettings {
|
|
132
|
+
modification_delay: number;
|
|
133
|
+
}
|
|
134
|
+
export interface FormattedMakeDirectSwapSettings {
|
|
135
|
+
modification_delay: number;
|
|
208
136
|
}
|
|
209
137
|
export interface AddTokenInput {
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
138
|
+
token_mint: string;
|
|
139
|
+
active: boolean;
|
|
140
|
+
min_oracles_thresh: number;
|
|
141
|
+
min_conf_bps: number;
|
|
142
|
+
conf_thresh_bps: number;
|
|
143
|
+
conf_multiplier: number;
|
|
144
|
+
oracles: {
|
|
145
|
+
oracle_type: number;
|
|
146
|
+
num_required_accounts: number;
|
|
147
|
+
weight: number;
|
|
148
|
+
is_required: boolean;
|
|
219
149
|
conf_thresh_bps: number;
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
staleness_thresh: number;
|
|
231
|
-
staleness_conf_rate_bps: number;
|
|
232
|
-
token_decimals: number;
|
|
233
|
-
twap_seconds_ago: number;
|
|
234
|
-
twap_secondary_seconds_ago: number;
|
|
235
|
-
}[];
|
|
236
|
-
oracle_accounts: string[];
|
|
237
|
-
};
|
|
150
|
+
volatility_thresh_bps: number;
|
|
151
|
+
max_slippage_bps: number;
|
|
152
|
+
min_liquidity: number;
|
|
153
|
+
staleness_thresh: number;
|
|
154
|
+
staleness_conf_rate_bps: number;
|
|
155
|
+
token_decimals: number;
|
|
156
|
+
twap_seconds_ago: number;
|
|
157
|
+
twap_secondary_seconds_ago: number;
|
|
158
|
+
}[];
|
|
159
|
+
oracle_accounts: string[];
|
|
238
160
|
}
|
|
239
161
|
export interface UpdateWeightsInput {
|
|
240
162
|
basket: string;
|
|
@@ -261,4 +183,4 @@ export interface MakeDirectSwapInput {
|
|
|
261
183
|
amount_to: number;
|
|
262
184
|
};
|
|
263
185
|
}
|
|
264
|
-
export type
|
|
186
|
+
export type Settings = FormattedCreatorSettings | FormattedManagersSettings | FormattedFeeSettings | FormattedScheduleSettings | FormattedAutomationSettings | FormattedLpSettings | FormattedMetadataSettings | FormattedDepositsSettings | FormattedForceRebalanceSettings | FormattedCustomRebalanceSettings | FormattedAddTokenSettings | FormattedUpdateWeightsSettings | FormattedMakeDirectSwapSettings | AddTokenInput | UpdateWeightsInput | MakeDirectSwapInput;
|
|
@@ -57,29 +57,109 @@ function addFieldsToBasket(basket) {
|
|
|
57
57
|
basket.settings.managers.managers = basket.settings.managers.managers.slice(0, totalManagers);
|
|
58
58
|
basket.settings.managers.managersWeightBps = basket.settings.managers.managersWeightBps.slice(0, totalManagers);
|
|
59
59
|
basket = Object.assign(Object.assign({}, basket), { metadata: metadata });
|
|
60
|
-
let
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
})
|
|
82
|
-
|
|
60
|
+
let creator_settings = {
|
|
61
|
+
creator: basket.settings.creator.toBase58(),
|
|
62
|
+
};
|
|
63
|
+
let manager_settings = {
|
|
64
|
+
managers: basket.settings.managers.managers.map((manager, i) => ({
|
|
65
|
+
pubkey: manager.toBase58(),
|
|
66
|
+
fee_split_weight_bps: basket.settings.managers.managersWeightBps[i],
|
|
67
|
+
authorities: {
|
|
68
|
+
managers: (((2 ** i) & basket.settings.managersAuthorityBitmask) != 0),
|
|
69
|
+
fees: (((2 ** i) & basket.settings.feesAuthorityBitmask) != 0),
|
|
70
|
+
schedule: (((2 ** i) & basket.settings.scheduleAuthorityBitmask) != 0),
|
|
71
|
+
automation: (((2 ** i) & basket.settings.automationAuthorityBitmask) != 0),
|
|
72
|
+
lp: (((2 ** i) & basket.settings.lpAuthorityBitmask) != 0),
|
|
73
|
+
metadata: (((2 ** i) & basket.settings.metadataAuthorityBitmask) != 0),
|
|
74
|
+
deposits: (((2 ** i) & basket.settings.depositsAuthorityBitmask) != 0),
|
|
75
|
+
force_rebalance: (((2 ** i) & basket.settings.forceRebalanceAuthorityBitmask) != 0),
|
|
76
|
+
custom_rebalance: (((2 ** i) & basket.settings.customRebalanceAuthorityBitmask) != 0),
|
|
77
|
+
add_token: (((2 ** i) & basket.settings.addTokenIntentAuthorityBitmask) != 0),
|
|
78
|
+
update_weights: (((2 ** i) & basket.settings.updateWeightsIntentAuthorityBitmask) != 0),
|
|
79
|
+
make_direct_swap: (((2 ** i) & basket.settings.makeDirectSwapIntentAuthorityBitmask) != 0),
|
|
80
|
+
},
|
|
81
|
+
})),
|
|
82
|
+
modification_delay: parseInt(basket.settings.managers.modificationDelay.toString()), //@ts-ignore
|
|
83
|
+
updated_at: parseInt(basket.settings.managersLastUpdateTimestamp.toString()),
|
|
84
|
+
};
|
|
85
|
+
let fee_settings = {
|
|
86
|
+
host_deposit_fee_bps: basket.settings.fees.hostDepositFeeBps,
|
|
87
|
+
host_withdraw_fee_bps: basket.settings.fees.hostWithdrawFeeBps,
|
|
88
|
+
host_management_fee_bps: basket.settings.fees.hostManagementFeeBps,
|
|
89
|
+
host_performance_fee_bps: basket.settings.fees.hostPerformanceFeeBps,
|
|
90
|
+
creator_deposit_fee_bps: basket.settings.fees.creatorDepositFeeBps,
|
|
91
|
+
creator_withdraw_fee_bps: basket.settings.fees.creatorWithdrawFeeBps,
|
|
92
|
+
creator_management_fee_bps: basket.settings.fees.creatorManagementFeeBps,
|
|
93
|
+
creator_performance_fee_bps: basket.settings.fees.creatorPerformanceFeeBps,
|
|
94
|
+
managers_deposit_fee_bps: basket.settings.fees.managersDepositFeeBps,
|
|
95
|
+
managers_withdraw_fee_bps: basket.settings.fees.managersWithdrawFeeBps,
|
|
96
|
+
managers_management_fee_bps: basket.settings.fees.managersManagementFeeBps,
|
|
97
|
+
managers_performance_fee_bps: basket.settings.fees.managersPerformanceFeeBps,
|
|
98
|
+
basket_deposit_fee_bps: basket.settings.fees.basketDepositFeeBps,
|
|
99
|
+
basket_withdraw_fee_bps: basket.settings.fees.basketWithdrawFeeBps,
|
|
100
|
+
modification_delay: parseInt(basket.settings.fees.modificationDelay.toString()), //@ts-ignore
|
|
101
|
+
updated_at: parseInt(basket.settings.feesLastUpdateTimestamp.toString()),
|
|
102
|
+
};
|
|
103
|
+
let schedule_settings = {
|
|
104
|
+
cycle_start_time: parseInt(basket.settings.schedule.cycleStartTime.toString()),
|
|
105
|
+
cycle_duration: parseInt(basket.settings.schedule.cycleDuration.toString()),
|
|
106
|
+
deposits_start: parseInt(basket.settings.schedule.depositsStart.toString()),
|
|
107
|
+
deposits_end: parseInt(basket.settings.schedule.depositsEnd.toString()),
|
|
108
|
+
automation_start: parseInt(basket.settings.schedule.automationStart.toString()),
|
|
109
|
+
automation_end: parseInt(basket.settings.schedule.automationEnd.toString()),
|
|
110
|
+
management_start: parseInt(basket.settings.schedule.managementStart.toString()),
|
|
111
|
+
management_end: parseInt(basket.settings.schedule.managementEnd.toString()),
|
|
112
|
+
modification_delay: parseInt(basket.settings.schedule.modificationDelay.toString()), //@ts-ignore
|
|
113
|
+
updated_at: parseInt(basket.settings.scheduleLastUpdateTimestamp.toString()),
|
|
114
|
+
};
|
|
115
|
+
let automation_settings = {
|
|
116
|
+
allow: basket.settings.automation.allowAutomation == 1 ? true : false,
|
|
117
|
+
rebalance_slippage_threshold_bps: basket.settings.automation.rebalanceSlippageThresholdBps,
|
|
118
|
+
per_trade_rebalance_slippage_threshold_bps: basket.settings.automation.perTradeRebalanceSlippageThresholdBps,
|
|
119
|
+
rebalance_activation_threshold_abs_bps: basket.settings.automation.rebalanceActivationThresholdAbsBps,
|
|
120
|
+
rebalance_activation_threshold_rel_bps: basket.settings.automation.rebalanceActivationThresholdRelBps,
|
|
121
|
+
rebalance_activation_cooldown: parseInt(basket.settings.automation.rebalanceActivationCooldown.toString()),
|
|
122
|
+
modification_delay: parseInt(basket.settings.automation.modificationDelay.toString()), //@ts-ignore
|
|
123
|
+
updated_at: parseInt(basket.settings.automationLastUpdateTimestamp.toString()),
|
|
124
|
+
};
|
|
125
|
+
let lp_settings = {
|
|
126
|
+
allow: basket.settings.lp.allowLp == 1 ? true : false,
|
|
127
|
+
lp_threshold_bps: basket.settings.lp.lpThresholdBps,
|
|
128
|
+
modification_delay: parseInt(basket.settings.lp.modificationDelay.toString()), //@ts-ignore
|
|
129
|
+
updated_at: parseInt(basket.settings.lpLastUpdateTimestamp.toString()),
|
|
130
|
+
};
|
|
131
|
+
let metadata_settings = {
|
|
132
|
+
symbol: metadata.symbol,
|
|
133
|
+
name: metadata.name,
|
|
134
|
+
uri: metadata.uri,
|
|
135
|
+
modification_delay: parseInt(basket.settings.metadata.modificationDelay.toString()), //@ts-ignore
|
|
136
|
+
updated_at: parseInt(basket.settings.metadataLastUpdateTimestamp.toString()),
|
|
137
|
+
};
|
|
138
|
+
let deposits_settings = {
|
|
139
|
+
allow: basket.settings.depositsAreAllowed == 1 ? true : false,
|
|
140
|
+
};
|
|
141
|
+
let force_rebalance_settings = {
|
|
142
|
+
allow: basket.settings.forceRebalanceIsAllowed == 1 ? true : false,
|
|
143
|
+
modification_delay: parseInt(basket.settings.forceRebalanceModificationDelay.toString()), //@ts-ignore
|
|
144
|
+
updated_at: parseInt(basket.settings.forceRebalanceLastUpdateTimestamp.toString()),
|
|
145
|
+
};
|
|
146
|
+
let custom_rebalance_settings = {
|
|
147
|
+
allow: basket.settings.customRebalanceIsAllowed == 1 ? true : false,
|
|
148
|
+
modification_delay: parseInt(basket.settings.customRebalanceModificationDelay.toString()), //@ts-ignore
|
|
149
|
+
updated_at: parseInt(basket.settings.customRebalanceLastUpdateTimestamp.toString()),
|
|
150
|
+
};
|
|
151
|
+
let add_token_settings = {
|
|
152
|
+
modification_delay: parseInt(basket.settings.addTokenDelay.toString()), //@ts-ignore
|
|
153
|
+
updated_at: parseInt(basket.settings.addTokenLastUpdateTimestamp.toString()),
|
|
154
|
+
};
|
|
155
|
+
let update_weights_settings = {
|
|
156
|
+
modification_delay: parseInt(basket.settings.updateWeightsDelay.toString()), //@ts-ignore
|
|
157
|
+
updated_at: parseInt(basket.settings.updateWeightsLastUpdateTimestamp.toString()),
|
|
158
|
+
};
|
|
159
|
+
let make_direct_swap_settings = {
|
|
160
|
+
modification_delay: parseInt(basket.settings.makeDirectSwapDelay.toString()), //@ts-ignore
|
|
161
|
+
updated_at: parseInt(basket.settings.makeDirectSwapLastUpdateTimestamp.toString()),
|
|
162
|
+
};
|
|
83
163
|
let formatted = {
|
|
84
164
|
pubkey: basket.ownAddress.toBase58(),
|
|
85
165
|
name: (_a = basket.metadata) === null || _a === void 0 ? void 0 : _a.name,
|
|
@@ -100,82 +180,19 @@ function addFieldsToBasket(basket) {
|
|
|
100
180
|
active_deposits: parseInt(basket.settings.activeDeposits.toString()),
|
|
101
181
|
active_managements: parseInt(basket.settings.activeManagements.toString()),
|
|
102
182
|
last_automation_execution_timestamp: parseInt(basket.settings.lastAutomationExecutionTimestamp.toString()),
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
creator_performance_fee_bps: basket.settings.fees.creatorPerformanceFeeBps,
|
|
117
|
-
managers_deposit_fee_bps: basket.settings.fees.managersDepositFeeBps,
|
|
118
|
-
managers_withdraw_fee_bps: basket.settings.fees.managersWithdrawFeeBps,
|
|
119
|
-
managers_management_fee_bps: basket.settings.fees.managersManagementFeeBps,
|
|
120
|
-
managers_performance_fee_bps: basket.settings.fees.managersPerformanceFeeBps,
|
|
121
|
-
basket_deposit_fee_bps: basket.settings.fees.basketDepositFeeBps,
|
|
122
|
-
basket_withdraw_fee_bps: basket.settings.fees.basketWithdrawFeeBps,
|
|
123
|
-
modification_delay: parseInt(basket.settings.fees.modificationDelay.toString()),
|
|
124
|
-
updated_at: parseInt(basket.settings.feesLastUpdateTimestamp.toString()),
|
|
125
|
-
},
|
|
126
|
-
schedule: {
|
|
127
|
-
cycle_start_time: parseInt(basket.settings.schedule.cycleStartTime.toString()),
|
|
128
|
-
cycle_duration: parseInt(basket.settings.schedule.cycleDuration.toString()),
|
|
129
|
-
deposits_start: parseInt(basket.settings.schedule.depositsStart.toString()),
|
|
130
|
-
deposits_end: parseInt(basket.settings.schedule.depositsEnd.toString()),
|
|
131
|
-
automation_start: parseInt(basket.settings.schedule.automationStart.toString()),
|
|
132
|
-
automation_end: parseInt(basket.settings.schedule.automationEnd.toString()),
|
|
133
|
-
management_start: parseInt(basket.settings.schedule.managementStart.toString()),
|
|
134
|
-
management_end: parseInt(basket.settings.schedule.managementEnd.toString()),
|
|
135
|
-
modification_delay: parseInt(basket.settings.schedule.modificationDelay.toString()),
|
|
136
|
-
updated_at: parseInt(basket.settings.scheduleLastUpdateTimestamp.toString()),
|
|
137
|
-
},
|
|
138
|
-
automation: {
|
|
139
|
-
allow: basket.settings.automation.allowAutomation == 1 ? true : false,
|
|
140
|
-
rebalance_slippage_threshold_bps: basket.settings.automation.rebalanceSlippageThresholdBps,
|
|
141
|
-
per_trade_rebalance_slippage_threshold_bps: basket.settings.automation.perTradeRebalanceSlippageThresholdBps,
|
|
142
|
-
rebalance_activation_threshold_abs_bps: basket.settings.automation.rebalanceActivationThresholdAbsBps,
|
|
143
|
-
rebalance_activation_threshold_rel_bps: basket.settings.automation.rebalanceActivationThresholdRelBps,
|
|
144
|
-
rebalance_activation_cooldown: parseInt(basket.settings.automation.rebalanceActivationCooldown.toString()),
|
|
145
|
-
modification_delay: parseInt(basket.settings.automation.modificationDelay.toString()),
|
|
146
|
-
updated_at: parseInt(basket.settings.automationLastUpdateTimestamp.toString()),
|
|
147
|
-
},
|
|
148
|
-
lp: {
|
|
149
|
-
allow: basket.settings.lp.allowLp == 1 ? true : false,
|
|
150
|
-
lp_threshold_bps: basket.settings.lp.lpThresholdBps,
|
|
151
|
-
modification_delay: parseInt(basket.settings.lp.modificationDelay.toString()),
|
|
152
|
-
updated_at: parseInt(basket.settings.lpLastUpdateTimestamp.toString()),
|
|
153
|
-
},
|
|
154
|
-
deposits: {
|
|
155
|
-
allow: basket.settings.depositsAreAllowed == 1 ? true : false,
|
|
156
|
-
},
|
|
157
|
-
force_rebalance: {
|
|
158
|
-
allow: basket.settings.forceRebalanceIsAllowed == 1 ? true : false,
|
|
159
|
-
modification_delay: parseInt(basket.settings.forceRebalanceModificationDelay.toString()),
|
|
160
|
-
updated_at: parseInt(basket.settings.forceRebalanceLastUpdateTimestamp.toString()),
|
|
161
|
-
},
|
|
162
|
-
custom_rebalance: {
|
|
163
|
-
allow: basket.settings.customRebalanceIsAllowed == 1 ? true : false,
|
|
164
|
-
modification_delay: parseInt(basket.settings.customRebalanceModificationDelay.toString()),
|
|
165
|
-
updated_at: parseInt(basket.settings.customRebalanceLastUpdateTimestamp.toString()),
|
|
166
|
-
},
|
|
167
|
-
add_token: {
|
|
168
|
-
delay: parseInt(basket.settings.addTokenDelay.toString()),
|
|
169
|
-
updated_at: parseInt(basket.settings.addTokenLastUpdateTimestamp.toString()),
|
|
170
|
-
},
|
|
171
|
-
update_weights: {
|
|
172
|
-
delay: parseInt(basket.settings.updateWeightsDelay.toString()),
|
|
173
|
-
updated_at: parseInt(basket.settings.updateWeightsLastUpdateTimestamp.toString()),
|
|
174
|
-
},
|
|
175
|
-
make_direct_swap: {
|
|
176
|
-
delay: parseInt(basket.settings.makeDirectSwapDelay.toString()),
|
|
177
|
-
updated_at: parseInt(basket.settings.makeDirectSwapLastUpdateTimestamp.toString()),
|
|
178
|
-
},
|
|
183
|
+
creator_settings: creator_settings,
|
|
184
|
+
manager_settings: manager_settings,
|
|
185
|
+
fee_settings: fee_settings,
|
|
186
|
+
schedule_settings: schedule_settings,
|
|
187
|
+
automation_settings: automation_settings,
|
|
188
|
+
lp_settings: lp_settings,
|
|
189
|
+
metadata_settings: metadata_settings,
|
|
190
|
+
deposits_settings: deposits_settings,
|
|
191
|
+
force_rebalance_settings: force_rebalance_settings,
|
|
192
|
+
custom_rebalance_settings: custom_rebalance_settings,
|
|
193
|
+
add_token_settings: add_token_settings,
|
|
194
|
+
update_weights_settings: update_weights_settings,
|
|
195
|
+
make_direct_swap_settings: make_direct_swap_settings,
|
|
179
196
|
accumulated_fees: {
|
|
180
197
|
symmetry_fees: parseInt(basket.accumulatedFees.symmetryFees.toString()),
|
|
181
198
|
creator_fees: parseInt(basket.accumulatedFees.creatorFees.toString()),
|