This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use tokio_tungstenite::{connect_async, tungstenite::Message}; | |
use futures_util::{StreamExt, SinkExt}; | |
use serde::{Deserialize, Serialize}; | |
#[derive(Debug, Deserialize)] | |
struct PythPriceFeed { | |
id: String, | |
price: Option<PriceData>, | |
ema_price: Option<PriceData>, | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use switchboard_on_demand_client::gateway::Gateway; | |
use switchboard_on_demand_client::FetchUpdateParams; | |
use switchboard_on_demand_client::PullFeed; | |
use switchboard_on_demand_client::SbContext; | |
use std::sync::Arc; | |
use std::str::FromStr; | |
use solana_client::nonblocking::rpc_client::RpcClient; | |
use solana_sdk::pubkey::Pubkey; | |
use anyhow::Result; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_liquidity Params: Object { | |
"args": Object { | |
"liquidity_parameter": Object { | |
"amount_x": Number(1881591784), | |
"amount_y": Number(0), | |
"bin_liquidity_dist": Array [ | |
Array [ | |
Number(8785), | |
Number(909), | |
Number(0), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
initialize_position_by_operator ix_data: lower bind id: 9113, width 15 | |
Bin array keys: 15CxRvzZyfFzCTNbnXgtMX1ivHvwdWi7UetFhgLFb6v - 6ocY6jLKPrfyxmN8Krzmc65dhtfyZhrGTxxsMmxkaCgc | |
add_liquidity_by_strategy Params: AddLiquidityByStrategyIxArgs { liquidity_parameter: LiquidityParameterByStrategy { amount_x: 33763532, amount_y: 11185204144, active_id: 9126, max_active_bin_slippage: 3, strategy_parameters: StrategyParameters { min_bin_id: 9125, max_bin_id: 9128, strategy_type: SpotBalanced, parameteres: [] } } } | |
Liquidity transaction simulation result: | |
Error: Some(InstructionError(4, Custom(6008))) | |
Logs: | |
Program ComputeBudget111111111111111111111111111111 invoke [1] | |
Program ComputeBudget111111111111111111111111111111 success | |
Program 11111111111111111111111111111111 invoke [1] | |
Program 11111111111111111111111111111111 success |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
running 1 test | |
Initializing state | |
Connecting to RPC: https://switchboard.rpcpool.com/5f7ec120-9628-40c4-997f-0cdb4135e059 | |
Connected to RPC | |
Loaded payer | |
Markets: 19 | |
====== Market Details ====== | |
Lifinity market ID: W5s3YFGHyMnWqYxkdfimB6AgMPiofDm5S5ndjqdvPuy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- ========== v1: May 2021 - Dec 2022 ========== | |
WITH | |
-- v1a: May 2021 - Oct 2021 | |
v1a AS ( | |
WITH tx_signers AS ( | |
SELECT DISTINCT tx_id, address AS signer | |
FROM solana.account_activity | |
WHERE signed = TRUE | |
AND block_time BETWEEN TIMESTAMP '2021-05-01' AND TIMESTAMP '2021-10-31' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- v1: May 2021 - Dec 2022 | |
WITH | |
tx_signers_v1 AS ( | |
SELECT DISTINCT tx_id, address AS signer | |
FROM solana.account_activity | |
WHERE signed = TRUE AND block_time BETWEEN TIMESTAMP '2021-05-01' AND TIMESTAMP '2022-12-31' | |
), | |
combined_keys_v1 AS ( | |
SELECT DISTINCT t.signer, aa.address AS key | |
FROM solana.account_activity aa |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mod idl; | |
use anchor_lang::{AnchorDeserialize, prelude::AccountInfo}; | |
use anyhow::{anyhow, Result}; | |
use anyhow_ext::Context; | |
use idl::*; | |
use rust_decimal::Decimal; | |
use sanctum_lst_list::{ | |
PoolInfo::{SPool, SanctumSpl, SanctumSplMulti, Spl}, | |
SanctumLst, SanctumLstList, SplPoolAccounts, | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WITH signer_lookup AS ( | |
SELECT | |
tx_id, | |
MAX(CASE WHEN signed THEN address END) AS signer | |
FROM account_activity | |
GROUP BY tx_id | |
) | |
SELECT | |
a.*, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use std::time::{SystemTime, UNIX_EPOCH}; | |
use anyhow::{anyhow, Context}; | |
use num_traits::FromPrimitive; | |
use rust_decimal::Decimal; | |
use solana_client::nonblocking::rpc_client::RpcClient; | |
use solana_sdk::pubkey::Pubkey; | |
use anyhow::Error as AnyhowError; | |
use crate::{ | |
protos::{oracle_job::*, OracleJob}, |
NewerOlder