Access Trading Signals Programmatically

Dear all,

As promised, you will find below the technical documentation on programmatic access to shprd trading signals. 👩‍💻👨‍💻

1. Request a message to sign

In a terminal shell (like Iterm) or on postman:

curl --location --request POST 'https://0lii8gygqg.execute-api.eu-west-3.amazonaws.com/prod/auth/<the_address_holding_your_NPXs>/message' \
--header 'Content-Type: application/json' \
--data-raw '{
    "uri": "https://signals.shprd.finance",
    "version": "v0.1.180",
    "maxTs": "2023-07-06T12:21:22.123",
    "chainId": 1,
    "app": "signals.shprd.finance"
}' 
  • Replace each <key> with appropriate value:

    • <the_address_holding_your_NPXs>
  • Version: see latest version on cf.app.shprd.finance, at bottom-left of the screen

  • ChainId integer can be either 1 (mainnet) or 56 (bsc)

This POST request will return:

{
  message: string;
  id: string;
  error: string;
}

2. Sign the message

Go on https://www.myetherwallet.com/wallet/sign

> Select Browser extension

> Enter the message received above and replace all \n by new lines (it should look like as in below screenshot)

Inside the input field, replace all
Inside the input field, replace all

> Click on Sign button

Signing with your wallet address will generate the signature. Copy and paste it
Signing with your wallet address will generate the signature. Copy and paste it

3. Retrieve a JSON Web Token (JWT)

In a shell (like Iterm) or on postman:

curl --location --request POST 'https://0lii8gygqg.execute-api.eu-west-3.amazonaws.com/prod/auth/<the_address_holding_your_NPXs>/verify' \
--header 'Content-Type: application/json' \
--data-raw '{
    "id": "<id>",
    "signature": "<signature>",
    "chainId": 1
}'
  • Replace each with appropriate value:

    • <the_address_holding_your_NPXs>

  • Prefix the signature value (“sig”) with “0x”

This POST request will return:

{
  verified: boolean;
  jwt: string;
  chainId: number;
  balance (in NPXs): number;
  error: string;
}

4. Access signals with the JWT

In a shell (like Iterm) or on postman:

curl --location --request POST 'https://0lii8gygqg.execute-api.eu-west-3.amazonaws.com/prod/strats/signals/filter' \
--header 'Authorization: Bearer <JWT>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "strategies": [
        {
            "code": "STRAT_BTC_ETH_USD_LO_H_1",
            "underlyingCurrencies": ["ETH", "BTC"]
        }
    ],
    "minTs": "2023-07-29T12:13:14.123",
    "maxTs": "2023-08-19T12:13:14.123"
}'
  • Replace each <key> with appropriate value:

  • List of available strategies:

    • STRAT_BTC_ETH_USD_LO_H_1

    • STRAT_XRP_USD_D_1

    • STRAT_ETH_USD_D_3

    • STRAT_BTC_USD_D_3

    • STRAT_BNB_USD_LO_D_1_V2

    • STRAT_BTC_USD_H_4_V2

    • STRAT_ETH_USD_H_3_V2

    • STRAT_ETH_USD_H_4_V2

    • STRAT_BTC_ETH_USD_H_1

    • STRAT_DOGE_USD_LO_D_1

    • STRAT_MATIC_USD_LO_D_1

    • STRAT_SOL_USD_LO_D_1

    • STRAT_AI_TOP_3_PERFORMERS_H_1

NB: strategy codes are also displayed in the URL of each strategy’s details page on https://signals.shprd.finance/.

Finally, this POST request will return:

{
  success: boolean,
  data: [], <- the signals
  offset: number, error: string
}

The Shprd Team

Subscribe to SHPRD
Receive the latest updates directly to your inbox.
Mint this entry as an NFT to add it to your collection.
Verification
This entry has been permanently stored onchain and signed by its creator.