Nature of 4FGL J1838.2+3223: a flaring ‘spider’ pulsar candidate

An unidentified 𝛾 -ray source 4FGL J1838.2+3223 has been proposed as a pulsar candidate. We present optical time-series multi-band photometry of its likely optical companion obtained with the 2.1-m telescope of Observatorio Astronómico Nacional San Pedro Mártir, Mexico. The observations and the data from the Zwicky Transient Facility revealed the source brightness variability with a period of ≈ 4.02 h likely associated with the orbital motion of the binary system. The folded light curves have a single sine-like peak per period with an amplitude of about three magnitude accompanied by fast sporadic flares up to one magnitude level. We reproduce them modelling the companion heating by the pulsar. As a result, the companion side facing the pulsar is strongly heated up to 11300 ± 400 K, while the temperature of its back side is only 2300 ± 700 K. It has a mass of 0.10 ± 0.05 M ⊙ and underfills its Roche lobe with a filling factor of 0 . 60 + 0 . 10 − 0 . 06 . This implies that 4FGL J1838.2+3223 likely belongs to the ‘spider’ pulsar family. The estimated distance of ≈ 3.1 kpc is compatible with Gaia results. We detect a flare from the source in X-rays and ultraviolet using Swift archival data and another one in X-rays with the eROSITA all-sky survey. Both flares have X-ray luminosity of ∼ 10 34 erg s − 1 which is two orders of magnitude higher than the upper limit in quiescence obtained from eROSITA assuming spectral shape typical for spider pulsars. If the spider interpretation is correct, these flares are among the strongest flares observed from non-accreting spider pulsars.


INTRODUCTION
To date, the Fermi Gamma-ray Space Telescope has detected 144 millisecond pulsars (MSPs) (Smith et al. 2023).Among them, the subclass of so-called 'spider' pulsars is of particular interest (Roberts 2013).It includes black widows (BWs) and redbacks (RBs) which are compact binaries with orbital periods   < 1 d where one side of the companion star is heated by the pulsar wind.BWs have very low-mass ( c ≲ 0.05 M ⊙ ) semi-degenerate companions while RBs have nondegenerate and more massive ( c ≈ 0.1-1 M ⊙ ) companions.Some RBs show transitions between radio-pulsar and accreting modes (e.g.Archibald et al. 2009;Papitto et al. 2013;Bassa et al. 2014;Roy et al. 2015) confirming the low-mass X-ray binaries as progenitors of spider systems.However, details of formation and the evolutionary link between RBs and BWs are not clear and actively discussed (Chen et al. 2013;Benvenuto et al. 2014;Ablimit 2019;Guo et al. 2022).Studies of spider pulsars are also important for constraining the equation of state of the superdense matter inside neutron stars (NSs) since the most massive of them have been found in binary systems (e.g.Romani et al. 2022).
Detection of pulsations from RBs and BWs is a somewhat chal-★ E-mail: da.zyuzin@gmail.com(DAZ) lenging task since the pulsar emission is often eclipsed by material ablated from the companion star by the pulsar wind.However, even in the case of non-detection of pulsations, it is possible to identify such systems using optical and X-ray observations of unassociated -ray sources (e.g.Salvetti et al. 2017).In particular, optical studies allow one to clarify the spectral type of the companion star, its mass and irradiation efficiency by the pulsar, the distance to the system, the binary inclination, and the pulsar mass.Only about four dozen confirmed spiders and about one dozen of candidates had been detected in the optical so far (Strader et al. 2019;Miller et al. 2020;Swihart et al. 2020Swihart et al. , 2021Swihart et al. , 2022;;Au et al. 2023;Karpova et al. 2023;Yap et al. 2023).Parameters of many of them are poorly constrained due to the faintness of the objects.Thus, new identifications and studies of brighter companions are necessary for investigations of such systems.
Recently, Kerby et al. (2021) built a neural network classifier trained on samples of known pulsars and blazars and used it to classify the unidentified Fermi sources.Based on possible X-ray and optical counterparts found with the Swift X-ray Telescope (XRT) and UltraViolet Optical Telescope (UVOT), they identified 14 Fermi sources for which the probability of being a blazar was less than 1 per cent, thus making them likely pulsar candidates.4FGL J1838.2+3223(hereafter J1838) is one of these sources.According to the 4FGL- To clarify the nature of the presumed X-ray and optical counterpart of J1838, we performed multi-band optical observations and multiepoch analysis of archival X-ray and optical data.The data from catalogues are presented in Sec. 2. Optical observations and data reduction are described in Sec. 3 and the light curves modellingin Sec. 4. The description of the X-ray and ultraviolet (UV) data is presented in Sec. 5. We discuss and summarise the results in Sec. 6.

DATA FROM CATALOGUES
The likely X-ray counterpart of J1838 suggested by Kerby et al. (2021) is nominated in their work as SwXF4 J183817.0+322416.Using the Swift/XRT data products generator1 (Evans et al. 2009) we obtained its coordinates (see Table 1) and the 90 per cent position uncertainty of 4.4 arcsec.Within the uncertainty circle we found the presumed J1838 optical counterpart in the Panoramic Survey Telescope and Rapid Response System (Pan-STARRS, Flewelling  et al. 2020) with ID 146882795700574433, which can also be crossidentified in Gaia (Gaia Collaboration et al. 2016Collaboration et al. , 2021) ) and Zwicky Transient Facility (ZTF, Masci et al. 2019) archive data.Its parameters are presented in Table 1.In the Pan-STARRS catalogue its mean AB magnitudes are  = 20.7(1), = 20.46(6), = 20.43(5) and  = 20.5(1).These are apparently brighter than   = 21.3 reported by Kerby et al. (2021).However, based on individual Pan-STARRS detections the source shows variability at a level of 1-2 stellar magnitude.The ZTF data confirm the variability.
The 'geometric' distance  geom obtained with Gaia lies in the range 1-3.5 kpc, while the 'photogeometric' distance  pgeom is 8.7-12.4kpc.The proper motion  = 11.1 ± 1.4 mas yr −1 transforms to the transverse velocity of about 50-200 km s −1 for  geom and 500-700 km s −1 for  pgeom .The latter is much larger than expected from the velocity distribution for binary systems with pulsars (Hobbs et al. 2005).This suggests that the photogeometric distance is unrealistic and we excluded it from consideration.For  geom , the J1838 -ray luminosity is   = (0.3-4)×10 33 erg s −1 and the X-ray luminosity obtained from the flux derived by Kerby et al. (2021) is   ≈ 10 32 -10 33 erg s −1 .Such parameters are typical for the spider pulsar family (Strader et al. 2019;Swihart et al. 2022).

OPTICAL OBSERVATIONS AND DATA REDUCTION
The time-series photometric observations of J1838 were performed using the   Johnson-Cousins bands with the 'Rueda Italiana'  We carried out standard data processing, including bias subtraction and flat-fielding utilising the iraf package.In addition, fringe correction was performed for all -band images.Astrometric solution was calculated using a set of 9 stars from the Gaia eDR3 Catalogue (Gaia Collaboration et al. 2016Collaboration et al. , 2021;;Lindegren et al. 2021) with positional errors of ≲0.13 mas.Formal  uncertainties of the resulting astrometric fit were Δ ≲ 0.04 arcsec and Δ ≲ 0.05 arcsec.The photometric calibration was performed using the Landolt standards SA 109-949, 954, 956 (Landolt 1992) observed on 2022 July 22.All the data from the other nights were re-calibrated using a field nonvariable star (Pan-STARRS ID 146882795769764297,  = 17.67(4) mag) close to the target as a secondary standard.It is marked by 'S' in Fig. 2, left.According to Pan-STARRS its brightness variability is Δ ≲ 0.1 mag.

IMAGES, LIGHT CURVES AND ORBITAL PERIOD
Representative images of the J1838 field obtained with the OAN-SPM telescope in the  band are shown in Fig. 2. They demonstrate that the J1838 likely optical counterpart is a highly variable source.It is firmly detected in most exposures and appears close to the detection limit of ≈23.8 in some others.There is another faint object detected inside the X-ray position uncertainty and located about 2.5 arcsec north-west of the counterpart candidate (see the inset in Fig. 2, right).The source is also visible close to the detection limit in the Pan-STARRS images.We did not find any variability associated with this background object in our data.
The OAN-SPM light curves of the candidate in four bands are presented in Fig. 3.A smooth sine-like brightness variation with an amplitude of several magnitudes is accompanied by a short flaring activity on time-scales of ∼10 min with the brightness increase by about 1 mag.This short-term variability is especially prominent in the data obtained on 2022 July 24.The data suggest a brightness periodicity of around 4 h.To find the period, we performed a Lomb-Scargle periodogram analysis (Lomb 1976;Scargle 1982) applying the period range 1-24 h.Excluding the most obvious flares in the -band marked by the circles in Fig. 3, we obtained a period of 4.0246 h.
To justify the period independently, we investigated the data from the ZTF DR16 catalogue which covers about 4.7 yr (MJD 58204-59905) and contains several hundreds of photometric measurements of the source in the -band.The highest peak in the periodogram corresponds to the period  ph = 4.02489 h, which is very close to the value obtained from the OAN-SPM data.However, the power spectrum is noisy, and folding the light curve with the obtained period we found indications of a heavy flaring activity, as has been revealed in the OAN-SPM data. ph = 4.02488(15) h3 obtained from the ZTF data as the true period of the J1838 candidate counterpart.
The ZTF light curves in the ,  and  bands folded with this period are shown in Fig. 5.They demonstrate a single broad peak per period.We calculated the mean binned ZTF light curves and removed all data points with magnitudes 0.3 mag lower than the mean value in each phase bin since they are likely caused by the flaring activity.After that, we calculated the mean binned light curves again -they are compiled together in the bottom panel of Fig. 5.The minima of the ZTF light curves at the orbital phase 0.5 have no detection points.Averaging over larger phase bins artificially smooths and decreases the depth of the minimum (see the bottom panel of Fig. 5).
The light curves obtained with the OAN-SPM are demonstrated in Fig. 6.In this case, deeper observations allowed us to measure the light curves minima more accurately resulting in a total brightness variation of about 3 mag (from ≈ 20 to ≈ 23 mag) in the  band.
The period value and shapes of the periodic light curves are typical for a spider pulsar companion owing to its orbital motion around a MSP (e.g.Mata Sánchez et al. 2023;Kandel et al. 2020;Linares et al. 2018).We thus can assume that  ph is an orbital period of J1838.We note, that on 2022 July 24 the source was apparently brighter throughout the whole observation as compared to the two previous nights.This is particularly clearly seen in the -band light curve in Fig. 6 at the phase ranges between about 0.2 and 0.8.It may reflect a global change of the presumed pulsar companion and/or the binary system stage.

Light-curve modelling
To estimate the parameters of the presumed binary system, we performed the light curve modelling using the technique described in Zharikov et al. (2013Zharikov et al. ( , 2019)).We modelled only the OAN-SPM data because they are deeper than the ZTF ones and consequently cover the whole period per each observing night.We excluded the data obtained on 2022 July 24 when J1838 was apparently in a different brightness stage.
The model of the system to fit the light curves considers only two components: the NS as the primary and the heated low-mass companion as the secondary.The free parameters were the distance , the binary system inclination , the Roche lobe filling factor  , the 'night-side' temperature  n of the secondary, the effective irradiation factor  irr [ergs s −1 cm −2 sr −1 ], the pulsar mass  NS , and mass ratio . irr defines the flux  in transferred to the companion: where  norm is the angle between the normal to the surface and the incoming flux, Ω =  2 NS / 2 is the solid angle from which the NS is visible from the surface element Δ of the secondary,  NS is the NS radius and  is the orbit separation.The 'day-side' temperature of the surface element of the secondary is where  SB is the Stefan-Boltzmann constant.We used the gradient descent method to find the minimum of the  2 function: where   ,   , and   are the observed and the calculated magnitudes, and uncertainties of the observed magnitudes, respectively.We found that the pulsar mass is derived from the fit with a very wide uncertainty of (1-2.7)M ⊙ making the calculated light curves and the rest of the parameters insensitive to variations of the mass within this range.We thus fixed it at a canonical NS mass of 1.4 ⊙ .
The fit results are presented in Table 3 and the left panel of Fig. 7.The parameter uncertainties were calculated following the method proposed by Lampton et al. (1976).As seen from the fit residuals, the calculated light curves are generally consistent with the data, and the minor outliers are likely related to a flaring activity.They are also compatible with the ZTF data which are noisier and less sensitive as compared to the OAN-SPM data.A noticeable discrepancy is seen only near the minimum brightness phase ( = 0.50 ± 0.05) in the  band.The object is reliably (/ ≈ 4) detected there (see Fig. 2), but high magnitude uncertainties (  ≈ 0.25 mag) lead to low weights of these points in the fit.This formally results in overshooting the brightness of the model points by about one magnitude in respect to the observed ones.
At the same time, these points can be critically important for convincing constraints of the binary system inclination angle.To study their impact on this parameter, we artificially assigned higher weights to these points, assuming that they could be detected with   = 0.09 mag, which is close to magnitude uncertainties at nearby orbital phases around the minimum,  ∈ [0.4,0.45] and  ∈ [0.55, 0.6].The result of the respective fit is presented in the right panel of Fig. 7.As seen from the plot, the brightness minimum is better approximated by the model in this case, while the nearby orbital phases are fitted much worse as compared to the initial fit shown in the left panel.It is obvious from this experiment that our light curve model can not account for the brightness dip at the minimum of the light curve.This may be caused by variability of the source light curve or by some effects unaccounted for in the model.Given the variable nature of the J1838 light curve, more photometric data are needed to In the right panel, the points at the minimum brightness phase in the  band were included in the fit with higher weights (see text).Lower panels show residuals calculated as the difference between the observed (O) and the calculated (C) magnitudes.11.3(4) choose between these possibilities.However, within the uncertainties most of the parameters obtained in this test fit remain the same as in the fit without the artificial weights, except for the inclination angle whose best fit value tends to increase by about 10 degrees.The resulting interstellar colour excess is in agreement with the maximum value in the J1838 direction  ( − ) = 0.098 mag following from the dust map of Green et al. (2019).Because of a high stochastic variability of the source, we note that the results of the fit provide only rough constraints on the system parameters.Nevertheless, they are compatible with parameters of other spider systems with modelled light curves.

X-RAY AND UV DATA
We re-analysed the X-ray data from Swift/XRT and UVOT together with the extended ROentgen Survey with an Imaging Telescope Array (eROSITA; Predehl et al. 2021) aboard Spectrum-Roentgen-Gamma (SRG) orbital observatory (Sunyaev et al. 2021).Swift/XRT observed J1838 nine times in 2019 with the total exposure time of ≈ 7.6 ks.SRG/eROSITA observed the source field in the course of four all-sky surveys in 2020-2021 with the total exposure time of ≈1.3 ks (the vignetting corrected exposure is ≈0.7 ks).
Inspection of the Swift data revealed that the source is clearly seen only in one data set obtained on 2019 December 12 with the exposure time of 0.85 ks, between the observations on December 8 and 15 (see the top panels of Fig. 8).Thus, the source exhibited a strong flare in X-rays.A similar flaring activity is simultaneously observed in the UV with the UVOT (see the bottom panels of Fig. 8).We measured the AB magnitude during the flare in the 2 band and obtained 20.24(10) mag.Given  ( −) = 0.092 mag (Table 3), the unabsorbed flux is about 70 Jy.We note that the position of the UV source perfectly coincides with that of the presumed optical counterpart (Fig. 8) showing that we see the same source in the optical, UV and X-rays.
The X-ray spectrum of the source during the flare was extracted using the Swift-XRT data products generator and fitted with the X-Ray Spectral Fitting Package (xspec) v.12.11.1 (Arnaud 1996) using an absorbed power-law (PL) model.Only about 30 source counts were obtained in the 0.3-10 keV range.The spectrum was grouped to ensure at least one count per energy bin.For the interstellar absorption, we used the tbabs model with the wilm abundances (Wilms, Allen & McCray 2000).Using the relation from Foight et al. (2016), we transformed  ( − ) from the optical light curve fit to the absorbing column density,  H = 8 × 10 20 cm −2 , which was fixed during the fitting procedure.The photon index is Γ flare = 0.5 ± 0.3 and the unabsorbed flux in the 0.5-10 keV range is  flare  = 4.5 +1.5  −1.1 × 10 −12 erg s −1 cm −2 (errors correspond to the 1 confidence interval).However, we created the light curve using the online generator and found that the flare took up only about a half of the total exposure (see Fig. 9).Thus, the actual flux of the flare is about two times greater than the one estimated above,  flare  ∼ 10 −11 erg s −1 cm −2 .
In the eROSITA data J1838 is detected with ≈4 significance in the 2.3-8 keV band while it is not seen in the soft band (see Fig. 10).Investigating the individual eROSITA scans, we found that the source is clearly visible only in the second observation carried out in October 2020 indicating another hard flare (see Fig. 11).We extracted the J1838 spectra from each scan using the eROSITA Science Analysis Software System (eSASS).They were binned to ensure at least one count per energy bin.We fitted the spectrum from the second scan with the exposure time of 0.26 ks which contains about 9 counts from the source with the absorbed PL model in the 0.3-10 keV band. H was fixed at the value mentioned above.We obtained a negative best fit vallue of the photon index Γ flare = −1.9+0.7  −1.0 in accord with the fact that the source was detected only in the hard band.The source flux is  flare  = 9 +9 −5 × 10 −12 erg s −1 cm −2 .Combining spectra from the other three scans, we derived 90 per cent confidence upper limits on the source flux in quiescence,   ≲ 9 × 10 −14 erg s −1 cm −2 for Γ = 1.4 and   ≲ 3 × 10 −14 erg s −1 cm −2 for Γ = 2.5.The adopted photon indices are the average values found for BWs and RBs (Swihart et al. 2022).

DISCUSSION
Surface density of X-ray sources within the Swift/XRT field of view with mean fluxes equal to or higher than the mean flux of the counterpart candidate is 0.0018 per arcmin 2 .Given that, the chance probability to find an unrelated X-ray source within the 95 per cent (4.1×3.9 arcmin 2 ) error ellipse of the -ray source is about 8 per cent.Such probability can be even lower if we take into account the strong variability of our source.Medvedev et al. (2022) found only 1325 objects (per a half of sky) from which the flux in the 0.3-2.3keV energy band changed by more than a factor of 10 during the SRG/eROSITA all-sky survey.The reported number transforms to about 1.8×10 −5 variable objects per arcmin 2 and the chance probability of 0.1 per cent.This supports the association of the X-ray source and the optical object with the pulsar candidate proposed by Kerby et al. (2021).However, this probability estimation has to be considered with a caution, as the 2 0 2 0 / 0 4 2 0 2 0 / 0 6 2 0 2 0 / 0 8 2 0 2 0 / 1 0 2 0 2 0 / 1 2 2 0 2 1 / 0 2 2 0 2 1 / 0 4 2 0 2 1 / 0 6 2 0 2 1 / 0 8 2 0 2 1 / 1 0 local density of variable sources can be different from a mean one, and it may depend on their maximum to minimum flux ratio.Most RBs have light curves with two peaks per orbital cycle caused by tidal distortion of the companion, i.e. ellipsoidal variations.For BWs, irradiation from the pulsar wind is more significant than the tidal distortion effects which leads to the heating of the companion's side facing the pulsar and a single-peak light curve (e.g.Draghis et al. 2019;Swihart et al. 2022).Usual light curve peak-to-peak amplitude is ≲1 mag for RBs and 2-4 mag for BWs.
We have revealed that the optical and X-ray counterpart of J1838 proposed by Kerby et al. (2021) is a highly variable source demonstrating typical properties of spider systems.The presumed optical counterpart demonstrates brightness changes with a period of ≈4 h, resembling an orbital period of the expected spider system.It shows a single-peaked sine-like variability with a total amplitude of the brightness variation of about 3 mag (from ≈20 to ≈23 mag in the  band).At the same time, we found indications of its strong short-term flaring activity.The shape and amplitudes of the light curves are more typical for BWs.However, the RB interpretation of J1838 cannot be excluded since there is an example of a RB pulsar, J2339−0533, with an orbital period of 4.6 h, which also demonstrates single-peak light curves with a large difference between maxima and minima (e.g.Δ ≈ 6 mag, Kandel et al. 2020).It was assumed to belong to the BW subclass until the pulsar discovery and measurements of the binary parameters (Ray et al. 2020).
From our light curve modelling of J1838, the derived Roche lobe filling factor is  ≈ 0.6.It excludes any significant optical brightness variations related with the distorted shape of the companion.Nevertheless, it is also less than what is usually found for most spider systems, although there are objects with low values, e.g., PSR J0023+0923 with  = 0.5±0.1 (Mata Sánchez et al. 2023).
Our modelling also showed that J1838 demonstrates a significant difference between the night-side ( n ∼ 2300 K, corresponding to a M5-L4 type star) and day-side temperatures ( d ∼ 11000 K).RBs typically have  n = 4000-6000 K (e.g.Turchetta et al. 2023) whereas BWs night sides are cooler, with  n = 1000-3000 K (e.g.Mata Sánchez et al. 2023).In addition, RBs with their larger orbital periods usually have lower irradiation temperatures4  irr (several hundreds K) in comparison with BWs (≳ 3000 K).A large  irr of ≈ 6300 K was found for the above mentioned RB J2339−0533 with extreme heating (Kandel et al. 2020).However, this is still lower than what we obtained for J1838 ( irr ≈  max d = 10600 K).The companion of the RB PSR J1816+4510 has an unusually high temperature of 16000 K (Kaplan et al. 2013) but its variability over the orbit is low (Δ ∼ 0.1 mag; Koljonen & Linares 2023).There are several BW systems with  irr of about 9000-10000 K, PSRs J1810+1744, J1555−2908 and J1641+8049 (Romani et al. 2021;Kennedy et al. 2022;Mata Sánchez et al. 2023), as well as the BW candidate ZTF J1406+1222 (Burdge et al. 2022).Overall, the temperature distribution of the J1838 companion is more typical for the BW family, although it is necessary to higher resolution light curves to confirm this.
The brightest (Δ mag ≈1) optical flare of J1838 was detected on 2022 July 24 (Fig. 6).The origin of such flares is not clear.They can be attributed to the variable emission from the intro-binary shocks between the pulsar and the companion created by the interaction of the pulsar wind and the wind ejected from the companion.Otherwise, they can be caused by an intrinsic companion magnetic activity as observed for low-mass stars (e.g.Schmidt et al. 2019).
The mass distribution of spider pulsars is bimodal with a gap in the range 0.07-0.1 M ⊙ between BWs and RBs (Swihart et al. 2022).Thus, J1838 with  c = 0.10(5) M ⊙ can belong to any of these subclasses.Better constraints on  c are necessary to understand its spider type.
The distance obtained from the light curve modelling is about 3.1 kpc which is close to the upper bound of the distance range provided by Gaia (Table 1).The transverse velocity corresponding to this distance is about 200 km s −1 which is at the upper bound of the velocity distribution for binary pulsar systems (Hobbs et al. 2005).
In X-rays, J1838 was firmly detected during two strong flares.Thus, we can estimate only an upper limit on its luminosity in quiescence,   ≲ 3.5 × 10 31 (/3.1 kpc) 2 erg s −1 and ≲ 10 32 (/3.1 kpc) 2 erg s −1 for the PL model with the photon index appropriate for BWs and RBs, respectively.Studying X-ray properties of spider pulsars, Swihart et al. (2022) found that RBs are brighter than BWs with the average luminosities  rb  = 2.3 × 10 32 erg s −1 and  bw  = 1.4 × 10 31 erg s −1 .The scatters of luminosities are rather wide and J1838 upper limits can be consistent with both subclasses.
Strong X-ray flares were observed for PSR J1311−3430, PSR J1048+2339, XMMU J083850.38−282756.8 and 1FGL J0523.5−2529systems mentioned above.The brightest flares were detected for 1FGL J0523.5−2529 with the peak luminosities of ∼ 10 34 erg s −1 , which is a factor of ∼100 stronger than its minimum luminosity (Halpern et al. 2022).The X-ray flares of J1838 with the luminosity   ∼ 10 34 (/3.1 kpc) 2 erg s −1 are at least two orders of magnitude (by a factor of 100-200) brighter than its quiescent emission.Its flare luminosity can be as large as for 1FGL J0523.5−2529, if the distance to the source is indeed 3.1 kpc.Thus, its flares can be the most luminous among the observed in RB/BW systems without accretion disks.The spectra of both flares are hard.It is interesting that the flare detected with eROSITA likely demonstrates a negative photon index.This possibly can be explained by an unresolved time lag between the hard and soft photon emission with a brighter outburst in the hard band.
Any alternative interpretation of the data, such as a cataclysmic variable (CV), a tight binary stellar system or a rotating magnetic star, appears to be very unlikely mainly due to the high modulation of the measured light curves.The former two demonstrate much flatter orbital light curves, sometimes with sharp dips due to binary companion eclipses (e.g., Warner 1995;Zasche et al. 2017, and references therein).For instance, light curves of intermediate polars (IPs), a subclass of CVs, typically show about 0.5 mag amplitude periodic variability.Sharp dips of 1-2 mag were observed in a few eclipsing IPs (e.g.: V597 Pup, Warner & Woudt (2009);IPHAS J062746.41+014811.3, Aungwerojwit et al. (2012); CX-OGBS J174954.5-294335,Johnson et al. (2017)).Brightness variations of magnetic stars are typically less than a magnitude while rotational periods are greater than a day (e.g., Bernhard et al. 2021).Therefore, the spider pulsar interpretation currently remains the most plausible.This is also strongly supported by the detection of -rays which are not observed in the alternative cases.The fact that the estimated -ray luminosity of J1838 (Table 1) is within the range of luminosities (4 × 10 32 -4 × 10 34 erg s −1 ) of the spider pulsar family (Strader et al. 2019;Swihart et al. 2022) is in line with this interpretation.
Optical spectroscopy is needed to obtain the radial velocity curve of the J1838 companion candidate and confirm its nature.Accounting for its brightness, this is feasible with 8-10 meter class telescopes.RBs spectra are dominated by hydrogen lines while BWs spectra may show helium features indicating hydrogen-deficient atmospheres (Swihart et al. 2022 and references therein).Measurements of the companion's radial velocity would provide constraints on the mass of the putative pulsar.High time-resolution multi-band light curves, especially in the minimum phase, would allow one to constrain the fundamental parameters of the binary system with a higher precision.To better understand the mechanism of flares simultaneous multicolour photometry would be preferable.Deeper X-ray observations are necessary to detect the object in quiescence.Last but not least, J1838 is of a particular interest for targeted searches of millisecond pulsations in the radio and/or -ray domains.

Figure 1 .
Figure 1.13×13 arcmin 2 Swift/XRT image of J1838 combined from different observations with the total exposure of 7.6 ks.The red cross and black ellipse show the -ray position of J1838 and its 95 per cent uncertainty.The X-ray counterpart candidate proposed by Kerby et al. (2021) is the nearest point object to the red cross.The stripe crossing the field is an instrumental artifact.

Figure 2 .
Figure 2. Individual -band images of the J1838 field obtained with the OAN-SPM telescope during the maximum (left) and the minimum (right) brightness phases of the likely optical counterpart marked by the arrow.The solid circle with a radius of 4.4 arcsec shows the Swift/XRT 90 per cent position uncertainty of the J1838 X-ray counterpart candidate; 'S' in the left panel denotes the star used as the secondary photometric standard in this work.The region enclosed in the dashed box in the right panel is shown in the inset with a different intensity scale to better reveal the candidate (marked with the dashed circle) at the phase of its minimum brightness.

Figure 3 .
Figure 3. Time-series photometry of the J1838 putative optical counterpart obtained with the OAN-SPM 2.1-m telescope at different dates shown in the panels.Points excluded from the timing analysis are marked with circles (see text).

Figure 5 .
Figure 5. ZTF optical light curves of the J1838 presumed companion in the ,  and  bands (panels 1-3) folded with a period of 4.02488 h.The data points associated with flaring and excluded from analysis are marked by lighter colours.The mean binned light curves are marked by black symbols in panels 1-3 and are shown together in panel 4.

Figure 6 .
Figure 6.Light curves the J1838 likely counterpart obtained with the 2.1meter telescope folded with a period of 4.02488 h.The data obtained during different nights are marked by the different grey colours as indicated in the legend.

Figure 7 .
Figure7.Folded light curves of J1838 obtained in the , ,  and  bands with the OAN-SPM telescope on July 21-22.The solid lines show the best-fitting models.In the right panel, the points at the minimum brightness phase in the  band were included in the fit with higher weights (see text).Lower panels show residuals calculated as the difference between the observed (O) and the calculated (C) magnitudes.

Figure 8 .
Figure 8. Swift XRT (top panels) and UVOT (bottom panels) images of the J1838 field.The position of J1838 likely optical counterpart is marked by the 'X' symbols in the top panels and by the bars in the bottom panels.The bright flare occurred on 2019 December 12. Exposure times are 0.55 ks for the left panels and 0.85 ks for the right panels.

Figure 9 .Figure 10 .
Figure 9. Swift XRT light curve of the J1838 putative counterpart during the flare in the 0.3-10 keV band.The time bin size is 90 s.Upper limits correspond to 3 confidence levels.

Figure 11 .
Figure 11.SRG eROSITA count rates of the J1838 putative counterpart in individual scans in the 2.3-8 keV band.The bright flare occurred in October 2020.

Table 2 .
Log of the J1838 observations with the OAN-SPM 2.1-m telescope.
Lomb-Scargle periodogramfor the ZTF data in the  band calculated excluding points with  < 19.2 mag.The best period  ph corresponding to the highest peak, enlarged in the inset, is also indicated.
Thus, we excluded ZTF measurements with  < 19.2 which are likely related to the flares and recalculated the periodogram.The latter is shown in Fig.4.The highest peak in the power spectrum at  ph = 4.02488 h is only slightly shifted from the previous estimates and is quite pronounced.Since the -band curve of the OAN-SPM contains only about 60 points, as opposed to the ZTF -band, and covers a much shorter time range, we adopt

Table 3 .
The light-curve fitting results for J1838.