quick start
- install poetry
- run
poetry shell
- run
poetry install
- run
python -m src.main
with your arguments
arguments guide:
- --rpc: your solana rpc url: ex. "https://api.mainnet-beta.solana.com"
- --public-key: the authority of the user account you want to archive. if you're trading under a delegate, this is the actual authority of the delegated account, not your signing pubkey ex: 4bZmj1Y3Dv5WrzRj4cxLUx6pfCfw1QV7y99f1aaPGU7y
- --subaccounts: the subaccounts to archive for. ex. 0 1 2
- --events: the events you want to archive for, out of EVENT_TYPES (OrderActionRecord will only archive FILLS.) ex. OrderActionRecord DepositRecord LiquidationRecord
- --start-date: the date you want to start archiving at, in YYYY-MM-DD format. MUST BE PROVIDED WITH --end-date ex. 2024-05-11
- --end-date: the date you want to end archiving at, in YYYY-MM-DD format. MUST BE PROVIDED WITH --start-date ex. 2024-05-15
in the absence of both start date and end date, the current day will be used
full command with these example arguments:
python -m src.main --rpc "https://api.mainnet-beta.solana.com" --public-key 4bZmj1Y3Dv5WrzRj4cxLUx6pfCfw1QV7y99f1aaPGU7y --subaccounts 0 1 2 --events OrderActionRecord DepositRecord LiquidationRecord --start-date 2024-05-11 --end-date 2024-05-15
EVENT_TYPES = [
"OrderActionRecord",
"SettlePnlRecord",
"InsuranceFundRecord",
"InsuranceFundStakeRecord",
"LiquidationRecord",
"LPRecord",
"FundingPaymentRecord",
]
Spot interest calculations
to calculate interest received on all spot assets run python -m src.interest
with the same arguments as the archiver command, but do not include --events
.