API reference
HTTP
| Route | Returns |
|---|---|
GET /api/health | { status, network, program, stage }; program is the mainnet program id |
GET /api/token | { stage: "pre-launch", ca: null } until launch |
GET /.well-known/lease.json | Program id and deployment status |
Program instructions
| Instruction | Arguments |
|---|---|
create_pool | base_amount: u64, quote_amount: u64 |
add_liquidity | max_base: u64, max_quote: u64, min_shares: u64 |
remove_liquidity | shares: u64, min_base: u64, min_quote: u64 |
claim_rent | none |
swap | amount_in: u64, min_out: u64, base_in: bool |
bid | rent: u64, deposit: u64, fee_ppm: u32 |
add_deposit / withdraw_deposit | amount: u64, queued: bool |
set_fee | fee_ppm: u32 |
claim_bidder, poke, sweep | none |
crank_burn | amount: u64 |
Constants
| Name | Value |
|---|---|
AUCTION_DELAY_SLOTS | 900 (20 in the local test build) |
MIN_RENT_APR_BPS | 2,000 (rent floor: 20% a year of pool value) |
SLOTS_PER_YEAR | 143,000,000 (0.22 s a slot) |
RAISE_NUM / RAISE_DEN | 11 / 10 |
FEE_CAP_PPM | 30,000 (3%) |
DEFAULT_FEE_PPM | 10,000 (1%) |
WITHDRAW_FEE_PPM | 110 |
PROTOCOL_RENT_BPS | 1,000 (10%) |
LOCKED_SHARES | 1,000 |
BURN_MAX_RESERVE_BPS | 10 (0.1%) |
BURN_MIN_OUT_BPS | 9,800 |
BURN_TWAP_SECS | 1,800 |