Problem
deposit_handler::load_market_props panics with Error::DepositNotFound when market keys are absent from data_store. This helper is called from create_deposit BEFORE any deposit exists — so a caller passing an unregistered/malformed market address gets DepositNotFound, which semantically means "no such deposit" (and is reused elsewhere for exactly that meaning). withdrawal_handler's equivalent correctly uses InvalidMarket for the same condition.
Why it matters
Any client, indexer, or wallet that branches on the handler's typed error code to distinguish "this deposit id doesn't exist" from "you passed a bad/unconfigured market" will misclassify the latter as the former when creating a deposit, producing a confusing error-handling path.
Suggested fix
Give deposit_handler its own InvalidMarket error variant (as withdrawal_handler already has) and use it in load_market_props, reserving DepositNotFound for lookups of an existing deposit key.
Problem
deposit_handler::load_market_props panics with Error::DepositNotFound when market keys are absent from data_store. This helper is called from create_deposit BEFORE any deposit exists — so a caller passing an unregistered/malformed market address gets DepositNotFound, which semantically means "no such deposit" (and is reused elsewhere for exactly that meaning). withdrawal_handler's equivalent correctly uses InvalidMarket for the same condition.
Why it matters
Any client, indexer, or wallet that branches on the handler's typed error code to distinguish "this deposit id doesn't exist" from "you passed a bad/unconfigured market" will misclassify the latter as the former when creating a deposit, producing a confusing error-handling path.
Suggested fix
Give deposit_handler its own InvalidMarket error variant (as withdrawal_handler already has) and use it in load_market_props, reserving DepositNotFound for lookups of an existing deposit key.