
    1l.j                    X    d dl mZ d dlZd dlmc mZ d dlm	Z	 d dl
mZ d dlmZ d	dZdS )
    )annotationsN)Decimal)CopyCostInput)estimate_follower_net_pnlreturnNonec                    t          t          t          d          t          d          t          d          t          d          t          d          t          d          t          d          t          d                              } | j        }d	}t          |          }||k    }|st	          j        d
|fd||f          dt          j                    v st	          j        |           rt	          j	        |           ndt	          j	        |          dt          j                    v st	          j        t                    rt	          j	        t                    ndt	          j	        |          t	          j	        |          dz  }dd|iz  }t          t	          j        |                    d x}x}x}}| j        }d	}t          |          }||k    }|st	          j        d
|fd||f          dt          j                    v st	          j        |           rt	          j	        |           ndt	          j	        |          dt          j                    v st	          j        t                    rt	          j	        t                    ndt	          j	        |          t	          j	        |          dz  }dd|iz  }t          t	          j        |                    d x}x}x}}| j        }d}t          |          }||k    }|st	          j        d
|fd||f          dt          j                    v st	          j        |           rt	          j	        |           ndt	          j	        |          dt          j                    v st	          j        t                    rt	          j	        t                    ndt	          j	        |          t	          j	        |          dz  }dd|iz  }t          t	          j        |                    d x}x}x}}| j        }d}t          |          }||k    }|st	          j        d
|fd||f          dt          j                    v st	          j        |           rt	          j	        |           ndt	          j	        |          dt          j                    v st	          j        t                    rt	          j	        t                    ndt	          j	        |          t	          j	        |          dz  }dd|iz  }t          t	          j        |                    d x}x}x}}| j        }d}t          |          }||k    }|st	          j        d
|fd||f          dt          j                    v st	          j        |           rt	          j	        |           ndt	          j	        |          dt          j                    v st	          j        t                    rt	          j	        t                    ndt	          j	        |          t	          j	        |          dz  }dd|iz  }t          t	          j        |                    d x}x}x}}d S )N100025z0.045z0.02z0.05z1.25z2.00)notional_usdgross_pnl_usdentry_fee_pctexit_fee_pct
spread_pctmodeled_slippage_pctfunding_usddelay_penalty_usdz0.45000)==)zS%(py2)s
{%(py2)s = %(py0)s.entry_fee_usd
} == %(py8)s
{%(py8)s = %(py4)s(%(py6)s)
}resultr   )py0py2py4py6py8zassert %(py10)spy10)zR%(py2)s
{%(py2)s = %(py0)s.exit_fee_usd
} == %(py8)s
{%(py8)s = %(py4)s(%(py6)s)
}z0.2000)zU%(py2)s
{%(py2)s = %(py0)s.spread_cost_usd
} == %(py8)s
{%(py8)s = %(py4)s(%(py6)s)
}z0.5000)zZ%(py2)s
{%(py2)s = %(py0)s.modeled_slippage_usd
} == %(py8)s
{%(py8)s = %(py4)s(%(py6)s)
}z20.15000)zQ%(py2)s
{%(py2)s = %(py0)s.net_pnl_usd
} == %(py8)s
{%(py8)s = %(py4)s(%(py6)s)
})r   r   r   entry_fee_usd
@pytest_ar_call_reprcompare@py_builtinslocals_should_repr_global_name	_safereprAssertionError_format_explanationexit_fee_usdspread_cost_usdmodeled_slippage_usdnet_pnl_usd)r   @py_assert1@py_assert5@py_assert7@py_assert3@py_format9@py_format11s          O/home/agent/projects/CryptoTradingBot/Crypto_Agent/tests/test_ctb_copy_costs.py.test_follower_net_pnl_subtracts_all_copy_costsr0   	   s   & !$--!'** ))v!(%foo		
 		
 		
 F 59579#5#55#55555555555#5555555555555655555655555555555555555755555755555595555#5555555555555555555555555555554)4')"4"44"44444444444"4444444444444644444644444444444444444'44444'444444)4444"444444444444444444444444444444!6X6WX%6%66!%66666666666!%66666666666666666666666666!66666666666W66666W666666X6666%666666666666666666666666666666&;(;'(*;*;;&*;;;;;;;;;;;&*;;;;;;;;;;;;;6;;;;;6;;;;;;&;;;;;;;;;;;';;;;;';;;;;;(;;;;*;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;44!4!44!44444444444!4444444444444644444644444444444444444444444444444444!44444444444444444444444444444444    )r   r   )
__future__r   builtinsr   _pytest.assertion.rewrite	assertionrewriter   decimalr   src.ctb_copy.modelsr   'src.ctb_copy.shadow.follower_fill_modelr   r0    r1   r/   <module>r;      s    " " " " " "                     - - - - - - M M M M M M5 5 5 5 5 5r1   