@prism-hq/prism-ag
Version:
Prism Aggregator
37 lines (36 loc) • 1.17 kB
JavaScript
;
// import { deserializeAccount } from "@orca-so/sdk";
// import { Market } from "@ellipsis-labs/phoenix-sdk";
// export function _loadPhoenix(liquidity: any){
// try {
// if (!liquidity || liquidity.length == 0) return [];
// let accounts: any = [];
// for (let i=0; i<liquidity.length; i++) {
// let pool: Market = liquidity[i].pool;
// accounts.push({account: pool.address, provider: "phoenix"});
// }
// return accounts;
// } catch {
// return [];
// }
// }
// export function loadPhoenix(liquidity: any, results: any[], slot: any) {
// try {
// if (!liquidity || liquidity.length == 0 || !results) return {};
// let phoenixMarkets: any = {};
// let ind = 0;
// for (let i=0; i<liquidity.length; i++) {
// let pool: Market = liquidity[i].pool;
// pool.reload(results[ind].account.data);
// phoenixMarkets[pool.address.toBase58()] = {
// pool: pool,
// provider: "phoenix",
// slot: slot,
// }
// ind = ind + 1;
// }
// return phoenixMarkets;
// } catch {
// return {};
// }
// }