Satori Finance Docs
  • ✨About Satori Finance
  • 👉Beginner's Guide
    • Deposit & Withdrawal
    • Trading
  • 💸Perpetual Trading
    • Matchmaking
    • Margin
    • Isolated/Cross Margin
    • Funding Costs
    • Trading fees
    • Index Price
    • Mark Price
    • Liquidations
    • Insurance Funds
    • Automatic Deleveraging
  • 🌽Vaults
  • 📲Telegram Mini APP
  • 🚀Liquid Restaked Tokens (LRT)
  • 🔥Points
  • 🎉Trading Competition
    • Satori Season2 Trading Competition Backed by Hemi
  • 🎭Referrals
  • 🦄Ecosystem Partner Incentives
  • API DOCS
    • 👨‍💻OpenAPI
      • Introduce
      • Auth
      • URL
      • Response Code
      • Rest API
        • A complete example
        • Order Operation 【Private Operation】
          • Create order
          • Batch create orders
          • Cancel order
          • Batch Cancel orders
        • Position Operation 【private operation】
          • Add/reduce margin
        • 【Private Query】
          • [Account] Query account balance
          • [Order] Query current order list
          • [Trade] Query match result
          • [Position] Query position list
        • 【Public Query】
          • System time
          • Index price
          • Mark price
          • Last trade
          • Pair list
      • WebSocket
        • Events
        • Subscription
          • Basic parameters
          • Example
          • Account
          • Orders
          • Positions
          • Trades
Powered by GitBook
On this page
  • 1 Apply app_key
  • 2 Install the SDK
  • 3 Deposit USD into Satori
  • 4 Open orders
  1. API DOCS

OpenAPI

PreviousEcosystem Partner IncentivesNextIntroduce

Last updated 7 months ago

1 Apply app_key

Open the website and connect your wallet,

Click the button "Create API" and input your data, you can read the doc detail.

Get your API Key.

Note: the API Key need auth pass before it works. This may take some days.

2 Install the SDK

SDK path: https://github.com/satoridao/satori_openapi_sdk

Init the sdk config with your API key and your api address private key.

# config.ini
[keys]
base_url= https://openapi.satori.finance
ws_url= wss://openapi.satori.finance/api/market/ws
api_key= ${your api key}
api_secret= ${your api address private key}

3 Deposit USD into Satori

Note: The same address at different chain have different account in satori. Please choose the same chain with your api key you applyed.

After depositing, you can check your available balance from the web front or through the sdk.

example code:

import json
​
from satori.client import Client
from examples.utils.prepare_env import get_env
​
if __name__ == '__main__':
    config = get_env()
    print(config)
    cs = Client(api_key=config["api_key"], api_secret=config["api_secret"], api_sign_type=config["api_sign_type"], base_url=config["base_url"])
    time = cs.time()["data"]
    print(json.dumps(cs.balance("USD", time), ensure_ascii=False))

4 Open orders

Open orders

#!/usr/bin/env python
import json
​
from satori.client import Client,Order
from examples.utils.prepare_env import get_env
​
if __name__ == '__main__':
    config = get_env()
    cs = Client(api_key=config["api_key"], api_secret=config["api_secret"], api_sign_type=config["api_sign_type"], base_url=config["base_url"])
    time = cs.time()["data"]
    order1 = Order(str(time), True, False, 1, 1, "ETH-USD", 3, "0.02", "2000")
    print(json.dumps(cs.create_order(order1,str(time)), ensure_ascii=False))

Cancel orders

#!/usr/bin/env python
import json
​
from satori.client import Client
from examples.utils.prepare_env import get_env
​
if __name__ == '__main__':
    config = get_env()
    cs = Client(api_key=config["api_key"], api_secret=config["api_secret"], api_sign_type=config["api_sign_type"], base_url=config["base_url"])
    time = cs.time()["data"]
    # print(cs.order_list("ETH-USD",time))
    print(json.dumps(cs.cancel_order(entrustId=178790278,timestamp=str(time)), ensure_ascii=False))

👨‍💻
https://zksync.satori.finance/tradeApi