Skip to main content

Prerequisites

  • Go 1.18 or higher
  • Aries API credentials (client ID and client secret)

Installation

Install the Aries Go SDK using go get:
go get github.com/aries-exchange/go-sdk

Initialize the Client

package main

import (
    "fmt"
    "log"
    aries "github.com/aries-exchange/go-sdk"
)

func main() {
    // Initialize the client with your credentials
    client := aries.NewClient(
        aries.WithClientID("your_client_id"),
        aries.WithClientSecret("your_client_secret"),
    )
}

Basic Operations

Get Account Information

// Retrieve user account details
accounts, err := client.Accounts.GetUserAccounts()
if err != nil {
    log.Fatal(err)
}
fmt.Println(accounts)

Place a Market Order

// Place a simple market order
order, err := client.Orders.PlaceOrder(&aries.OrderRequest{
    Symbol:    "AAPL",
    Quantity:  10,
    Side:      "buy",
    OrderType: "market",
})
if err != nil {
    log.Fatal(err)
}
fmt.Printf("Order placed: %+v\n", order)

Search for Securities

// Search for a security
results, err := client.MarketData.Search("AAPL")
if err != nil {
    log.Fatal(err)
}
fmt.Println(results)

Next Steps

Now that you have the basics working, explore the SDK’s capabilities:

Additional Resources