Solana perp DEX๋ค(Jupiter/Flash/Phoenix/GMTrade)์ ํ ๊ณ์ ์ผ๋ก ๋ฌถ์ ๋ผ์ฐํฐ.
โข API ๋ฒ ์ด์ค: https://api.imperial.space/api/v1
โข ์ ์ฒด ์คํ: https://api.imperial.space/api/v1/openapi.json
โโโโโโโโโโโ
๐ 1. ์ธ์ฆ (์ ์ผ ํฐ ํจ์ )
๋ฌธ์์ ์ฝ๋ ์๋ช (/mobile/connect)์ ๋ฌด์กฐ๊ฑด 401 "Failed to generate mobile session" โ ๋งํ๋ค. ์๊ฐ๋ญ๋น ํฌ์ธํธ.
โ
์ค์ ๋ฐฉ๋ฒ:
โข Imperial ์ฑ/์น์์ ์ง๊ฐ ์ฐ๊ฒฐ + ์
๊ธ + "one-click/API/mobile trading" ํ์ฑํ
โข โ JWT(Bearer, 30์ผ ๋ง๋ฃ) ๋ฐ๊ธ๋จ โ ๋ด์ด ์ด๊ฑธ ์ฌ์ฉ
โข ํค๋: Authorization: Bearer <JWT>
โข JWT๋ ๊ฑฐ๋ ๊ถํ๋ง(์
์ถ๊ธ ๋ถ๊ฐ). โ ๏ธ 30์ผ ๋ง๋ฃ โ ๊ฐฑ์ ์ ํ๋ฉด ์ฃผ๋ฌธ์ด 401๋ก ์กฐ์ฉํ ๋ฉ์ถค
โโโโโโโโโโโ
๐ 2. ์ฃผ๋ฌธ ์ธ์ฝ๋ฉ (POST /mobile/orders)
ํ๋ โ ์๋ฏธ:
โข wallet โ base58 pubkey
โข profileIndex โ ์๋ธ๊ณ์ 0~5
โข side โ 0=long, 1=short
โข action โ 0=increase(์ง์
), 1=decrease(์ถ์)
โข underwriter โ 0=Jupiter, 1=Flash, 2=Phoenix, 3=GMTrade
โข orderType โ 0=Market, 1=Limit
โข sizeUsd โ 6-decimal ($1 = 1,000,000)
โข collateralAmount โ ๋ด๋ณด 6-dec (1x๋ฉด sizeUsd์ ๋์ผ)
โข triggerPrice โ ์ค๋ผํด ์ค์ผ์ผ 1e9 (๊ฐ๊ฒฉ ร 1,000,000,000)
โข slippageBps โ bps
โข symbol / phoenixNative โ "SOL" ๋ฑ / Phoenix CLOB์ด๋ฉด true
์๋ต: {success, signature, orderPda} โ orderPda๋ก ์ทจ์/์์
โข ์ทจ์: POST /mobile/orders/cancel {wallet, orderPda, profileIndex}
โข ์์ : POST /mobile/orders/update
โโโโโโโโโโโ
๐ 3. ๋ง์ผ๋ฉ์ดํน์ ๋ฌด์กฐ๊ฑด Phoenix
ํจ์๋ธ ๋ฉ์ด์ปค๋ Phoenix(underwriter=2 + phoenixNative=true)๋ง ๊ฐ๋ฅ. Jupiter/Flash/GMTrade๋ ์ค๋ผํดยทํํ์ด๋ผ resting
limit ๋ถ๊ฐ.
โข ์์๋ฃ: maker ~0.5bps / taker ~3.5bps (maker ์ธ์ ์ ๋ฆฌ)
โข bid(๋งค์) = side=0, action=0, Limit @ mid ์๋
โข ask(๋งค๋) = side=1, action=0, Limit @ mid ์
โข ์ํฌ์ง์
= long โ short
โโโโโโโโโโโ
๐ 4. ์์ธยท์ํ ์ฝ๊ธฐ (๋๋ถ๋ถ public)
โข GET /phoenix/mark-prices โ ์ฌ๋ณผ๋ณ mid (fair price)
โข GET /phoenix/depth?symbol=SOL โ ์ค๋๋ถ bids/asks
โข GET /phoenix/markets โ ์ฌ๋ณผ๋ณ tick/lot/maxLev/์์๋ฃ
โข GET /positions?walletAddress= โ ํฌ์ง์
(side,sizeUsd,entry,pnl)
โข GET /orders?walletAddress= โ resting ์ฃผ๋ฌธ
โข GET /mobile/balances (JWT) โ ํ๋กํ๋ณ USDC
โข WS: /ws/market(์์ธ), /ws(์ง๊ฐ ๋ณ๊ฒฝ ์ ํธ)
โโโโโโโโโโโ
๐ 5. ์ต์ ๋ด ๋ฃจํ
jwt = <์ฑ์์ ๋ฐ๊ธ>
๋งค N์ด:
mid = GET /phoenix/mark-prices
pos = GET /positions
bid, ask = ์ ๋ต(mid, pos)
๊ธฐ์กด ์ฃผ๋ฌธ cancel(orderPda)
POST /mobile/orders bid (side0/action0/Limit/phoenixNative,
sizeUsd=$*1e6, triggerPrice=px*1e9)
POST /mobile/orders ask (side1/action0/...)
์ข
๋ฃ ์: ๋ชจ๋ orderPda cancel โ ํ์
โโโโโโโโโโโ
โ ๏ธ 6. ํจ์ ์ฒดํฌ๋ฆฌ์คํธ
โข JWT๋ ์ฑ์์ ๋ฐ๊ธ(์ฝ๋์๋ช
X), 30์ผ๋ง๋ค ๊ฐฑ์
โข sizeUsd 6-dec / triggerPrice 1e9 ์ค์ผ์ผ (ํ๋ฆฌ๋ฉด ๊ฐ๊ฒฉ ์๋ฑ)
โข MM์ Phoenix + phoenixNative=true๋ง
โข ์
๊ธ์ /deposit/build-tx(์คํฐ์ ํธ๋์ญ์
)๋ก โ ์์ ์ฃผ์ raw ์ ์ก ๊ธ์ง(์๊ธ ๋ถ์ค)
โข rate limit 600/min (per wallet)
โข ๋ด ์ฃฝ์ ๋ cancel-all ์ ํ๋ฉด ์ ๋ น ์ฃผ๋ฌธ ๋จ์
โข Solana ๊ฐ์ค์ฉ SOL ์์ก ํ์
์๋ผ๋ Perp ์ชฝ์์๋ ํ์ฌ Phoenix๊ฐ ๊ฐ์ฅ ์ ๋งํ๋ค๊ณ ๋ณด๊ณ ์์ต๋๋ค.
Imperial์ด Phoenix ์ ๋์ฑ์ ๋์ด์ ๊ฑฐ๋๋ฅผ ์ฒด๊ฒฐํ๋ ๊ตฌ์กฐ๋ผ ์ด์ค ํ๋ฐ ๊ฐ๋ฅ์ฑ์ ๊ธฐ๋ํ๋ฉฐ ์ฌ์ฉํ๊ณ ์์ต๋๋ค.
๋ค๋ง API ๊ตฌ์ถ ๊ณผ์ ์ด ์๊ฐ๋ณด๋ค ๋ณต์กํ ํธ์ด๋ผ, ์ง์ ์๋ํ๋ ๋ด ์ฐ๋์ ๊ณ ๋ คํ์๋ ๋ถ๋ค์ ์ด ๋ถ๋ถ์ ์ฐธ๊ณ ํ์๋ ๊ฒ์ด ์ข๊ฒ ์ต๋๋ค.
Imperial ์ด๋
Phoenix ์ด๋ EG2XN4DV
