ChatGPT処理取引所の新たな発表

作者: リン・ハーンチャオチャン, 日付: 2023-04-03 13:49:13
タグ:

取引所での時間格差を解決する効果的な方法は,規則式表現による繁忙なマッチを避けるため,ChatGPTを利用して処理を行うことです. 通知を直接ChatGPTに委ね,さまざまな取引所の時間形式を認識し処理できるようにすることで,便利で効率的なアプリケーションのシナリオになります.

発表テキストをopenaiCompletions機能に転送することで,ChatGPTの強力な能力を活用して,さまざまな取引所の上場発表から重要な情報を抽出できます.この方法は処理効率を向上させ,異なる時間形式との互換性を向上させます.

この機能を使用する前に,ポリシーパラメータ OPENAI_API_KEY を設定する必要があります. このパラメータは,あなたの OpenAI API キーを提供するために使用されます. gpt-3.5-turbo API にアクセスするには,自分のキーを使用できます.

機能名:openaiCompletions

機能概要:この関数は,OpenAIのgpt-3.5-turboモデルを呼び出すことで,入力された通知内容が交換所の現場で新しい取引対の通知であるかどうかを判断する. 通知が条件を満たせば,関数はJSONオブジェクトを入力し,成功・取引対および北京時間を含む. 通知が条件を満たさない場合は,失敗符だけ返します.

パラメータ入力: 内容: 判断すべき広告の内容.

輸出結果: JSON オブジェクトは,次のキー値対を含む:

success: ブール値,判定が成功したかどうかを表示する. pair: (success が true のときのみ存在する) 文字列の配列,取引対を表示する. time: (success は true のときのみ存在する) 文字列は,発表の時間を表し,北京時間 ((UTC+8) に変換されている. 機能の実行プロセス:

gpt-3.5-turbo APIの要求のURL,要求ヘッダー,および要求データの定義. HttpQuery メソッドを呼び出し,要求データを JSON 形式で gpt-3.5-turbo API に送信します. gpt-3.5-turbo API が返した JSON データを解析し,必要な情報を抽出します. 処理されたJSONオブジェクトを返します.

実験用例:

var content = "某交易所宣布,将于2023年3月22日12:00(UTC+8)上线ID/USDT交易对。";
var result = openaiCompletions(content);
Log(result);

輸出結果:

{
  "success": true,
  "pair": ["ID_USDT"],
  "time": "2023-03-22 12:00:00"
}



// 封装的函数
function openaiCompletions(content) {
    var url = 'https://api.openai.com/v1/chat/completions';
    var headers = 'Content-Type: application/json\nAuthorization: Bearer ' + OPENAI_API_KEY;
    var data = {
        model: 'gpt-4',//如果api没有gpt-4的权限,这里可以修改为gpt-3.5-turbo
        messages: [
          {role: "system", "content": '判断公告内容,是交易所现货上新交易对的公告吗?如果是你只需要以json的{"success":true,"pair":["ID_USDT"],"time":"2023-03-22 12:00:00"}格式,时间转换为北京时间utc+8,如果不是返回{"success":false}'},
          {role: 'user', content: content}
          ]
    };

    var response = HttpQuery(url, JSON.stringify(data),null,headers,false);
    response = JSON.parse(response)
    return JSON.parse(response.choices[0].message.content);
}

// 使用示例
function main() {
    let announcement = `Fellow Binancians,
Binance will list Radiant Capital (RDNT) in the Innovation Zone and will open trading for these spot trading pairs at 2023-03-30 07:30 (UTC):
New Spot Trading Pairs: RDNT/BTC, RDNT/USDT, RDNT/TUSD
Users can now start depositing RDNT in preparation for trading
Withdrawals for RDNT will open at 2023-03-31 07:30 (UTC)
RDNT Listing Fee: 0 BNB
Users will enjoy zero maker fees on the RDNT/TUSD trading pairs until further notice
Note: The withdrawal open time is an estimated time for users’ reference. Users can view the actual status of withdrawals on the withdrawal page.
In addition, Binance will add RDNT as a new borrowable asset with these new margin pairs on Isolated Margin, within 48 hours from 2023-03-30 07:30 (UTC):
New Isolated Margin Pairs: RDNT/USDT
Please refer to Margin Data for a list of the most updated marginable assets and further information on specific limits and rates.
What is Radiant Capital (RDNT)?
Radiant Capital is a decentralized omnichain money market protocol. Users can stake their collateral on one of the major chains and borrow from another chain. RDNT is the utility token for liquidity mining and governance.
Reminder:
The Innovation Zone is a dedicated trading zone where users are able to trade new, innovative tokens that are likely to have higher volatility and pose a higher risk than other tokens.
Before being able to trade in the Innovation Zone, all users are required to visit the web version of the Innovation Zone trading page to carefully read the Binance Terms of Use and complete a questionnaire as part of the Initial Disclaimer. Please note that there will not be any trading restrictions on trading pairs in the Innovation Zone.
RDNT is a relatively new token that poses a higher than normal risk, and as such will likely be subject to high price volatility. Please ensure that you exercise sufficient risk management, have done your own research in regards to RDNT’s fundamentals, and fully understand the project before opting to trade the token.
Details:
Radiant Capital Website
RDNT Token Contract Addresses - Arbitrum, BNB Chain
Fees
Rules
Thanks for your support!
Binance Team
2023-03-30`
Log(openaiCompletions(announcement))

}


もっと

xxs1xxs1革新は可能か?

クンフェン91断じて断じて