express_relay/
state.rs

1use anchor_lang::prelude::*;
2
3pub const FEE_SPLIT_PRECISION: u64 = 10_000;
4
5pub const FEE_SPLIT_PRECISION_PPM: u64 = 1_000_000;
6pub const FEE_BPS_TO_PPM: u64 = 100;
7
8pub const RESERVE_EXPRESS_RELAY_METADATA: usize = 8 + 152 + 260;
9pub const SEED_METADATA: &[u8] = b"metadata";
10
11#[account]
12#[derive(Default)]
13pub struct ExpressRelayMetadata {
14    pub admin:                    Pubkey,
15    pub relayer_signer:           Pubkey,
16    pub fee_receiver_relayer:     Pubkey,
17    // the portion of the bid that goes to the router, in bps
18    pub split_router_default:     u64,
19    // the portion of the remaining bid (after router fees) that goes to the relayer, in bps
20    pub split_relayer:            u64,
21    // the portion of the swap amount that should go to the platform (relayer + express relay), in bps
22    pub swap_platform_fee_bps:    u64,
23    // secondary relayer signer, useful for 0-downtime transitioning to a new relayer
24    pub secondary_relayer_signer: Pubkey,
25}
26
27pub const RESERVE_EXPRESS_RELAY_CONFIG_ROUTER: usize = 8 + 40 + 200;
28pub const SEED_CONFIG_ROUTER: &[u8] = b"config_router";
29
30#[account]
31#[derive(Default)]
32pub struct ConfigRouter {
33    pub router: Pubkey,
34    pub split:  u64,
35}