Update mango-v4, try to use async client
This commit is contained in:
parent
05f42c7352
commit
8f19a20b91
|
@ -104,7 +104,7 @@ checksum = "6b2d54853319fd101b8dd81de382bcbf3e03410a64d8928bbee85a3e7dcde483"
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "anchor-attribute-access-control"
|
name = "anchor-attribute-access-control"
|
||||||
version = "0.25.0"
|
version = "0.25.0"
|
||||||
source = "git+ssh://git@github.com/blockworks-foundation/mango-v4?branch=dev#0ed7175341c39b944aa298a7e2a0207ba36c6cbe"
|
source = "git+https://github.com/blockworks-foundation/mango-v4?branch=dev#7a8f31c6118b0577aa6375af4643e41efe85e057"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anchor-syn",
|
"anchor-syn",
|
||||||
"anyhow",
|
"anyhow",
|
||||||
|
@ -117,7 +117,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "anchor-attribute-account"
|
name = "anchor-attribute-account"
|
||||||
version = "0.25.0"
|
version = "0.25.0"
|
||||||
source = "git+ssh://git@github.com/blockworks-foundation/mango-v4?branch=dev#0ed7175341c39b944aa298a7e2a0207ba36c6cbe"
|
source = "git+https://github.com/blockworks-foundation/mango-v4?branch=dev#7a8f31c6118b0577aa6375af4643e41efe85e057"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anchor-syn",
|
"anchor-syn",
|
||||||
"anyhow",
|
"anyhow",
|
||||||
|
@ -131,7 +131,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "anchor-attribute-constant"
|
name = "anchor-attribute-constant"
|
||||||
version = "0.25.0"
|
version = "0.25.0"
|
||||||
source = "git+ssh://git@github.com/blockworks-foundation/mango-v4?branch=dev#0ed7175341c39b944aa298a7e2a0207ba36c6cbe"
|
source = "git+https://github.com/blockworks-foundation/mango-v4?branch=dev#7a8f31c6118b0577aa6375af4643e41efe85e057"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anchor-syn",
|
"anchor-syn",
|
||||||
"proc-macro2 1.0.47",
|
"proc-macro2 1.0.47",
|
||||||
|
@ -141,7 +141,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "anchor-attribute-error"
|
name = "anchor-attribute-error"
|
||||||
version = "0.25.0"
|
version = "0.25.0"
|
||||||
source = "git+ssh://git@github.com/blockworks-foundation/mango-v4?branch=dev#0ed7175341c39b944aa298a7e2a0207ba36c6cbe"
|
source = "git+https://github.com/blockworks-foundation/mango-v4?branch=dev#7a8f31c6118b0577aa6375af4643e41efe85e057"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anchor-syn",
|
"anchor-syn",
|
||||||
"proc-macro2 1.0.47",
|
"proc-macro2 1.0.47",
|
||||||
|
@ -152,7 +152,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "anchor-attribute-event"
|
name = "anchor-attribute-event"
|
||||||
version = "0.25.0"
|
version = "0.25.0"
|
||||||
source = "git+ssh://git@github.com/blockworks-foundation/mango-v4?branch=dev#0ed7175341c39b944aa298a7e2a0207ba36c6cbe"
|
source = "git+https://github.com/blockworks-foundation/mango-v4?branch=dev#7a8f31c6118b0577aa6375af4643e41efe85e057"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anchor-syn",
|
"anchor-syn",
|
||||||
"anyhow",
|
"anyhow",
|
||||||
|
@ -164,7 +164,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "anchor-attribute-interface"
|
name = "anchor-attribute-interface"
|
||||||
version = "0.25.0"
|
version = "0.25.0"
|
||||||
source = "git+ssh://git@github.com/blockworks-foundation/mango-v4?branch=dev#0ed7175341c39b944aa298a7e2a0207ba36c6cbe"
|
source = "git+https://github.com/blockworks-foundation/mango-v4?branch=dev#7a8f31c6118b0577aa6375af4643e41efe85e057"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anchor-syn",
|
"anchor-syn",
|
||||||
"anyhow",
|
"anyhow",
|
||||||
|
@ -177,7 +177,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "anchor-attribute-program"
|
name = "anchor-attribute-program"
|
||||||
version = "0.25.0"
|
version = "0.25.0"
|
||||||
source = "git+ssh://git@github.com/blockworks-foundation/mango-v4?branch=dev#0ed7175341c39b944aa298a7e2a0207ba36c6cbe"
|
source = "git+https://github.com/blockworks-foundation/mango-v4?branch=dev#7a8f31c6118b0577aa6375af4643e41efe85e057"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anchor-syn",
|
"anchor-syn",
|
||||||
"anyhow",
|
"anyhow",
|
||||||
|
@ -189,7 +189,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "anchor-attribute-state"
|
name = "anchor-attribute-state"
|
||||||
version = "0.25.0"
|
version = "0.25.0"
|
||||||
source = "git+ssh://git@github.com/blockworks-foundation/mango-v4?branch=dev#0ed7175341c39b944aa298a7e2a0207ba36c6cbe"
|
source = "git+https://github.com/blockworks-foundation/mango-v4?branch=dev#7a8f31c6118b0577aa6375af4643e41efe85e057"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anchor-syn",
|
"anchor-syn",
|
||||||
"anyhow",
|
"anyhow",
|
||||||
|
@ -201,7 +201,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "anchor-client"
|
name = "anchor-client"
|
||||||
version = "0.25.0"
|
version = "0.25.0"
|
||||||
source = "git+ssh://git@github.com/blockworks-foundation/mango-v4?branch=dev#0ed7175341c39b944aa298a7e2a0207ba36c6cbe"
|
source = "git+https://github.com/blockworks-foundation/mango-v4?branch=dev#7a8f31c6118b0577aa6375af4643e41efe85e057"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anchor-lang",
|
"anchor-lang",
|
||||||
"anyhow",
|
"anyhow",
|
||||||
|
@ -217,7 +217,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "anchor-derive-accounts"
|
name = "anchor-derive-accounts"
|
||||||
version = "0.25.0"
|
version = "0.25.0"
|
||||||
source = "git+ssh://git@github.com/blockworks-foundation/mango-v4?branch=dev#0ed7175341c39b944aa298a7e2a0207ba36c6cbe"
|
source = "git+https://github.com/blockworks-foundation/mango-v4?branch=dev#7a8f31c6118b0577aa6375af4643e41efe85e057"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anchor-syn",
|
"anchor-syn",
|
||||||
"anyhow",
|
"anyhow",
|
||||||
|
@ -229,7 +229,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "anchor-lang"
|
name = "anchor-lang"
|
||||||
version = "0.25.0"
|
version = "0.25.0"
|
||||||
source = "git+ssh://git@github.com/blockworks-foundation/mango-v4?branch=dev#0ed7175341c39b944aa298a7e2a0207ba36c6cbe"
|
source = "git+https://github.com/blockworks-foundation/mango-v4?branch=dev#7a8f31c6118b0577aa6375af4643e41efe85e057"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anchor-attribute-access-control",
|
"anchor-attribute-access-control",
|
||||||
"anchor-attribute-account",
|
"anchor-attribute-account",
|
||||||
|
@ -252,7 +252,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "anchor-spl"
|
name = "anchor-spl"
|
||||||
version = "0.25.0"
|
version = "0.25.0"
|
||||||
source = "git+ssh://git@github.com/blockworks-foundation/mango-v4?branch=dev#0ed7175341c39b944aa298a7e2a0207ba36c6cbe"
|
source = "git+https://github.com/blockworks-foundation/mango-v4?branch=dev#7a8f31c6118b0577aa6375af4643e41efe85e057"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anchor-lang",
|
"anchor-lang",
|
||||||
"solana-program",
|
"solana-program",
|
||||||
|
@ -263,7 +263,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "anchor-syn"
|
name = "anchor-syn"
|
||||||
version = "0.25.0"
|
version = "0.25.0"
|
||||||
source = "git+ssh://git@github.com/blockworks-foundation/mango-v4?branch=dev#0ed7175341c39b944aa298a7e2a0207ba36c6cbe"
|
source = "git+https://github.com/blockworks-foundation/mango-v4?branch=dev#7a8f31c6118b0577aa6375af4643e41efe85e057"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"bs58 0.3.1",
|
"bs58 0.3.1",
|
||||||
|
@ -966,7 +966,7 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "checked_math"
|
name = "checked_math"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+ssh://git@github.com/blockworks-foundation/mango-v4?branch=dev#0ed7175341c39b944aa298a7e2a0207ba36c6cbe"
|
source = "git+https://github.com/blockworks-foundation/mango-v4?branch=dev#7a8f31c6118b0577aa6375af4643e41efe85e057"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"proc-macro-error",
|
"proc-macro-error",
|
||||||
"proc-macro2 1.0.47",
|
"proc-macro2 1.0.47",
|
||||||
|
@ -1072,16 +1072,18 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "client"
|
name = "client"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+ssh://git@github.com/blockworks-foundation/mango-v4?branch=dev#0ed7175341c39b944aa298a7e2a0207ba36c6cbe"
|
source = "git+https://github.com/blockworks-foundation/mango-v4?branch=dev#7a8f31c6118b0577aa6375af4643e41efe85e057"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anchor-client",
|
"anchor-client",
|
||||||
"anchor-lang",
|
"anchor-lang",
|
||||||
"anchor-spl",
|
"anchor-spl",
|
||||||
"anyhow",
|
"anyhow",
|
||||||
|
"async-trait",
|
||||||
"base64 0.13.1",
|
"base64 0.13.1",
|
||||||
"bincode",
|
"bincode",
|
||||||
"fixed",
|
"fixed",
|
||||||
"fixed-macro",
|
"fixed-macro",
|
||||||
|
"futures 0.3.25",
|
||||||
"itertools 0.10.5",
|
"itertools 0.10.5",
|
||||||
"log 0.4.17",
|
"log 0.4.17",
|
||||||
"mango-v4",
|
"mango-v4",
|
||||||
|
@ -1092,6 +1094,7 @@ dependencies = [
|
||||||
"serum_dex 0.5.6",
|
"serum_dex 0.5.6",
|
||||||
"shellexpand",
|
"shellexpand",
|
||||||
"solana-account-decoder",
|
"solana-account-decoder",
|
||||||
|
"solana-address-lookup-table-program",
|
||||||
"solana-client",
|
"solana-client",
|
||||||
"solana-sdk",
|
"solana-sdk",
|
||||||
"spl-associated-token-account",
|
"spl-associated-token-account",
|
||||||
|
@ -3002,7 +3005,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "mango-v4"
|
name = "mango-v4"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
source = "git+ssh://git@github.com/blockworks-foundation/mango-v4?branch=dev#0ed7175341c39b944aa298a7e2a0207ba36c6cbe"
|
source = "git+https://github.com/blockworks-foundation/mango-v4?branch=dev#7a8f31c6118b0577aa6375af4643e41efe85e057"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anchor-lang",
|
"anchor-lang",
|
||||||
"anchor-spl",
|
"anchor-spl",
|
||||||
|
@ -5079,7 +5082,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serum_dex"
|
name = "serum_dex"
|
||||||
version = "0.5.10"
|
version = "0.5.10"
|
||||||
source = "git+ssh://git@github.com/jup-ag/openbook-program?branch=feat/expose-things#d287391bd7ed8111078fd1afb8f7b6d55cdd1d1f"
|
source = "git+https://github.com/jup-ag/openbook-program?branch=feat/expose-things#d287391bd7ed8111078fd1afb8f7b6d55cdd1d1f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anchor-lang",
|
"anchor-lang",
|
||||||
"arrayref",
|
"arrayref",
|
||||||
|
@ -5103,7 +5106,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "serum_dex"
|
name = "serum_dex"
|
||||||
version = "0.5.10"
|
version = "0.5.10"
|
||||||
source = "git+ssh://git@github.com/openbook-dex/program?branch=master#b7af74a7300227ba5375b8fe2ee24f8f098cbc46"
|
source = "git+https://github.com/openbook-dex/program?branch=master#546e5fe0f366ce7414424eaf5a481a917b8b5210"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anchor-lang",
|
"anchor-lang",
|
||||||
"arrayref",
|
"arrayref",
|
||||||
|
@ -5145,7 +5148,7 @@ dependencies = [
|
||||||
"serde",
|
"serde",
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"serum_dex 0.5.10 (git+ssh://git@github.com/jup-ag/openbook-program?branch=feat/expose-things)",
|
"serum_dex 0.5.10 (git+https://github.com/jup-ag/openbook-program?branch=feat/expose-things)",
|
||||||
"solana-geyser-connector-lib",
|
"solana-geyser-connector-lib",
|
||||||
"solana-logger",
|
"solana-logger",
|
||||||
"tokio",
|
"tokio",
|
||||||
|
@ -5163,17 +5166,17 @@ dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"async-channel",
|
"async-channel",
|
||||||
"async-trait",
|
"async-trait",
|
||||||
"bs58 0.3.1",
|
"bs58 0.4.0",
|
||||||
"bytemuck",
|
"bytemuck",
|
||||||
"client",
|
"client",
|
||||||
"futures-channel",
|
"futures-channel",
|
||||||
"futures-util",
|
"futures-util",
|
||||||
"log 0.3.9",
|
"log 0.4.17",
|
||||||
"mango-v4",
|
"mango-v4",
|
||||||
"serde",
|
"serde",
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"serum_dex 0.5.10 (git+ssh://git@github.com/openbook-dex/program?branch=master)",
|
"serum_dex 0.5.10 (git+https://github.com/openbook-dex/program?branch=master)",
|
||||||
"solana-geyser-connector-lib",
|
"solana-geyser-connector-lib",
|
||||||
"solana-logger",
|
"solana-logger",
|
||||||
"tokio",
|
"tokio",
|
||||||
|
@ -5752,7 +5755,7 @@ dependencies = [
|
||||||
"serde",
|
"serde",
|
||||||
"serde_derive",
|
"serde_derive",
|
||||||
"serde_json",
|
"serde_json",
|
||||||
"serum_dex 0.5.10 (git+ssh://git@github.com/jup-ag/openbook-program?branch=feat/expose-things)",
|
"serum_dex 0.5.10 (git+https://github.com/jup-ag/openbook-program?branch=feat/expose-things)",
|
||||||
"solana-account-decoder",
|
"solana-account-decoder",
|
||||||
"solana-client",
|
"solana-client",
|
||||||
"solana-rpc",
|
"solana-rpc",
|
||||||
|
@ -6738,7 +6741,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "switchboard-v2"
|
name = "switchboard-v2"
|
||||||
version = "0.1.17"
|
version = "0.1.17"
|
||||||
source = "git+ssh://git@github.com/blockworks-foundation/sbv2-solana?branch=mango-v4#97ed7b12de198f9dca2637af0ce8f5823cc3a0e3"
|
source = "git+https://github.com/blockworks-foundation/sbv2-solana?branch=mango-v4#97ed7b12de198f9dca2637af0ce8f5823cc3a0e3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anchor-lang",
|
"anchor-lang",
|
||||||
"anchor-spl",
|
"anchor-spl",
|
||||||
|
|
|
@ -11,7 +11,7 @@ members = [
|
||||||
# for gzip encoded responses
|
# for gzip encoded responses
|
||||||
jsonrpc-core-client = { git = "https://github.com/ckamm/jsonrpc.git", branch = "ckamm/http-with-gzip" }
|
jsonrpc-core-client = { git = "https://github.com/ckamm/jsonrpc.git", branch = "ckamm/http-with-gzip" }
|
||||||
# force usage of mango-v4 submodules with 1.14.9 support
|
# force usage of mango-v4 submodules with 1.14.9 support
|
||||||
anchor-spl = { git = "ssh://git@github.com/blockworks-foundation/mango-v4", branch = "dev" }
|
anchor-spl = { git = "https://github.com/blockworks-foundation/mango-v4", branch = "dev" }
|
||||||
anchor-lang = { git = "ssh://git@github.com/blockworks-foundation/mango-v4", branch = "dev" }
|
anchor-lang = { git = "https://github.com/blockworks-foundation/mango-v4", branch = "dev" }
|
||||||
anchor-client = { git = "ssh://git@github.com/blockworks-foundation/mango-v4", branch = "dev" }
|
anchor-client = { git = "https://github.com/blockworks-foundation/mango-v4", branch = "dev" }
|
||||||
switchboard-v2 = { git = "ssh://git@github.com/blockworks-foundation/sbv2-solana", branch = "mango-v4" }
|
switchboard-v2 = { git = "https://github.com/blockworks-foundation/sbv2-solana", branch = "mango-v4" }
|
||||||
|
|
|
@ -16,7 +16,7 @@ solana-client = "~1.14.9"
|
||||||
solana-account-decoder = "~1.14.9"
|
solana-account-decoder = "~1.14.9"
|
||||||
solana-sdk = "~1.14.9"
|
solana-sdk = "~1.14.9"
|
||||||
|
|
||||||
mango-v4 = { git = "ssh://git@github.com/blockworks-foundation/mango-v4", branch = "dev" }
|
mango-v4 = { git = "https://github.com/blockworks-foundation/mango-v4", branch = "dev" }
|
||||||
arrayref = "*"
|
arrayref = "*"
|
||||||
bytemuck = "*"
|
bytemuck = "*"
|
||||||
fixed = { version = "*", features = ["serde"] }
|
fixed = { version = "*", features = ["serde"] }
|
||||||
|
@ -58,7 +58,7 @@ warp = "0.3"
|
||||||
|
|
||||||
anchor-lang = "0.25.0"
|
anchor-lang = "0.25.0"
|
||||||
|
|
||||||
serum_dex = { git = "ssh://git@github.com/jup-ag/openbook-program", branch = "feat/expose-things" }
|
serum_dex = { git = "https://github.com/jup-ag/openbook-program", branch = "feat/expose-things" }
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
tonic-build = { version = "0.6", features = ["compression"] }
|
tonic-build = { version = "0.6", features = ["compression"] }
|
||||||
|
|
|
@ -24,8 +24,8 @@ tokio = { version = "1", features = ["full"] }
|
||||||
tokio-tungstenite = "0.17"
|
tokio-tungstenite = "0.17"
|
||||||
bytemuck = "1.7.2"
|
bytemuck = "1.7.2"
|
||||||
|
|
||||||
mango-v4 = { git = "ssh://git@github.com/blockworks-foundation/mango-v4", branch = "dev" }
|
mango-v4 = { git = "https://github.com/blockworks-foundation/mango-v4", branch = "dev" }
|
||||||
client = { git = "ssh://git@github.com/blockworks-foundation/mango-v4", branch = "dev" }
|
client = { git = "https://github.com/blockworks-foundation/mango-v4", branch = "dev" }
|
||||||
serum_dex = { git = "ssh://git@github.com/jup-ag/openbook-program", branch = "feat/expose-things" }
|
serum_dex = { git = "https://github.com/jup-ag/openbook-program", branch = "feat/expose-things" }
|
||||||
anchor-lang = "0.25.0"
|
anchor-lang = "0.25.0"
|
||||||
anchor-client = "0.25.0"
|
anchor-client = "0.25.0"
|
||||||
|
|
|
@ -24,8 +24,8 @@ tokio = { version = "1", features = ["full"] }
|
||||||
tokio-tungstenite = "0.17"
|
tokio-tungstenite = "0.17"
|
||||||
bytemuck = "1.7.2"
|
bytemuck = "1.7.2"
|
||||||
|
|
||||||
mango-v4 = { git = "ssh://git@github.com/blockworks-foundation/mango-v4", branch = "dev" }
|
mango-v4 = { git = "https://github.com/blockworks-foundation/mango-v4", branch = "dev" }
|
||||||
client = { git = "ssh://git@github.com/blockworks-foundation/mango-v4", branch = "dev" }
|
client = { git = "https://github.com/blockworks-foundation/mango-v4", branch = "dev" }
|
||||||
serum_dex = { git = "ssh://git@github.com/openbook-dex/program", branch = "master" }
|
serum_dex = { git = "https://github.com/openbook-dex/program", branch = "master" }
|
||||||
anchor-lang = "0.25.0"
|
anchor-lang = "0.25.0"
|
||||||
anchor-client = "0.25.0"
|
anchor-client = "0.25.0"
|
||||||
|
|
|
@ -21,7 +21,7 @@ tokio = { version = "1", features = ["full"] }
|
||||||
|
|
||||||
serde = "1.0.130"
|
serde = "1.0.130"
|
||||||
serde_derive = "1.0.130"
|
serde_derive = "1.0.130"
|
||||||
mango-v4 = { git = "ssh://git@github.com/blockworks-foundation/mango-v4", branch = "dev" }
|
mango-v4 = { git = "https://github.com/blockworks-foundation/mango-v4", branch = "dev" }
|
||||||
client = { git = "ssh://git@github.com/blockworks-foundation/mango-v4", branch = "dev" }
|
client = { git = "https://github.com/blockworks-foundation/mango-v4", branch = "dev" }
|
||||||
anchor-lang = "0.25.0"
|
anchor-lang = "0.25.0"
|
||||||
anchor-client = "0.25.0"
|
anchor-client = "0.25.0"
|
||||||
|
|
|
@ -45,12 +45,12 @@ pub struct Config {
|
||||||
|
|
||||||
type PnlData = Vec<(Pubkey, Vec<(PerpMarketIndex, I80F48)>)>;
|
type PnlData = Vec<(Pubkey, Vec<(PerpMarketIndex, I80F48)>)>;
|
||||||
|
|
||||||
fn compute_pnl(
|
async fn compute_pnl(
|
||||||
context: Arc<MangoGroupContext>,
|
context: Arc<MangoGroupContext>,
|
||||||
account_fetcher: Arc<impl AccountFetcher>,
|
account_fetcher: Arc<impl AccountFetcher>,
|
||||||
account: &MangoAccountValue,
|
account: &MangoAccountValue,
|
||||||
) -> anyhow::Result<Vec<(PerpMarketIndex, I80F48)>> {
|
) -> anyhow::Result<Vec<(PerpMarketIndex, I80F48)>> {
|
||||||
let health_cache = health_cache::new(&context, account_fetcher.as_ref(), account)?;
|
let health_cache = health_cache::new(&context, account_fetcher.as_ref(), account).await?;
|
||||||
let perp_settle_health = health_cache.perp_settle_health();
|
let perp_settle_health = health_cache.perp_settle_health();
|
||||||
|
|
||||||
let pnls = account
|
let pnls = account
|
||||||
|
@ -119,7 +119,7 @@ fn start_pnl_updater(
|
||||||
}
|
}
|
||||||
|
|
||||||
let pnl_vals =
|
let pnl_vals =
|
||||||
compute_pnl(context.clone(), account_fetcher.clone(), &mango_account).unwrap();
|
compute_pnl(context.clone(), account_fetcher.clone(), &mango_account.clone()).await.unwrap();
|
||||||
|
|
||||||
// Alternatively, we could prepare the sorted and limited lists for each
|
// Alternatively, we could prepare the sorted and limited lists for each
|
||||||
// market here. That would be faster and cause less contention on the pnl_data
|
// market here. That would be faster and cause less contention on the pnl_data
|
||||||
|
@ -248,14 +248,13 @@ async fn main() -> anyhow::Result<()> {
|
||||||
Some(rpc_timeout),
|
Some(rpc_timeout),
|
||||||
);
|
);
|
||||||
let group_context = Arc::new(MangoGroupContext::new_from_rpc(
|
let group_context = Arc::new(MangoGroupContext::new_from_rpc(
|
||||||
|
&client.rpc_async(),
|
||||||
Pubkey::from_str(&config.pnl.mango_group).unwrap(),
|
Pubkey::from_str(&config.pnl.mango_group).unwrap(),
|
||||||
client.cluster.clone(),
|
).await?);
|
||||||
client.commitment,
|
|
||||||
)?);
|
|
||||||
let chain_data = Arc::new(RwLock::new(chain_data::ChainData::new()));
|
let chain_data = Arc::new(RwLock::new(chain_data::ChainData::new()));
|
||||||
let account_fetcher = Arc::new(chain_data::AccountFetcher {
|
let account_fetcher = Arc::new(chain_data::AccountFetcher {
|
||||||
chain_data: chain_data.clone(),
|
chain_data: chain_data.clone(),
|
||||||
rpc: client.rpc(),
|
rpc: client.rpc_async(),
|
||||||
});
|
});
|
||||||
|
|
||||||
let metrics_tx = metrics::start(config.metrics, "pnl".into());
|
let metrics_tx = metrics::start(config.metrics, "pnl".into());
|
||||||
|
|
Loading…
Reference in New Issue