drift-labs / gateway

Self hosted API gateway to easily interact with Drift V2 Protocol
Apache License 2.0
22 stars 12 forks source link

Panic calling /getPositionInfo and BAL #56

Closed wildbunny closed 5 months ago

wildbunny commented 5 months ago

Division by zero
stack backtrace:
   0: std::panicking::begin_panic_handler
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library\std\src\panicking.rs:645
   1: core::panicking::panic_fmt
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library\core\src\panicking.rs:72
   2: rust_decimal::arithmetic_impls::impl$8::div
             at C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\rust_decimal-1.35.0\src\arithmetic_impls.rs:219
   3: rust_decimal::arithmetic_impls::impl$15::div
             at C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\rust_decimal-1.35.0\src\arithmetic_impls.rs:147
   4: drift_gateway::types::impl$3::from
             at c:\temp\gateway-master\src\types.rs:156
   5: core::convert::impl$3::into<drift::state::user::PerpPosition,drift_gateway::types::PerpPosition>
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce\library\core\src\convert\mod.rs:757
   6: drift_gateway::controller::impl$0::get_position_extended::async_fn$0
             at c:\temp\gateway-master\src\controller.rs:274
   7: drift_gateway::impl$9::register::get_positions_extended::async_fn$0
             at c:\temp\gateway-master\src\main.rs:156
   8: actix_web::handler::handler_service::closure$0::async_block$0<enum2$<drift_gateway::impl$9::register::get_positions_extended::async_fn_env$0> (*)(actix_web::data::Data<drift_gateway::controller::AppState>,actix_web::types::path::Path<u16>,actix_web::types
             at C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\actix-web-4.5.1\src\handler.rs:113
   9: core::future::future::impl$1::poll<alloc::boxed::Box<dyn$<core::future::future::Future<assoc$<Output,enum2$<core::result::Result<actix_web::service::ServiceResponse<actix_http::body::boxed::BoxBody>,actix_web::error::error::Error> > > > >,alloc::alloc::Gl
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce\library\core\src\future\future.rs:124
  10: actix_web::resource::impl$3::register::closure$0::async_block$0<actix_web::resource::ResourceEndpoint,actix_http::body::boxed::BoxBody>
             at C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\actix-web-4.5.1\src\resource.rs:452
  11: core::future::future::impl$1::poll<alloc::boxed::Box<dyn$<core::future::future::Future<assoc$<Output,enum2$<core::result::Result<actix_web::service::ServiceResponse<actix_http::body::boxed::BoxBody>,actix_web::error::error::Error> > > > >,alloc::alloc::Gl
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce\library\core\src\future\future.rs:124
  12: actix_web::scope::impl$2::register::closure$3::async_block$0<actix_web::scope::ScopeEndpoint,actix_http::body::boxed::BoxBody>
             at C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\actix-web-4.5.1\src\scope.rs:430
  13: core::future::future::impl$1::poll<alloc::boxed::Box<dyn$<core::future::future::Future<assoc$<Output,enum2$<core::result::Result<actix_web::service::ServiceResponse<actix_http::body::boxed::BoxBody>,actix_web::error::error::Error> > > > >,alloc::alloc::Gl
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce\library\core\src\future\future.rs:124
  14: actix_web::middleware::logger::impl$4::poll<actix_web::app_service::AppRouting,actix_http::body::boxed::BoxBody>
             at C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\actix-web-4.5.1\src\middleware\logger.rs:357
  15: actix_service::map_err::impl$4::poll<actix_web::app_service::AppInitService<actix_web::middleware::logger::LoggerMiddleware<actix_web::app_service::AppRouting>,actix_web::middleware::logger::StreamLog<actix_http::body::boxed::BoxBody> >,actix_http::reques
             at C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\actix-service-2.0.2\src\map_err.rs:99
  16: actix_http::h1::dispatcher::InnerDispatcher<tokio::net::tcp::stream::TcpStream,actix_service::map_err::MapErr<actix_web::app_service::AppInitService<actix_web::middleware::logger::LoggerMiddleware<actix_web::app_service::AppRouting>,actix_web::middleware:
             at C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\actix-http-3.6.0\src\h1\dispatcher.rs:466
  17: actix_http::h1::dispatcher::impl$4::poll<tokio::net::tcp::stream::TcpStream,actix_service::map_err::MapErr<actix_web::app_service::AppInitService<actix_web::middleware::logger::LoggerMiddleware<actix_web::app_service::AppRouting>,actix_web::middleware::lo
             at C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\actix-http-3.6.0\src\h1\dispatcher.rs:1125
  18: actix_http::service::impl$8::poll<tokio::net::tcp::stream::TcpStream,actix_service::map_err::MapErr<actix_web::app_service::AppInitService<actix_web::middleware::logger::LoggerMiddleware<actix_web::app_service::AppRouting>,actix_web::middleware::logger::S
             at C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\actix-http-3.6.0\src\service.rs:966
  19: actix_service::and_then::impl$3::poll<actix_service::fn_service::FnService<actix_http::service::impl$3::tcp::closure_env$0<actix_service::map_config::MapConfig<actix_service::map_err::MapErrServiceFactory<actix_web::app_service::AppInit<actix_service::tra
             at C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\actix-service-2.0.2\src\and_then.rs:114
  20: actix_server::service::impl$1::call::async_block$0<actix_service::and_then::AndThenService<actix_service::fn_service::FnService<actix_http::service::impl$3::tcp::closure_env$0<actix_service::map_config::MapConfig<actix_service::map_err::MapErrServiceFacto
             at C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\actix-server-2.3.0\src\service.rs:75
  21: tokio::runtime::task::core::impl$6::poll::closure$0<enum2$<actix_server::service::impl$1::call::async_block_env$0<actix_service::and_then::AndThenService<actix_service::fn_service::FnService<actix_http::service::impl$3::tcp::closure_env$0<actix_service::m
             at C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.37.0\src\runtime\task\core.rs:328
  22: tokio::loom::std::unsafe_cell::UnsafeCell<enum2$<tokio::runtime::task::core::Stage<enum2$<actix_server::service::impl$1::call::async_block_env$0<actix_service::and_then::AndThenService<actix_service::fn_service::FnService<actix_http::service::impl$3::tcp:
             at C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.37.0\src\loom\std\unsafe_cell.rs:16
  23: tokio::runtime::task::core::Core<enum2$<actix_server::service::impl$1::call::async_block_env$0<actix_service::and_then::AndThenService<actix_service::fn_service::FnService<actix_http::service::impl$3::tcp::closure_env$0<actix_service::map_config::MapConfi
             at C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.37.0\src\runtime\task\core.rs:317
  24: tokio::runtime::task::harness::poll_future::closure$0<enum2$<actix_server::service::impl$1::call::async_block_env$0<actix_service::and_then::AndThenService<actix_service::fn_service::FnService<actix_http::service::impl$3::tcp::closure_env$0<actix_service:
             at C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.37.0\src\runtime\task\harness.rs:485
  25: core::panic::unwind_safe::impl$23::call_once<enum2$<core::task::poll::Poll<tuple$<> > >,tokio::runtime::task::harness::poll_future::closure_env$0<enum2$<actix_server::service::impl$1::call::async_block_env$0<actix_service::and_then::AndThenService<actix_s
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce\library\core\src\panic\unwind_safe.rs:272
  26: std::panicking::try::do_call<core::panic::unwind_safe::AssertUnwindSafe<tokio::runtime::task::harness::poll_future::closure_env$0<enum2$<actix_server::service::impl$1::call::async_block_env$0<actix_service::and_then::AndThenService<actix_service::fn_servi
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce\library\std\src\panicking.rs:552
  27: std::panicking::try::do_catch<core::panic::unwind_safe::AssertUnwindSafe<tokio::runtime::task::harness::poll_future::closure_env$0<core::pin::Pin<alloc::boxed::Box<enum2$<drift_sdk::async_utils::spawn_retry_task::async_block_env$0<enum2$<drift_sdk::event_
  28: std::panicking::try<enum2$<core::task::poll::Poll<tuple$<> > >,core::panic::unwind_safe::AssertUnwindSafe<tokio::runtime::task::harness::poll_future::closure_env$0<enum2$<actix_server::service::impl$1::call::async_block_env$0<actix_service::and_then::AndT
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce\library\std\src\panicking.rs:516
  29: std::panic::catch_unwind<core::panic::unwind_safe::AssertUnwindSafe<tokio::runtime::task::harness::poll_future::closure_env$0<enum2$<actix_server::service::impl$1::call::async_block_env$0<actix_service::and_then::AndThenService<actix_service::fn_service::
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce\library\std\src\panic.rs:142
  30: tokio::runtime::task::harness::poll_future<enum2$<actix_server::service::impl$1::call::async_block_env$0<actix_service::and_then::AndThenService<actix_service::fn_service::FnService<actix_http::service::impl$3::tcp::closure_env$0<actix_service::map_config
             at C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.37.0\src\runtime\task\harness.rs:473
  31: tokio::runtime::task::harness::Harness<enum2$<actix_server::service::impl$1::call::async_block_env$0<actix_service::and_then::AndThenService<actix_service::fn_service::FnService<actix_http::service::impl$3::tcp::closure_env$0<actix_service::map_config::Ma
             at C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.37.0\src\runtime\task\harness.rs:208
  32: tokio::runtime::task::harness::Harness<enum2$<actix_server::service::impl$1::call::async_block_env$0<actix_service::and_then::AndThenService<actix_service::fn_service::FnService<actix_http::service::impl$3::tcp::closure_env$0<actix_service::map_config::Ma
             at C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.37.0\src\runtime\task\harness.rs:153
  33: tokio::runtime::task::raw::poll<enum2$<actix_server::service::impl$1::call::async_block_env$0<actix_service::and_then::AndThenService<actix_service::fn_service::FnService<actix_http::service::impl$3::tcp::closure_env$0<actix_service::map_config::MapConfig
             at C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.37.0\src\runtime\task\raw.rs:271
  34: tokio::runtime::task::raw::RawTask::poll
             at C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.37.0\src\runtime\task\raw.rs:201
  35: tokio::runtime::task::LocalNotified<alloc::sync::Arc<tokio::task::local::Shared,alloc::alloc::Global> >::run<alloc::sync::Arc<tokio::task::local::Shared,alloc::alloc::Global> >
             at C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.37.0\src\runtime\task\mod.rs:427
  36: tokio::task::local::impl$4::tick::closure$0
             at C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.37.0\src\task\local.rs:676
  37: tokio::runtime::coop::with_budget
             at C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.37.0\src\runtime\coop.rs:107
  38: tokio::runtime::coop::budget
             at C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.37.0\src\runtime\coop.rs:73
  39: tokio::task::local::LocalSet::tick
             at C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.37.0\src\task\local.rs:676
  40: tokio::task::local::impl$10::poll::closure$0<actix_rt::arbiter::ArbiterRunner>
             at C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.37.0\src\task\local.rs:982
  41: tokio::task::local::impl$4::with::closure$0<enum2$<core::task::poll::Poll<tuple$<> > >,tokio::task::local::impl$10::poll::closure_env$0<actix_rt::arbiter::ArbiterRunner> >
             at C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.37.0\src\task\local.rs:730
  42: std::thread::local::LocalKey<tokio::task::local::LocalData>::try_with<tokio::task::local::LocalData,tokio::task::local::impl$4::with::closure_env$0<enum2$<core::task::poll::Poll<tuple$<> > >,tokio::task::local::impl$10::poll::closure_env$0<actix_rt::arbit
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce\library\std\src\thread\local.rs:270
  43: std::thread::local::LocalKey<tokio::task::local::LocalData>::with<tokio::task::local::LocalData,tokio::task::local::impl$4::with::closure_env$0<enum2$<core::task::poll::Poll<tuple$<> > >,tokio::task::local::impl$10::poll::closure_env$0<actix_rt::arbiter::
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce\library\std\src\thread\local.rs:246
  44: tokio::task::local::LocalSet::with<enum2$<core::task::poll::Poll<tuple$<> > >,tokio::task::local::impl$10::poll::closure_env$0<actix_rt::arbiter::ArbiterRunner> >
             at C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.37.0\src\task\local.rs:728
  45: tokio::task::local::impl$10::poll<actix_rt::arbiter::ArbiterRunner>
             at C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.37.0\src\task\local.rs:968
  46: tokio::task::local::impl$4::run_until::async_fn$0<actix_rt::arbiter::ArbiterRunner>
             at C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.37.0\src\task\local.rs:635
  47: core::future::future::impl$1::poll<ref_mut$<enum2$<tokio::task::local::impl$4::run_until::async_fn_env$0<actix_rt::arbiter::ArbiterRunner> > > >
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce\library\core\src\future\future.rs:124
  48: tokio::runtime::scheduler::current_thread::impl$8::block_on::closure$0::closure$0::closure$0<core::pin::Pin<ref_mut$<enum2$<tokio::task::local::impl$4::run_until::async_fn_env$0<actix_rt::arbiter::ArbiterRunner> > > > >
             at C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.37.0\src\runtime\scheduler\current_thread\mod.rs:659
  49: tokio::runtime::coop::with_budget
             at C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.37.0\src\runtime\coop.rs:107
  50: tokio::runtime::coop::budget
             at C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.37.0\src\runtime\coop.rs:73
  51: tokio::runtime::scheduler::current_thread::impl$8::block_on::closure$0::closure$0<core::pin::Pin<ref_mut$<enum2$<tokio::task::local::impl$4::run_until::async_fn_env$0<actix_rt::arbiter::ArbiterRunner> > > > >
             at C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.37.0\src\runtime\scheduler\current_thread\mod.rs:659
  52: tokio::runtime::scheduler::current_thread::Context::enter<enum2$<core::task::poll::Poll<tuple$<> > >,tokio::runtime::scheduler::current_thread::impl$8::block_on::closure$0::closure_env$0<core::pin::Pin<ref_mut$<enum2$<tokio::task::local::impl$4::run_until
             at C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.37.0\src\runtime\scheduler\current_thread\mod.rs:404
  53: tokio::runtime::scheduler::current_thread::impl$8::block_on::closure$0<core::pin::Pin<ref_mut$<enum2$<tokio::task::local::impl$4::run_until::async_fn_env$0<actix_rt::arbiter::ArbiterRunner> > > > >
             at C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.37.0\src\runtime\scheduler\current_thread\mod.rs:658
  54: tokio::runtime::scheduler::current_thread::impl$8::enter::closure$0<tokio::runtime::scheduler::current_thread::impl$8::block_on::closure_env$0<core::pin::Pin<ref_mut$<enum2$<tokio::task::local::impl$4::run_until::async_fn_env$0<actix_rt::arbiter::ArbiterR
             at C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.37.0\src\runtime\scheduler\current_thread\mod.rs:737
  55: tokio::runtime::context::scoped::Scoped<enum2$<tokio::runtime::scheduler::Context> >::set<enum2$<tokio::runtime::scheduler::Context>,tokio::runtime::scheduler::current_thread::impl$8::enter::closure_env$0<tokio::runtime::scheduler::current_thread::impl$8:
             at C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.37.0\src\runtime\context\scoped.rs:40
  56: tokio::runtime::context::set_scheduler::closure$0<tuple$<alloc::boxed::Box<tokio::runtime::scheduler::current_thread::Core,alloc::alloc::Global>,enum2$<core::option::Option<tuple$<> > > >,tokio::runtime::scheduler::current_thread::impl$8::enter::closure_e
             at C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.37.0\src\runtime\context.rs:176
  57: std::thread::local::LocalKey<tokio::runtime::context::Context>::try_with<tokio::runtime::context::Context,tokio::runtime::context::set_scheduler::closure_env$0<tuple$<alloc::boxed::Box<tokio::runtime::scheduler::current_thread::Core,alloc::alloc::Global>,
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce\library\std\src\thread\local.rs:270
  58: std::thread::local::LocalKey<tokio::runtime::context::Context>::with<tokio::runtime::context::Context,tokio::runtime::context::set_scheduler::closure_env$0<tuple$<alloc::boxed::Box<tokio::runtime::scheduler::current_thread::Core,alloc::alloc::Global>,enum
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce\library\std\src\thread\local.rs:246
  59: tokio::runtime::context::set_scheduler<tuple$<alloc::boxed::Box<tokio::runtime::scheduler::current_thread::Core,alloc::alloc::Global>,enum2$<core::option::Option<tuple$<> > > >,tokio::runtime::scheduler::current_thread::impl$8::enter::closure_env$0<tokio:
             at C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.37.0\src\runtime\context.rs:176
  60: tokio::runtime::scheduler::current_thread::CoreGuard::enter<tokio::runtime::scheduler::current_thread::impl$8::block_on::closure_env$0<core::pin::Pin<ref_mut$<enum2$<tokio::task::local::impl$4::run_until::async_fn_env$0<actix_rt::arbiter::ArbiterRunner> >
             at C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.37.0\src\runtime\scheduler\current_thread\mod.rs:737
  61: tokio::runtime::scheduler::current_thread::CoreGuard::block_on<core::pin::Pin<ref_mut$<enum2$<tokio::task::local::impl$4::run_until::async_fn_env$0<actix_rt::arbiter::ArbiterRunner> > > > >
             at C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.37.0\src\runtime\scheduler\current_thread\mod.rs:646
  62: tokio::runtime::scheduler::current_thread::impl$0::block_on::closure$0<enum2$<tokio::task::local::impl$4::run_until::async_fn_env$0<actix_rt::arbiter::ArbiterRunner> > >
             at C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.37.0\src\runtime\scheduler\current_thread\mod.rs:175
  63: tokio::runtime::context::runtime::enter_runtime<tokio::runtime::scheduler::current_thread::impl$0::block_on::closure_env$0<enum2$<tokio::task::local::impl$4::run_until::async_fn_env$0<actix_rt::arbiter::ArbiterRunner> > >,tuple$<> >
             at C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.37.0\src\runtime\context\runtime.rs:65
  64: tokio::runtime::scheduler::current_thread::CurrentThread::block_on<enum2$<tokio::task::local::impl$4::run_until::async_fn_env$0<actix_rt::arbiter::ArbiterRunner> > >
             at C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.37.0\src\runtime\scheduler\current_thread\mod.rs:167
  65: tokio::runtime::runtime::Runtime::block_on<enum2$<tokio::task::local::impl$4::run_until::async_fn_env$0<actix_rt::arbiter::ArbiterRunner> > >
             at C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.37.0\src\runtime\runtime.rs:349
  66: tokio::task::local::LocalSet::block_on<actix_rt::arbiter::ArbiterRunner>
             at C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tokio-1.37.0\src\task\local.rs:592
  67: actix_rt::runtime::Runtime::block_on<actix_rt::arbiter::ArbiterRunner>
             at C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\actix-rt-2.9.0\src\runtime.rs:138
  68: actix_rt::arbiter::impl$2::with_tokio_rt::closure$0<actix_server::worker::impl$10::start::closure_env$1>
             at C:\Users\paul\.cargo\registry\src\index.crates.io-6f17d22bba15001f\actix-rt-2.9.0\src\arbiter.rs:143
  69: core::hint::black_box
             at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce\library\core\src\hint.rs:286```

I have a BAL only position and I guess we're dividing by zero because "remainder_base_asset_amount" isn't being taken into account?
jordy25519 commented 5 months ago

thanks for the report, please see latest commit it should resolve this.

wildbunny commented 5 months ago

Great, thanks. I can confirm no panic with new code.... But it's returning 0 amount/entry price for BAL positions?

jordy25519 commented 5 months ago

Great, thanks. I can confirm no panic with new code.... But it's returning 0 amount/entry price for BAL positions?

the avgEntryPrice and positionInfo endpoint is intended for perps positions only. there's some lack of information on program/smart contract side to track entry price for spot balances

wildbunny commented 5 months ago

What I mean is, if I have add liquidity to the drift AMM (BAL), it opens/closes perp positions continuously, but this endpoint doesn't reflect their amount/entryPrice