Skip to content

Instantly share code, notes, and snippets.

@bpdarlyn
Created January 15, 2024 20:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bpdarlyn/31e64ace117f9bc8a166f15df79d8e37 to your computer and use it in GitHub Desktop.
Save bpdarlyn/31e64ace117f9bc8a166f15df79d8e37 to your computer and use it in GitHub Desktop.
Swagger Editor
openapi: 3.0.0
info:
title: Arbitraining API
version: "v1.0.0-beta"
description: Definition for Arbitraining API
termsOfService: "http://example.com/terms/"
contact:
name: API Support
email: contact@bpdarlyn.com
license:
name: Apache 2.0
url: "http://www.apache.org/licenses/LICENSE-2.0.html"
servers:
- url: https://api.arbitraining.{stage}.{hosted_zone}
variables:
stage:
default: prod
description: API Stage
hosted_zone:
default: nylrad.com
description: Default Hosted
paths:
/{version}/simulator/:
post:
tags:
- simulator
summary: Simulate Exchange
description: ""
operationId: postSimulator
parameters:
- $ref: "#/components/parameters/version"
requestBody:
$ref: "#/components/requestBodies/BodyCalculateSimulator"
responses:
"200":
$ref: "#/components/responses/ResponseCalculateSimulator"
"400":
$ref: "#/components/responses/ClientSideGeneralError"
"500":
$ref: "#/components/responses/ServerSideGeneralError"
x-amazon-apigateway-integration:
type: "aws_proxy"
httpMethod: "POST"
uri:
Fn::Sub: "arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${LambdaFNSimulator.Arn}/invocations"
responses:
default:
statusCode: "200"
passthroughBehavior: "when_no_match"
contentHandling: "CONVERT_TO_TEXT"
/{version}/order-book/:
get:
tags:
- order-book
summary: Get Order Book
description: "Converts Binance P2P market to a standard order book"
operationId: getOrderBook
parameters:
- $ref: "#/components/parameters/version"
responses:
"200":
content:
application/json:
schema:
$ref: "#/components/schemas/OrderBookResponse"
"400":
$ref: "#/components/responses/ClientSideGeneralError"
"500":
$ref: "#/components/responses/ServerSideGeneralError"
x-amazon-apigateway-integration:
type: "aws_proxy"
httpMethod: "POST"
uri:
Fn::Sub: "arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${LambdaFNOrderBook.Arn}/invocations"
responses:
default:
statusCode: "200"
passthroughBehavior: "when_no_match"
contentHandling: "CONVERT_TO_TEXT"
components:
schemas:
Meta:
type: object
required:
- module
- version
properties:
module:
type: string
example: "pricing_workflow"
version:
type: string
example: "v1"
integrationType:
type: string
example: "lambda"
Advertiser:
type: object
properties:
id:
type: string
username:
type: string
amount_available:
type: number
format: float
limits:
$ref: "#/components/schemas/Limits"
pay_time_limit:
type: integer
required:
- id
- username
- amount_available
- limits
- pay_time_limit
Limits:
type: object
properties:
min:
type: string
max:
type: string
required:
- min
- max
AskBid:
type: object
properties:
price:
type: string
available:
type: number
format: float
advertisers:
type: array
items:
$ref: "#/components/schemas/Advertiser"
required:
- price
- available
- advertisers
Filter:
type: object
properties:
trade_type:
type: string
fiat:
type: string
trans_amount:
type: integer
publisher_type:
type: string
payment_methods:
type: array
items:
type: string
required:
- trade_type
- fiat
- trans_amount
- payment_methods
OrderBookResponse:
type: object
properties:
aks:
type: array
items:
$ref: "#/components/schemas/AskBid"
bids:
type: array
items:
$ref: "#/components/schemas/AskBid"
filters:
$ref: "#/components/schemas/Filter"
required:
- aks
- bids
- filters
Error:
type: object
properties:
status:
type: string
example: XXX
title:
type: string
example: Error processing something
details:
type: string
example: Error details
required:
- code
- message
OperationError:
type: object
properties:
meta:
$ref: "#/components/schemas/Meta"
errors:
type: array
items:
$ref: "#/components/schemas/Error"
responses:
ClientSideGeneralError:
description: Client side general error
content:
application/json:
schema:
$ref: "#/components/schemas/OperationError"
ServerSideGeneralError:
description: Server side general error
content:
application/json:
schema:
$ref: "#/components/schemas/OperationError"
ResponseCalculateSimulator:
description: Calculate Simulator Response
content:
application/json:
schema:
type: object
properties:
data:
type: array
items:
type: object
properties:
total_amount_invest:
type: number
format: float
cycle_number:
type: number
profit:
type: number
format: float
percentage_profit:
type: number
format: float
fiat:
type: string
exchange_buyer:
type: string
exchange_seller:
type: string
asset:
type: string
payment_method:
type: string
parameters:
version:
name: version
in: path
description: API version
required: true
schema:
type: string
requestBodies:
BodyCalculateSimulator:
required: true
description: Body for Calculate Simulator
content:
application/json:
schema:
type: object
properties:
sell_price:
type: number
format: float
buy_price:
type: number
format: float
fiat:
type: string
asset:
type: string
exchanges:
type: array
items:
type: string
payment_method:
type: string
cycles:
type: number
amount_to_invest:
type: number
format: float
username:
type: string
user_verified:
type: array
items:
type: boolean
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment